Skip to content

Commit 616f712

Browse files
Merge pull request #109 from syntaxandsips/mr-dark-debug/fix-build-errors-for-npm-run-build
fix: allow content sections to forward html props
2 parents e953b64 + 0370530 commit 616f712

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

src/components/ui/ContentPageLayout.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ReactNode } from 'react';
1+
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
22
import { NewFooter } from './NewFooter';
33

44
interface ContentPageLayoutProps {
@@ -44,15 +44,15 @@ export function ContentPageLayout({
4444
);
4545
}
4646

47-
interface ContentSectionProps {
47+
type ContentSectionProps = Omit<ComponentPropsWithoutRef<'section'>, 'children' | 'className'> & {
4848
title: string;
4949
description?: string;
5050
eyebrow?: ReactNode;
5151
actions?: ReactNode;
5252
children: ReactNode;
5353
className?: string;
5454
fullWidth?: boolean;
55-
}
55+
};
5656

5757
export function ContentSection({
5858
title,
@@ -62,14 +62,15 @@ export function ContentSection({
6262
children,
6363
className,
6464
fullWidth = false,
65+
...sectionProps
6566
}: ContentSectionProps) {
6667
const containerClassName = `neo-container bg-white ${className ?? ''}`.trim();
6768
const layoutClassName = fullWidth
6869
? 'space-y-6'
6970
: 'flex flex-col lg:flex-row lg:items-start gap-8';
7071

7172
return (
72-
<section className={containerClassName}>
73+
<section {...sectionProps} className={containerClassName}>
7374
{eyebrow && (
7475
<div className="mb-4 inline-flex items-center gap-2 bg-[#06D6A0] border-4 border-black px-3 py-1 text-xs font-bold uppercase tracking-widest text-black shadow-[4px_4px_0_0_#000]">
7576
{eyebrow}

src/components/ui/PageLayout.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ReactNode } from 'react';
1+
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
22
import Link from 'next/link';
33
import { cn } from '@/lib/utils';
44
import { NewFooter } from './NewFooter';
@@ -64,15 +64,15 @@ export function PageHero({
6464
);
6565
}
6666

67-
interface ContentSectionProps {
67+
type ContentSectionProps = Omit<ComponentPropsWithoutRef<'section'>, 'children'> & {
6868
eyebrow?: string;
6969
title: string;
7070
description?: string;
7171
children: ReactNode;
7272
align?: 'left' | 'center';
7373
tone?: 'neutral' | 'lavender' | 'peach';
7474
footerContent?: ReactNode;
75-
}
75+
};
7676

7777
const toneStyles: Record<Required<ContentSectionProps>['tone'], string> = {
7878
neutral: 'bg-white',
@@ -88,11 +88,13 @@ export function ContentSection({
8888
align = 'left',
8989
tone = 'neutral',
9090
footerContent,
91+
className,
92+
...sectionProps
9193
}: ContentSectionProps) {
9294
const hasChildren = children !== undefined && children !== null;
9395

9496
return (
95-
<section>
97+
<section className={className} {...sectionProps}>
9698
<div
9799
className={cn(
98100
'relative overflow-hidden rounded-3xl border-4 border-black p-8 md:p-12 shadow-[12px_12px_0px_0px_rgba(0,0,0,0.08)]',

0 commit comments

Comments
 (0)