Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dashboard): update node styles #7321

Merged
merged 3 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions apps/dashboard/src/components/workflow-editor/base-node.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const NodeBody = ({ children }: { children: ReactNode }) => {
<span className="text-foreground-400 overflow-hidden text-ellipsis text-nowrap text-sm font-medium">
{children}
</span>
<span className="to-background/90 absolute left-0 top-0 h-full w-full bg-gradient-to-r from-[rgba(255,255,255,0.00)] from-70% to-95%" />
<span className="to-background/90 absolute left-0 top-0 h-full w-full rounded-b-[calc(var(--radius)-1px)] bg-gradient-to-r from-[rgba(255,255,255,0.00)] from-70% to-95%" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the -1px ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because the outer container has 1px padding,so (outer radius - padding) = inner radius

</div>
);
};
Expand Down Expand Up @@ -98,11 +98,11 @@ export const NODE_WIDTH = 300;
export const NODE_HEIGHT = 86;

const nodeVariants = cva(
`relative border-neutral-alpha-200 transition-colors aria-selected:border-primary bg-foreground-0 flex w-[300px] flex-col gap-1 border p-1 shadow-xs`,
`relative bg-neutral-alpha-200 transition-colors aria-selected:bg-gradient-to-tr aria-selected:to-warning/50 aria-selected:from-destructive/60 [&>span]:bg-foreground-0 flex w-[300px] flex-col p-px shadow-xs flex [&>span]:flex-1 [&>span]:rounded-[calc(var(--radius)-1px)] [&>span]:p-1 [&>span]:flex [&>span]:flex-col [&>span]:gap-1`,
{
variants: {
variant: {
default: 'rounded-xl',
default: 'rounded-lg',
sm: 'text-neutral-400 w-min rounded-lg',
},
},
Expand All @@ -118,7 +118,7 @@ export const Node = (props: BaseNodeProps) => {
const { children, variant, className, ...rest } = props;
return (
<div className={nodeVariants({ variant, className })} {...rest}>
{children}
<span>{children}</span>
</div>
);
};
4 changes: 2 additions & 2 deletions apps/dashboard/src/components/workflow-editor/nodes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ export const TriggerNode = ({ data }: NodeProps<FlowNode<{ environmentSlug: stri
workflowSlug: data.workflowSlug,
})}
>
<Node className="relative rounded-tl-none border-r">
<div className="border-neutral-alpha-200 text-foreground-600 absolute -left-[1px] top-0 flex -translate-y-full items-center gap-1 rounded-t-lg border bg-neutral-50 px-2 py-1 text-xs font-medium">
<Node className="relative rounded-tl-none [&>span]:rounded-tl-none">
<div className="border-neutral-alpha-200 text-foreground-600 absolute left-0 top-0 flex -translate-y-full items-center gap-1 rounded-t-lg border border-b-0 bg-neutral-50 px-2 py-1 text-xs font-medium">
<RiPlayCircleLine className="size-3" />
<span>TRIGGER</span>
</div>
Expand Down
Loading