/**
* 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 (
);
}
// Demo box component
function DemoBox({ label, children }: { label: string; children: React.ReactNode }) {
return (
);
}
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 */}
{/* ================================================================ */}
{/* ================================================================ */}
{/* 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(true)}>Open Alert Modal
setShowAlertModal(false)}
variant="warning"
title="Confirm Action"
message="Are you sure you want to proceed?"
isConfirmation={true}
onConfirm={() => setShowAlertModal(false)}
/>
{/* ================================================================ */}
{/* MODALS */}
{/* ================================================================ */}
setShowModal(true)}>Open Modal
setShowModal(false)}>
Modal Title
This is modal content. You can put any React components here.
setShowModal(false)}>Cancel
setShowModal(false)}>Confirm
{/* ================================================================ */}
{/* 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 */}
{/* ================================================================ */}
setDropdownOpen(!dropdownOpen)}>
Open Dropdown
setDropdownOpen(false)}
anchorRef={dropdownRef}
>
setDropdownOpen(false)}>Option One
setDropdownOpen(false)}>Option Two
setDropdownOpen(false)}>Option Three
{/* ================================================================ */}
{/* PAGINATION */}
{/* ================================================================ */}
{/* ================================================================ */}
{/* PROGRESS */}
{/* ================================================================ */}
{/* ================================================================ */}
{/* SPINNER */}
{/* ================================================================ */}
{/* ================================================================ */}
{/* AVATAR */}
{/* ================================================================ */}
{/* ================================================================ */}
{/* BREADCRUMB */}
{/* ================================================================ */}
},
{ label: 'Category', path: '/category' },
{ label: 'Current Page' },
]} />
{/* ================================================================ */}
{/* LIST */}
{/* ================================================================ */}
Item One
Item Two
Item Three
{/* ================================================================ */}
{/* TOOLTIP */}
{/* ================================================================ */}
}
>
Hover Me
{/* ================================================================ */}
{/* RIBBON */}
{/* ================================================================ */}
{/* ================================================================ */}
{/* TOAST */}
{/* ================================================================ */}
toast.success('Success', 'Operation completed!')}>
Show Success
toast.error('Error', 'Something went wrong!')} tone="danger">
Show Error
toast.warning('Warning', 'Please review!')} tone="warning">
Show Warning
toast.info('Info', 'Here is some information')} variant="outline">
Show Info
{/* ================================================================ */}
{/* DATAVIEW */}
{/* ================================================================ */}
Action}
/>
Filter
Sort
Data content goes here...
Add Item}
/>
>
);
}