/** * UI Elements Showcase Page * * Single source of truth for all UI components from components/ui/ * This page is non-indexable and serves as documentation/reference * * Route: /ui-elements */ import React, { useState } from 'react'; import PageMeta from '../components/common/PageMeta'; // ============================================================================ // UI COMPONENTS - All imports from components/ui/ (SINGLE SOURCE OF TRUTH) // ============================================================================ // Accordion import { Accordion, AccordionItem } from '../components/ui/accordion/Accordion'; // Alert import Alert from '../components/ui/alert/Alert'; import AlertModal from '../components/ui/alert/AlertModal'; // Avatar import Avatar from '../components/ui/avatar/Avatar'; // Badge import Badge from '../components/ui/badge/Badge'; // Breadcrumb import { Breadcrumb } from '../components/ui/breadcrumb/Breadcrumb'; // Button import Button from '../components/ui/button/Button'; import ButtonWithTooltip from '../components/ui/button/ButtonWithTooltip'; import IconButton from '../components/ui/button/IconButton'; // Button Group import { ButtonGroup, ButtonGroupItem } from '../components/ui/button-group/ButtonGroup'; // Card import { Card, CardImage, CardTitle, CardContent, CardDescription, CardAction, CardIcon, HorizontalCard } from '../components/ui/card/Card'; // DataView import { DataView, DataViewHeader, DataViewToolbar, DataViewEmptyState } from '../components/ui/dataview/DataView'; // Dropdown import { Dropdown } from '../components/ui/dropdown/Dropdown'; import { DropdownItem } from '../components/ui/dropdown/DropdownItem'; // List import { List, ListItem, ListDot, ListIcon, ListCheckboxItem, ListRadioItem } from '../components/ui/list/List'; // Modal import { Modal } from '../components/ui/modal'; // Pagination import { Pagination } from '../components/ui/pagination/Pagination'; import { CompactPagination } from '../components/ui/pagination/CompactPagination'; // Progress import { ProgressBar } from '../components/ui/progress/ProgressBar'; // Ribbon import { Ribbon } from '../components/ui/ribbon/Ribbon'; // Spinner import { Spinner } from '../components/ui/spinner/Spinner'; // Table import { Table, TableHeader, TableBody, TableRow, TableCell } from '../components/ui/table'; // Tabs import { Tabs, TabList, Tab, TabPanel } from '../components/ui/tabs/Tabs'; // Toast import { useToast } from '../components/ui/toast/ToastContainer'; // Tooltip import { Tooltip } from '../components/ui/tooltip/Tooltip'; import { EnhancedTooltip } from '../components/ui/tooltip/EnhancedTooltip'; // Icons for demos import { CheckCircleIcon, CloseIcon, PlusIcon, ArrowRightIcon, GridIcon, FileIcon, BoltIcon, } from '../icons'; // Component categories for navigation const CATEGORIES = [ { id: 'buttons', label: 'Buttons' }, { id: 'badges', label: 'Badges' }, { id: 'cards', label: 'Cards' }, { id: 'alerts', label: 'Alerts' }, { id: 'modals', label: 'Modals' }, { id: 'tables', label: 'Tables' }, { id: 'tabs', label: 'Tabs' }, { id: 'accordion', label: 'Accordion' }, { id: 'dropdown', label: 'Dropdown' }, { id: 'pagination', label: 'Pagination' }, { id: 'progress', label: 'Progress' }, { id: 'spinner', label: 'Spinner' }, { id: 'avatar', label: 'Avatar' }, { id: 'breadcrumb', label: 'Breadcrumb' }, { id: 'list', label: 'List' }, { id: 'tooltip', label: 'Tooltip' }, { id: 'ribbon', label: 'Ribbon' }, { id: 'toast', label: 'Toast' }, { id: 'dataview', label: 'DataView' }, ]; // Section wrapper component function Section({ id, title, children }: { id: string; title: string; children: React.ReactNode }) { return (

{title}

{children}
); } // Demo box component function DemoBox({ label, children }: { label: string; children: React.ReactNode }) { return (

{label}

{children}
); } export default function UIElements() { const toast = useToast(); // Modal states const [showModal, setShowModal] = useState(false); const [showAlertModal, setShowAlertModal] = useState(false); // Dropdown state const [dropdownOpen, setDropdownOpen] = useState(false); const dropdownRef = React.useRef(null); // Pagination state const [currentPage, setCurrentPage] = useState(1); const [pageSize, setPageSize] = useState(10); // Tabs state const [activeTab, setActiveTab] = useState('tab1'); // List state const [checkboxChecked, setCheckboxChecked] = useState(false); const [radioValue, setRadioValue] = useState('option1'); // Button group state const [activeButton, setActiveButton] = useState(0); return ( <>
{/* Sticky Navigation */} {/* Main Content */}

UI Elements Library

Single source of truth for all UI components. All components are imported from components/ui/

{/* ================================================================ */} {/* BUTTONS */} {/* ================================================================ */}
Disabled with Tooltip setActiveButton(0)}>Day setActiveButton(1)}>Week setActiveButton(2)}>Month } variant="solid" tone="brand" title="Add" /> } variant="outline" tone="brand" title="Add" /> } variant="ghost" tone="brand" title="Add" /> } size="xs" title="Close" /> } size="sm" title="Close" /> } size="md" title="Close" /> } size="lg" title="Close" /> } shape="rounded" variant="solid" tone="success" title="Approve" /> } shape="circle" variant="solid" tone="success" title="Approve" /> } variant="ghost" tone="brand" title="Brand" /> } variant="ghost" tone="success" title="Success" /> } variant="ghost" tone="warning" title="Warning" /> } variant="ghost" tone="danger" title="Danger" /> } variant="ghost" tone="neutral" title="Neutral" />
{/* ================================================================ */} {/* BADGES */} {/* ================================================================ */}
Solid Soft Outline Light Brand Success Warning Danger Info Neutral XS SM MD } tone="success">Completed } tone="danger">Remove
{/* ================================================================ */} {/* CARDS */} {/* ================================================================ */}
Surface Card Panel Card Small Padding Large Padding Card Title Card description text goes here View More
{/* ================================================================ */} {/* ALERTS */} {/* ================================================================ */}
setShowAlertModal(false)} variant="warning" title="Confirm Action" message="Are you sure you want to proceed?" isConfirmation={true} onConfirm={() => setShowAlertModal(false)} />
{/* ================================================================ */} {/* MODALS */} {/* ================================================================ */}
setShowModal(false)}>

Modal Title

This is modal content. You can put any React components here.

{/* ================================================================ */} {/* TABLES */} {/* ================================================================ */}
Name Status Date Item One Active Jan 1, 2024 Item Two Pending Jan 2, 2024
{/* ================================================================ */} {/* TABS */} {/* ================================================================ */}
Tab One Tab Two Tab Three
Content for Tab One
Content for Tab Two
Content for Tab Three
{/* ================================================================ */} {/* ACCORDION */} {/* ================================================================ */}
Content for section one goes here. Content for section two goes here. Content for section three goes here.
{/* ================================================================ */} {/* DROPDOWN */} {/* ================================================================ */} {/* ================================================================ */} {/* PAGINATION */} {/* ================================================================ */}
{/* ================================================================ */} {/* PROGRESS */} {/* ================================================================ */}
{/* ================================================================ */} {/* SPINNER */} {/* ================================================================ */}
{/* ================================================================ */} {/* AVATAR */} {/* ================================================================ */}
{/* ================================================================ */} {/* BREADCRUMB */} {/* ================================================================ */} {/* ================================================================ */} {/* LIST */} {/* ================================================================ */}
Item One Item Two Item Three
{/* ================================================================ */} {/* TOOLTIP */} {/* ================================================================ */}
Rich Content

With multiple lines

} > {/* ================================================================ */} {/* RIBBON */} {/* ================================================================ */}
Card with ribbon
{/* ================================================================ */} {/* TOAST */} {/* ================================================================ */}
{/* ================================================================ */} {/* DATAVIEW */} {/* ================================================================ */}
Action} />
Data content goes here...
Add Item} />
); }