mirror of
https://github.com/lukevella/rallly.git
synced 2025-07-13 22:47:27 +02:00
✨ Updated sidebar layout (#1661)
This commit is contained in:
parent
8c0814b92b
commit
72ca1d4c38
104 changed files with 3268 additions and 1331 deletions
84
packages/ui/src/action-bar.tsx
Normal file
84
packages/ui/src/action-bar.tsx
Normal file
|
@ -0,0 +1,84 @@
|
|||
import * as Portal from "@radix-ui/react-portal";
|
||||
import * as React from "react";
|
||||
|
||||
import { cn } from "./lib/utils";
|
||||
|
||||
const ACTION_BAR_PORTAL_ID = "action-bar-portal";
|
||||
|
||||
const ActionBar = React.forwardRef<
|
||||
HTMLDivElement,
|
||||
React.HTMLAttributes<HTMLDivElement>
|
||||
>(({ className, ...props }, ref) => (
|
||||
<div
|
||||
ref={ref}
|
||||
className={cn(
|
||||
"pointer-events-none sticky bottom-8 flex justify-center pb-5",
|
||||
className,
|
||||
)}
|
||||
id={ACTION_BAR_PORTAL_ID}
|
||||
{...props}
|
||||
/>
|
||||
));
|
||||
ActionBar.displayName = "ActionBar";
|
||||
|
||||
const ActionBarPortal = React.forwardRef<
|
||||
HTMLDivElement,
|
||||
React.HTMLAttributes<HTMLDivElement>
|
||||
>(({ className, ...props }, ref) => (
|
||||
<Portal.Root
|
||||
container={document.getElementById(ACTION_BAR_PORTAL_ID)}
|
||||
ref={ref}
|
||||
className={className}
|
||||
{...props}
|
||||
/>
|
||||
));
|
||||
ActionBarPortal.displayName = "ActionBarPortal";
|
||||
|
||||
const ActionBarContainer = React.forwardRef<
|
||||
HTMLDivElement,
|
||||
React.HTMLAttributes<HTMLDivElement>
|
||||
>(({ className, ...props }, ref) => {
|
||||
return (
|
||||
<div
|
||||
ref={ref}
|
||||
className={cn(
|
||||
"bg-action-bar text-action-bar-foreground pointer-events-auto z-50 mx-auto inline-flex w-full max-w-2xl items-center gap-4 rounded-xl p-2 shadow-lg",
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
});
|
||||
ActionBarContainer.displayName = "ActionBarContainer";
|
||||
|
||||
const ActionBarContent = React.forwardRef<
|
||||
HTMLDivElement,
|
||||
React.HTMLAttributes<HTMLDivElement>
|
||||
>(({ className, ...props }, ref) => (
|
||||
<div
|
||||
ref={ref}
|
||||
className={cn("flex items-center px-2.5", className)}
|
||||
{...props}
|
||||
/>
|
||||
));
|
||||
ActionBarContent.displayName = "ActionBarContent";
|
||||
|
||||
const ActionBarGroup = React.forwardRef<
|
||||
HTMLDivElement,
|
||||
React.HTMLAttributes<HTMLDivElement>
|
||||
>(({ className, ...props }, ref) => (
|
||||
<div
|
||||
ref={ref}
|
||||
className={cn("flex items-center gap-2", className)}
|
||||
{...props}
|
||||
/>
|
||||
));
|
||||
ActionBarGroup.displayName = "ActionBarGroup";
|
||||
|
||||
export {
|
||||
ActionBar,
|
||||
ActionBarContainer,
|
||||
ActionBarContent,
|
||||
ActionBarGroup,
|
||||
ActionBarPortal,
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue