const [stepIndex, setStepIndex] = useState(0);
const steps = ["Information", "Ligue", "Paiement"];
const onStepClick = (index: number) => {
setStepIndex(index);
};
return (
<>
<StepBox
steps={steps}
currentIndex={stepIndex}
onStepClick={onStepClick}
/>
<button
className="p-2 bg-blue-600 rounded-lg"
onClick={() =>
setStepIndex((prev) => (prev + 1) % (steps.length + 1))
}
>
Next Step
</button>
</>
);
const [stepIndex, setStepIndex] = useState(0);
const steps = ["Information", "Ligue", "Paiement"];
const onStepClick = (index: number) => {
setStepIndex(index);
};
return (
<>
<StepBox
steps={steps}
currentIndex={stepIndex}
onStepClick={onStepClick}
/>
<button
className="p-2 bg-blue-600 rounded-lg"
onClick={() =>
setStepIndex((prev) => (prev + 1) % (steps.length + 1))
}
>
Next Step
</button>
</>
);
const [isOpen, setIsOpen] = useState(false);
const handleClose = () => {
setIsOpen(false);
};
return (
<>
<button
className="px-4 py-2 bg-blue-500 text-white rounded"
onClick={() => setIsOpen(true)}
>
Open Feedback
</button>
<FeedbackForm isOpen={isOpen} onClose={handleClose} />
</>
);
const [isOpen, setIsOpen] = useState(false);
const handleClose = () => {
setIsOpen(false);
};
return (
<>
<button
className="px-4 py-2 bg-blue-500 text-white rounded"
onClick={() => setIsOpen(true)}
>
Open Feedback
</button>
<FeedbackForm isOpen={isOpen} onClose={handleClose} />
</>
);
const methods = useForm();
const formContent = (
<Form {...methods}>
<form onSubmit={methods.handleSubmit((data) => console.log(data))}>
<FormField
name="email"
control={methods.control}
render={({ field }) => (
<FormItem>
<FormLabel>Email</FormLabel>
<FormControl>
<input
{...field}
type="email"
placeholder="Enter your email"
className="border rounded p-2 w-full"
/>
</FormControl>
<FormDescription>We'll never share your email.</FormDescription>
<FormMessage />
</FormItem>
)}
/>
<button
type="submit"
className="mt-4 px-4 py-2 bg-blue-500 text-white rounded"
>
Submit
</button>
</form>
</Form>
);
return formContent;
const methods = useForm();
const formContent = (
<Form {...methods}>
<form onSubmit={methods.handleSubmit((data) => console.log(data))}>
<FormField
name="email"
control={methods.control}
render={({ field }) => (
<FormItem>
<FormLabel>Email</FormLabel>
<FormControl>
<input
{...field}
type="email"
placeholder="Enter your email"
className="border rounded p-2 w-full"
/>
</FormControl>
<FormDescription>We'll never share your email.</FormDescription>
<FormMessage />
</FormItem>
)}
/>
<button
type="submit"
className="mt-4 px-4 py-2 bg-blue-500 text-white rounded"
>
Submit
</button>
</form>
</Form>
);
return formContent;
const fqcnBUI = { namespace: "example", component: "form" };
const formContent = (
<Form {...methods}>
<form onSubmit={methods.handleSubmit((data) => console.log(data))}>
<CustomInput
fqcnBUI={fqcnBUI}
nameInSchema="email"
label="Email"
placeholder="Enter your email"
required
/>
<CustomUnitInput
fqcnBUI={fqcnBUI}
name="quantity"
label="Quantity"
placeholder="Enter quantity"
unit="kg"
required
/>
<button
type="submit"
className="mt-4 px-4 py-2 bg-blue-500 text-white rounded"
>
Submit
</button>
</form>
</Form>
);
return formContent;
const fqcnBUI = { namespace: "example", component: "form" };
const formContent = (
<Form {...methods}>
<form onSubmit={methods.handleSubmit((data) => console.log(data))}>
<CustomInput
fqcnBUI={fqcnBUI}
nameInSchema="email"
label="Email"
placeholder="Enter your email"
required
/>
<CustomUnitInput
fqcnBUI={fqcnBUI}
name="quantity"
label="Quantity"
placeholder="Enter quantity"
unit="kg"
required
/>
<button
type="submit"
className="mt-4 px-4 py-2 bg-blue-500 text-white rounded"
>
Submit
</button>
</form>
</Form>
);
return formContent;
const fqcnBUI = { namespace: "example", component: "input" };
const inputFields = (
<div className="flex flex-col gap-4">
<Input
fqcn_bui={fqcnBUI}
type="text"
placeholder="Enter your name"
className="border-gray-300"
/>
<Input
fqcn_bui={fqcnBUI}
type="password"
placeholder="Enter your password"
className="border-gray-300"
/>
</div>
);
return inputFields;
const fqcnBUI = { namespace: "example", component: "input" };
const inputFields = (
<div className="flex flex-col gap-4">
<Input
fqcn_bui={fqcnBUI}
type="text"
placeholder="Enter your name"
className="border-gray-300"
/>
<Input
fqcn_bui={fqcnBUI}
type="password"
placeholder="Enter your password"
className="border-gray-300"
/>
</div>
);
return inputFields;
const tenant = "exampleTenant";
const primaryLinks = [
{ title: "Home", icon: <span>🏠</span>, link: "/", externalLink: false },
{ title: "About", icon: <span>ℹ️</span>, link: "/about", externalLink: false },
];
const layoutContent = (
<LayoutClient tenant={tenant} primaryLinks={primaryLinks}>
<div className="p-4">
<h1>Welcome to the Dashboard</h1>
<p>This is the main content area.</p>
</div>
</LayoutClient>
);
return layoutContent;
const tenant = "exampleTenant";
const primaryLinks = [
{ title: "Home", icon: <span>🏠</span>, link: "/", externalLink: false },
{ title: "About", icon: <span>ℹ️</span>, link: "/about", externalLink: false },
];
const layoutContent = (
<LayoutClient tenant={tenant} primaryLinks={primaryLinks}>
<div className="p-4">
<h1>Welcome to the Dashboard</h1>
<p>This is the main content area.</p>
</div>
</LayoutClient>
);
return layoutContent;
const fqcnBUI = { namespace: "example", component: "logo" };
const logoPath = "/custom-logo.png";
const logoComponent = (
<Logo fqcnBUI={fqcnBUI} logoPath={logoPath} />
);
return logoComponent;
const fqcnBUI = { namespace: "example", component: "logo" };
const logoPath = "/custom-logo.png";
const logoComponent = (
<Logo fqcnBUI={fqcnBUI} logoPath={logoPath} />
);
return logoComponent;
const fqcnBUI = { namespace: "example", component: "mode-toggle" };
return (
<ModeToggle fqcnBUI={fqcnBUI} />
);
const fqcnBUI = { namespace: "example", component: "mode-toggle" };
return (
<ModeToggle fqcnBUI={fqcnBUI} />
);
const tenant = "exampleTenant";
const primaryLinks = [
{
title: "Dashboard",
icon: <span>📊</span>,
link: "/dashboard",
externalLink: false,
subMenus: [
{ title: "Reports", icon: <span>📄</span>, link: "/reports" },
{ title: "Analytics", icon: <span>📈</span>, link: "/analytics" },
],
},
{
title: "Settings",
icon: <span>⚙️</span>,
link: "/settings",
externalLink: false,
},
];
return (
<div className="w-fit">
<SidebarMenu
tenant={tenant}
isOpen={isOpen}
setIsOpen={setIsOpen}
primaryLinks={primaryLinks}
/>
</div>
);
const tenant = "exampleTenant";
const primaryLinks = [
{
title: "Dashboard",
icon: <span>📊</span>,
link: "/dashboard",
externalLink: false,
subMenus: [
{ title: "Reports", icon: <span>📄</span>, link: "/reports" },
{ title: "Analytics", icon: <span>📈</span>, link: "/analytics" },
],
},
{
title: "Settings",
icon: <span>⚙️</span>,
link: "/settings",
externalLink: false,
},
];
return (
<div className="w-fit">
<SidebarMenu
tenant={tenant}
isOpen={isOpen}
setIsOpen={setIsOpen}
primaryLinks={primaryLinks}
/>
</div>
);
const popoverContent = (
<Popover>
<PopoverTrigger className="px-4 py-2 bg-blue-500 text-white rounded">
Open Popover
</PopoverTrigger>
<PopoverContent>
<p>This is the content inside the popover.</p>
</PopoverContent>
</Popover>
);
return popoverContent;
const popoverContent = (
<Popover>
<PopoverTrigger className="px-4 py-2 bg-blue-500 text-white rounded">
Open Popover
</PopoverTrigger>
<PopoverContent>
<p>This is the content inside the popover.</p>
</PopoverContent>
</Popover>
);
return popoverContent;
const tooltipContent = (
<TooltipProvider>
<Tooltip>
<TooltipTrigger className="px-4 py-2 bg-blue-500 text-white rounded">
Hover me
</TooltipTrigger>
<TooltipContent>
<p>This is a tooltip message.</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
);
return tooltipContent;
const tooltipContent = (
<TooltipProvider>
<Tooltip>
<TooltipTrigger className="px-4 py-2 bg-blue-500 text-white rounded">
Hover me
</TooltipTrigger>
<TooltipContent>
<p>This is a tooltip message.</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
);
return tooltipContent;