Rule Stack #11

Merged
an.di merged 29 commits from adilallo/component/RuleStack into main 2025-08-26 21:31:42 +00:00
3 changed files with 16 additions and 12 deletions
Showing only changes of commit 661b3c6e05 - Show all commits
+6 -6
View File
@@ -9,27 +9,27 @@ const RuleCard = ({
}) => { }) => {
return ( return (
<div <div
className={`${backgroundColor} rounded-[var(--radius-measures-radius-small)] pt-[var(--spacing-scale-012)] pr-[var(--spacing-scale-012)] pl-[var(--spacing-scale-012)] pb-[var(--spacing-scale-024)] flex flex-col gap-[18px] shadow-lg backdrop-blur-sm ${className}`} className={`${backgroundColor} rounded-[var(--radius-measures-radius-small)] pt-[var(--spacing-scale-012)] pr-[var(--spacing-scale-012)] pl-[var(--spacing-scale-012)] pb-[var(--spacing-scale-024)] md:p-[var(--spacing-scale-024)] md:h-[210px] flex flex-col gap-[18px] shadow-lg backdrop-blur-sm ${className}`}
> >
{/* Header Container */} {/* Header Container */}
<div className="grid grid-cols-[auto_1fr] h-[72px] border-b border-[var(--color-surface-default-primary)]"> <div className="grid grid-cols-[auto_1fr] h-[72px] md:h-[80px] border-b border-[var(--color-surface-default-primary)]">
{/* Icon Container */} {/* Icon Container */}
{icon && ( {icon && (
<div className="p-[var(--spacing-scale-016)] border-r border-[var(--color-surface-default-primary)] w-fit flex items-center justify-center"> <div className="p-[var(--spacing-scale-016)] md:p-[var(--spacing-scale-012)] border-r border-[var(--color-surface-default-primary)] w-fit flex items-center justify-center">
{icon} {icon}
</div> </div>
)} )}
{/* Title Container */} {/* Title Container */}
{title && ( {title && (
<div className="pl-[var(--spacing-scale-008)] flex items-center gap-[var(--spacing-scale-004)]"> <div className="pl-[var(--spacing-scale-008)] md:pl-[var(--spacing-scale-012)] flex items-center gap-[var(--spacing-scale-004)]">
<h3 className="font-space-grotesk font-bold text-[20px] leading-[28px] text-[--color-content-inverse-primary]"> <h3 className="font-space-grotesk font-bold text-[20px] md:text-[28px] leading-[28px] md:leading-[36px] text-[--color-content-inverse-primary]">
{title} {title}
</h3> </h3>
</div> </div>
)} )}
</div> </div>
{description && ( {description && (
<p className="font-inter font-medium text-[12px] leading-[14px] text-[var(--color-content-inverse-primary)]"> <p className="font-inter font-medium text-[12px] md:text-[14px] leading-[14px] md:leading-[16px] text-[var(--color-content-inverse-primary)]">
{description} {description}
</p> </p>
)} )}
+6 -2
View File
@@ -8,12 +8,12 @@ import Image from "next/image";
const RuleStack = ({ children, className = "" }) => { const RuleStack = ({ children, className = "" }) => {
return ( return (
<div <div
className={`w-full bg-transparent py-[var(--spacing-scale-032)] px-[var(--spacing-scale-020)] flex flex-col gap-[var(--spacing-scale-024)] ${className}`} className={`w-full bg-transparent py-[var(--spacing-scale-032)] px-[var(--spacing-scale-020)] md:py-[var(--spacing-scale-048)] md:px-[var(--spacing-scale-032)] flex flex-col gap-[var(--spacing-scale-024)] ${className}`}
> >
<SectionHeader <SectionHeader
title="Popular templates" title="Popular templates"
subtitle="These are popular patterns for making decisions in mutual aid and open source communities. You can use them as they are or as a starting place for customizing your own CommunityRule." subtitle="These are popular patterns for making decisions in mutual aid and open source communities. You can use them as they are or as a starting place for customizing your own CommunityRule."
variant="small" variant="multi-line"
/> />
<div className="flex flex-col gap-[18px]"> <div className="flex flex-col gap-[18px]">
<RuleCard <RuleCard
@@ -25,6 +25,7 @@ const RuleStack = ({ children, className = "" }) => {
alt="Sociocracy" alt="Sociocracy"
width={40} width={40}
height={40} height={40}
className="md:w-[56px] md:h-[56px]"
/> />
} }
backgroundColor="bg-[var(--color-surface-default-brand-lime)]" backgroundColor="bg-[var(--color-surface-default-brand-lime)]"
@@ -38,6 +39,7 @@ const RuleStack = ({ children, className = "" }) => {
alt="Consensus" alt="Consensus"
width={40} width={40}
height={40} height={40}
className="md:w-[56px] md:h-[56px]"
/> />
} }
backgroundColor="bg-[var(--color-surface-default-brand-rust)]" backgroundColor="bg-[var(--color-surface-default-brand-rust)]"
@@ -51,6 +53,7 @@ const RuleStack = ({ children, className = "" }) => {
alt="Elected Board" alt="Elected Board"
width={40} width={40}
height={40} height={40}
className="md:w-[56px] md:h-[56px]"
/> />
} }
backgroundColor="bg-[var(--color-surface-default-brand-red)]" backgroundColor="bg-[var(--color-surface-default-brand-red)]"
@@ -64,6 +67,7 @@ const RuleStack = ({ children, className = "" }) => {
alt="Petition" alt="Petition"
width={40} width={40}
height={40} height={40}
className="md:w-[56px] md:h-[56px]"
/> />
} }
backgroundColor="bg-[var(--color-surface-default-brand-teal)]" backgroundColor="bg-[var(--color-surface-default-brand-teal)]"
+4 -4
View File
@@ -7,8 +7,8 @@ const SectionHeader = ({ title, subtitle, titleLg, variant = "default" }) => {
<div className="lg:w-[369px] lg:h-[var(--spacing-scale-120)] lg:flex lg:items-center xl:w-[452px] xl:h-[156px] xl:flex xl:items-center"> <div className="lg:w-[369px] lg:h-[var(--spacing-scale-120)] lg:flex lg:items-center xl:w-[452px] xl:h-[156px] xl:flex xl:items-center">
<h2 <h2
className={ className={
variant === "small" variant === "multi-line"
? "font-bricolage-grotesque font-bold text-[28px] leading-[36px] text-[var(--color-content-default-primary)]" ? "font-bricolage-grotesque font-bold text-[28px] leading-[36px] md:font-bold md:text-[32px] md:leading-[40px] text-[var(--color-content-default-primary)]"
: "font-bricolage-grotesque font-bold text-[28px] leading-[36px] sm:text-[32px] sm:leading-[40px] lg:text-[32px] lg:leading-[40px] lg:w-[369px] lg:pr-24 xl:text-[40px] xl:leading-[52px] xl:w-[452px] xl:pr-24 text-[var(--color-content-default-primary)]" : "font-bricolage-grotesque font-bold text-[28px] leading-[36px] sm:text-[32px] sm:leading-[40px] lg:text-[32px] lg:leading-[40px] lg:w-[369px] lg:pr-24 xl:text-[40px] xl:leading-[52px] xl:w-[452px] xl:pr-24 text-[var(--color-content-default-primary)]"
} }
> >
@@ -21,8 +21,8 @@ const SectionHeader = ({ title, subtitle, titleLg, variant = "default" }) => {
<div className="lg:w-[928px] lg:h-[120px] lg:flex lg:items-center lg:justify-end xl:w-[763px] xl:h-[156px] xl:flex xl:items-center xl:justify-end"> <div className="lg:w-[928px] lg:h-[120px] lg:flex lg:items-center lg:justify-end xl:w-[763px] xl:h-[156px] xl:flex xl:items-center xl:justify-end">
<p <p
className={ className={
variant === "small" variant === "multi-line"
? "font-inter font-normal text-[14px] leading-[20px] text-[var(--color-content-default-tertiary)]" ? "font-inter font-normal text-[14px] leading-[20px] md:font-normal md:text-[18px] md:leading-[130%] text-[var(--color-content-default-tertiary)]"
: "font-inter font-normal text-[18px] leading-[130%] sm:text-[18px] sm:leading-[32px] lg:text-[24px] lg:leading-[32px] xl:text-[32px] xl:leading-[40px] xl:text-right text-[#484848] sm:text-[var(--color-content-default-tertiary)] lg:text-[var(--color-content-default-tertiary)] xl:text-[var(--color-content-default-tertiary)] tracking-[0px]" : "font-inter font-normal text-[18px] leading-[130%] sm:text-[18px] sm:leading-[32px] lg:text-[24px] lg:leading-[32px] xl:text-[32px] xl:leading-[40px] xl:text-right text-[#484848] sm:text-[var(--color-content-default-tertiary)] lg:text-[var(--color-content-default-tertiary)] xl:text-[var(--color-content-default-tertiary)] tracking-[0px]"
} }
> >