+ dangerouslySetInnerHTML={{ __html: html }}
+ />
+ );
}
diff --git a/packages/ui/cuicui/application-ui/code/advanced-code-block/preview-advanced-code-block-tab-variant.tsx b/packages/ui/cuicui/application-ui/code/advanced-code-block/preview-advanced-code-block-tab-variant.tsx
index 5ae57c89..58b43efa 100644
--- a/packages/ui/cuicui/application-ui/code/advanced-code-block/preview-advanced-code-block-tab-variant.tsx
+++ b/packages/ui/cuicui/application-ui/code/advanced-code-block/preview-advanced-code-block-tab-variant.tsx
@@ -3,69 +3,69 @@ import * as Tabs from "@radix-ui/react-tabs";
import { AdvancedCodeBlock } from "@/cuicui/application-ui/code/advanced-code-block/advanced-code-block";
const codeToDisplay = [
- {
- slug: "Explanations",
- fileName: "./explanations.ts",
- code: `export const = explanations = {
+ {
+ slug: "Explanations",
+ fileName: "./explanations.ts",
+ code: `export const = explanations = {
main : "This component needs more than the default code block to be displayed"
detailed : "For now, if you want the exact same behaviour, please check the github"
}`,
- lang: "typescript",
- },
- {
- slug: "Example",
- fileName: "./example.ts",
- code: `let b = 2 + 1
+ lang: "typescript",
+ },
+ {
+ slug: "Example",
+ fileName: "./example.ts",
+ code: `let b = 2 + 1
console.log(b)
function test() {
return b
}`,
- lang: "typescript",
- },
+ lang: "typescript",
+ },
] as const;
export default function PreviewAdvancedCodeBlockTabVariant() {
- return (
-
-
-
- {codeToDisplay.map((code) => (
-
- {code.slug}
-
-
- ))}
-
+ return (
+
+
+
+ {codeToDisplay.map((code) => (
+
+ {code.slug}
+
+
+ ))}
+
- {codeToDisplay.map((code) => (
-
-
-
- ))}
-
-
- );
+ {codeToDisplay.map((code) => (
+
+
+
+ ))}
+
+
+ );
}
diff --git a/packages/ui/cuicui/application-ui/code/advanced-code-block/preview-advanced-code-block.tsx b/packages/ui/cuicui/application-ui/code/advanced-code-block/preview-advanced-code-block.tsx
index 2bb352b1..02f74371 100644
--- a/packages/ui/cuicui/application-ui/code/advanced-code-block/preview-advanced-code-block.tsx
+++ b/packages/ui/cuicui/application-ui/code/advanced-code-block/preview-advanced-code-block.tsx
@@ -6,14 +6,14 @@ const codeToDisplay = `export const = explanations = {
}`;
export default function PreviewAdvancedCodeBlock() {
- return (
-
- );
+ return (
+
+ );
}
diff --git a/packages/ui/cuicui/application-ui/code/code-card/code-card-preview.tsx b/packages/ui/cuicui/application-ui/code/code-card/code-card-preview.tsx
index 6e62ba52..0a964213 100644
--- a/packages/ui/cuicui/application-ui/code/code-card/code-card-preview.tsx
+++ b/packages/ui/cuicui/application-ui/code/code-card/code-card-preview.tsx
@@ -11,5 +11,5 @@ const code = `.container {
import CodeEditor from "@/cuicui/application-ui/code/code-card/code-card";
export const CodeCardPreview = () => {
- return
;
+ return
;
};
diff --git a/packages/ui/cuicui/application-ui/code/code-card/code-card.component.tsx b/packages/ui/cuicui/application-ui/code/code-card/code-card.component.tsx
index faafc442..45a833bd 100644
--- a/packages/ui/cuicui/application-ui/code/code-card/code-card.component.tsx
+++ b/packages/ui/cuicui/application-ui/code/code-card/code-card.component.tsx
@@ -2,17 +2,17 @@ import type { ComponentType } from "@/lib/types/component";
import { CodeCardPreview } from "@/cuicui/application-ui/code/code-card/code-card-preview";
export const codeCardComponent: ComponentType = {
- sizePreview: "md",
- slug: "code-card",
+ sizePreview: "md",
+ slug: "code-card",
- variantList: [
- {
- name: "Default",
- component:
,
- slugPreviewFile: "code-card-preview",
- slugComponentFile: "code-card",
- },
- ],
- name: "Code Card",
- description: "A code card component with a copy to clipboard button.",
+ variantList: [
+ {
+ name: "Default",
+ component:
,
+ slugPreviewFile: "code-card-preview",
+ slugComponentFile: "code-card",
+ },
+ ],
+ name: "Code Card",
+ description: "A code card component with a copy to clipboard button.",
};
diff --git a/packages/ui/cuicui/application-ui/code/code-snippet/code-snippet.component.tsx b/packages/ui/cuicui/application-ui/code/code-snippet/code-snippet.component.tsx
index b68daf13..9523eea4 100644
--- a/packages/ui/cuicui/application-ui/code/code-snippet/code-snippet.component.tsx
+++ b/packages/ui/cuicui/application-ui/code/code-snippet/code-snippet.component.tsx
@@ -2,17 +2,17 @@ import type { ComponentType } from "@/lib/types/component";
import PreviewCommandVariant1 from "@/cuicui/application-ui/code/code-snippet/preview-variant1";
export const codeSnippetComponent: ComponentType = {
- sizePreview: "xs",
- slug: "code-snippet",
+ sizePreview: "xs",
+ slug: "code-snippet",
- variantList: [
- {
- name: "Default",
- component:
,
- slugPreviewFile: "preview-variant1",
- slugComponentFile: "variant1",
- },
- ],
- name: "Code Snippet",
- description: "A code snippet component with a copy to clipboard button.",
+ variantList: [
+ {
+ name: "Default",
+ component:
,
+ slugPreviewFile: "preview-variant1",
+ slugComponentFile: "variant1",
+ },
+ ],
+ name: "Code Snippet",
+ description: "A code snippet component with a copy to clipboard button.",
};
diff --git a/packages/ui/cuicui/application-ui/code/code-snippet/variant1.tsx b/packages/ui/cuicui/application-ui/code/code-snippet/variant1.tsx
index 8ec21991..f6c62816 100644
--- a/packages/ui/cuicui/application-ui/code/code-snippet/variant1.tsx
+++ b/packages/ui/cuicui/application-ui/code/code-snippet/variant1.tsx
@@ -4,21 +4,21 @@ import { toast } from "sonner";
import { useCopyToClipboard } from "@/cuicui/hooks/use-copy-to-clipboard/use-copy-to-clipboard";
export function CommandCode({ children }: Readonly<{ children: string }>) {
- const [copiedText, copy] = useCopyToClipboard();
- const handleCopyCode = (_code: string) => {
- copy(children);
- toast.success(`Command copied: ${copiedText}`);
- };
- return (
-
handleCopyCode(children)}
- type="button"
- >
-
- {children}
-
-
-
- );
+ const [copiedText, copy] = useCopyToClipboard();
+ const handleCopyCode = (_code: string) => {
+ copy(children);
+ toast.success(`Command copied: ${copiedText}`);
+ };
+ return (
+
handleCopyCode(children)}
+ type="button"
+ >
+
+ {children}
+
+
+
+ );
}
diff --git a/packages/ui/cuicui/application-ui/code/code.category.tsx b/packages/ui/cuicui/application-ui/code/code.category.tsx
index d69e94fd..4375e328 100644
--- a/packages/ui/cuicui/application-ui/code/code.category.tsx
+++ b/packages/ui/cuicui/application-ui/code/code.category.tsx
@@ -7,19 +7,19 @@ import { codeSnippetComponent } from "@/cuicui/application-ui/code/code-snippet/
import { inlineCodeComponent } from "@/cuicui/application-ui/code/inline-code/inline-code.component";
export const codeCategory: CategoryType = {
- slug: "code",
- name: "Code",
- description: "Code components with special interactions",
- releaseDateCategory: new Date("2024-08-20"),
- icon: Code2Icon,
- previewCategory: {
- component:
,
- previewScale: 0.8,
- },
- componentList: [
- codeSnippetComponent,
- codeCardComponent,
- inlineCodeComponent,
- advancedCodeBlockComponent,
- ],
+ slug: "code",
+ name: "Code",
+ description: "Code components with special interactions",
+ releaseDateCategory: new Date("2024-08-20"),
+ icon: Code2Icon,
+ previewCategory: {
+ component:
,
+ previewScale: 0.8,
+ },
+ componentList: [
+ codeSnippetComponent,
+ codeCardComponent,
+ inlineCodeComponent,
+ advancedCodeBlockComponent,
+ ],
};
diff --git a/packages/ui/cuicui/application-ui/code/inline-code/inline-code.component.tsx b/packages/ui/cuicui/application-ui/code/inline-code/inline-code.component.tsx
index 2387c972..54b6352b 100644
--- a/packages/ui/cuicui/application-ui/code/inline-code/inline-code.component.tsx
+++ b/packages/ui/cuicui/application-ui/code/inline-code/inline-code.component.tsx
@@ -2,17 +2,17 @@ import type { ComponentType } from "@/lib/types/component";
import { PreviewInlineCode } from "@/cuicui/application-ui/code/inline-code/preview-inline-code";
export const inlineCodeComponent: ComponentType = {
- sizePreview: "xs",
- slug: "inline-code",
+ sizePreview: "xs",
+ slug: "inline-code",
- variantList: [
- {
- name: "Default",
- component:
,
- slugPreviewFile: "preview-inline-code",
- slugComponentFile: "inline-code",
- },
- ],
- name: "Inline Code",
- description: "A code snippet component with a copy to clipboard button.",
+ variantList: [
+ {
+ name: "Default",
+ component:
,
+ slugPreviewFile: "preview-inline-code",
+ slugComponentFile: "inline-code",
+ },
+ ],
+ name: "Inline Code",
+ description: "A code snippet component with a copy to clipboard button.",
};
diff --git a/packages/ui/cuicui/application-ui/code/inline-code/inline-code.tsx b/packages/ui/cuicui/application-ui/code/inline-code/inline-code.tsx
index 23f4737c..294fbea0 100644
--- a/packages/ui/cuicui/application-ui/code/inline-code/inline-code.tsx
+++ b/packages/ui/cuicui/application-ui/code/inline-code/inline-code.tsx
@@ -2,20 +2,20 @@ import type { ReactNode } from "react";
import { cn } from "@/cuicui/utils/cn/cn";
export const InlineCode = ({
- className,
- children,
+ className,
+ children,
}: {
- className?: string;
- children: ReactNode;
+ className?: string;
+ children: ReactNode;
}) => {
- return (
-
- {children}
-
- );
+ return (
+
+ {children}
+
+ );
};
diff --git a/packages/ui/cuicui/application-ui/code/inline-code/preview-inline-code.tsx b/packages/ui/cuicui/application-ui/code/inline-code/preview-inline-code.tsx
index 1cee5d74..9ec44055 100644
--- a/packages/ui/cuicui/application-ui/code/inline-code/preview-inline-code.tsx
+++ b/packages/ui/cuicui/application-ui/code/inline-code/preview-inline-code.tsx
@@ -1,10 +1,10 @@
import { InlineCode } from "@/cuicui/application-ui/code/inline-code/inline-code";
export const PreviewInlineCode = () => {
- return (
-
- This is an example of a code found on cuicui.day {" "}
- which you can simply copy component and paste it in your project.
-
- );
+ return (
+
+ This is an example of a code found on cuicui.day {" "}
+ which you can simply copy component and paste it in your project.
+
+ );
};
diff --git a/packages/ui/cuicui/application-ui/cookie-banner/category.cookie-banner.tsx b/packages/ui/cuicui/application-ui/cookie-banner/category.cookie-banner.tsx
index a93b9a86..f36aae54 100644
--- a/packages/ui/cuicui/application-ui/cookie-banner/category.cookie-banner.tsx
+++ b/packages/ui/cuicui/application-ui/cookie-banner/category.cookie-banner.tsx
@@ -4,15 +4,15 @@ import { simpleCookieBannerComponent } from "@/cuicui/application-ui/cookie-bann
import PreviewSimpleCookieBanner from "@/cuicui/application-ui/cookie-banner/simple-cookie-banner/preview-simple-cookie-banner";
export const cookieBannerCategory: CategoryType = {
- name: "Cookie Banner",
- slug: "cookie-banner",
- description: "Display a cookie banner to inform users about cookies",
- releaseDateCategory: new Date("2024-09-26"),
- icon: CookieIcon,
- comingSoonCategory: false,
- previewCategory: {
- component:
,
- previewScale: 0.75,
- },
- componentList: [simpleCookieBannerComponent],
+ name: "Cookie Banner",
+ slug: "cookie-banner",
+ description: "Display a cookie banner to inform users about cookies",
+ releaseDateCategory: new Date("2024-09-26"),
+ icon: CookieIcon,
+ comingSoonCategory: false,
+ previewCategory: {
+ component:
,
+ previewScale: 0.75,
+ },
+ componentList: [simpleCookieBannerComponent],
};
diff --git a/packages/ui/cuicui/application-ui/cookie-banner/simple-cookie-banner/component.simple-cookie-banner.tsx b/packages/ui/cuicui/application-ui/cookie-banner/simple-cookie-banner/component.simple-cookie-banner.tsx
index e50f22f0..9ac8ee1e 100644
--- a/packages/ui/cuicui/application-ui/cookie-banner/simple-cookie-banner/component.simple-cookie-banner.tsx
+++ b/packages/ui/cuicui/application-ui/cookie-banner/simple-cookie-banner/component.simple-cookie-banner.tsx
@@ -2,18 +2,18 @@ import type { ComponentType } from "@/lib/types/component";
import PreviewSimpleCookieBanner from "@/cuicui/application-ui/cookie-banner/simple-cookie-banner/preview-simple-cookie-banner";
export const simpleCookieBannerComponent: ComponentType = {
- slug: "simple-cookie-banner",
- name: "Simple Cookie Banner",
- description:
- "A simple cookie banner that can be used in any project with simple artistic style.",
- isIframed: true,
- variantList: [
- {
- component:
,
- name: "Default",
- slugPreviewFile: "preview-simple-cookie-banner",
- slugComponentFile: "simple-cookie-banner",
- },
- ],
- sizePreview: "sm",
+ slug: "simple-cookie-banner",
+ name: "Simple Cookie Banner",
+ description:
+ "A simple cookie banner that can be used in any project with simple artistic style.",
+ isIframed: true,
+ variantList: [
+ {
+ component:
,
+ name: "Default",
+ slugPreviewFile: "preview-simple-cookie-banner",
+ slugComponentFile: "simple-cookie-banner",
+ },
+ ],
+ sizePreview: "sm",
};
diff --git a/packages/ui/cuicui/application-ui/cookie-banner/simple-cookie-banner/preview-simple-cookie-banner.tsx b/packages/ui/cuicui/application-ui/cookie-banner/simple-cookie-banner/preview-simple-cookie-banner.tsx
index 96f7935c..28830a1f 100644
--- a/packages/ui/cuicui/application-ui/cookie-banner/simple-cookie-banner/preview-simple-cookie-banner.tsx
+++ b/packages/ui/cuicui/application-ui/cookie-banner/simple-cookie-banner/preview-simple-cookie-banner.tsx
@@ -1,10 +1,10 @@
import SimpleCookieBanner from "@/cuicui/application-ui/cookie-banner/simple-cookie-banner/simple-cookie-banner";
export default function PreviewSimpleCookieBanner() {
- return (
-
- We use tracking cookies to understand how you use the product and help us
- improve it.
-
- );
+ return (
+
+ We use tracking cookies to understand how you use the product and help us
+ improve it.
+
+ );
}
diff --git a/packages/ui/cuicui/application-ui/cookie-banner/simple-cookie-banner/simple-cookie-banner.tsx b/packages/ui/cuicui/application-ui/cookie-banner/simple-cookie-banner/simple-cookie-banner.tsx
index 51f22ee8..2b34399d 100644
--- a/packages/ui/cuicui/application-ui/cookie-banner/simple-cookie-banner/simple-cookie-banner.tsx
+++ b/packages/ui/cuicui/application-ui/cookie-banner/simple-cookie-banner/simple-cookie-banner.tsx
@@ -2,32 +2,32 @@ import type { HTMLAttributes, ReactNode } from "react";
import { cn } from "@/cuicui/utils/cn/cn";
export default function SimpleCookieBanner({
- children,
- className,
- ...props
+ children,
+ className,
+ ...props
}: {
- children?: ReactNode;
- className?: string;
+ children?: ReactNode;
+ className?: string;
} & HTMLAttributes
) {
- return (
-
- {children}
-
-
- Accept
-
-
- Decline
-
-
-
- );
+ return (
+
+ {children}
+
+
+ Accept
+
+
+ Decline
+
+
+
+ );
}
diff --git a/packages/ui/cuicui/application-ui/kbd/kbd.category.tsx b/packages/ui/cuicui/application-ui/kbd/kbd.category.tsx
index e925dc68..7167c71b 100644
--- a/packages/ui/cuicui/application-ui/kbd/kbd.category.tsx
+++ b/packages/ui/cuicui/application-ui/kbd/kbd.category.tsx
@@ -4,42 +4,42 @@ import Modern3dKbdVariant1 from "@/cuicui/application-ui/kbd/modern-3d-kbd/varia
import ModernDetailedKbdVariant1 from "@/cuicui/application-ui/kbd/modern-detailed-kbd/variant1";
export const kbdCategory: CategoryType = {
- slug: "kbd",
- name: "Keyboard",
- description: "Keyboard components with various styles",
- releaseDateCategory: new Date("2024-08-13"),
- icon: CommandIcon,
- previewCategory: {
- component: ,
- previewScale: 1,
- },
- componentList: [
- {
- sizePreview: "xs",
- slug: "modern-detailed-kbd",
- variantList: [
- {
- name: "Default",
- component: ,
- slugPreviewFile: "variant1",
- },
- ],
- name: "Simple keyboard Kbd",
- description:
- "A simple keyboard Kbd with an effect on hover and on press.",
- },
- {
- sizePreview: "xs",
- slug: "modern-3d-kbd",
- variantList: [
- {
- name: "Default",
- component: ,
- slugPreviewFile: "variant1",
- },
- ],
- name: "3D keyboard Kbd",
- description: "A 3D keyboard Kbd with an effect on hover and on press.",
- },
- ],
+ slug: "kbd",
+ name: "Keyboard",
+ description: "Keyboard components with various styles",
+ releaseDateCategory: new Date("2024-08-13"),
+ icon: CommandIcon,
+ previewCategory: {
+ component: ,
+ previewScale: 1,
+ },
+ componentList: [
+ {
+ sizePreview: "xs",
+ slug: "modern-detailed-kbd",
+ variantList: [
+ {
+ name: "Default",
+ component: ,
+ slugPreviewFile: "variant1",
+ },
+ ],
+ name: "Simple keyboard Kbd",
+ description:
+ "A simple keyboard Kbd with an effect on hover and on press.",
+ },
+ {
+ sizePreview: "xs",
+ slug: "modern-3d-kbd",
+ variantList: [
+ {
+ name: "Default",
+ component: ,
+ slugPreviewFile: "variant1",
+ },
+ ],
+ name: "3D keyboard Kbd",
+ description: "A 3D keyboard Kbd with an effect on hover and on press.",
+ },
+ ],
};
diff --git a/packages/ui/cuicui/application-ui/kbd/modern-detailed-kbd/variant1.tsx b/packages/ui/cuicui/application-ui/kbd/modern-detailed-kbd/variant1.tsx
index 0deb54e5..3c427111 100644
--- a/packages/ui/cuicui/application-ui/kbd/modern-detailed-kbd/variant1.tsx
+++ b/packages/ui/cuicui/application-ui/kbd/modern-detailed-kbd/variant1.tsx
@@ -1,20 +1,20 @@
import { cn } from "@/cuicui/utils/cn/cn";
export default function ModernDetailedKbdVariant1() {
- return (
-
- ⌘ + Option + Shift + K
-
- );
+ return (
+
+ ⌘ + Option + Shift + K
+
+ );
}
diff --git a/packages/ui/cuicui/application-ui/notification/category.notification.tsx b/packages/ui/cuicui/application-ui/notification/category.notification.tsx
index fa0d428a..b5ce672f 100644
--- a/packages/ui/cuicui/application-ui/notification/category.notification.tsx
+++ b/packages/ui/cuicui/application-ui/notification/category.notification.tsx
@@ -4,14 +4,14 @@ import GrowingSearchVariant1 from "@/cuicui/application-ui/search-bars/growing-s
import { dynamicIslandNotificationComponent } from "@/cuicui/application-ui/notification/dynamic-island-notification/component.dynamic-island-notification";
export const notificationCategory: CategoryType = {
- slug: "notification",
- name: "Notification",
- description: "Notification components",
- releaseDateCategory: new Date("2024-10-14"),
- icon: BellDotIcon,
- previewCategory: {
- component: ,
- previewScale: 1,
- },
- componentList: [dynamicIslandNotificationComponent],
+ slug: "notification",
+ name: "Notification",
+ description: "Notification components",
+ releaseDateCategory: new Date("2024-10-14"),
+ icon: BellDotIcon,
+ previewCategory: {
+ component: ,
+ previewScale: 1,
+ },
+ componentList: [dynamicIslandNotificationComponent],
};
diff --git a/packages/ui/cuicui/application-ui/notification/dynamic-island-notification/component.dynamic-island-notification.tsx b/packages/ui/cuicui/application-ui/notification/dynamic-island-notification/component.dynamic-island-notification.tsx
index 102591c2..38969d6e 100644
--- a/packages/ui/cuicui/application-ui/notification/dynamic-island-notification/component.dynamic-island-notification.tsx
+++ b/packages/ui/cuicui/application-ui/notification/dynamic-island-notification/component.dynamic-island-notification.tsx
@@ -2,17 +2,17 @@ import type { ComponentType } from "@/lib/types/component";
import { PreviewDynamicIslandNotification } from "@/cuicui/application-ui/notification/dynamic-island-notification/preview.dynamic-island-notification";
export const dynamicIslandNotificationComponent: ComponentType = {
- sizePreview: "md",
- slug: "dynamic-island-notification",
- variantList: [
- {
- name: "Dynamic Island Notification",
- component: ,
- slugPreviewFile: "preview.dynamic-island-notification",
- slugComponentFile: "dynamic-island-notification",
- },
- ],
- name: "Dynamic Island Notification",
- description:
- "Notification that appears from the bottom right corner of the screen.",
+ sizePreview: "md",
+ slug: "dynamic-island-notification",
+ variantList: [
+ {
+ name: "Dynamic Island Notification",
+ component: ,
+ slugPreviewFile: "preview.dynamic-island-notification",
+ slugComponentFile: "dynamic-island-notification",
+ },
+ ],
+ name: "Dynamic Island Notification",
+ description:
+ "Notification that appears from the bottom right corner of the screen.",
};
diff --git a/packages/ui/cuicui/application-ui/notification/dynamic-island-notification/dynamic-island-notification.tsx b/packages/ui/cuicui/application-ui/notification/dynamic-island-notification/dynamic-island-notification.tsx
index f648e24e..a5041df8 100644
--- a/packages/ui/cuicui/application-ui/notification/dynamic-island-notification/dynamic-island-notification.tsx
+++ b/packages/ui/cuicui/application-ui/notification/dynamic-island-notification/dynamic-island-notification.tsx
@@ -9,99 +9,99 @@ import { useMeasure } from "@/cuicui/hooks/use-measure/use-measure";
const WIDTH = 500;
export default function DynamicIslandNotification({
- title,
- children,
- showNotification,
- closeNotification,
+ title,
+ children,
+ showNotification,
+ closeNotification,
}: Readonly<{
- title: string;
- children: string;
- showNotification: boolean;
- closeNotification: () => void;
+ title: string;
+ children: string;
+ showNotification: boolean;
+ closeNotification: () => void;
}>) {
- const [isOpen, setIsOpen] = useState(false);
+ const [isOpen, setIsOpen] = useState(false);
- const [ref, { height: viewHeight }] = useMeasure();
+ const [ref, { height: viewHeight }] = useMeasure();
- const handleOpenSettings = () => {
- setIsOpen((prev) => !prev);
- };
+ const handleOpenSettings = () => {
+ setIsOpen((prev) => !prev);
+ };
- return (
-
- {showNotification && (
-
-
- {!isOpen && (
-
-
- {/*
*/}
-
- )}
-
+ return (
+
+ {showNotification && (
+
+
+ {!isOpen && (
+
+
+ {/*
*/}
+
+ )}
+
-
- {isOpen && (
-
-
-
- {title}
-
-
- {children}
-
-
- {
- setIsOpen(false);
- closeNotification();
- }}
- >
- Close
-
-
- )}
-
-
- )}
-
- );
+
+ {isOpen && (
+
+
+
+ {title}
+
+
+ {children}
+
+
+ {
+ setIsOpen(false);
+ closeNotification();
+ }}
+ >
+ Close
+
+
+ )}
+
+
+ )}
+
+ );
}
diff --git a/packages/ui/cuicui/application-ui/notification/dynamic-island-notification/preview.dynamic-island-notification.tsx b/packages/ui/cuicui/application-ui/notification/dynamic-island-notification/preview.dynamic-island-notification.tsx
index a4b346f5..df552671 100644
--- a/packages/ui/cuicui/application-ui/notification/dynamic-island-notification/preview.dynamic-island-notification.tsx
+++ b/packages/ui/cuicui/application-ui/notification/dynamic-island-notification/preview.dynamic-island-notification.tsx
@@ -3,27 +3,27 @@ import DynamicIslandNotification from "@/cuicui/application-ui/notification/dyna
import { useState } from "react";
export const PreviewDynamicIslandNotification = () => {
- const [showNotification, setShowNotification] = useState(false);
+ const [showNotification, setShowNotification] = useState(false);
- return (
- <>
- setShowNotification(false)}
- >
- Cuicui has released a new version with a lot of new features and bug
- fixes. Make sure to update your app to get the best
-
- {!showNotification && (
- setShowNotification(true)}
- className="mt-4 bg-neutral-500 text-neutral-50 rounded-lg p-2"
- >
- Show notification
-
- )}
- >
- );
+ return (
+ <>
+ setShowNotification(false)}
+ >
+ Cuicui has released a new version with a lot of new features and bug
+ fixes. Make sure to update your app to get the best
+
+ {!showNotification && (
+ setShowNotification(true)}
+ className="mt-4 bg-neutral-500 text-neutral-50 rounded-lg p-2"
+ >
+ Show notification
+
+ )}
+ >
+ );
};
diff --git a/packages/ui/cuicui/application-ui/search-bars/growing-search/variant1.tsx b/packages/ui/cuicui/application-ui/search-bars/growing-search/variant1.tsx
index c377ca48..5bab19c4 100644
--- a/packages/ui/cuicui/application-ui/search-bars/growing-search/variant1.tsx
+++ b/packages/ui/cuicui/application-ui/search-bars/growing-search/variant1.tsx
@@ -5,94 +5,94 @@ import { toast } from "sonner";
import { cn } from "@/cuicui/utils/cn/cn";
export default function GrowingSearchVariant1() {
- return (
-
-
- Press enter to see all the effects
-
-
-
- );
+ return (
+
+
+ Press enter to see all the effects
+
+
+
+ );
}
export const SearchBar = () => {
- const [searchSubmittedOutline, setSearchSubmittedOutline] = useState(false);
- const [searchSubmittedShadow, setSearchSubmittedShadow] = useState(false);
- const [searchValue, setSearchValue] = useState("");
- function handleSearch() {
- setSearchSubmittedOutline(true);
- setSearchSubmittedShadow(true);
- toast(`Searching for ${searchValue}`);
- }
+ const [searchSubmittedOutline, setSearchSubmittedOutline] = useState(false);
+ const [searchSubmittedShadow, setSearchSubmittedShadow] = useState(false);
+ const [searchValue, setSearchValue] = useState("");
+ function handleSearch() {
+ setSearchSubmittedOutline(true);
+ setSearchSubmittedShadow(true);
+ toast(`Searching for ${searchValue}`);
+ }
- useEffect(() => {
- if (searchSubmittedOutline) {
- // Wait 3 sec
- setTimeout(() => {
- setSearchSubmittedOutline(false);
- }, 150);
- }
- }, [searchSubmittedOutline]);
+ useEffect(() => {
+ if (searchSubmittedOutline) {
+ // Wait 3 sec
+ setTimeout(() => {
+ setSearchSubmittedOutline(false);
+ }, 150);
+ }
+ }, [searchSubmittedOutline]);
- useEffect(() => {
- if (searchSubmittedShadow) {
- // Wait 3 sec
- setTimeout(() => {
- setSearchSubmittedShadow(false);
- }, 1000);
- }
- }, [searchSubmittedShadow]);
+ useEffect(() => {
+ if (searchSubmittedShadow) {
+ // Wait 3 sec
+ setTimeout(() => {
+ setSearchSubmittedShadow(false);
+ }, 1000);
+ }
+ }, [searchSubmittedShadow]);
- return (
-
- {
- setSearchSubmittedOutline(false);
- setSearchSubmittedShadow(false);
- setSearchValue("");
- }}
- onChange={(e) => setSearchValue(e.target.value)}
- onKeyDown={(e) => {
- if (e.key === "Enter") {
- handleSearch();
- }
- }}
- onSubmit={handleSearch}
- placeholder="Search"
- type="search"
- value={searchValue}
- />
-
-
- );
+ return (
+
+ {
+ setSearchSubmittedOutline(false);
+ setSearchSubmittedShadow(false);
+ setSearchValue("");
+ }}
+ onChange={(e) => setSearchValue(e.target.value)}
+ onKeyDown={(e) => {
+ if (e.key === "Enter") {
+ handleSearch();
+ }
+ }}
+ onSubmit={handleSearch}
+ placeholder="Search"
+ type="search"
+ value={searchValue}
+ />
+
+
+ );
};
diff --git a/packages/ui/cuicui/application-ui/search-bars/search-bars.category.tsx b/packages/ui/cuicui/application-ui/search-bars/search-bars.category.tsx
index 5d213ce4..088195a3 100644
--- a/packages/ui/cuicui/application-ui/search-bars/search-bars.category.tsx
+++ b/packages/ui/cuicui/application-ui/search-bars/search-bars.category.tsx
@@ -3,28 +3,28 @@ import type { CategoryType } from "@/lib/types/component";
import GrowingSearchVariant1 from "@/cuicui/application-ui/search-bars/growing-search/variant1";
export const searchBarsCategory: CategoryType = {
- slug: "search-bars",
- name: "Search Bars",
- description: "Search bar components",
- releaseDateCategory: new Date("2024-08-19"),
- icon: SearchIcon,
- previewCategory: {
- component: ,
- previewScale: 1,
- },
- componentList: [
- {
- sizePreview: "xs",
- slug: "growing-search",
- variantList: [
- {
- name: "With press effect",
- component: ,
- slugPreviewFile: "variant1",
- },
- ],
- name: "Growing Search",
- description: "Search bar that grows when focused.",
- },
- ],
+ slug: "search-bars",
+ name: "Search Bars",
+ description: "Search bar components",
+ releaseDateCategory: new Date("2024-08-19"),
+ icon: SearchIcon,
+ previewCategory: {
+ component: ,
+ previewScale: 1,
+ },
+ componentList: [
+ {
+ sizePreview: "xs",
+ slug: "growing-search",
+ variantList: [
+ {
+ name: "With press effect",
+ component: ,
+ slugPreviewFile: "variant1",
+ },
+ ],
+ name: "Growing Search",
+ description: "Search bar that grows when focused.",
+ },
+ ],
};
diff --git a/packages/ui/cuicui/application-ui/settings/dynamic-settings/variant1.tsx b/packages/ui/cuicui/application-ui/settings/dynamic-settings/variant1.tsx
index 01c3a84a..5408adac 100644
--- a/packages/ui/cuicui/application-ui/settings/dynamic-settings/variant1.tsx
+++ b/packages/ui/cuicui/application-ui/settings/dynamic-settings/variant1.tsx
@@ -11,208 +11,208 @@ import { cn } from "@/cuicui/utils/cn/cn";
//TODO : Add dimensions section with sliders
const menuCategories = [
- { label: "Dimensions", slug: "dimensions", menuWidth: 320, menuHeight: 240 },
- {
- label: "Aspect Ratio",
- slug: "aspect-ratio",
- menuWidth: 320,
- menuHeight: 188,
- },
- { label: "Prompt", slug: "prompt", menuWidth: 320, menuHeight: 240 },
+ { label: "Dimensions", slug: "dimensions", menuWidth: 320, menuHeight: 240 },
+ {
+ label: "Aspect Ratio",
+ slug: "aspect-ratio",
+ menuWidth: 320,
+ menuHeight: 188,
+ },
+ { label: "Prompt", slug: "prompt", menuWidth: 320, menuHeight: 240 },
] as const;
export default function DynamicSettingsVariant1() {
- const [isOpen, setIsOpen] = useState(false);
- const [subMenuSelected, setSubMenuSelected] = useState("dimensions");
- const handleOpenSettings = () => {
- setIsOpen(!isOpen);
- };
- return (
- item.slug === subMenuSelected)
- ?.menuHeight
- : 52,
- width: isOpen
- ? menuCategories.find((item) => item.slug === subMenuSelected)
- ?.menuWidth
- : 132,
- }}
- className={cn(
- "items-center justify-between overflow-hidden rounded-2xl bg-neutral-900 p-2 text-neutral-50 shadow-lg",
- !isOpen && "hover:bg-neutral-800",
- )}
- transition={{
- type: "spring",
- duration: 0.6,
- // damping: 8,
- // stiffness: 120,
- }}
- >
-
-
-
- {isOpen ? (
-
- ) : (
-
setIsOpen(true)}
- type="button"
- >
- Add Style
-
- )}
-
handleOpenSettings()}
- type="button"
- >
-
-
-
- {isOpen && subMenuSelected === "aspect-ratio" && (
-
-
-
-
-
{
- handleOpenSettings();
- toast.message("Changes done", {
- description: "Changes validated and applied successfully",
- });
- }}
- type="submit"
- >
- Apply Changes
-
-
-
- )}
- {isOpen && subMenuSelected === "prompt" && (
-
-
-
-
-
{
- handleOpenSettings();
- toast.message("Changes done", {
- description: "Changes validated and applied successfully",
- });
- }}
- type="submit"
- >
- Apply Changes
-
-
-
- )}
- {isOpen && subMenuSelected === "dimensions" && (
-
-
-
-
{
- handleOpenSettings();
- toast.message("Changes done", {
- description: "Changes validated and applied successfully",
- });
- }}
- type="submit"
- >
- Apply Changes
-
-
-
- )}
-
-
-
- );
+ const [isOpen, setIsOpen] = useState(false);
+ const [subMenuSelected, setSubMenuSelected] = useState("dimensions");
+ const handleOpenSettings = () => {
+ setIsOpen(!isOpen);
+ };
+ return (
+ item.slug === subMenuSelected)
+ ?.menuHeight
+ : 52,
+ width: isOpen
+ ? menuCategories.find((item) => item.slug === subMenuSelected)
+ ?.menuWidth
+ : 132,
+ }}
+ className={cn(
+ "items-center justify-between overflow-hidden rounded-2xl bg-neutral-900 p-2 text-neutral-50 shadow-lg",
+ !isOpen && "hover:bg-neutral-800",
+ )}
+ transition={{
+ type: "spring",
+ duration: 0.6,
+ // damping: 8,
+ // stiffness: 120,
+ }}
+ >
+
+
+
+ {isOpen ? (
+
+ ) : (
+
setIsOpen(true)}
+ type="button"
+ >
+ Add Style
+
+ )}
+
handleOpenSettings()}
+ type="button"
+ >
+
+
+
+ {isOpen && subMenuSelected === "aspect-ratio" && (
+
+
+
+
+
{
+ handleOpenSettings();
+ toast.message("Changes done", {
+ description: "Changes validated and applied successfully",
+ });
+ }}
+ type="submit"
+ >
+ Apply Changes
+
+
+
+ )}
+ {isOpen && subMenuSelected === "prompt" && (
+
+
+
+
+
{
+ handleOpenSettings();
+ toast.message("Changes done", {
+ description: "Changes validated and applied successfully",
+ });
+ }}
+ type="submit"
+ >
+ Apply Changes
+
+
+
+ )}
+ {isOpen && subMenuSelected === "dimensions" && (
+
+
+
+
{
+ handleOpenSettings();
+ toast.message("Changes done", {
+ description: "Changes validated and applied successfully",
+ });
+ }}
+ type="submit"
+ >
+ Apply Changes
+
+
+
+ )}
+
+
+
+ );
}
const aspectRatioList = [
- { label: "1:1", icon: SquareIcon },
- { label: "16:9", icon: SquareIcon },
- { label: "21:9", icon: SquareIcon },
- { label: "3:4", icon: SquareIcon },
- { label: "4:3", icon: SquareIcon },
- { label: "Custom", icon: SquareIcon },
+ { label: "1:1", icon: SquareIcon },
+ { label: "16:9", icon: SquareIcon },
+ { label: "21:9", icon: SquareIcon },
+ { label: "3:4", icon: SquareIcon },
+ { label: "4:3", icon: SquareIcon },
+ { label: "Custom", icon: SquareIcon },
];
function AspectRatioSection() {
- const [selected, setSelected] = useState(0);
- return (
-
- {aspectRatioList.map((item, index) => (
- setSelected(index)}
- type="button"
- >
-
- {item.label}
-
- ))}
-
- );
+ const [selected, setSelected] = useState(0);
+ return (
+
+ {aspectRatioList.map((item, index) => (
+ setSelected(index)}
+ type="button"
+ >
+
+ {item.label}
+
+ ))}
+
+ );
}
// function SliderRow() {
// return (
@@ -224,40 +224,40 @@ function AspectRatioSection() {
// }
function NavigationMenu({
- setSubMenuSelected,
- subMenuSelected,
+ setSubMenuSelected,
+ subMenuSelected,
}: Readonly<{
- setSubMenuSelected: (slug: string) => void;
- subMenuSelected: string;
+ setSubMenuSelected: (slug: string) => void;
+ subMenuSelected: string;
}>) {
- return (
-
- {menuCategories.map((button, _index) => (
- setSubMenuSelected(button.slug)}
- type="button"
- >
- {button.label}
-
- {subMenuSelected === button.slug && (
-
- )}
-
-
- ))}
-
- );
+ return (
+
+ {menuCategories.map((button, _index) => (
+ setSubMenuSelected(button.slug)}
+ type="button"
+ >
+ {button.label}
+
+ {subMenuSelected === button.slug && (
+
+ )}
+
+
+ ))}
+
+ );
}
diff --git a/packages/ui/cuicui/application-ui/settings/settings.category.tsx b/packages/ui/cuicui/application-ui/settings/settings.category.tsx
index 378f68e6..07604e7d 100644
--- a/packages/ui/cuicui/application-ui/settings/settings.category.tsx
+++ b/packages/ui/cuicui/application-ui/settings/settings.category.tsx
@@ -3,31 +3,31 @@ import type { CategoryType } from "@/lib/types/component";
import DynamicSettingsVariant1 from "@/cuicui/application-ui/settings/dynamic-settings/variant1";
export const settingsCategory: CategoryType = {
- slug: "settings",
- name: "Settings",
- description: "Settings components with animations",
- releaseDateCategory: new Date("2024-06-30"),
- icon: SettingsIcon,
- previewCategory: {
- component: ,
- previewScale: 1.25,
- },
- componentList: [
- {
- sizePreview: "sm",
- slug: "dynamic-settings",
- variantList: [
- {
- name: "Default",
- component: ,
- slugPreviewFile: "variant1",
- },
- ],
- name: "Dynamic Settings",
- description: "Settings with lots of micro-interactions and animations.",
- componentBadges: ["updated"],
- inspiration: "UI Labs",
- inspirationLink: "https://www.uilabs.dev/",
- },
- ],
+ slug: "settings",
+ name: "Settings",
+ description: "Settings components with animations",
+ releaseDateCategory: new Date("2024-06-30"),
+ icon: SettingsIcon,
+ previewCategory: {
+ component: ,
+ previewScale: 1.25,
+ },
+ componentList: [
+ {
+ sizePreview: "sm",
+ slug: "dynamic-settings",
+ variantList: [
+ {
+ name: "Default",
+ component: ,
+ slugPreviewFile: "variant1",
+ },
+ ],
+ name: "Dynamic Settings",
+ description: "Settings with lots of micro-interactions and animations.",
+ componentBadges: ["updated"],
+ inspiration: "UI Labs",
+ inspirationLink: "https://www.uilabs.dev/",
+ },
+ ],
};
diff --git a/packages/ui/cuicui/application-ui/signature/react-signature/preview-react-signature.tsx b/packages/ui/cuicui/application-ui/signature/react-signature/preview-react-signature.tsx
index 40c01d57..bc36f69d 100644
--- a/packages/ui/cuicui/application-ui/signature/react-signature/preview-react-signature.tsx
+++ b/packages/ui/cuicui/application-ui/signature/react-signature/preview-react-signature.tsx
@@ -1,5 +1,5 @@
import { ReactSignature } from "@/cuicui/application-ui/signature/react-signature/react-signature";
export default function PreviewReactSignature() {
- return ;
+ return ;
}
diff --git a/packages/ui/cuicui/application-ui/signature/react-signature/react-signature.component.tsx b/packages/ui/cuicui/application-ui/signature/react-signature/react-signature.component.tsx
index ea34ffbd..58929eec 100644
--- a/packages/ui/cuicui/application-ui/signature/react-signature/react-signature.component.tsx
+++ b/packages/ui/cuicui/application-ui/signature/react-signature/react-signature.component.tsx
@@ -2,16 +2,16 @@ import type { ComponentType } from "@/lib/types/component";
import PreviewReactSignature from "@/cuicui/application-ui/signature/react-signature/preview-react-signature";
export const reactSignatureComponent: ComponentType = {
- name: "React Signature",
- slug: "react-signature",
- description: "A signature component for React.",
- sizePreview: "sm",
- variantList: [
- {
- name: "Default",
- component: ,
- slugPreviewFile: "preview-react-signature",
- slugComponentFile: "react-signature",
- },
- ],
+ name: "React Signature",
+ slug: "react-signature",
+ description: "A signature component for React.",
+ sizePreview: "sm",
+ variantList: [
+ {
+ name: "Default",
+ component: ,
+ slugPreviewFile: "preview-react-signature",
+ slugComponentFile: "react-signature",
+ },
+ ],
};
diff --git a/packages/ui/cuicui/application-ui/signature/react-signature/react-signature.tsx b/packages/ui/cuicui/application-ui/signature/react-signature/react-signature.tsx
index de39d907..e8271f37 100644
--- a/packages/ui/cuicui/application-ui/signature/react-signature/react-signature.tsx
+++ b/packages/ui/cuicui/application-ui/signature/react-signature/react-signature.tsx
@@ -1,195 +1,195 @@
"use client";
import Signature, { type SignatureRef } from "@uiw/react-signature";
import {
- CheckIcon,
- CopyIcon,
- DownloadIcon,
- Eraser,
- RefreshCcwIcon,
+ CheckIcon,
+ CopyIcon,
+ DownloadIcon,
+ Eraser,
+ RefreshCcwIcon,
} from "lucide-react";
import { type ComponentProps, useRef, useState } from "react";
import { useCopyToClipboard } from "@/cuicui/hooks/use-copy-to-clipboard/use-copy-to-clipboard";
import { cn } from "@/cuicui/utils/cn/cn";
export function ReactSignature({
- className,
- ...props
+ className,
+ ...props
}: ComponentProps) {
- const [readonly, setReadonly] = useState(false);
- const $svg = useRef(null);
+ const [readonly, setReadonly] = useState(false);
+ const $svg = useRef(null);
- const handleClear = () => $svg.current?.clear();
+ const handleClear = () => $svg.current?.clear();
- const handleValidate = () => {
- if (readonly) {
- $svg.current?.clear();
- setReadonly(false);
- } else {
- setReadonly(true);
- }
- };
+ const handleValidate = () => {
+ if (readonly) {
+ $svg.current?.clear();
+ setReadonly(false);
+ } else {
+ setReadonly(true);
+ }
+ };
- return (
-
-
Just sign here
-
-
-
- {readonly && (
- <>
-
-
- >
- )}
- {!readonly && }
-
-
- );
+ return (
+
+
Just sign here
+
+
+
+ {readonly && (
+ <>
+
+
+ >
+ )}
+ {!readonly && }
+
+
+ );
}
function prepareSvgElement(svgElement: SVGSVGElement) {
- const svgelm = svgElement.cloneNode(true) as SVGSVGElement;
- const clientWidth = svgElement.clientWidth;
- const clientHeight = svgElement.clientHeight;
- svgelm.removeAttribute("style");
- svgelm.setAttribute("width", `${clientWidth}px`);
- svgelm.setAttribute("height", `${clientHeight}px`);
- svgelm.setAttribute("viewBox", `0 0 ${clientWidth} ${clientHeight}`);
- return { svgelm, clientWidth, clientHeight };
+ const svgelm = svgElement.cloneNode(true) as SVGSVGElement;
+ const clientWidth = svgElement.clientWidth;
+ const clientHeight = svgElement.clientHeight;
+ svgelm.removeAttribute("style");
+ svgelm.setAttribute("width", `${clientWidth}px`);
+ svgelm.setAttribute("height", `${clientHeight}px`);
+ svgelm.setAttribute("viewBox", `0 0 ${clientWidth} ${clientHeight}`);
+ return { svgelm, clientWidth, clientHeight };
}
function ValidateButton({
- readonly,
- onClick,
+ readonly,
+ onClick,
}: Readonly<{
- readonly: boolean;
- onClick: () => void;
+ readonly: boolean;
+ onClick: () => void;
}>) {
- return (
-
- {readonly ? (
- <>
-
- Reset
- >
- ) : (
- <>
-
- Validate
- >
- )}
-
- );
+ return (
+
+ {readonly ? (
+ <>
+
+ Reset
+ >
+ ) : (
+ <>
+
+ Validate
+ >
+ )}
+
+ );
}
function DownloadButton({
- svgElement,
+ svgElement,
}: Readonly<{
- svgElement: SVGSVGElement | undefined | null;
+ svgElement: SVGSVGElement | undefined | null;
}>) {
- const handleDownloadImage = () => {
- if (!svgElement) {
- return;
- }
+ const handleDownloadImage = () => {
+ if (!svgElement) {
+ return;
+ }
- const { svgelm, clientWidth, clientHeight } = prepareSvgElement(svgElement);
+ const { svgelm, clientWidth, clientHeight } = prepareSvgElement(svgElement);
- const data = new XMLSerializer().serializeToString(svgelm);
- const canvas = document.createElement("canvas");
- const ctx = canvas.getContext("2d");
- const img = new Image();
- img.onload = () => {
- canvas.width = clientWidth ?? 0;
- canvas.height = clientHeight ?? 0;
- ctx?.drawImage(img, 0, 0);
- const a = document.createElement("a");
- a.download = "signature.png";
- a.href = canvas.toDataURL("image/png");
- a.click();
- };
- img.src = `data:image/svg+xml;base64,${window.btoa(
- decodeURIComponent(encodeURIComponent(data)),
- )}`;
- };
+ const data = new XMLSerializer().serializeToString(svgelm);
+ const canvas = document.createElement("canvas");
+ const ctx = canvas.getContext("2d");
+ const img = new Image();
+ img.onload = () => {
+ canvas.width = clientWidth ?? 0;
+ canvas.height = clientHeight ?? 0;
+ ctx?.drawImage(img, 0, 0);
+ const a = document.createElement("a");
+ a.download = "signature.png";
+ a.href = canvas.toDataURL("image/png");
+ a.click();
+ };
+ img.src = `data:image/svg+xml;base64,${window.btoa(
+ decodeURIComponent(encodeURIComponent(data)),
+ )}`;
+ };
- return (
-
-
- Download
-
- );
+ return (
+
+
+ Download
+
+ );
}
function CopySvgButton({
- svgElement,
+ svgElement,
}: Readonly<{
- svgElement: SVGSVGElement | undefined | null;
+ svgElement: SVGSVGElement | undefined | null;
}>) {
- const [_, copyText, isCopied] = useCopyToClipboard();
+ const [_, copyText, isCopied] = useCopyToClipboard();
- const handleCopySvg = () => {
- if (!svgElement) {
- return;
- }
+ const handleCopySvg = () => {
+ if (!svgElement) {
+ return;
+ }
- const { svgelm } = prepareSvgElement(svgElement);
- copyText(svgelm.outerHTML);
- };
+ const { svgelm } = prepareSvgElement(svgElement);
+ copyText(svgelm.outerHTML);
+ };
- return (
-
- {isCopied ? (
- <>
- Copied
-
- >
- ) : (
- <>
- Copy to SVG
-
- >
- )}
-
- );
+ return (
+
+ {isCopied ? (
+ <>
+ Copied
+
+ >
+ ) : (
+ <>
+ Copy to SVG
+
+ >
+ )}
+
+ );
}
function ClearButton({ onClick }: Readonly<{ onClick: () => void }>) {
- return (
-
-
- Clear
-
- );
+ return (
+
+
+ Clear
+
+ );
}
diff --git a/packages/ui/cuicui/application-ui/signature/signature.category.tsx b/packages/ui/cuicui/application-ui/signature/signature.category.tsx
index 9ae6f92f..6aa612c2 100644
--- a/packages/ui/cuicui/application-ui/signature/signature.category.tsx
+++ b/packages/ui/cuicui/application-ui/signature/signature.category.tsx
@@ -4,14 +4,14 @@ import PreviewReactSignature from "@/cuicui/application-ui/signature/react-signa
import { reactSignatureComponent } from "@/cuicui/application-ui/signature/react-signature/react-signature.component";
export const signatureCategory: CategoryType = {
- slug: "signature",
- name: "Signature",
- description: "Signature components",
- releaseDateCategory: new Date("2024-09-24"),
- icon: SignatureIcon,
- previewCategory: {
- component: ,
- previewScale: 1,
- },
- componentList: [reactSignatureComponent],
+ slug: "signature",
+ name: "Signature",
+ description: "Signature components",
+ releaseDateCategory: new Date("2024-09-24"),
+ icon: SignatureIcon,
+ previewCategory: {
+ component: ,
+ previewScale: 1,
+ },
+ componentList: [reactSignatureComponent],
};
diff --git a/packages/ui/cuicui/application-ui/sliders/sliders.category.tsx b/packages/ui/cuicui/application-ui/sliders/sliders.category.tsx
index 18098863..4c157313 100644
--- a/packages/ui/cuicui/application-ui/sliders/sliders.category.tsx
+++ b/packages/ui/cuicui/application-ui/sliders/sliders.category.tsx
@@ -5,48 +5,48 @@ import SimpleModernSlider from "@/cuicui/application-ui/sliders/simple-modern-sl
import SimpleModernSliderWithMax from "@/cuicui/application-ui/sliders/simple-modern-slider/simple-modern-slider-with-max";
export const slidersCategory: CategoryType = {
- slug: "sliders",
- name: "Sliders",
- description: "Slider components with animations",
- releaseDateCategory: new Date("2024-08-10"),
- icon: SlidersHorizontalIcon,
- previewCategory: {
- component: ,
- previewScale: 1,
- },
- componentList: [
- {
- slug: "elastic-slider",
- name: "Elastic Slider",
- description: "Smooth slider with scale effect.",
- sizePreview: "xs",
- variantList: [
- {
- name: "Default",
- component: ,
- slugPreviewFile: "variant1",
- },
- ],
- inspiration: "Build UI",
- inspirationLink: "https://buildui.com/recipes/elastic-slider",
- },
- {
- slug: "simple-modern-slider",
- name: "Simple Modern Slider",
- description: "Simple modern slider with micro animations.",
- sizePreview: "xs",
- variantList: [
- {
- name: "Smooth",
- component: ,
- slugPreviewFile: "simple-modern-slider",
- },
- {
- name: "Min & max steps",
- component: ,
- slugPreviewFile: "simple-modern-slider-with-max",
- },
- ],
- },
- ],
+ slug: "sliders",
+ name: "Sliders",
+ description: "Slider components with animations",
+ releaseDateCategory: new Date("2024-08-10"),
+ icon: SlidersHorizontalIcon,
+ previewCategory: {
+ component: ,
+ previewScale: 1,
+ },
+ componentList: [
+ {
+ slug: "elastic-slider",
+ name: "Elastic Slider",
+ description: "Smooth slider with scale effect.",
+ sizePreview: "xs",
+ variantList: [
+ {
+ name: "Default",
+ component: ,
+ slugPreviewFile: "variant1",
+ },
+ ],
+ inspiration: "Build UI",
+ inspirationLink: "https://buildui.com/recipes/elastic-slider",
+ },
+ {
+ slug: "simple-modern-slider",
+ name: "Simple Modern Slider",
+ description: "Simple modern slider with micro animations.",
+ sizePreview: "xs",
+ variantList: [
+ {
+ name: "Smooth",
+ component: ,
+ slugPreviewFile: "simple-modern-slider",
+ },
+ {
+ name: "Min & max steps",
+ component: ,
+ slugPreviewFile: "simple-modern-slider-with-max",
+ },
+ ],
+ },
+ ],
};
diff --git a/packages/ui/cuicui/application-ui/static-steppers/code/variant1.tsx b/packages/ui/cuicui/application-ui/static-steppers/code/variant1.tsx
index b6f2271c..5b073397 100644
--- a/packages/ui/cuicui/application-ui/static-steppers/code/variant1.tsx
+++ b/packages/ui/cuicui/application-ui/static-steppers/code/variant1.tsx
@@ -3,73 +3,73 @@ import type { ReactNode } from "react";
import { cn } from "@/cuicui/utils/cn/cn";
const dataSteps = [
- {
- title: "Step 1",
- code: "npx create-react-app my-app",
- },
- {
- title: "Step 2",
- code: "cd my-app",
- },
- {
- title: "Step 3",
- code: "npm start",
- },
- {
- title: "Step 4",
- code: "npm run build",
- },
+ {
+ title: "Step 1",
+ code: "npx create-react-app my-app",
+ },
+ {
+ title: "Step 2",
+ code: "cd my-app",
+ },
+ {
+ title: "Step 3",
+ code: "npm start",
+ },
+ {
+ title: "Step 4",
+ code: "npm run build",
+ },
];
export const StepWithStickyColorVariant1 = () => {
- return (
-
- {dataSteps.map((step, index) => (
-
- {step.code}
-
- ))}
-
- );
+ return (
+
+ {dataSteps.map((step, index) => (
+
+ {step.code}
+
+ ))}
+
+ );
};
const StaticStep = ({
- step,
- title,
- children,
+ step,
+ title,
+ children,
}: {
- step: number;
- title: string;
- children?: ReactNode;
+ step: number;
+ title: string;
+ children?: ReactNode;
}) => {
- return (
-
-
-
-
- {title}
-
- {children}
-
-
- );
+ return (
+
+
+
+
+ {title}
+
+ {children}
+
+
+ );
};
const CodeContainer = ({ children }: { children: ReactNode }) => {
- return (
-
-
- {children}
-
-
- );
+ return (
+
+
+ {children}
+
+
+ );
};
diff --git a/packages/ui/cuicui/application-ui/static-steppers/static-steppers.category.tsx b/packages/ui/cuicui/application-ui/static-steppers/static-steppers.category.tsx
index 783334bc..b6baa4db 100644
--- a/packages/ui/cuicui/application-ui/static-steppers/static-steppers.category.tsx
+++ b/packages/ui/cuicui/application-ui/static-steppers/static-steppers.category.tsx
@@ -3,32 +3,32 @@ import type { CategoryType } from "@/lib/types/component";
import { StepWithStickyColorVariant1 } from "@/cuicui/application-ui/static-steppers/code/variant1";
export const staticSteppersCategory: CategoryType = {
- slug: "static-steppers",
- name: "Static Steppers",
- description: "Components to display a list of steps",
- releaseDateCategory: new Date("2024-08-01"),
- icon: ListOrderedIcon,
- previewCategory: {
- component: ,
- previewScale: 0.75,
- },
- componentList: [
- {
- slug: "code",
- name: "Simple static stepper",
- description:
- "A simple static stepper component to display a list of steps.",
- sizePreview: "sm",
- variantList: [
- {
- name: "Default",
- component: ,
- slugPreviewFile: "variant1",
- },
- ],
- componentBadges: ["updated"],
- inspiration: "Hooks Scriptkavi manual installation",
- inspirationLink: "https://hooks.scriptkavi.com/docs/hooks/battery",
- },
- ],
+ slug: "static-steppers",
+ name: "Static Steppers",
+ description: "Components to display a list of steps",
+ releaseDateCategory: new Date("2024-08-01"),
+ icon: ListOrderedIcon,
+ previewCategory: {
+ component: ,
+ previewScale: 0.75,
+ },
+ componentList: [
+ {
+ slug: "code",
+ name: "Simple static stepper",
+ description:
+ "A simple static stepper component to display a list of steps.",
+ sizePreview: "sm",
+ variantList: [
+ {
+ name: "Default",
+ component: ,
+ slugPreviewFile: "variant1",
+ },
+ ],
+ componentBadges: ["updated"],
+ inspiration: "Hooks Scriptkavi manual installation",
+ inspirationLink: "https://hooks.scriptkavi.com/docs/hooks/battery",
+ },
+ ],
};
diff --git a/packages/ui/cuicui/application-ui/table-of-contents/modul-inspired/following-header-preview.tsx b/packages/ui/cuicui/application-ui/table-of-contents/modul-inspired/following-header-preview.tsx
index 7c91588c..aad443d1 100644
--- a/packages/ui/cuicui/application-ui/table-of-contents/modul-inspired/following-header-preview.tsx
+++ b/packages/ui/cuicui/application-ui/table-of-contents/modul-inspired/following-header-preview.tsx
@@ -1,61 +1,61 @@
import TableOfContent from "@/cuicui/application-ui/table-of-contents/modul-inspired/following-headers";
export default function TableOfContentPreview() {
- return (
-
-
-
-
- Scroll the section below
-
-
-
Table of content preview
-
- Here is the first h2
-
- Here is the first h3
-
- Here is the second h3
-
- Here is the second h2
-
- Here is the third h3
-
- Here is the fourth h3
-
- Here is the third h2
-
- Here is the fifth h3
-
- Here is the sixth h3
-
-
-
-
- );
+ return (
+
+
+
+
+ Scroll the section below
+
+
+
Table of content preview
+
+ Here is the first h2
+
+ Here is the first h3
+
+ Here is the second h3
+
+ Here is the second h2
+
+ Here is the third h3
+
+ Here is the fourth h3
+
+ Here is the third h2
+
+ Here is the fifth h3
+
+ Here is the sixth h3
+
+
+
+
+ );
}
const LoremIpsum = () => {
- return (
-
- Commodo labore ullamco excepteur. Labore sunt dolore velit et consectetur
- proident minim minim occaecat. Id sit adipisicing aliqua proident nisi
- mollit aute. Duis in dolore incididunt ea. Quis quis in do quis laboris
- veniam ex irure consectetur incididunt in. Est ipsum in nostrud anim ut
- exercitation. Deserunt in consequat Lorem. Id magna culpa anim anim quis
- tempor reprehenderit enim ex fugiat veniam aliqua. Commodo proident
- laboris aute qui. Fugiat non ullamco nulla sunt officia eu cupidatat sit
- id qui id. Aliquip anim elit eu occaecat id pariatur irure labore
- cupidatat aliqua aliquip sunt commodo incididunt officia. Id ea elit
- labore sunt Lorem culpa exercitation. Deserunt pariatur enim in. Aliquip
- fugiat irure labore in consequat ex consequat et esse cupidatat aute in
- esse.
-
- );
+ return (
+
+ Commodo labore ullamco excepteur. Labore sunt dolore velit et consectetur
+ proident minim minim occaecat. Id sit adipisicing aliqua proident nisi
+ mollit aute. Duis in dolore incididunt ea. Quis quis in do quis laboris
+ veniam ex irure consectetur incididunt in. Est ipsum in nostrud anim ut
+ exercitation. Deserunt in consequat Lorem. Id magna culpa anim anim quis
+ tempor reprehenderit enim ex fugiat veniam aliqua. Commodo proident
+ laboris aute qui. Fugiat non ullamco nulla sunt officia eu cupidatat sit
+ id qui id. Aliquip anim elit eu occaecat id pariatur irure labore
+ cupidatat aliqua aliquip sunt commodo incididunt officia. Id ea elit
+ labore sunt Lorem culpa exercitation. Deserunt pariatur enim in. Aliquip
+ fugiat irure labore in consequat ex consequat et esse cupidatat aute in
+ esse.
+
+ );
};
diff --git a/packages/ui/cuicui/application-ui/table-of-contents/modul-inspired/following-headers.tsx b/packages/ui/cuicui/application-ui/table-of-contents/modul-inspired/following-headers.tsx
index e8696a59..561c1239 100644
--- a/packages/ui/cuicui/application-ui/table-of-contents/modul-inspired/following-headers.tsx
+++ b/packages/ui/cuicui/application-ui/table-of-contents/modul-inspired/following-headers.tsx
@@ -10,259 +10,259 @@ import Link from "next/link";
import { type HTMLProps, useEffect, useRef, useState } from "react";
type Heading = {
- id: string;
- text: string;
- level: number;
- index: number;
+ id: string;
+ text: string;
+ level: number;
+ index: number;
};
const TableOfContent = ({
- className,
- idOfParentContainer,
- ...props
+ className,
+ idOfParentContainer,
+ ...props
}: {
- readonly props?: HTMLProps;
- readonly className?: string;
- readonly idOfParentContainer: string;
+ readonly props?: HTMLProps;
+ readonly className?: string;
+ readonly idOfParentContainer: string;
}) => {
- const [headings, setHeadings] = useState([]);
- const [activeIds, setActiveIds] = useState([]);
- const [activeTableOfContentIds, setActiveTableOfContentIds] = useState<
- string[]
- >([]);
- const [firstActiveHeading2, setFirstActiveHeading2] = useState(
- null,
- );
- const [lastActiveHeading2, setLastActiveHeading2] = useState(
- null,
- );
- const [bottomCoordinate, setBottomCoordinate] = useState(0);
- const [topCoordinate, setTopCoordinate] = useState(0);
- const refTableOfContentList = useRef(null);
- useEffect(() => {
- if (activeTableOfContentIds.length > 0) {
- setFirstActiveHeading2(activeTableOfContentIds[0]);
- setLastActiveHeading2(
- activeTableOfContentIds[activeTableOfContentIds.length - 1],
- );
- } else {
- setFirstActiveHeading2(null);
- setLastActiveHeading2(null);
- }
- }, [activeTableOfContentIds]);
+ const [headings, setHeadings] = useState([]);
+ const [activeIds, setActiveIds] = useState([]);
+ const [activeTableOfContentIds, setActiveTableOfContentIds] = useState<
+ string[]
+ >([]);
+ const [firstActiveHeading2, setFirstActiveHeading2] = useState(
+ null,
+ );
+ const [lastActiveHeading2, setLastActiveHeading2] = useState(
+ null,
+ );
+ const [bottomCoordinate, setBottomCoordinate] = useState(0);
+ const [topCoordinate, setTopCoordinate] = useState(0);
+ const refTableOfContentList = useRef(null);
+ useEffect(() => {
+ if (activeTableOfContentIds.length > 0) {
+ setFirstActiveHeading2(activeTableOfContentIds[0]);
+ setLastActiveHeading2(
+ activeTableOfContentIds[activeTableOfContentIds.length - 1],
+ );
+ } else {
+ setFirstActiveHeading2(null);
+ setLastActiveHeading2(null);
+ }
+ }, [activeTableOfContentIds]);
- useEffect(() => {
- // Get coordinates of the bottom of the last active heading and the top of the first active heading
- const lastChildId =
- activeTableOfContentIds[activeTableOfContentIds.length - 1];
- const firstChildId = activeTableOfContentIds[0];
- const lastChild = document.getElementById(
- `${lastChildId}-table-of-content-item`,
- );
- const firstChild = document.getElementById(
- `${firstChildId}-table-of-content-item`,
- );
+ useEffect(() => {
+ // Get coordinates of the bottom of the last active heading and the top of the first active heading
+ const lastChildId =
+ activeTableOfContentIds[activeTableOfContentIds.length - 1];
+ const firstChildId = activeTableOfContentIds[0];
+ const lastChild = document.getElementById(
+ `${lastChildId}-table-of-content-item`,
+ );
+ const firstChild = document.getElementById(
+ `${firstChildId}-table-of-content-item`,
+ );
- if (lastChild && firstChild) {
- const lastChildRect = lastChild.getBoundingClientRect();
- const firstChildRect = firstChild.getBoundingClientRect();
+ if (lastChild && firstChild) {
+ const lastChildRect = lastChild.getBoundingClientRect();
+ const firstChildRect = firstChild.getBoundingClientRect();
- // Calculate relative coordinates from the ol element
- if (!refTableOfContentList.current) {
- return;
- }
- setBottomCoordinate(
- lastChildRect.bottom -
- refTableOfContentList.current.getBoundingClientRect().top,
- );
- setTopCoordinate(
- firstChildRect.top -
- refTableOfContentList.current.getBoundingClientRect().top,
- );
- }
- }, [activeTableOfContentIds]);
+ // Calculate relative coordinates from the ol element
+ if (!refTableOfContentList.current) {
+ return;
+ }
+ setBottomCoordinate(
+ lastChildRect.bottom -
+ refTableOfContentList.current.getBoundingClientRect().top,
+ );
+ setTopCoordinate(
+ firstChildRect.top -
+ refTableOfContentList.current.getBoundingClientRect().top,
+ );
+ }
+ }, [activeTableOfContentIds]);
- useEffect(() => {
- if (!headings) {
- return;
- }
- if (activeIds.length > 0) {
- const previousHeading = getPreviousHeading(activeIds[0], headings);
- if (previousHeading) {
- const activeIdsWithPreviousHeading = [previousHeading, ...activeIds];
- setActiveTableOfContentIds(activeIdsWithPreviousHeading);
- } else {
- setActiveTableOfContentIds(activeIds);
- }
- } else {
- // Keep the previous active ids if there are no active ids but without the first one
- setActiveTableOfContentIds((prevIds) => {
- if (prevIds.length > 0) {
- return prevIds.slice(1);
- }
- return [];
- });
- }
- }, [activeIds, headings]);
+ useEffect(() => {
+ if (!headings) {
+ return;
+ }
+ if (activeIds.length > 0) {
+ const previousHeading = getPreviousHeading(activeIds[0], headings);
+ if (previousHeading) {
+ const activeIdsWithPreviousHeading = [previousHeading, ...activeIds];
+ setActiveTableOfContentIds(activeIdsWithPreviousHeading);
+ } else {
+ setActiveTableOfContentIds(activeIds);
+ }
+ } else {
+ // Keep the previous active ids if there are no active ids but without the first one
+ setActiveTableOfContentIds((prevIds) => {
+ if (prevIds.length > 0) {
+ return prevIds.slice(1);
+ }
+ return [];
+ });
+ }
+ }, [activeIds, headings]);
- useEffect(() => {
- if (typeof document === "undefined") {
- return;
- }
+ useEffect(() => {
+ if (typeof document === "undefined") {
+ return;
+ }
- const content = document.getElementById(idOfParentContainer);
- if (!content) {
- return;
- }
+ const content = document.getElementById(idOfParentContainer);
+ if (!content) {
+ return;
+ }
- const headingElements = Array.from(
- content.querySelectorAll("h1, h2, h3, h4, h5, h6"),
- );
+ const headingElements = Array.from(
+ content.querySelectorAll("h1, h2, h3, h4, h5, h6"),
+ );
- const newHeadings: Heading[] = headingElements.map((elem, index) => {
- let id = elem.id;
- if (!id) {
- id =
- elem.textContent
- ?.toLowerCase()
- .replace(/\s+/g, "-")
- .replace(/[!@#$%^&*(),.?":{}|<>]/g, "") ?? "";
- elem.id = id;
- }
- const level = Number.parseInt(elem.tagName.substring(1), 10);
- return { id, text: elem.textContent ?? "", level, index };
- });
+ const newHeadings: Heading[] = headingElements.map((elem, index) => {
+ let id = elem.id;
+ if (!id) {
+ id =
+ elem.textContent
+ ?.toLowerCase()
+ .replace(/\s+/g, "-")
+ .replace(/[!@#$%^&*(),.?":{}|<>]/g, "") ?? "";
+ elem.id = id;
+ }
+ const level = Number.parseInt(elem.tagName.substring(1), 10);
+ return { id, text: elem.textContent ?? "", level, index };
+ });
- setHeadings(newHeadings);
+ setHeadings(newHeadings);
- const handleIntersection: IntersectionObserverCallback = (entries) => {
- const updateActiveIds = (
- prevIds: string[],
- entries: IntersectionObserverEntry[],
- ) => {
- const updatedIds = [...prevIds];
- for (const entry of entries) {
- const index = updatedIds.indexOf(entry.target.id);
+ const handleIntersection: IntersectionObserverCallback = (entries) => {
+ const updateActiveIds = (
+ prevIds: string[],
+ entries: IntersectionObserverEntry[],
+ ) => {
+ const updatedIds = [...prevIds];
+ for (const entry of entries) {
+ const index = updatedIds.indexOf(entry.target.id);
- if (entry.isIntersecting) {
- if (index === -1) {
- updatedIds.push(entry.target.id);
- updatedIds.sort(
- (a, b) =>
- headingElements.findIndex((el) => el.id === a) -
- headingElements.findIndex((el) => el.id === b),
- );
- }
- } else if (index !== -1) {
- updatedIds.splice(index, 1);
- }
- }
+ if (entry.isIntersecting) {
+ if (index === -1) {
+ updatedIds.push(entry.target.id);
+ updatedIds.sort(
+ (a, b) =>
+ headingElements.findIndex((el) => el.id === a) -
+ headingElements.findIndex((el) => el.id === b),
+ );
+ }
+ } else if (index !== -1) {
+ updatedIds.splice(index, 1);
+ }
+ }
- return updatedIds;
- };
+ return updatedIds;
+ };
- setActiveIds((prevIds) => updateActiveIds(prevIds, entries));
- };
+ setActiveIds((prevIds) => updateActiveIds(prevIds, entries));
+ };
- const observerOptions: IntersectionObserverInit = {
- root: null,
- rootMargin: "-10px",
- // threshold: [0.5, 1],
- threshold: [1],
- };
+ const observerOptions: IntersectionObserverInit = {
+ root: null,
+ rootMargin: "-10px",
+ // threshold: [0.5, 1],
+ threshold: [1],
+ };
- const observer = new IntersectionObserver(
- handleIntersection,
- observerOptions,
- );
+ const observer = new IntersectionObserver(
+ handleIntersection,
+ observerOptions,
+ );
- for (const elem of headingElements) {
- observer.observe(elem);
- }
+ for (const elem of headingElements) {
+ observer.observe(elem);
+ }
- return () => {
- observer.disconnect();
- };
- }, [idOfParentContainer]);
+ return () => {
+ observer.disconnect();
+ };
+ }, [idOfParentContainer]);
- function getPreviousHeading(id: string, headings: Heading[]) {
- const index = headings.findIndex((heading) => heading.id === id);
- if (index === 0) {
- return null;
- }
- return headings[index - 1]?.id;
- }
+ function getPreviousHeading(id: string, headings: Heading[]) {
+ const index = headings.findIndex((heading) => heading.id === id);
+ if (index === 0) {
+ return null;
+ }
+ return headings[index - 1]?.id;
+ }
- if (headings.length === 0) {
- return ;
- }
+ if (headings.length === 0) {
+ return ;
+ }
- return (
-
-
- {headings.map((heading, _index) => {
- return (
-
-
-
-
- {heading.text}
-
-
-
- );
- })}
-
- {firstActiveHeading2 && lastActiveHeading2 && (
-
- )}
-
-
-
- );
+ return (
+
+
+ {headings.map((heading, _index) => {
+ return (
+
+
+
+
+ {heading.text}
+
+
+
+ );
+ })}
+
+ {firstActiveHeading2 && lastActiveHeading2 && (
+
+ )}
+
+
+
+ );
};
export default TableOfContent;
diff --git a/packages/ui/cuicui/application-ui/table-of-contents/table-of-contents.category.tsx b/packages/ui/cuicui/application-ui/table-of-contents/table-of-contents.category.tsx
index d41993eb..d5e276e8 100644
--- a/packages/ui/cuicui/application-ui/table-of-contents/table-of-contents.category.tsx
+++ b/packages/ui/cuicui/application-ui/table-of-contents/table-of-contents.category.tsx
@@ -4,35 +4,35 @@ import { StepWithStickyColorVariant1 } from "@/cuicui/application-ui/static-step
import TableOfContentPreview from "@/cuicui/application-ui/table-of-contents/modul-inspired/following-header-preview";
export const tableOfContentCategory: CategoryType = {
- slug: "table-of-contents",
- name: "Table of Contents",
- description: "Table of contents components",
- releaseDateCategory: new Date("2024-08-28"),
- icon: TableOfContentsIcon,
- previewCategory: {
- component: ,
- previewScale: 0.75,
- },
- componentList: [
- {
- slug: "modul-inspired",
- name: "Modul inspired table of contents",
- description:
- "An advanced animated table of contents component highlighting every sections on the screen.",
- sizePreview: "md",
+ slug: "table-of-contents",
+ name: "Table of Contents",
+ description: "Table of contents components",
+ releaseDateCategory: new Date("2024-08-28"),
+ icon: TableOfContentsIcon,
+ previewCategory: {
+ component: ,
+ previewScale: 0.75,
+ },
+ componentList: [
+ {
+ slug: "modul-inspired",
+ name: "Modul inspired table of contents",
+ description:
+ "An advanced animated table of contents component highlighting every sections on the screen.",
+ sizePreview: "md",
- variantList: [
- {
- name: "Default",
- component: ,
- slugPreviewFile: "following-header-preview",
- slugComponentFile: "following-headers",
- },
- ],
- isResizable: false,
+ variantList: [
+ {
+ name: "Default",
+ component: ,
+ slugPreviewFile: "following-header-preview",
+ slugComponentFile: "following-headers",
+ },
+ ],
+ isResizable: false,
- inspiration: "Modul",
- inspirationLink: "https://www.modul.day",
- },
- ],
+ inspiration: "Modul",
+ inspirationLink: "https://www.modul.day",
+ },
+ ],
};
diff --git a/packages/ui/cuicui/application-ui/theme/theme-switcher/theme-switcher-button.tsx b/packages/ui/cuicui/application-ui/theme/theme-switcher/theme-switcher-button.tsx
index db72b502..df6f224b 100644
--- a/packages/ui/cuicui/application-ui/theme/theme-switcher/theme-switcher-button.tsx
+++ b/packages/ui/cuicui/application-ui/theme/theme-switcher/theme-switcher-button.tsx
@@ -4,59 +4,59 @@ import React from "react";
import { cn } from "@/cuicui/utils/cn/cn";
export const ThemeSwitcherButton = () => {
- const [theme, setTheme] = React.useState<"light" | "dark">("light");
- return (
- setTheme((prev) => (prev === "light" ? "dark" : "light"))}
- type="button"
- >
-
-
-
-
-
-
-
- Dark
-
-
- Light
-
-
-
- );
+ const [theme, setTheme] = React.useState<"light" | "dark">("light");
+ return (
+ setTheme((prev) => (prev === "light" ? "dark" : "light"))}
+ type="button"
+ >
+
+
+
+
+
+
+
+ Dark
+
+
+ Light
+
+
+
+ );
};
diff --git a/packages/ui/cuicui/application-ui/theme/theme.category.tsx b/packages/ui/cuicui/application-ui/theme/theme.category.tsx
index fe1fc5d8..3b2d778c 100644
--- a/packages/ui/cuicui/application-ui/theme/theme.category.tsx
+++ b/packages/ui/cuicui/application-ui/theme/theme.category.tsx
@@ -3,29 +3,29 @@ import type { CategoryType } from "@/lib/types/component";
import { ThemeSwitcherButton } from "@/cuicui/application-ui/theme/theme-switcher/theme-switcher-button";
export const themeCategory: CategoryType = {
- slug: "theme",
- name: "Theme",
- description: "Theme components",
- releaseDateCategory: new Date("2024-08-29"),
- icon: SunMoonIcon,
- previewCategory: {
- component: ,
- previewScale: 1,
- },
- componentList: [
- {
- slug: "theme-switcher",
- name: "Theme Switcher",
- description: "A theme switcher button.",
+ slug: "theme",
+ name: "Theme",
+ description: "Theme components",
+ releaseDateCategory: new Date("2024-08-29"),
+ icon: SunMoonIcon,
+ previewCategory: {
+ component: ,
+ previewScale: 1,
+ },
+ componentList: [
+ {
+ slug: "theme-switcher",
+ name: "Theme Switcher",
+ description: "A theme switcher button.",
- sizePreview: "xs",
- variantList: [
- {
- name: "Default",
- component: ,
- slugPreviewFile: "theme-switcher-button",
- },
- ],
- },
- ],
+ sizePreview: "xs",
+ variantList: [
+ {
+ name: "Default",
+ component: ,
+ slugPreviewFile: "theme-switcher-button",
+ },
+ ],
+ },
+ ],
};
diff --git a/packages/ui/cuicui/application-ui/tree/recursive-tree/recursive-tree-less-animations.tsx b/packages/ui/cuicui/application-ui/tree/recursive-tree/recursive-tree-less-animations.tsx
index be7d7b7e..baca2621 100644
--- a/packages/ui/cuicui/application-ui/tree/recursive-tree/recursive-tree-less-animations.tsx
+++ b/packages/ui/cuicui/application-ui/tree/recursive-tree/recursive-tree-less-animations.tsx
@@ -5,79 +5,79 @@ import React, { useState, type HTMLAttributes, type ReactNode } from "react";
import { cn } from "@/cuicui/utils/cn/cn";
type TreeProps = {
- contentTree: ReactNode;
- children?: ReactNode;
- defaultCollapsed?: boolean;
- depth?: number;
+ contentTree: ReactNode;
+ children?: ReactNode;
+ defaultCollapsed?: boolean;
+ depth?: number;
} & HTMLAttributes;
export const Tree = ({
- contentTree,
- children,
- defaultCollapsed = false,
- depth = 0,
- ...rest
+ contentTree,
+ children,
+ defaultCollapsed = false,
+ depth = 0,
+ ...rest
}: TreeProps) => {
- const [collapsed, setCollapsed] = useState(defaultCollapsed);
+ const [collapsed, setCollapsed] = useState(defaultCollapsed);
- const hasChildren = React.Children.count(children) > 0;
+ const hasChildren = React.Children.count(children) > 0;
- const toggleCollapse = () => {
- if (hasChildren) {
- setCollapsed(!collapsed);
- }
- };
+ const toggleCollapse = () => {
+ if (hasChildren) {
+ setCollapsed(!collapsed);
+ }
+ };
- return (
-
-
-
- {contentTree}
-
- {hasChildren && (
-
-
-
- )}
-
- {hasChildren && !collapsed && (
-
- {React.Children.map(children, (child) => {
- return React.isValidElement(child)
- ? React.cloneElement(child, { depth: depth + 1 })
- : child;
- })}
-
- )}
-
- );
+ return (
+
+
+
+ {contentTree}
+
+ {hasChildren && (
+
+
+
+ )}
+
+ {hasChildren && !collapsed && (
+
+ {React.Children.map(children, (child) => {
+ return React.isValidElement(child)
+ ? React.cloneElement(child, { depth: depth + 1 })
+ : child;
+ })}
+
+ )}
+
+ );
};
diff --git a/packages/ui/cuicui/application-ui/tree/recursive-tree/recursive-tree.component.tsx b/packages/ui/cuicui/application-ui/tree/recursive-tree/recursive-tree.component.tsx
index af405dd8..c9d44f4c 100644
--- a/packages/ui/cuicui/application-ui/tree/recursive-tree/recursive-tree.component.tsx
+++ b/packages/ui/cuicui/application-ui/tree/recursive-tree/recursive-tree.component.tsx
@@ -3,23 +3,23 @@ import { PreviewRecursiveTree } from "@/cuicui/application-ui/tree/recursive-tre
import { PreviewRecursiveTreeLessAnimations } from "@/cuicui/application-ui/tree/recursive-tree/preview-recursive-tree-less-animations";
export const recursiveTreeComponent: ComponentType = {
- sizePreview: "lg",
- slug: "recursive-tree",
- variantList: [
- {
- name: "Default",
- component: ,
- slugPreviewFile: "preview-recursive-tree",
- slugComponentFile: "recursive-tree",
- },
- {
- name: "Less animations",
- component: ,
- slugPreviewFile: "preview-recursive-tree-less-animations",
- slugComponentFile: "recursive-tree-less-animations",
- },
- ],
- name: "Recursive Tree",
- description:
- "A tree component with recursive children. Without any limit with animated collapse and without needing to know the depth or to specify parent component.",
+ sizePreview: "lg",
+ slug: "recursive-tree",
+ variantList: [
+ {
+ name: "Default",
+ component: ,
+ slugPreviewFile: "preview-recursive-tree",
+ slugComponentFile: "recursive-tree",
+ },
+ {
+ name: "Less animations",
+ component: ,
+ slugPreviewFile: "preview-recursive-tree-less-animations",
+ slugComponentFile: "recursive-tree-less-animations",
+ },
+ ],
+ name: "Recursive Tree",
+ description:
+ "A tree component with recursive children. Without any limit with animated collapse and without needing to know the depth or to specify parent component.",
};
diff --git a/packages/ui/cuicui/application-ui/tree/recursive-tree/recursive-tree.tsx b/packages/ui/cuicui/application-ui/tree/recursive-tree/recursive-tree.tsx
index 6e6e16a4..67b48ddc 100644
--- a/packages/ui/cuicui/application-ui/tree/recursive-tree/recursive-tree.tsx
+++ b/packages/ui/cuicui/application-ui/tree/recursive-tree/recursive-tree.tsx
@@ -5,108 +5,108 @@ import React, { useState, type ReactNode, type HTMLAttributes } from "react";
import { cn } from "@/cuicui/utils/cn/cn";
type TreeProps = {
- contentTree: ReactNode;
- children?: ReactNode;
- defaultCollapsed?: boolean;
- depth?: number;
+ contentTree: ReactNode;
+ children?: ReactNode;
+ defaultCollapsed?: boolean;
+ depth?: number;
} & HTMLAttributes;
export const Tree = ({
- contentTree,
- children,
- defaultCollapsed = false,
- depth = 0,
- ...rest
+ contentTree,
+ children,
+ defaultCollapsed = false,
+ depth = 0,
+ ...rest
}: TreeProps) => {
- const [collapsed, setCollapsed] = useState(defaultCollapsed);
+ const [collapsed, setCollapsed] = useState(defaultCollapsed);
- const hasChildren = React.Children.count(children) > 0;
+ const hasChildren = React.Children.count(children) > 0;
- const toggleCollapse = () => {
- if (hasChildren) {
- setCollapsed(!collapsed);
- }
- };
+ const toggleCollapse = () => {
+ if (hasChildren) {
+ setCollapsed(!collapsed);
+ }
+ };
- return (
-
-
- {hasChildren && (
-
- {collapsed ? (
-
- ) : (
-
- )}
-
- )}
-
- {contentTree}
-
-
- {hasChildren && (
-
- {!collapsed && (
-
- {React.Children.map(children, (child) => {
- return React.isValidElement(child)
- ? React.cloneElement(child, { depth: depth + 1 })
- : child;
- })}
-
- )}
-
- )}
-
- );
+ return (
+
+
+ {hasChildren && (
+
+ {collapsed ? (
+
+ ) : (
+
+ )}
+
+ )}
+
+ {contentTree}
+
+
+ {hasChildren && (
+
+ {!collapsed && (
+
+ {React.Children.map(children, (child) => {
+ return React.isValidElement(child)
+ ? React.cloneElement(child, { depth: depth + 1 })
+ : child;
+ })}
+
+ )}
+
+ )}
+
+ );
};
diff --git a/packages/ui/cuicui/application-ui/tree/tree.category.tsx b/packages/ui/cuicui/application-ui/tree/tree.category.tsx
index e8fed281..dea9d8df 100644
--- a/packages/ui/cuicui/application-ui/tree/tree.category.tsx
+++ b/packages/ui/cuicui/application-ui/tree/tree.category.tsx
@@ -4,14 +4,14 @@ import { PreviewRecursiveTree } from "@/cuicui/application-ui/tree/recursive-tre
import { recursiveTreeComponent } from "@/cuicui/application-ui/tree/recursive-tree/recursive-tree.component";
export const treeCategory: CategoryType = {
- slug: "tree",
- name: "Tree",
- description: "Tree components",
- releaseDateCategory: new Date("2024-09-18"),
- icon: FolderTreeIcon,
- previewCategory: {
- component: ,
- previewScale: 1,
- },
- componentList: [recursiveTreeComponent],
+ slug: "tree",
+ name: "Tree",
+ description: "Tree components",
+ releaseDateCategory: new Date("2024-09-18"),
+ icon: FolderTreeIcon,
+ previewCategory: {
+ component: ,
+ previewScale: 1,
+ },
+ componentList: [recursiveTreeComponent],
};
diff --git a/packages/ui/cuicui/common-ui/avatars/avatars.category.tsx b/packages/ui/cuicui/common-ui/avatars/avatars.category.tsx
index 5e7dc912..6af081d0 100644
--- a/packages/ui/cuicui/common-ui/avatars/avatars.category.tsx
+++ b/packages/ui/cuicui/common-ui/avatars/avatars.category.tsx
@@ -2,11 +2,11 @@ import { CircleUserRoundIcon } from "lucide-react";
import type { CategoryType } from "@/lib/types/component";
export const avatarsCategory: CategoryType = {
- slug: "avatars",
- name: "Avatars",
- description: "Create simple avatars with different styles",
- comingSoonCategory: true,
- icon: CircleUserRoundIcon,
- releaseDateCategory: new Date(),
- componentList: null,
+ slug: "avatars",
+ name: "Avatars",
+ description: "Create simple avatars with different styles",
+ comingSoonCategory: true,
+ icon: CircleUserRoundIcon,
+ releaseDateCategory: new Date(),
+ componentList: null,
};
diff --git a/packages/ui/cuicui/common-ui/badges/advanced-badges/variant1.tsx b/packages/ui/cuicui/common-ui/badges/advanced-badges/variant1.tsx
index 5f810127..a9c274fe 100644
--- a/packages/ui/cuicui/common-ui/badges/advanced-badges/variant1.tsx
+++ b/packages/ui/cuicui/common-ui/badges/advanced-badges/variant1.tsx
@@ -5,110 +5,110 @@ import type { ReactNode } from "react";
import { cn } from "@/cuicui/utils/cn/cn";
export default function AdvancedBadgesVariant1() {
- const colors = Object.keys(badgeColorVariants) as ColorType[];
- return (
-
-
With icon & without border
-
- {colors.map((color) => (
-
-
- {color}
-
- ))}
-
-
With border & rounded full
-
- {colors.map((color) => (
-
- {color}
-
- ))}
-
-
- );
+ const colors = Object.keys(badgeColorVariants) as ColorType[];
+ return (
+
+
With icon & without border
+
+ {colors.map((color) => (
+
+
+ {color}
+
+ ))}
+
+
With border & rounded full
+
+ {colors.map((color) => (
+
+ {color}
+
+ ))}
+
+
+ );
}
type ColorType = keyof typeof badgeColorVariants;
const badgeColorVariants = {
- neutral:
- "text-neutral-600 bg-neutral-400/10 dark:text-neutral-200 border-neutral-500/20",
- green:
- "text-green-600 bg-green-400/10 dark:text-green-400 border-green-200/80",
- blue: "text-blue-600 bg-blue-400/10 dark:text-blue-400 border-blue-200/80",
- red: "text-red-600 bg-red-400/10 dark:text-red-400 border-red-200/80",
- orange:
- "text-orange-600 bg-orange-400/10 dark:text-orange-400 border-orange-200/80",
- yellow:
- "text-yellow-600 bg-yellow-400/10 dark:text-yellow-400 border-yellow-400/60",
- violet:
- "text-violet-600 bg-violet-400/10 dark:text-violet-400 border-violet-200/80",
- // Add other colors here
+ neutral:
+ "text-neutral-600 bg-neutral-400/10 dark:text-neutral-200 border-neutral-500/20",
+ green:
+ "text-green-600 bg-green-400/10 dark:text-green-400 border-green-200/80",
+ blue: "text-blue-600 bg-blue-400/10 dark:text-blue-400 border-blue-200/80",
+ red: "text-red-600 bg-red-400/10 dark:text-red-400 border-red-200/80",
+ orange:
+ "text-orange-600 bg-orange-400/10 dark:text-orange-400 border-orange-200/80",
+ yellow:
+ "text-yellow-600 bg-yellow-400/10 dark:text-yellow-400 border-yellow-400/60",
+ violet:
+ "text-violet-600 bg-violet-400/10 dark:text-violet-400 border-violet-200/80",
+ // Add other colors here
};
const badgeSizeVariants = {
- sm: "h-6 px-2",
- md: "h-7 px-3",
- lg: "h-8 px-4",
- icon: "size-10",
+ sm: "h-6 px-2",
+ md: "h-7 px-3",
+ lg: "h-8 px-4",
+ icon: "size-10",
};
const badgeRoundedVariants = {
- sm: "rounded-sm",
- md: "rounded-md",
- lg: "rounded-lg",
- full: "rounded-full",
+ sm: "rounded-sm",
+ md: "rounded-md",
+ lg: "rounded-lg",
+ full: "rounded-full",
};
const badgesVariants = cva(
- "inline-flex items-center justify-center whitespace-nowrap rounded-md transition-colors dark:bg-neutral-800 dark:border-neutral-700 gap-1",
- {
- variants: {
- color: badgeColorVariants,
- size: badgeSizeVariants,
- rounded: badgeRoundedVariants,
- border: {
- true: "border",
- false: "",
- },
- },
- defaultVariants: {
- color: "neutral",
- size: "md",
- rounded: "md",
- border: false,
- },
- },
+ "inline-flex items-center justify-center whitespace-nowrap rounded-md transition-colors dark:bg-neutral-800 dark:border-neutral-700 gap-1",
+ {
+ variants: {
+ color: badgeColorVariants,
+ size: badgeSizeVariants,
+ rounded: badgeRoundedVariants,
+ border: {
+ true: "border",
+ false: "",
+ },
+ },
+ defaultVariants: {
+ color: "neutral",
+ size: "md",
+ rounded: "md",
+ border: false,
+ },
+ },
);
function AdvancedColorfulBadges({
- color,
- size,
- rounded,
- border,
- children,
- className,
- ...props
+ color,
+ size,
+ rounded,
+ border,
+ children,
+ className,
+ ...props
}: Readonly<
- {
- className?: string;
- children: ReactNode;
- } & VariantProps
+ {
+ className?: string;
+ children: ReactNode;
+ } & VariantProps
>) {
- return (
-
- {children}
-
- );
+ return (
+
+ {children}
+
+ );
}
diff --git a/packages/ui/cuicui/common-ui/badges/badges.category.tsx b/packages/ui/cuicui/common-ui/badges/badges.category.tsx
index 27a62a9b..178eb3d1 100644
--- a/packages/ui/cuicui/common-ui/badges/badges.category.tsx
+++ b/packages/ui/cuicui/common-ui/badges/badges.category.tsx
@@ -6,64 +6,64 @@ import { BadgeSimpleVariantAmber } from "@/cuicui/common-ui/badges/modern-simple
import { BadgeSimpleVariantRed } from "@/cuicui/common-ui/badges/modern-simple-badges/variant2";
export const badgesCategory: CategoryType = {
- slug: "badges",
- name: "Badges",
- description: "Badges with various styles and purposes",
- releaseDateCategory: new Date("2024-06-29"),
- icon: TagIcon,
- previewCategory: {
- component: ,
- previewScale: 3,
- },
- componentList: [
- {
- sizePreview: "xs",
- slug: "modern-simple-badges",
- variantList: [
- {
- name: "Amber",
- component: ,
- slugPreviewFile: "variant1",
- },
- {
- name: "Red",
- component: ,
- slugPreviewFile: "variant2",
- },
- ],
- name: "Badge",
- description:
- "Simple modern badge that can be used in any project with any artistic style.",
- },
- {
- sizePreview: "xs",
- slug: "clerk-badge",
- variantList: [
- {
- name: "Default",
- component: ,
- slugPreviewFile: "variant1",
- },
- ],
- name: "Clerk Badge",
- description:
- "Simple modern badge that can be used in any project with any artistic style.",
- inspiration: "Clerk",
- inspirationLink: "https://clerk.com/docs",
- },
- {
- sizePreview: "xs",
- slug: "advanced-badges",
- variantList: [
- {
- name: "Default",
- component: ,
- slugPreviewFile: "variant1",
- },
- ],
- name: "Advanced Badges",
- description:
- "Advanced badges that can be used in any project with any artistic style.",
- },
- ],
+ slug: "badges",
+ name: "Badges",
+ description: "Badges with various styles and purposes",
+ releaseDateCategory: new Date("2024-06-29"),
+ icon: TagIcon,
+ previewCategory: {
+ component: ,
+ previewScale: 3,
+ },
+ componentList: [
+ {
+ sizePreview: "xs",
+ slug: "modern-simple-badges",
+ variantList: [
+ {
+ name: "Amber",
+ component: ,
+ slugPreviewFile: "variant1",
+ },
+ {
+ name: "Red",
+ component: ,
+ slugPreviewFile: "variant2",
+ },
+ ],
+ name: "Badge",
+ description:
+ "Simple modern badge that can be used in any project with any artistic style.",
+ },
+ {
+ sizePreview: "xs",
+ slug: "clerk-badge",
+ variantList: [
+ {
+ name: "Default",
+ component: ,
+ slugPreviewFile: "variant1",
+ },
+ ],
+ name: "Clerk Badge",
+ description:
+ "Simple modern badge that can be used in any project with any artistic style.",
+ inspiration: "Clerk",
+ inspirationLink: "https://clerk.com/docs",
+ },
+ {
+ sizePreview: "xs",
+ slug: "advanced-badges",
+ variantList: [
+ {
+ name: "Default",
+ component: ,
+ slugPreviewFile: "variant1",
+ },
+ ],
+ name: "Advanced Badges",
+ description:
+ "Advanced badges that can be used in any project with any artistic style.",
+ },
+ ],
};
diff --git a/packages/ui/cuicui/common-ui/blockquotes/blockquotes.category.tsx b/packages/ui/cuicui/common-ui/blockquotes/blockquotes.category.tsx
index 0aa7071c..8be70c55 100644
--- a/packages/ui/cuicui/common-ui/blockquotes/blockquotes.category.tsx
+++ b/packages/ui/cuicui/common-ui/blockquotes/blockquotes.category.tsx
@@ -3,28 +3,28 @@ import type { CategoryType } from "@/lib/types/component";
import ModernSimpleQuoteVariant1 from "@/cuicui/common-ui/blockquotes/modern-simple-quote/variant1";
export const blockquotesCategory: CategoryType = {
- slug: "blockquotes",
- name: "Blockquotes",
- description: "Blockquotes with different styles",
- releaseDateCategory: new Date("2024-08-01"),
- icon: QuoteIcon,
- previewCategory: {
- component: ,
- previewScale: 0.75,
- },
- componentList: [
- {
- slug: "modern-simple-quote",
- name: "Simple modern quote",
- description: "A simple modern quote with a border on the left side.",
- sizePreview: "sm",
- variantList: [
- {
- name: "On hover effect",
- component: ,
- slugPreviewFile: "variant1",
- },
- ],
- },
- ],
+ slug: "blockquotes",
+ name: "Blockquotes",
+ description: "Blockquotes with different styles",
+ releaseDateCategory: new Date("2024-08-01"),
+ icon: QuoteIcon,
+ previewCategory: {
+ component: ,
+ previewScale: 0.75,
+ },
+ componentList: [
+ {
+ slug: "modern-simple-quote",
+ name: "Simple modern quote",
+ description: "A simple modern quote with a border on the left side.",
+ sizePreview: "sm",
+ variantList: [
+ {
+ name: "On hover effect",
+ component: ,
+ slugPreviewFile: "variant1",
+ },
+ ],
+ },
+ ],
};
diff --git a/packages/ui/cuicui/common-ui/buttons/before-effect-button/before-effect-button.tsx b/packages/ui/cuicui/common-ui/buttons/before-effect-button/before-effect-button.tsx
index e3b7c153..8b6ba82d 100644
--- a/packages/ui/cuicui/common-ui/buttons/before-effect-button/before-effect-button.tsx
+++ b/packages/ui/cuicui/common-ui/buttons/before-effect-button/before-effect-button.tsx
@@ -2,34 +2,34 @@ import type { ButtonHTMLAttributes, ReactNode } from "react";
import { cn } from "@/cuicui/utils/cn/cn";
type BeforeEffectButtonProps = {
- children: ReactNode;
- className?: string;
- hoverOnly?: boolean;
+ children: ReactNode;
+ className?: string;
+ hoverOnly?: boolean;
} & ButtonHTMLAttributes;
export const BeforeEffectButton = ({
- children,
- className,
- hoverOnly = true,
- ...props
+ children,
+ className,
+ hoverOnly = true,
+ ...props
}: BeforeEffectButtonProps) => {
- return (
-
- {children}
-
- );
+ return (
+
+ {children}
+
+ );
};
diff --git a/packages/ui/cuicui/common-ui/buttons/before-effect-button/preview-advanced-button.tsx b/packages/ui/cuicui/common-ui/buttons/before-effect-button/preview-advanced-button.tsx
index 15a1e8fb..6450e4e4 100644
--- a/packages/ui/cuicui/common-ui/buttons/before-effect-button/preview-advanced-button.tsx
+++ b/packages/ui/cuicui/common-ui/buttons/before-effect-button/preview-advanced-button.tsx
@@ -2,20 +2,20 @@
import { BeforeEffectButton } from "@/cuicui/common-ui/buttons/before-effect-button/before-effect-button";
export default function PreviewBeforeEffectButtonAdvancedButton() {
- return (
-
-
-
- Damien Schneider
-
+ return (
+
+
+
+ Damien Schneider
+
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit.
-
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit.
+
-
- See more
-
-
- );
+
+ See more
+
+
+ );
}
diff --git a/packages/ui/cuicui/common-ui/buttons/before-effect-button/preview-default.tsx b/packages/ui/cuicui/common-ui/buttons/before-effect-button/preview-default.tsx
index f9a0bc00..134c64e6 100644
--- a/packages/ui/cuicui/common-ui/buttons/before-effect-button/preview-default.tsx
+++ b/packages/ui/cuicui/common-ui/buttons/before-effect-button/preview-default.tsx
@@ -2,5 +2,5 @@
import { BeforeEffectButton } from "@/cuicui/common-ui/buttons/before-effect-button/before-effect-button";
export default function PreviewBeforeEffectButtonDefault() {
- return Button ;
+ return Button ;
}
diff --git a/packages/ui/cuicui/common-ui/buttons/before-effect-button/preview-hover-only.tsx b/packages/ui/cuicui/common-ui/buttons/before-effect-button/preview-hover-only.tsx
index ff9d5c25..16fc27e3 100644
--- a/packages/ui/cuicui/common-ui/buttons/before-effect-button/preview-hover-only.tsx
+++ b/packages/ui/cuicui/common-ui/buttons/before-effect-button/preview-hover-only.tsx
@@ -2,5 +2,5 @@
import { BeforeEffectButton } from "@/cuicui/common-ui/buttons/before-effect-button/before-effect-button";
export default function PreviewBeforeEffectButtonHoverOnly() {
- return Button ;
+ return Button ;
}
diff --git a/packages/ui/cuicui/common-ui/buttons/buttons.category.tsx b/packages/ui/cuicui/common-ui/buttons/buttons.category.tsx
index beb88d4f..e7800eec 100644
--- a/packages/ui/cuicui/common-ui/buttons/buttons.category.tsx
+++ b/packages/ui/cuicui/common-ui/buttons/buttons.category.tsx
@@ -13,130 +13,130 @@ import PreviewGithubStars from "@/cuicui/common-ui/buttons/github-stars/preview.
import PreviewGradientContainer from "@/cuicui/common-ui/buttons/github-stars/preview.gradient-container";
export const buttonsCategory: CategoryType = {
- slug: "buttons",
- name: "Buttons",
- description: "Buttons with various animations and styles",
- releaseDateCategory: new Date("2024-08-09"),
- icon: SquareArrowRightIcon,
- previewCategory: {
- component: ,
- previewScale: 1.5,
- },
- componentList: [
- {
- slug: "magnetic-button",
- name: "Magnetic Button",
- description: "Button with a magnetic effect.",
- sizePreview: "sm",
- variantList: [
- {
- name: "Magnetic Background",
- component: ,
- slugPreviewFile: "preview.magnetic-background-button",
- slugComponentFile: "component.magnetic-background-button",
- },
- {
- name: "Magnetic Button",
- component: ,
- slugPreviewFile: "preview.magnetic-button",
- slugComponentFile: "component.magnetic-button",
- },
- ],
- },
- {
- slug: "github-stars",
- name: "Github Stars Button",
- description:
- "Button with to show the number of stars of a GitHub repository.",
- sizePreview: "sm",
- variantList: [
- {
- name: "Cuicui colors",
- component: ,
- slugPreviewFile: "preview.github-stars",
- slugComponentFile: "component.github-stars",
- },
- {
- name: "Container only",
- component: ,
- slugPreviewFile: "preview.github-stars",
- slugComponentFile: "component.github-stars",
- },
- ],
- inspiration: "Refine",
- inspirationLink: "https://refine.dev/",
- },
- {
- slug: "growing-button",
- name: "Button",
- description:
- "Simple button with icon which grows on hover. Perfect for small, rarely used buttons replacing an old tooltip.",
- sizePreview: "xs",
- variantList: [
- {
- name: "Amber",
- component: ,
- slugPreviewFile: "variant1",
- },
- ],
- },
- {
- slug: "before-effect-button",
- name: "Dynamic button hover effect",
- description: "Button with a hover effect that has a 'before' effect.",
- sizePreview: "xs",
- isIframed: true,
- variantList: [
- {
- name: "Hover only",
- component: ,
- slugPreviewFile: "preview-hover-only",
- slugComponentFile: "before-effect-button",
- },
- {
- name: "Simple",
- component: ,
- slugPreviewFile: "preview-default",
- slugComponentFile: "before-effect-button",
- },
- {
- name: "Advanced button",
- component: ,
- slugPreviewFile: "preview-advanced-button",
- slugComponentFile: "before-effect-button",
- },
- ],
- },
- {
- slug: "shiny-rotating-border-button",
- name: "Shiny rotating border button",
- description: "Button with a shiny rotating border effect.",
- sizePreview: "xs",
- variantList: [
- {
- name: "Default",
- component: ,
- slugPreviewFile: "preview.shiny-rotating-border-button",
- slugComponentFile: "component.shiny-rotating-border-button",
- },
- ],
- isIframed: true,
- },
- {
- slug: "modern-animated-button",
- name: "Modern Animated Button",
- description: "Button with a modern animated style.",
- sizePreview: "xs",
- variantList: [
- {
- name: "Shiny rotating border button",
- component: ,
- slugPreviewFile: "variant1",
- },
- ],
+ slug: "buttons",
+ name: "Buttons",
+ description: "Buttons with various animations and styles",
+ releaseDateCategory: new Date("2024-08-09"),
+ icon: SquareArrowRightIcon,
+ previewCategory: {
+ component: ,
+ previewScale: 1.5,
+ },
+ componentList: [
+ {
+ slug: "magnetic-button",
+ name: "Magnetic Button",
+ description: "Button with a magnetic effect.",
+ sizePreview: "sm",
+ variantList: [
+ {
+ name: "Magnetic Background",
+ component: ,
+ slugPreviewFile: "preview.magnetic-background-button",
+ slugComponentFile: "component.magnetic-background-button",
+ },
+ {
+ name: "Magnetic Button",
+ component: ,
+ slugPreviewFile: "preview.magnetic-button",
+ slugComponentFile: "component.magnetic-button",
+ },
+ ],
+ },
+ {
+ slug: "github-stars",
+ name: "Github Stars Button",
+ description:
+ "Button with to show the number of stars of a GitHub repository.",
+ sizePreview: "sm",
+ variantList: [
+ {
+ name: "Cuicui colors",
+ component: ,
+ slugPreviewFile: "preview.github-stars",
+ slugComponentFile: "component.github-stars",
+ },
+ {
+ name: "Container only",
+ component: ,
+ slugPreviewFile: "preview.github-stars",
+ slugComponentFile: "component.github-stars",
+ },
+ ],
+ inspiration: "Refine",
+ inspirationLink: "https://refine.dev/",
+ },
+ {
+ slug: "growing-button",
+ name: "Button",
+ description:
+ "Simple button with icon which grows on hover. Perfect for small, rarely used buttons replacing an old tooltip.",
+ sizePreview: "xs",
+ variantList: [
+ {
+ name: "Amber",
+ component: ,
+ slugPreviewFile: "variant1",
+ },
+ ],
+ },
+ {
+ slug: "before-effect-button",
+ name: "Dynamic button hover effect",
+ description: "Button with a hover effect that has a 'before' effect.",
+ sizePreview: "xs",
+ isIframed: true,
+ variantList: [
+ {
+ name: "Hover only",
+ component: ,
+ slugPreviewFile: "preview-hover-only",
+ slugComponentFile: "before-effect-button",
+ },
+ {
+ name: "Simple",
+ component: ,
+ slugPreviewFile: "preview-default",
+ slugComponentFile: "before-effect-button",
+ },
+ {
+ name: "Advanced button",
+ component: ,
+ slugPreviewFile: "preview-advanced-button",
+ slugComponentFile: "before-effect-button",
+ },
+ ],
+ },
+ {
+ slug: "shiny-rotating-border-button",
+ name: "Shiny rotating border button",
+ description: "Button with a shiny rotating border effect.",
+ sizePreview: "xs",
+ variantList: [
+ {
+ name: "Default",
+ component: ,
+ slugPreviewFile: "preview.shiny-rotating-border-button",
+ slugComponentFile: "component.shiny-rotating-border-button",
+ },
+ ],
+ isIframed: true,
+ },
+ {
+ slug: "modern-animated-button",
+ name: "Modern Animated Button",
+ description: "Button with a modern animated style.",
+ sizePreview: "xs",
+ variantList: [
+ {
+ name: "Shiny rotating border button",
+ component: ,
+ slugPreviewFile: "variant1",
+ },
+ ],
- inspiration: "Raycast",
- inspirationLink: "https://www.raycast.com/",
- },
- ],
+ inspiration: "Raycast",
+ inspirationLink: "https://www.raycast.com/",
+ },
+ ],
};
diff --git a/packages/ui/cuicui/common-ui/buttons/github-stars/component.github-stars.tsx b/packages/ui/cuicui/common-ui/buttons/github-stars/component.github-stars.tsx
index ea899c86..81c224bf 100644
--- a/packages/ui/cuicui/common-ui/buttons/github-stars/component.github-stars.tsx
+++ b/packages/ui/cuicui/common-ui/buttons/github-stars/component.github-stars.tsx
@@ -4,139 +4,139 @@ import Link from "next/link";
import { cn } from "@/cuicui/utils/cn/cn";
import type { ComponentProps } from "react";
export const GithubStarsButton = ({
- starNumber,
- href,
- children,
- className,
- ...props
+ starNumber,
+ href,
+ children,
+ className,
+ ...props
}: Readonly<{
- starNumber: number;
- children?: string;
- href: string;
- className?: string;
+ starNumber: number;
+ children?: string;
+ href: string;
+ className?: string;
}> &
- ComponentProps<"a">) => {
- return (
-
-
-
-
-
-
-
-
-
+ ComponentProps<"a">) => {
+ return (
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
- {children && (
-
- {children}
-
- )}
-
-
- );
+
+
+
+
+
+
+ {children && (
+
+ {children}
+
+ )}
+
+
+ );
};
const CuicuiStarIcon = ({ ...props }: React.SVGProps) => {
- return (
-
- Star Icon
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
+ return (
+
+ Star Icon
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
};
diff --git a/packages/ui/cuicui/common-ui/buttons/github-stars/github-stars.css b/packages/ui/cuicui/common-ui/buttons/github-stars/github-stars.css
index c5f2bfdf..0a524b82 100644
--- a/packages/ui/cuicui/common-ui/buttons/github-stars/github-stars.css
+++ b/packages/ui/cuicui/common-ui/buttons/github-stars/github-stars.css
@@ -32,15 +32,15 @@
@keyframes star-shine {
0% {
/* opacity: 0.3; */
- transform: scale(.4);
+ transform: scale(0.4);
}
50% {
/* opacity: 0.6; */
- transform: scale(.9);
+ transform: scale(0.9);
}
100% {
/* opacity: 0.3; */
- transform: scale(.5);
+ transform: scale(0.5);
}
}
@@ -57,4 +57,4 @@
100% {
transform: rotate(0deg);
}
-}
\ No newline at end of file
+}
diff --git a/packages/ui/cuicui/common-ui/buttons/github-stars/preview.github-stars.tsx b/packages/ui/cuicui/common-ui/buttons/github-stars/preview.github-stars.tsx
index 580ccca0..2c13e15f 100644
--- a/packages/ui/cuicui/common-ui/buttons/github-stars/preview.github-stars.tsx
+++ b/packages/ui/cuicui/common-ui/buttons/github-stars/preview.github-stars.tsx
@@ -5,20 +5,20 @@ import { sleep } from "@/cuicui/utils/sleep/sleep";
import { useEffect, useState } from "react";
export default function PreviewGithubStars() {
- const [stars, setStars] = useState(0);
+ const [stars, setStars] = useState(0);
- useEffect(() => {
- sleep(1000).then(() => {
- setStars(1024);
- });
- }, []);
+ useEffect(() => {
+ sleep(1000).then(() => {
+ setStars(1024);
+ });
+ }, []);
- return (
-
- Star Cuicui on GitHub
-
- );
+ return (
+
+ Star Cuicui on GitHub
+
+ );
}
diff --git a/packages/ui/cuicui/common-ui/buttons/github-stars/preview.gradient-container.tsx b/packages/ui/cuicui/common-ui/buttons/github-stars/preview.gradient-container.tsx
index c75aed29..e35a4081 100644
--- a/packages/ui/cuicui/common-ui/buttons/github-stars/preview.gradient-container.tsx
+++ b/packages/ui/cuicui/common-ui/buttons/github-stars/preview.gradient-container.tsx
@@ -1,14 +1,14 @@
import {
- ModernGradientContainerContent,
- ModernGradientContainerRoot,
+ ModernGradientContainerContent,
+ ModernGradientContainerRoot,
} from "@/cuicui/common-ui/buttons/github-stars/simple-container";
export default function PreviewGradientContainer() {
- return (
-
-
- preview.gradient-container
-
-
- );
+ return (
+
+
+ preview.gradient-container
+
+
+ );
}
diff --git a/packages/ui/cuicui/common-ui/buttons/github-stars/simple-container.tsx b/packages/ui/cuicui/common-ui/buttons/github-stars/simple-container.tsx
index faf2bed8..158668da 100644
--- a/packages/ui/cuicui/common-ui/buttons/github-stars/simple-container.tsx
+++ b/packages/ui/cuicui/common-ui/buttons/github-stars/simple-container.tsx
@@ -2,84 +2,84 @@ import { cn } from "@/cuicui/utils/cn/cn";
import type { ComponentProps, HTMLProps, ReactNode } from "react";
export function ModernGradientContainerRoot({
- children,
- className,
- animationDurationInSeconds = 10,
- ...props
+ children,
+ className,
+ animationDurationInSeconds = 10,
+ ...props
}: {
- children?: ReactNode;
- animationDurationInSeconds?: number;
+ children?: ReactNode;
+ animationDurationInSeconds?: number;
} & ComponentProps<"div">) {
- return (
-
-
-
-
-
-
-
-
-
+ return (
+
+
+
+
+
+
+
+
+
- {children}
-
- );
+ {children}
+
+ );
}
export function ModernGradientContainerContent({
- children,
- ...props
+ children,
+ ...props
}: ComponentProps<"span">) {
- return (
-
- {children}
-
- );
+ return (
+
+ {children}
+
+ );
}
diff --git a/packages/ui/cuicui/common-ui/buttons/growing-button/variant1.tsx b/packages/ui/cuicui/common-ui/buttons/growing-button/variant1.tsx
index 5117f728..82d77681 100644
--- a/packages/ui/cuicui/common-ui/buttons/growing-button/variant1.tsx
+++ b/packages/ui/cuicui/common-ui/buttons/growing-button/variant1.tsx
@@ -1,18 +1,18 @@
import { ChevronDown, SparklesIcon } from "lucide-react";
export default function GrowingButtonVariant1() {
- return (
-
-
-
-
- Feature list
-
-
-
-
- );
+ return (
+
+
+
+
+ Feature list
+
+
+
+
+ );
}
diff --git a/packages/ui/cuicui/common-ui/buttons/magnetic-button/component.magnetic-background-button.tsx b/packages/ui/cuicui/common-ui/buttons/magnetic-button/component.magnetic-background-button.tsx
index 3ec10cbe..c3f2bed5 100644
--- a/packages/ui/cuicui/common-ui/buttons/magnetic-button/component.magnetic-background-button.tsx
+++ b/packages/ui/cuicui/common-ui/buttons/magnetic-button/component.magnetic-background-button.tsx
@@ -4,128 +4,128 @@ import { cn } from "@/cuicui/utils/cn/cn";
import { useState, useRef, type ReactNode, type MouseEvent } from "react";
type PositionType = {
- x: number;
- y: number;
+ x: number;
+ y: number;
};
export function MagneticBackgroundButton({
- children = "Magnetic Button",
- magneticStrength = 0.5,
- className,
- exitForce = 20,
- ...props
+ children = "Magnetic Button",
+ magneticStrength = 0.5,
+ className,
+ exitForce = 20,
+ ...props
}: {
- children?: ReactNode;
- magneticStrength?: number;
- className?: string;
- exitForce?: number;
+ children?: ReactNode;
+ magneticStrength?: number;
+ className?: string;
+ exitForce?: number;
} & React.HTMLAttributes) {
- const [position, setPosition] = useState({ x: 0, y: 0 });
- const [lastMousePosition, setLastMousePosition] = useState<{
- x: number;
- y: number;
- } | null>(null);
- const buttonRef = useRef(null);
-
- const [isHovered, setIsHovered] = useState(false);
-
- const handleMouseMove = (e: MouseEvent) => {
- if (!buttonRef.current) {
- return;
- }
- const rect = buttonRef.current.getBoundingClientRect();
- const centerX = rect.left + rect.width / 2;
- const centerY = rect.top + rect.height / 2;
- const distanceX = e.clientX - centerX;
- const distanceY = e.clientY - centerY;
- const distance = Math.sqrt(distanceX ** 2 + distanceY ** 2);
- const maxDistance = Math.max(rect.width, rect.height);
-
- // Normalize the direction vector
- const unitX = distanceX / distance;
- const unitY = distanceY / distance;
-
- // Clamp the distance to maxDistance
- const clampedDistance = Math.min(distance, maxDistance);
-
- // Calculate the magnetic effect
- const magneticMagnitude =
- (clampedDistance / maxDistance) * magneticStrength * (rect.width / 4);
-
- const magneticX = unitX * magneticMagnitude;
- const magneticY = unitY * magneticMagnitude;
-
- setPosition({ x: magneticX, y: magneticY });
- setLastMousePosition({ x: e.clientX, y: e.clientY });
- };
-
- function getFarAwayLastPosition() {
- if (!buttonRef.current || !lastMousePosition) {
- return { x: 0, y: 0 };
- }
- const rect = buttonRef.current.getBoundingClientRect();
- const centerX = rect.left + rect.width / 2;
- const centerY = rect.top + rect.height / 2;
-
- // Calculate direction from the cursor to the button center
- const distanceX = centerX - lastMousePosition.x;
- const distanceY = centerY - lastMousePosition.y;
-
- const distance = Math.sqrt(distanceX ** 2 + distanceY ** 2);
-
- if (distance === 0) {
- return { x: 0, y: 0 };
- }
-
- // Normalize the direction vector
- const unitX = distanceX / distance;
- const unitY = distanceY / distance;
-
- // Calculate the new position
- const farAwayX = unitX * exitForce;
- const farAwayY = unitY * exitForce;
-
- return { x: -farAwayX, y: -farAwayY };
- }
-
- function getTransformedValue() {
- return `translate3D(${position.x}px, ${position.y}px, 0)`;
- }
-
- return (
- {
- setIsHovered(true);
- const farAwayPosition = getFarAwayLastPosition();
- setPosition(farAwayPosition);
- }}
- onMouseLeave={() => {
- setIsHovered(false);
- const farAwayPosition = getFarAwayLastPosition();
- setPosition(farAwayPosition);
- }}
- ref={buttonRef}
- className={cn(
- "relative inline-flex items-center justify-center rounded-lg z-10 tracking-tight dark:text-neutral-200 text-neutral-600 font-medium px-3 py-2",
- className,
- )}
- {...props}
- >
-
- {children}
-
- );
+ const [position, setPosition] = useState({ x: 0, y: 0 });
+ const [lastMousePosition, setLastMousePosition] = useState<{
+ x: number;
+ y: number;
+ } | null>(null);
+ const buttonRef = useRef(null);
+
+ const [isHovered, setIsHovered] = useState(false);
+
+ const handleMouseMove = (e: MouseEvent) => {
+ if (!buttonRef.current) {
+ return;
+ }
+ const rect = buttonRef.current.getBoundingClientRect();
+ const centerX = rect.left + rect.width / 2;
+ const centerY = rect.top + rect.height / 2;
+ const distanceX = e.clientX - centerX;
+ const distanceY = e.clientY - centerY;
+ const distance = Math.sqrt(distanceX ** 2 + distanceY ** 2);
+ const maxDistance = Math.max(rect.width, rect.height);
+
+ // Normalize the direction vector
+ const unitX = distanceX / distance;
+ const unitY = distanceY / distance;
+
+ // Clamp the distance to maxDistance
+ const clampedDistance = Math.min(distance, maxDistance);
+
+ // Calculate the magnetic effect
+ const magneticMagnitude =
+ (clampedDistance / maxDistance) * magneticStrength * (rect.width / 4);
+
+ const magneticX = unitX * magneticMagnitude;
+ const magneticY = unitY * magneticMagnitude;
+
+ setPosition({ x: magneticX, y: magneticY });
+ setLastMousePosition({ x: e.clientX, y: e.clientY });
+ };
+
+ function getFarAwayLastPosition() {
+ if (!buttonRef.current || !lastMousePosition) {
+ return { x: 0, y: 0 };
+ }
+ const rect = buttonRef.current.getBoundingClientRect();
+ const centerX = rect.left + rect.width / 2;
+ const centerY = rect.top + rect.height / 2;
+
+ // Calculate direction from the cursor to the button center
+ const distanceX = centerX - lastMousePosition.x;
+ const distanceY = centerY - lastMousePosition.y;
+
+ const distance = Math.sqrt(distanceX ** 2 + distanceY ** 2);
+
+ if (distance === 0) {
+ return { x: 0, y: 0 };
+ }
+
+ // Normalize the direction vector
+ const unitX = distanceX / distance;
+ const unitY = distanceY / distance;
+
+ // Calculate the new position
+ const farAwayX = unitX * exitForce;
+ const farAwayY = unitY * exitForce;
+
+ return { x: -farAwayX, y: -farAwayY };
+ }
+
+ function getTransformedValue() {
+ return `translate3D(${position.x}px, ${position.y}px, 0)`;
+ }
+
+ return (
+ {
+ setIsHovered(true);
+ const farAwayPosition = getFarAwayLastPosition();
+ setPosition(farAwayPosition);
+ }}
+ onMouseLeave={() => {
+ setIsHovered(false);
+ const farAwayPosition = getFarAwayLastPosition();
+ setPosition(farAwayPosition);
+ }}
+ ref={buttonRef}
+ className={cn(
+ "relative inline-flex items-center justify-center rounded-lg z-10 tracking-tight dark:text-neutral-200 text-neutral-600 font-medium px-3 py-2",
+ className,
+ )}
+ {...props}
+ >
+
+ {children}
+
+ );
}
diff --git a/packages/ui/cuicui/common-ui/buttons/magnetic-button/component.magnetic-button.tsx b/packages/ui/cuicui/common-ui/buttons/magnetic-button/component.magnetic-button.tsx
index 4cb6e266..e8922ee0 100644
--- a/packages/ui/cuicui/common-ui/buttons/magnetic-button/component.magnetic-button.tsx
+++ b/packages/ui/cuicui/common-ui/buttons/magnetic-button/component.magnetic-button.tsx
@@ -6,55 +6,55 @@ const SPRING_CONFIG = { damping: 30, stiffness: 400 };
const MAX_DISTANCE = 0.3;
export const MagneticButton = ({
- children,
- ...props
+ children,
+ ...props
}: {
- children: React.ReactNode;
+ children: React.ReactNode;
} & { height?: string }) => {
- const [isHovered, setIsHovered] = useState(false);
- const x = useMotionValue(0);
- const y = useMotionValue(0);
- const ref = useRef(null);
- const springX = useSpring(x, SPRING_CONFIG);
- const springY = useSpring(y, SPRING_CONFIG);
+ const [isHovered, setIsHovered] = useState(false);
+ const x = useMotionValue(0);
+ const y = useMotionValue(0);
+ const ref = useRef(null);
+ const springX = useSpring(x, SPRING_CONFIG);
+ const springY = useSpring(y, SPRING_CONFIG);
- const calculateDistance = (e: MouseEvent) => {
- if (ref.current) {
- const rect = ref.current.getBoundingClientRect();
- const centerX = rect.left + rect.width / 2;
- const centerY = rect.top + rect.height / 2;
- const distanceX = e.clientX - centerX;
- const distanceY = e.clientY - centerY;
+ const calculateDistance = (e: MouseEvent) => {
+ if (ref.current) {
+ const rect = ref.current.getBoundingClientRect();
+ const centerX = rect.left + rect.width / 2;
+ const centerY = rect.top + rect.height / 2;
+ const distanceX = e.clientX - centerX;
+ const distanceY = e.clientY - centerY;
- if (isHovered) {
- x.set(distanceX * MAX_DISTANCE);
- y.set(distanceY * MAX_DISTANCE);
- } else {
- x.set(0);
- y.set(0);
- }
- }
- };
+ if (isHovered) {
+ x.set(distanceX * MAX_DISTANCE);
+ y.set(distanceY * MAX_DISTANCE);
+ } else {
+ x.set(0);
+ y.set(0);
+ }
+ }
+ };
- return (
- {
- calculateDistance(e);
- }}
- onMouseEnter={() => setIsHovered(true)}
- onMouseLeave={() => {
- setIsHovered(false);
- x.set(0);
- y.set(0);
- }}
- style={{
- x: springX,
- y: springY,
- height: props.height || "auto",
- }}
- >
- {children}
-
- );
+ return (
+ {
+ calculateDistance(e);
+ }}
+ onMouseEnter={() => setIsHovered(true)}
+ onMouseLeave={() => {
+ setIsHovered(false);
+ x.set(0);
+ y.set(0);
+ }}
+ style={{
+ x: springX,
+ y: springY,
+ height: props.height || "auto",
+ }}
+ >
+ {children}
+
+ );
};
diff --git a/packages/ui/cuicui/common-ui/buttons/magnetic-button/preview.magnetic-background-button.tsx b/packages/ui/cuicui/common-ui/buttons/magnetic-button/preview.magnetic-background-button.tsx
index 6d10742f..ce8e71b7 100644
--- a/packages/ui/cuicui/common-ui/buttons/magnetic-button/preview.magnetic-background-button.tsx
+++ b/packages/ui/cuicui/common-ui/buttons/magnetic-button/preview.magnetic-background-button.tsx
@@ -2,24 +2,24 @@ import { MagneticBackgroundButton } from "@/cuicui/common-ui/buttons/magnetic-bu
import { BedDoubleIcon, PopcornIcon, TvIcon, WavesIcon } from "lucide-react";
export function PreviewMagneticBackgroundButton() {
- return (
-
-
-
- Rest
-
-
-
- Watch TV
-
-
-
- Eat popcorn
-
-
-
- Go swimming
-
-
- );
+ return (
+
+
+
+ Rest
+
+
+
+ Watch TV
+
+
+
+ Eat popcorn
+
+
+
+ Go swimming
+
+
+ );
}
diff --git a/packages/ui/cuicui/common-ui/buttons/magnetic-button/preview.magnetic-button.tsx b/packages/ui/cuicui/common-ui/buttons/magnetic-button/preview.magnetic-button.tsx
index 901d1d57..acf419a1 100644
--- a/packages/ui/cuicui/common-ui/buttons/magnetic-button/preview.magnetic-button.tsx
+++ b/packages/ui/cuicui/common-ui/buttons/magnetic-button/preview.magnetic-button.tsx
@@ -1,14 +1,14 @@
import { MagneticButton } from "@/cuicui/common-ui/buttons/magnetic-button/component.magnetic-button";
export function PreviewMagneticButton() {
- return (
-
-
- Click me
-
-
- );
+ return (
+
+
+ Click me
+
+
+ );
}
diff --git a/packages/ui/cuicui/common-ui/buttons/shiny-rotating-border-button/component.shiny-rotating-border-button.tsx b/packages/ui/cuicui/common-ui/buttons/shiny-rotating-border-button/component.shiny-rotating-border-button.tsx
index 905368a9..5c1f4d52 100644
--- a/packages/ui/cuicui/common-ui/buttons/shiny-rotating-border-button/component.shiny-rotating-border-button.tsx
+++ b/packages/ui/cuicui/common-ui/buttons/shiny-rotating-border-button/component.shiny-rotating-border-button.tsx
@@ -4,70 +4,70 @@ import { motion } from "framer-motion";
import type { HTMLAttributes, ReactNode } from "react";
export const ShinyRotatingBorderButton = ({
- children,
- className,
- ...props
+ children,
+ className,
+ ...props
}: Readonly<{ children: ReactNode; className?: string }> &
- HTMLAttributes) => {
- return (
-
-
-
-
-
-
- {children}
-
-
-
- );
+ HTMLAttributes) => {
+ return (
+
+
+
+
+
+
+ {children}
+
+
+
+ );
};
diff --git a/packages/ui/cuicui/common-ui/buttons/shiny-rotating-border-button/preview.shiny-rotating-border-button.tsx b/packages/ui/cuicui/common-ui/buttons/shiny-rotating-border-button/preview.shiny-rotating-border-button.tsx
index 14cae089..4f10dd7a 100644
--- a/packages/ui/cuicui/common-ui/buttons/shiny-rotating-border-button/preview.shiny-rotating-border-button.tsx
+++ b/packages/ui/cuicui/common-ui/buttons/shiny-rotating-border-button/preview.shiny-rotating-border-button.tsx
@@ -1,5 +1,5 @@
import { ShinyRotatingBorderButton } from "@/cuicui/common-ui/buttons/shiny-rotating-border-button/component.shiny-rotating-border-button";
export const PreviewShinyRotatingBorderButton = () => {
- return Click ;
+ return Click ;
};
diff --git a/packages/ui/cuicui/common-ui/cards/cards.category.tsx b/packages/ui/cuicui/common-ui/cards/cards.category.tsx
index 8d628135..68728d7f 100644
--- a/packages/ui/cuicui/common-ui/cards/cards.category.tsx
+++ b/packages/ui/cuicui/common-ui/cards/cards.category.tsx
@@ -6,81 +6,81 @@ import { ModernInnerShadowCardVariant1 } from "@/cuicui/common-ui/cards/modern-i
import NotificationCardPreview from "@/cuicui/common-ui/cards/notification-card/notification-card-preview";
export const cardsCategory: CategoryType = {
- slug: "cards",
- name: "Cards",
- description: "Cards with various layouts and effects",
- releaseDateCategory: new Date("2024-08-10"),
- icon: CreditCardIcon,
- previewCategory: {
- component: ,
- previewScale: 0.5,
- },
- componentList: [
- {
- slug: "modern-inner-shadow",
- name: "Modern inner shadow card",
- description:
- "A card that showcases a set of tools that you use to create your product.",
- sizePreview: "sm",
- variantList: [
- {
- name: "Variant 1",
- component: ,
- slugPreviewFile: "variant1",
- },
- ],
+ slug: "cards",
+ name: "Cards",
+ description: "Cards with various layouts and effects",
+ releaseDateCategory: new Date("2024-08-10"),
+ icon: CreditCardIcon,
+ previewCategory: {
+ component: ,
+ previewScale: 0.5,
+ },
+ componentList: [
+ {
+ slug: "modern-inner-shadow",
+ name: "Modern inner shadow card",
+ description:
+ "A card that showcases a set of tools that you use to create your product.",
+ sizePreview: "sm",
+ variantList: [
+ {
+ name: "Variant 1",
+ component: ,
+ slugPreviewFile: "variant1",
+ },
+ ],
- componentBadges: ["better-in-dark-mode"],
- },
- {
- slug: "dynamic-square-background",
- name: "Dynamic Square Background",
- description:
- "A card to announce any new feature or product with a modern dynamic square background.",
- sizePreview: "sm",
- variantList: [
- {
- name: "Variant 1",
- component: ,
- slugPreviewFile: "dynamic-square-background-preview",
- slugComponentFile: "dynamic-square-background",
- },
- ],
- },
- {
- slug: "notification-card",
- name: "Notification Card",
- description:
- "A notification card with a date and time to show the user when the notification was sent.",
+ componentBadges: ["better-in-dark-mode"],
+ },
+ {
+ slug: "dynamic-square-background",
+ name: "Dynamic Square Background",
+ description:
+ "A card to announce any new feature or product with a modern dynamic square background.",
+ sizePreview: "sm",
+ variantList: [
+ {
+ name: "Variant 1",
+ component: ,
+ slugPreviewFile: "dynamic-square-background-preview",
+ slugComponentFile: "dynamic-square-background",
+ },
+ ],
+ },
+ {
+ slug: "notification-card",
+ name: "Notification Card",
+ description:
+ "A notification card with a date and time to show the user when the notification was sent.",
- sizePreview: "sm",
- variantList: [
- {
- name: "Variant 1",
- component: ,
- slugPreviewFile: "notification-card-preview",
- slugComponentFile: "notification-card",
- },
- ],
- },
- {
- sizePreview: "sm",
- slug: "hover-effect-card",
+ sizePreview: "sm",
+ variantList: [
+ {
+ name: "Variant 1",
+ component: ,
+ slugPreviewFile: "notification-card-preview",
+ slugComponentFile: "notification-card",
+ },
+ ],
+ },
+ {
+ sizePreview: "sm",
+ slug: "hover-effect-card",
- variantList: [
- {
- name: "Variant 1",
- component: ,
- slugPreviewFile: "hover-effect-card-preview",
- slugComponentFile: "hover-effect-card",
- },
- ],
- name: "Hover Effect Card",
- description:
- "A card with a hover effect that rotates on hover. Only CSS.",
- isIframed: true,
+ variantList: [
+ {
+ name: "Variant 1",
+ component: ,
+ slugPreviewFile: "hover-effect-card-preview",
+ slugComponentFile: "hover-effect-card",
+ },
+ ],
+ name: "Hover Effect Card",
+ description:
+ "A card with a hover effect that rotates on hover. Only CSS.",
+ isIframed: true,
- componentBadges: ["no-js"],
- },
- ],
+ componentBadges: ["no-js"],
+ },
+ ],
};
diff --git a/packages/ui/cuicui/common-ui/cards/dynamic-square-background/dynamic-square-background-preview.tsx b/packages/ui/cuicui/common-ui/cards/dynamic-square-background/dynamic-square-background-preview.tsx
index e9b82725..ec650498 100644
--- a/packages/ui/cuicui/common-ui/cards/dynamic-square-background/dynamic-square-background-preview.tsx
+++ b/packages/ui/cuicui/common-ui/cards/dynamic-square-background/dynamic-square-background-preview.tsx
@@ -1,13 +1,13 @@
import DynamicSquareBackground from "@/cuicui/common-ui/cards/dynamic-square-background/dynamic-square-background";
export default function DynamicSquareBackgroundPreview() {
- return (
-
- );
+ return (
+
+ );
}
diff --git a/packages/ui/cuicui/common-ui/cards/hover-effect-card/hover-effect-card-preview.tsx b/packages/ui/cuicui/common-ui/cards/hover-effect-card/hover-effect-card-preview.tsx
index a8f63fa1..9343bf69 100644
--- a/packages/ui/cuicui/common-ui/cards/hover-effect-card/hover-effect-card-preview.tsx
+++ b/packages/ui/cuicui/common-ui/cards/hover-effect-card/hover-effect-card-preview.tsx
@@ -1,25 +1,25 @@
import HoverCard from "@/cuicui/common-ui/cards/hover-effect-card/hover-effect-card";
export default function HoverEffectCardPreview() {
- return (
-
-
-
- Hover this card
-
-
- Stop using JS
-
- when it is not needed
-
-
-
- );
+ return (
+
+
+
+ Hover this card
+
+
+ Stop using JS
+
+ when it is not needed
+
+
+
+ );
}
diff --git a/packages/ui/cuicui/common-ui/cards/hover-effect-card/hover-effect-card.tsx b/packages/ui/cuicui/common-ui/cards/hover-effect-card/hover-effect-card.tsx
index 7285824f..3a7fb59c 100644
--- a/packages/ui/cuicui/common-ui/cards/hover-effect-card/hover-effect-card.tsx
+++ b/packages/ui/cuicui/common-ui/cards/hover-effect-card/hover-effect-card.tsx
@@ -2,89 +2,89 @@ import type { ReactNode } from "react";
import { cn } from "@/cuicui/utils/cn/cn";
const HoverCard = ({
- columns = 5,
- rows = 5,
- maxXrotation = 10,
- maxYrotation = 10,
- children,
- className,
- containerClassName,
+ columns = 5,
+ rows = 5,
+ maxXrotation = 10,
+ maxYrotation = 10,
+ children,
+ className,
+ containerClassName,
}: {
- columns?: number;
- rows?: number;
- maxXrotation?: number;
- maxYrotation?: number;
- children?: ReactNode;
- className?: string;
- containerClassName?: string;
+ columns?: number;
+ rows?: number;
+ maxXrotation?: number;
+ maxYrotation?: number;
+ children?: ReactNode;
+ className?: string;
+ containerClassName?: string;
}) => {
- const generateTrackers = () => {
- return Array.from({ length: columns * rows }, (_, i) => {
- return (
-
- );
- });
- };
+ const generateTrackers = () => {
+ return Array.from({ length: columns * rows }, (_, i) => {
+ return (
+
+ );
+ });
+ };
- const getTransform = (row: number, col: number) => {
- const xRotation = maxXrotation - (row / (rows - 1)) * 2 * maxXrotation;
- const yRotation = -maxYrotation + (col / (columns - 1)) * 2 * maxYrotation;
+ const getTransform = (row: number, col: number) => {
+ const xRotation = maxXrotation - (row / (rows - 1)) * 2 * maxXrotation;
+ const yRotation = -maxYrotation + (col / (columns - 1)) * 2 * maxYrotation;
- return `rotateX(${xRotation.toFixed(2)}deg) rotateY(${yRotation.toFixed(
- 2,
- )}deg)`;
- };
+ return `rotateX(${xRotation.toFixed(2)}deg) rotateY(${yRotation.toFixed(
+ 2,
+ )}deg)`;
+ };
- return (
-
-
-
- `"${Array.from(
- { length: columns },
- (_, colIndex) => `tr-${rowIndex * columns + colIndex + 1}`,
- ).join(" ")}"`,
- ).join(" "),
- }}
- >
- {generateTrackers()}
-
- {children}
-
-
-
- );
+
+ `"${Array.from(
+ { length: columns },
+ (_, colIndex) => `tr-${rowIndex * columns + colIndex + 1}`,
+ ).join(" ")}"`,
+ ).join(" "),
+ }}
+ >
+ {generateTrackers()}
+
+ {children}
+
+
+
+ );
};
export default HoverCard;
diff --git a/packages/ui/cuicui/common-ui/cards/modern-inner-shadow/variant1.tsx b/packages/ui/cuicui/common-ui/cards/modern-inner-shadow/variant1.tsx
index e9f81555..342c8c43 100644
--- a/packages/ui/cuicui/common-ui/cards/modern-inner-shadow/variant1.tsx
+++ b/packages/ui/cuicui/common-ui/cards/modern-inner-shadow/variant1.tsx
@@ -1,25 +1,25 @@
import { cn } from "@/cuicui/utils/cn/cn";
export function ModernInnerShadowCardVariant1() {
- return (
-
+ );
}
diff --git a/packages/ui/cuicui/common-ui/cards/notification-card/notification-card-preview.tsx b/packages/ui/cuicui/common-ui/cards/notification-card/notification-card-preview.tsx
index e58278d6..31f13745 100644
--- a/packages/ui/cuicui/common-ui/cards/notification-card/notification-card-preview.tsx
+++ b/packages/ui/cuicui/common-ui/cards/notification-card/notification-card-preview.tsx
@@ -1,9 +1,9 @@
import NotificationCard from "@/cuicui/common-ui/cards/notification-card/notification-card";
export default function NotificationCardPreview() {
- return (
-
+ );
}
diff --git a/packages/ui/cuicui/common-ui/cards/notification-card/notification-card.tsx b/packages/ui/cuicui/common-ui/cards/notification-card/notification-card.tsx
index b67c55e6..97815dce 100644
--- a/packages/ui/cuicui/common-ui/cards/notification-card/notification-card.tsx
+++ b/packages/ui/cuicui/common-ui/cards/notification-card/notification-card.tsx
@@ -2,33 +2,33 @@ import type { ReactNode } from "react";
import { cn } from "@/cuicui/utils/cn/cn";
export default function NotificationCard({
- date = new Date(),
- title,
- children,
- className,
+ date = new Date(),
+ title,
+ children,
+ className,
}: Readonly<{
- date?: Date;
- title: string;
- children: ReactNode;
- className?: string;
+ date?: Date;
+ title: string;
+ children: ReactNode;
+ className?: string;
}>) {
- return (
-
+ );
}
diff --git a/packages/ui/cuicui/common-ui/checkboxes/checkboxes.category.tsx b/packages/ui/cuicui/common-ui/checkboxes/checkboxes.category.tsx
index 0a0f3d11..b60c2519 100644
--- a/packages/ui/cuicui/common-ui/checkboxes/checkboxes.category.tsx
+++ b/packages/ui/cuicui/common-ui/checkboxes/checkboxes.category.tsx
@@ -3,30 +3,30 @@ import type { CategoryType } from "@/lib/types/component";
import SimpleCheckboxPreview from "@/cuicui/common-ui/checkboxes/simple-checkbox/simple-checkbox-preview";
export const checkboxesCategory: CategoryType = {
- slug: "checkboxes",
- name: "Checkboxes",
- description: "Checkboxes with various styles and interactions",
- releaseDateCategory: new Date("2024-08-31"),
- icon: CheckSquare2Icon,
- previewCategory: {
- component:
,
- previewScale: 2,
- },
- componentList: [
- {
- sizePreview: "sm",
- slug: "simple-checkbox",
- variantList: [
- {
- name: "Default",
- component:
,
- slugPreviewFile: "simple-checkbox-preview",
- slugComponentFile: "simple-checkbox",
- },
- ],
- name: "Simple checkbox",
- description:
- "A simple checkbox that can be used in any project with simple artistic style.",
- },
- ],
+ slug: "checkboxes",
+ name: "Checkboxes",
+ description: "Checkboxes with various styles and interactions",
+ releaseDateCategory: new Date("2024-08-31"),
+ icon: CheckSquare2Icon,
+ previewCategory: {
+ component:
,
+ previewScale: 2,
+ },
+ componentList: [
+ {
+ sizePreview: "sm",
+ slug: "simple-checkbox",
+ variantList: [
+ {
+ name: "Default",
+ component:
,
+ slugPreviewFile: "simple-checkbox-preview",
+ slugComponentFile: "simple-checkbox",
+ },
+ ],
+ name: "Simple checkbox",
+ description:
+ "A simple checkbox that can be used in any project with simple artistic style.",
+ },
+ ],
};
diff --git a/packages/ui/cuicui/common-ui/checkboxes/simple-checkbox/simple-checkbox-preview.tsx b/packages/ui/cuicui/common-ui/checkboxes/simple-checkbox/simple-checkbox-preview.tsx
index 371c08d8..5e0620a6 100644
--- a/packages/ui/cuicui/common-ui/checkboxes/simple-checkbox/simple-checkbox-preview.tsx
+++ b/packages/ui/cuicui/common-ui/checkboxes/simple-checkbox/simple-checkbox-preview.tsx
@@ -1,5 +1,5 @@
import SimpleCheckbox from "@/cuicui/common-ui/checkboxes/simple-checkbox/simple-checkbox";
export default function SimpleCheckboxPreview() {
- return
;
}
diff --git a/packages/ui/cuicui/common-ui/checkboxes/simple-checkbox/simple-checkbox.tsx b/packages/ui/cuicui/common-ui/checkboxes/simple-checkbox/simple-checkbox.tsx
index ae0277a6..b501a37c 100644
--- a/packages/ui/cuicui/common-ui/checkboxes/simple-checkbox/simple-checkbox.tsx
+++ b/packages/ui/cuicui/common-ui/checkboxes/simple-checkbox/simple-checkbox.tsx
@@ -2,33 +2,33 @@ import type { HTMLProps } from "react";
import { cn } from "@/cuicui/utils/cn/cn";
const SimpleCheckbox = ({
- label,
- ...props
+ label,
+ ...props
}: {
- label: string;
+ label: string;
} & HTMLProps