Skip to content

Commit 689977d

Browse files
committed
feat: Contact Section
1 parent 8a39f0a commit 689977d

11 files changed

Lines changed: 672 additions & 2 deletions

File tree

7.92 KB
Loading

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
"react": "^19.0.0",
7575
"react-dom": "^19.0.0",
7676
"semantic-release": "^24.2.0",
77+
"sonner": "^1.7.1",
7778
"storybook": "^8.4.7",
7879
"style-loader": "^4.0.0",
7980
"tailwind-merge": "^2.6.0",
@@ -109,16 +110,19 @@
109110
"class-variance-authority": "^0.7.1",
110111
"clsx": "^2.1.1",
111112
"cmdk": "^1.0.4",
113+
"formik": "^2.4.6",
112114
"prism-react-renderer": "^2.4.1",
113115
"r18gs": "^3.0.1",
114-
"react-icons": "^5.4.0"
116+
"react-icons": "^5.4.0",
117+
"yup": "^1.6.1"
115118
},
116119
"peerDependencies": {
117120
"@types/react": ">=16.8",
118121
"framer-motion": "^11.15.0",
119122
"lucide-react": "^0.469.0",
120123
"next": ">=10",
121-
"react": ">=16.8"
124+
"react": ">=16.8",
125+
"sonner": "^1.7.1"
122126
},
123127
"peerDependenciesMeta": {
124128
"next": {

pnpm-lock.yaml

Lines changed: 75 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { cn } from '@/lib/utils'
2+
3+
export function inputFieldCommonClassesGenerator({ className }: { className?: string }): string {
4+
return cn(
5+
// Layout styles
6+
'flex items-center min-h-[3.5rem] md:min-h-[3.75rem] w-full rounded-5 px-4 md:px-5 py-2',
7+
8+
// General styles
9+
' bg-transparent text-accent-800 placeholder:text-accent-800 dark:text-body dark:placeholder:text-body',
10+
11+
// Border styles
12+
' border border-solid border-accent-900 border-opacity-20 dark:border-opacity-20 dark:border-accent-200',
13+
14+
// Focus styles
15+
' focus:border-accent-900 focus:ring-0 focus-visible:outline-0 focus-visible:ring-0 focus-visible:ring-offset-0',
16+
17+
// Animation
18+
'transition-all duration-300',
19+
20+
// Additional custom className (optional)
21+
className,
22+
)
23+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { ComponentProps } from 'react'
2+
import { inputFieldCommonClassesGenerator } from '../common/styles'
3+
4+
export type InputProps = ComponentProps<'input'>
5+
6+
function Input({ className, ...props }: InputProps) {
7+
return <input {...props} className={inputFieldCommonClassesGenerator({ className })} />
8+
}
9+
10+
export interface TextInputProps extends InputProps {
11+
icon?: React.ReactNode
12+
}
13+
14+
export function TextInput({ icon, ...props }: TextInputProps) {
15+
return (
16+
<div className="relative w-full">
17+
<Input {...props} />
18+
{icon && (
19+
<span className="absolute right-5 top-1/2 w-[14px] -translate-y-1/2 text-primary">
20+
{icon}
21+
</span>
22+
)}
23+
</div>
24+
)
25+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { ComponentProps } from 'react'
2+
import { inputFieldCommonClassesGenerator } from '../common/styles'
3+
import { cn } from '@/lib/utils/cn'
4+
5+
export type TextareaProps = ComponentProps<'textarea'>
6+
7+
function Input({ className, ...props }: TextareaProps) {
8+
return (
9+
<textarea
10+
{...props}
11+
className={cn(
12+
inputFieldCommonClassesGenerator({}),
13+
'resize-none md:min-h-[130px]',
14+
className,
15+
)}
16+
/>
17+
)
18+
}
19+
20+
export interface TextareaInputProps extends TextareaProps {
21+
icon?: React.ReactNode
22+
}
23+
24+
export function TextAreaInput({ icon, ...props }: TextareaInputProps) {
25+
return (
26+
<div className="relative w-full">
27+
<Input {...props} />
28+
{icon && <span className="absolute right-5 top-[18px] w-[14px] text-primary">{icon}</span>}
29+
</div>
30+
)
31+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import React from 'react';
2+
import { Meta, StoryFn } from '@storybook/react';
3+
import { ContactSection, type ContactSectionProps } from './ContactSection';
4+
import { Toaster } from 'sonner'
5+
6+
export default {
7+
title: 'Sections/ContactSection',
8+
component: ContactSection,
9+
tags: ['autodocs'],
10+
11+
parameters: {
12+
docs: {
13+
description: {
14+
component: 'A card component that displays a service with an icon, title, description, and a link.',
15+
},
16+
},
17+
},
18+
argTypes: {
19+
},
20+
decorators: [
21+
(Story) => (
22+
<>
23+
<Story />
24+
<Toaster richColors position="top-right" closeButton visibleToasts={9} />
25+
</>
26+
),
27+
],
28+
} as Meta;
29+
30+
const Template: StoryFn<ContactSectionProps> = (args) => <ContactSection {...args} />;
31+
32+
export const Default = Template.bind({});
33+
Default.args = {
34+
sectionHeading: {
35+
title: 'Get in Touch',
36+
subtitle: 'We would love to hear from you',
37+
},
38+
image: {
39+
src: '/assets/images/contact.png',
40+
alt: 'Contact Us',
41+
blurDataURL: 'data:image/jpeg;base64,...', // Add your blur data URL here
42+
},
43+
contactInfo: {
44+
sectionHeading: {
45+
title: 'Contact Information',
46+
subtitle: 'Reach out to us through any of the following methods',
47+
},
48+
location: '123 Main Street, Anytown, AT 12345',
49+
mail: 'info@example.com',
50+
phone: '+1 (555) 123-4567',
51+
},
52+
locations: [
53+
{
54+
title: 'Head Office',
55+
location: '123 Main Street, Anytown, AT 12345',
56+
mails: ['headoffice@example.com'],
57+
phoneNumbers: ['+1 (555) 123-4567'],
58+
embedUrl: 'https://www.google.com/maps/embed?...', // Add your Google Maps embed URL here
59+
},
60+
{
61+
title: 'Branch Office',
62+
location: '456 Elm Street, Othertown, OT 67890',
63+
mails: ['branchoffice@example.com'],
64+
phoneNumbers: ['+1 (555) 987-6543'],
65+
embedUrl: 'https://www.google.com/maps/embed?...', // Add your Google Maps embed URL here
66+
},
67+
],
68+
};

0 commit comments

Comments
 (0)