Add the No Rules empty-state card from Figma.
This commit is contained in:
1 parent
e08884efde
commit
b1ae274ff6
7 files changed
+156
-1
No files matched your search
@@ -0,0 +1,17 @@
|
||||
"use client";
|
||||
|
||||
/**
|
||||
* Figma: "Card / No Rules" (25032:50447)
|
||||
* https://www.figma.com/design/agv0VBLiBlcnSAaiAORgPR/Community-Rule-System?node-id=25032-50447
|
||||
*/
|
||||
import { memo } from "react";
|
||||
import { NoRulesView } from "./NoRules.view";
|
||||
import type { NoRulesProps } from "./NoRules.types";
|
||||
|
||||
const NoRulesContainer = memo<NoRulesProps>((props) => {
|
||||
return <NoRulesView {...props} />;
|
||||
});
|
||||
|
||||
NoRulesContainer.displayName = "NoRules";
|
||||
|
||||
export default NoRulesContainer;
|
||||
@@ -0,0 +1,11 @@
|
||||
export type NoRulesProps = {
|
||||
title: string;
|
||||
description: string;
|
||||
createLabel: string;
|
||||
browseLabel: string;
|
||||
onCreate: () => void;
|
||||
browseHref: string;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
export type NoRulesViewProps = NoRulesProps;
|
||||
@@ -0,0 +1,52 @@
|
||||
"use client";
|
||||
|
||||
import { memo } from "react";
|
||||
import Button from "../../buttons/Button";
|
||||
import NavigationLink from "../../navigation/Link";
|
||||
import type { NoRulesViewProps } from "./NoRules.types";
|
||||
|
||||
export const NoRulesView = memo(function NoRulesView({
|
||||
title,
|
||||
description,
|
||||
createLabel,
|
||||
browseLabel,
|
||||
onCreate,
|
||||
browseHref,
|
||||
className = "",
|
||||
}: NoRulesViewProps) {
|
||||
return (
|
||||
<div
|
||||
className={`flex w-full flex-col items-start gap-4 rounded-[var(--radius-300)] border border-dashed border-[var(--color-border-default-secondary)] p-8 ${className}`.trim()}
|
||||
data-figma-node="25032:50447"
|
||||
>
|
||||
<h3 className="w-full font-bricolage-grotesque text-small-heading text-[var(--color-content-default-primary)]">
|
||||
{title}
|
||||
</h3>
|
||||
<p className="w-full text-medium-paragraph text-[var(--color-content-default-secondary)]">
|
||||
{description}
|
||||
</p>
|
||||
<div className="flex w-full flex-wrap items-center gap-x-4 gap-y-3 pt-2">
|
||||
<Button
|
||||
type="button"
|
||||
size="large"
|
||||
buttonType="filled"
|
||||
palette="default"
|
||||
onClick={onCreate}
|
||||
>
|
||||
{createLabel}
|
||||
</Button>
|
||||
<NavigationLink
|
||||
href={browseHref}
|
||||
type="primary"
|
||||
theme="dark"
|
||||
leadingIcon={false}
|
||||
trailingIcon={false}
|
||||
>
|
||||
{browseLabel}
|
||||
</NavigationLink>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
});
|
||||
|
||||
NoRulesView.displayName = "NoRulesView";
|
||||
@@ -0,0 +1,2 @@
|
||||
export { default } from "./NoRules.container";
|
||||
export type { NoRulesProps } from "./NoRules.types";
|
||||
Reference in new issue
Block a user