diff --git a/.changeset/eight-seas-greet.md b/.changeset/eight-seas-greet.md new file mode 100644 index 000000000..72b18e227 --- /dev/null +++ b/.changeset/eight-seas-greet.md @@ -0,0 +1,5 @@ +--- +'@theguild/components': minor +--- + +Add InfoCard and Stud components for landing pages' diff --git a/packages/components/src/components/index.ts b/packages/components/src/components/index.ts index 2083d76a0..93abda31e 100644 --- a/packages/components/src/components/index.ts +++ b/packages/components/src/components/index.ts @@ -31,3 +31,5 @@ export * from './decorations'; export * from './call-to-action'; export * from './cookies-consent'; export * from './heading'; +export * from './info-card'; +export * from './stud'; diff --git a/packages/components/src/components/info-card.stories.tsx b/packages/components/src/components/info-card.stories.tsx new file mode 100644 index 000000000..c1050eb6e --- /dev/null +++ b/packages/components/src/components/info-card.stories.tsx @@ -0,0 +1,20 @@ +import { Meta, StoryObj } from '@storybook/react'; +import { hiveThemeDecorator } from '../../../../.storybook/hive-theme-decorator'; +import { AccountBox } from './icons'; +import { InfoCard, InfoCardProps } from './info-card'; + +export default { + title: 'Components/InfoCard', + component: InfoCard, + decorators: [hiveThemeDecorator], +} satisfies Meta; + +export const Default: StoryObj = { + args: { + icon: , + as: 'div', + heading: 'Customizable User Roles and Permissions', + children: + 'Control user access with detailed, role-based permissions for enhanced security and flexibility.', + }, +}; diff --git a/packages/components/src/components/info-card.tsx b/packages/components/src/components/info-card.tsx new file mode 100644 index 000000000..25e0cdd12 --- /dev/null +++ b/packages/components/src/components/info-card.tsx @@ -0,0 +1,26 @@ +import { ReactNode } from 'react'; +import { cn } from '../cn'; +import { Stud } from './stud'; + +export interface InfoCardProps extends React.HTMLAttributes { + icon: ReactNode; + heading: ReactNode; + as?: 'div' | 'li'; +} + +export function InfoCard({ + as: Root = 'div', + icon, + heading, + className, + children, + ...rest +}: InfoCardProps) { + return ( + + {icon} +

{heading}

+

{children}

+
+ ); +} diff --git a/packages/components/src/components/stud.stories.tsx b/packages/components/src/components/stud.stories.tsx new file mode 100644 index 000000000..67eb13c30 --- /dev/null +++ b/packages/components/src/components/stud.stories.tsx @@ -0,0 +1,17 @@ +import { Meta, StoryObj } from '@storybook/react'; +import { hiveThemeDecorator } from '../../../../.storybook/hive-theme-decorator'; +import { RightCornerIcon } from './icons'; +import { Stud, StudProps } from './stud'; + +export default { + title: 'Components/Stud', + component: Stud, + decorators: [hiveThemeDecorator], +} satisfies Meta; + +export const Default: StoryObj = { + name: 'Stud', + args: { + children: , + }, +}; diff --git a/packages/components/src/components/stud.tsx b/packages/components/src/components/stud.tsx new file mode 100644 index 000000000..3c3464f1a --- /dev/null +++ b/packages/components/src/components/stud.tsx @@ -0,0 +1,14 @@ +import { cn } from '../cn'; + +export interface StudProps extends React.HTMLAttributes {} +export function Stud(props: StudProps) { + return ( +
+ ); +}