From 4c5bd049709d270e8e0b71de23d35606be3e9609 Mon Sep 17 00:00:00 2001 From: johndoe6345789 Date: Sun, 18 Jan 2026 00:32:03 +0000 Subject: [PATCH] Refactor atomic showcase tabs --- src/components/AtomicComponentShowcase.tsx | 544 ++---------------- src/components/atomic-showcase/DisplayTab.tsx | 125 ++++ src/components/atomic-showcase/FormsTab.tsx | 137 +++++ .../atomic-showcase/TypographyTab.tsx | 149 +++++ src/data/atomic-showcase/display.json | 69 +++ src/data/atomic-showcase/forms.json | 68 +++ src/data/atomic-showcase/showcase.json | 4 + src/data/atomic-showcase/tabs.json | 5 + src/data/atomic-showcase/typography.json | 73 +++ 9 files changed, 676 insertions(+), 498 deletions(-) create mode 100644 src/components/atomic-showcase/DisplayTab.tsx create mode 100644 src/components/atomic-showcase/FormsTab.tsx create mode 100644 src/components/atomic-showcase/TypographyTab.tsx create mode 100644 src/data/atomic-showcase/display.json create mode 100644 src/data/atomic-showcase/forms.json create mode 100644 src/data/atomic-showcase/showcase.json create mode 100644 src/data/atomic-showcase/tabs.json create mode 100644 src/data/atomic-showcase/typography.json diff --git a/src/components/AtomicComponentShowcase.tsx b/src/components/AtomicComponentShowcase.tsx index 986145f..5dfecea 100644 --- a/src/components/AtomicComponentShowcase.tsx +++ b/src/components/AtomicComponentShowcase.tsx @@ -1,53 +1,17 @@ import { useState } from 'react' -import { Heart, Share, User, Envelope, Lock, Gear, House, Trash, Pencil, Check } from '@phosphor-icons/react' -import { - Heading, - Text, - Link, - ActionButton, - IconButton, - StatusBadge, - Chip, - Dot, - Avatar, - Code, - Kbd, - Alert, - Spinner, - ProgressBar, - Skeleton, - Label, - HelperText, - Container, - Section, - Stack, - Spacer, - Divider, - Timestamp, - Tag, - BreadcrumbNav, - IconText, - TextArea, - Input, - Toggle, - RadioGroup, - Checkbox, - Slider, - ColorSwatch, - Stepper, - Rating, - Timeline, - FileUpload, - Tabs, - Accordion, - Card, - Notification, - CopyButton, - PasswordInput, - BasicSearchInput, - Select, - Table, -} from '@/components/atoms' +import { House, Pencil, User } from '@phosphor-icons/react' +import showcaseCopy from '@/data/atomic-showcase/showcase.json' +import tabsCopy from '@/data/atomic-showcase/tabs.json' +import { FormsTab } from '@/components/atomic-showcase/FormsTab' +import { DisplayTab } from '@/components/atomic-showcase/DisplayTab' +import { TypographyTab } from '@/components/atomic-showcase/TypographyTab' +import { Container, Heading, Section, Stack, Tabs, Text } from '@/components/atoms' + +const tabIcons = { + house: , + pencil: , + user: , +} export function AtomicComponentShowcase() { const [toggleValue, setToggleValue] = useState(false) @@ -63,469 +27,53 @@ export function AtomicComponentShowcase() { const [activeTab, setActiveTab] = useState('typography') const [selectedColor, setSelectedColor] = useState('#8b5cf6') - const tableData = [ - { id: 1, name: 'John Doe', email: 'john@example.com', status: 'active' }, - { id: 2, name: 'Jane Smith', email: 'jane@example.com', status: 'inactive' }, - { id: 3, name: 'Bob Johnson', email: 'bob@example.com', status: 'active' }, - ] - - const tabs = [ - { id: 'typography', label: 'Typography', icon: }, - { id: 'forms', label: 'Forms', icon: }, - { id: 'display', label: 'Display', icon: }, - ] + const tabs = tabsCopy.map((tab) => ({ + ...tab, + icon: tabIcons[tab.icon as keyof typeof tabIcons], + })) return (
- Atomic Component Library - - A comprehensive showcase of all available atomic components - + {showcaseCopy.title} + {showcaseCopy.description}
- {activeTab === 'typography' && ( - - - - Typography Components - - - - Headings - Heading Level 1 - Heading Level 2 - Heading Level 3 - - - - - - Text Variants - Body text with default styling - Muted text for less emphasis - Caption text for descriptions - Small text for fine print - - - - - - Links & Code - Default Link - Accent Link - npm install react -
Press Ctrl + K to search
-
-
-
- - - - Badges & Indicators - - - - Status Badges - - - - - - - - - - - - Tags - - Default - Primary - Secondary - Accent - Destructive - - - - - Dots - - - - - - - - - - - - Chips - - React - TypeScript - Tailwind - - - - - - - - Feedback Components - - - - This is an informational message - - - Operation completed successfully - - - Please review this warning - - - Something went wrong - - - {}} - /> - - - Loading States - - - - - - - - - Progress Bar - - - - - - - Skeleton Loaders - - - - - - - - - - - - -
- )} + {activeTab === 'typography' && } {activeTab === 'forms' && ( - - - - Form Components - - - setInputValue(e.target.value)} - leftIcon={} - helperText="Enter your email address" - /> - - - - - -