81e8c85280
- Create components-showcase.html with all Bootstrap 5 components - Dark mode support with localStorage persistence - Interactive theme toggle button - Complete style guide documentation in STYLE_GUIDE.md Components included: ✅ Color palette (primary, secondary, success, danger, warning, info) ✅ Buttons (variants, sizes, states, groups) ✅ Cards (basic, with badges, hover effects) ✅ Badges (variants, pill shapes) ✅ Alerts (all variants, dismissible) ✅ Forms (inputs, selects, textarea, validation) ✅ Checkboxes & Radio buttons ✅ Tables (striped, hover, bordered, pagination) ✅ Typography (headings, text styles) ✅ Utilities (spacing, display, flexbox, text, colors, borders, shadows) ✅ Dark mode demonstration ✅ Responsive breakpoints guide Style guide includes: 📖 Complete component documentation 🎨 Color system reference 📝 Code examples for all components 📱 Responsive design patterns 🌙 Dark mode implementation ✅ Best practices & accessibility Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
554 lines
21 KiB
HTML
554 lines
21 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en" data-bs-theme="light">
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Component Library | SmartAdmin Bootstrap 5</title>
|
|
<meta name="description" content="SmartAdmin Bootstrap 5 Component Library">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, maximum-scale=5">
|
|
|
|
<link rel="icon" href="img/favicon-32x32.png" type="image/png" sizes="32x32">
|
|
|
|
<!-- SmartAdmin Bootstrap 5 - Modular CSS -->
|
|
<link rel="stylesheet" media="screen, print" href="css/base.css">
|
|
<link rel="stylesheet" media="screen, print" href="css/components.css">
|
|
<link rel="stylesheet" media="screen, print" href="css/forms.css">
|
|
<link rel="stylesheet" media="screen, print" href="css/tables.css">
|
|
<link rel="stylesheet" media="screen, print" href="css/layout.css">
|
|
<link rel="stylesheet" media="screen, print" href="css/darkmode.css">
|
|
<link rel="stylesheet" media="screen, print" href="css/responsive.css">
|
|
<link rel="stylesheet" media="screen, print" href="css/utilities.css">
|
|
|
|
<!-- Vendor CSS -->
|
|
<link rel="stylesheet" media="screen, print" href="plugins/waves/waves.min.css">
|
|
<link rel="stylesheet" media="screen, print" href="css/smartapp.min.css">
|
|
|
|
<!-- Icons -->
|
|
<link rel="stylesheet" media="screen, print" href="webfonts/smartadmin/sa-icons.css">
|
|
<link rel="stylesheet" media="screen, print" href="webfonts/fontawesome/fontawesome.css">
|
|
|
|
<style>
|
|
body {
|
|
padding: 2rem 0;
|
|
}
|
|
|
|
.section {
|
|
margin-bottom: 4rem;
|
|
padding: 2rem;
|
|
border-bottom: 2px solid var(--bs-gray-200);
|
|
}
|
|
|
|
.section h2 {
|
|
margin-top: 0;
|
|
margin-bottom: 1.5rem;
|
|
font-size: 1.75rem;
|
|
font-weight: 700;
|
|
color: var(--bs-primary);
|
|
}
|
|
|
|
.section h3 {
|
|
margin-top: 2rem;
|
|
margin-bottom: 1rem;
|
|
font-size: 1.25rem;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.component-group {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
|
gap: 2rem;
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
.component-demo {
|
|
padding: 1.5rem;
|
|
background-color: var(--bs-gray-50);
|
|
border-radius: var(--bs-border-radius-lg);
|
|
border: 1px solid var(--bs-gray-200);
|
|
}
|
|
|
|
[data-bs-theme="dark"] .component-demo {
|
|
background-color: var(--bs-gray-800);
|
|
border-color: var(--bs-gray-700);
|
|
}
|
|
|
|
.component-demo > * + * {
|
|
margin-top: 1rem;
|
|
}
|
|
|
|
.demo-label {
|
|
font-size: 0.8125rem;
|
|
font-weight: 600;
|
|
text-transform: uppercase;
|
|
color: var(--bs-gray-600);
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
.button-group {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 0.5rem;
|
|
align-items: center;
|
|
}
|
|
|
|
.color-swatch {
|
|
display: inline-block;
|
|
width: 40px;
|
|
height: 40px;
|
|
border-radius: var(--bs-border-radius);
|
|
border: 1px solid var(--bs-gray-300);
|
|
vertical-align: middle;
|
|
margin-right: 0.5rem;
|
|
}
|
|
|
|
.color-palette {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
|
|
gap: 1rem;
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
.color-item {
|
|
text-align: center;
|
|
}
|
|
|
|
.color-item strong {
|
|
display: block;
|
|
font-size: 0.875rem;
|
|
margin-top: 0.5rem;
|
|
}
|
|
|
|
.container {
|
|
max-width: 1320px;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
header {
|
|
background: linear-gradient(135deg, var(--bs-primary) 0%, #1565c0 100%);
|
|
color: white;
|
|
padding: 3rem 2rem;
|
|
margin-bottom: 3rem;
|
|
text-align: center;
|
|
}
|
|
|
|
header h1 {
|
|
margin: 0;
|
|
font-size: 2.5rem;
|
|
font-weight: 700;
|
|
}
|
|
|
|
header p {
|
|
margin: 0.5rem 0 0 0;
|
|
font-size: 1.125rem;
|
|
opacity: 0.9;
|
|
}
|
|
|
|
.theme-toggle {
|
|
position: fixed;
|
|
top: 2rem;
|
|
right: 2rem;
|
|
z-index: 1000;
|
|
}
|
|
|
|
.theme-toggle .btn {
|
|
border-radius: 50%;
|
|
width: 50px;
|
|
height: 50px;
|
|
padding: 0;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
box-shadow: var(--bs-box-shadow-lg);
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.component-group {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
|
|
header h1 {
|
|
font-size: 1.75rem;
|
|
}
|
|
|
|
.section {
|
|
padding: 1rem;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<!-- Theme Toggle -->
|
|
<div class="theme-toggle">
|
|
<button class="btn btn-primary" id="themeToggle" title="Toggle Dark Mode">
|
|
<i class="fa-solid fa-moon"></i>
|
|
</button>
|
|
</div>
|
|
|
|
<!-- Header -->
|
|
<header>
|
|
<h1>SmartAdmin Bootstrap 5</h1>
|
|
<p>Component Library & Style Guide</p>
|
|
</header>
|
|
|
|
<div class="container">
|
|
<!-- Colors Section -->
|
|
<section class="section">
|
|
<h2>🎨 Color Palette</h2>
|
|
|
|
<h3>Primary Colors</h3>
|
|
<div class="color-palette">
|
|
<div class="color-item">
|
|
<div class="color-swatch" style="background-color: var(--bs-primary);"></div>
|
|
<strong>Primary</strong>
|
|
<small>#2196f3</small>
|
|
</div>
|
|
<div class="color-item">
|
|
<div class="color-swatch" style="background-color: var(--bs-secondary);"></div>
|
|
<strong>Secondary</strong>
|
|
<small>#757575</small>
|
|
</div>
|
|
<div class="color-item">
|
|
<div class="color-swatch" style="background-color: var(--bs-success);"></div>
|
|
<strong>Success</strong>
|
|
<small>#4caf50</small>
|
|
</div>
|
|
<div class="color-item">
|
|
<div class="color-swatch" style="background-color: var(--bs-danger);"></div>
|
|
<strong>Danger</strong>
|
|
<small>#f44336</small>
|
|
</div>
|
|
<div class="color-item">
|
|
<div class="color-swatch" style="background-color: var(--bs-warning);"></div>
|
|
<strong>Warning</strong>
|
|
<small>#ff9800</small>
|
|
</div>
|
|
<div class="color-item">
|
|
<div class="color-swatch" style="background-color: var(--bs-info);"></div>
|
|
<strong>Info</strong>
|
|
<small>#00bcd4</small>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- Buttons Section -->
|
|
<section class="section">
|
|
<h2>🔘 Buttons</h2>
|
|
|
|
<h3>Button Variants</h3>
|
|
<div class="component-group">
|
|
<div class="component-demo">
|
|
<div class="demo-label">Primary</div>
|
|
<button class="btn btn-primary">Primary Button</button>
|
|
<button class="btn btn-primary btn-sm">Small</button>
|
|
<button class="btn btn-primary btn-lg">Large</button>
|
|
</div>
|
|
<div class="component-demo">
|
|
<div class="demo-label">Success</div>
|
|
<button class="btn btn-success">Success Button</button>
|
|
<button class="btn btn-success btn-sm">Small</button>
|
|
<button class="btn btn-success" disabled>Disabled</button>
|
|
</div>
|
|
<div class="component-demo">
|
|
<div class="demo-label">Danger</div>
|
|
<button class="btn btn-danger">Danger Button</button>
|
|
<button class="btn btn-danger btn-sm">Small</button>
|
|
<button class="btn btn-danger" disabled>Disabled</button>
|
|
</div>
|
|
<div class="component-demo">
|
|
<div class="demo-label">Warning</div>
|
|
<button class="btn btn-warning">Warning Button</button>
|
|
<button class="btn btn-warning btn-sm">Small</button>
|
|
<button class="btn btn-warning" disabled>Disabled</button>
|
|
</div>
|
|
</div>
|
|
|
|
<h3>Button Group</h3>
|
|
<div class="component-demo">
|
|
<div class="btn-group" role="group">
|
|
<button type="button" class="btn btn-primary">Left</button>
|
|
<button type="button" class="btn btn-primary">Middle</button>
|
|
<button type="button" class="btn btn-primary">Right</button>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- Cards Section -->
|
|
<section class="section">
|
|
<h2>📇 Cards</h2>
|
|
<div class="component-group">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
Card Header
|
|
</div>
|
|
<div class="card-body">
|
|
<h5 class="card-title">Card Title</h5>
|
|
<p class="card-text">This is a sample card body with some content.</p>
|
|
<button class="btn btn-primary btn-sm">Learn More</button>
|
|
</div>
|
|
</div>
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Simple Card</h5>
|
|
<p class="card-text">Card without header or footer.</p>
|
|
</div>
|
|
<div class="card-footer">
|
|
Card Footer
|
|
</div>
|
|
</div>
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Card with Badge</h5>
|
|
<p class="card-text">
|
|
<span class="badge badge-primary">Primary</span>
|
|
<span class="badge badge-success">Success</span>
|
|
<span class="badge badge-danger">Danger</span>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- Badges Section -->
|
|
<section class="section">
|
|
<h2>🏷️ Badges</h2>
|
|
<div class="component-group">
|
|
<div class="component-demo">
|
|
<div class="demo-label">Badge Variants</div>
|
|
<span class="badge badge-primary me-2">Primary</span>
|
|
<span class="badge badge-success me-2">Success</span>
|
|
<span class="badge badge-danger me-2">Danger</span>
|
|
<span class="badge badge-warning me-2">Warning</span>
|
|
<span class="badge badge-info">Info</span>
|
|
</div>
|
|
<div class="component-demo">
|
|
<div class="demo-label">Pill Badges</div>
|
|
<span class="badge badge-primary badge-pill me-2">Primary</span>
|
|
<span class="badge badge-success badge-pill me-2">Success</span>
|
|
<span class="badge badge-danger badge-pill">Danger</span>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- Alerts Section -->
|
|
<section class="section">
|
|
<h2>⚠️ Alerts</h2>
|
|
<div class="component-group" style="grid-template-columns: 1fr;">
|
|
<div class="alert alert-primary">
|
|
<i class="fa-solid fa-info-circle me-2"></i>
|
|
<strong>Info Alert:</strong> This is an informational message.
|
|
</div>
|
|
<div class="alert alert-success">
|
|
<i class="fa-solid fa-check-circle me-2"></i>
|
|
<strong>Success Alert:</strong> Operation completed successfully!
|
|
</div>
|
|
<div class="alert alert-warning">
|
|
<i class="fa-solid fa-exclamation-triangle me-2"></i>
|
|
<strong>Warning Alert:</strong> Please be careful with this action.
|
|
</div>
|
|
<div class="alert alert-danger">
|
|
<i class="fa-solid fa-exclamation-circle me-2"></i>
|
|
<strong>Danger Alert:</strong> An error occurred, please try again.
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- Forms Section -->
|
|
<section class="section">
|
|
<h2>📝 Forms</h2>
|
|
|
|
<h3>Input Fields</h3>
|
|
<div class="component-demo" style="max-width: 400px;">
|
|
<div class="form-group">
|
|
<label class="form-label required">Text Input</label>
|
|
<input type="text" class="form-control" placeholder="Enter text">
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="form-label">Email Input</label>
|
|
<input type="email" class="form-control" placeholder="user@example.com">
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="form-label">Password Input</label>
|
|
<input type="password" class="form-control" placeholder="••••••••">
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="form-label">Select</label>
|
|
<select class="form-select">
|
|
<option>Choose option</option>
|
|
<option>Option 1</option>
|
|
<option>Option 2</option>
|
|
<option>Option 3</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="form-label">Textarea</label>
|
|
<textarea class="form-control" rows="3" placeholder="Enter your message..."></textarea>
|
|
</div>
|
|
</div>
|
|
|
|
<h3>Checkboxes & Radio</h3>
|
|
<div class="component-demo" style="max-width: 300px;">
|
|
<div class="form-check">
|
|
<input type="checkbox" class="form-check-input" id="check1">
|
|
<label class="form-check-label" for="check1">Checkbox 1</label>
|
|
</div>
|
|
<div class="form-check">
|
|
<input type="checkbox" class="form-check-input" id="check2" checked>
|
|
<label class="form-check-label" for="check2">Checkbox 2 (Checked)</label>
|
|
</div>
|
|
<div class="form-check">
|
|
<input type="radio" class="form-check-input" name="radio" id="radio1" checked>
|
|
<label class="form-check-label" for="radio1">Radio 1</label>
|
|
</div>
|
|
<div class="form-check">
|
|
<input type="radio" class="form-check-input" name="radio" id="radio2">
|
|
<label class="form-check-label" for="radio2">Radio 2</label>
|
|
</div>
|
|
</div>
|
|
|
|
<h3>Form Validation</h3>
|
|
<div class="component-demo" style="max-width: 400px;">
|
|
<div class="form-group">
|
|
<label class="form-label">Valid Input</label>
|
|
<input type="text" class="form-control is-valid" value="Valid input">
|
|
<div class="valid-feedback">Looks good!</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="form-label">Invalid Input</label>
|
|
<input type="text" class="form-control is-invalid" value="Invalid">
|
|
<div class="invalid-feedback">This field is required.</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- Tables Section -->
|
|
<section class="section">
|
|
<h2>📊 Tables</h2>
|
|
<div class="component-demo">
|
|
<table class="table table-striped table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th>ID</th>
|
|
<th>Name</th>
|
|
<th>Email</th>
|
|
<th>Status</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>#001</td>
|
|
<td>John Doe</td>
|
|
<td>john@example.com</td>
|
|
<td><span class="badge badge-success">Active</span></td>
|
|
</tr>
|
|
<tr>
|
|
<td>#002</td>
|
|
<td>Jane Smith</td>
|
|
<td>jane@example.com</td>
|
|
<td><span class="badge badge-success">Active</span></td>
|
|
</tr>
|
|
<tr>
|
|
<td>#003</td>
|
|
<td>Bob Johnson</td>
|
|
<td>bob@example.com</td>
|
|
<td><span class="badge badge-danger">Inactive</span></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- Typography Section -->
|
|
<section class="section">
|
|
<h2>📝 Typography</h2>
|
|
|
|
<h3>Headings</h3>
|
|
<div class="component-demo">
|
|
<h1>Heading 1</h1>
|
|
<h2>Heading 2</h2>
|
|
<h3>Heading 3</h3>
|
|
<h4>Heading 4</h4>
|
|
<h5>Heading 5</h5>
|
|
<h6>Heading 6</h6>
|
|
</div>
|
|
|
|
<h3>Text Styles</h3>
|
|
<div class="component-demo">
|
|
<p><strong>Bold Text:</strong> Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
|
|
<p><em>Italic Text:</em> Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
|
|
<p><u>Underlined Text:</u> Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
|
|
<p><del>Deleted Text:</del> Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
|
|
<p><small>Small Text:</small> Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- Utilities Section -->
|
|
<section class="section">
|
|
<h2>⚙️ Utilities</h2>
|
|
|
|
<h3>Text Alignment</h3>
|
|
<div class="component-demo">
|
|
<p class="text-start">Left aligned text</p>
|
|
<p class="text-center">Center aligned text</p>
|
|
<p class="text-end">Right aligned text</p>
|
|
</div>
|
|
|
|
<h3>Text Colors</h3>
|
|
<div class="component-demo">
|
|
<p class="text-primary">Primary text</p>
|
|
<p class="text-success">Success text</p>
|
|
<p class="text-danger">Danger text</p>
|
|
<p class="text-warning">Warning text</p>
|
|
<p class="text-muted">Muted text</p>
|
|
</div>
|
|
|
|
<h3>Background Colors</h3>
|
|
<div class="component-demo">
|
|
<div class="bg-primary text-white p-3 mb-2">Primary Background</div>
|
|
<div class="bg-success text-white p-3 mb-2">Success Background</div>
|
|
<div class="bg-danger text-white p-3 mb-2">Danger Background</div>
|
|
<div class="bg-warning text-white p-3 mb-2">Warning Background</div>
|
|
</div>
|
|
</section>
|
|
|
|
</div>
|
|
|
|
<script>
|
|
// Theme Toggle
|
|
const themeToggle = document.getElementById('themeToggle');
|
|
const html = document.documentElement;
|
|
|
|
// Check saved preference
|
|
const savedTheme = localStorage.getItem('theme') || 'light';
|
|
html.setAttribute('data-bs-theme', savedTheme);
|
|
updateThemeIcon();
|
|
|
|
themeToggle.addEventListener('click', () => {
|
|
const currentTheme = html.getAttribute('data-bs-theme');
|
|
const newTheme = currentTheme === 'light' ? 'dark' : 'light';
|
|
html.setAttribute('data-bs-theme', newTheme);
|
|
localStorage.setItem('theme', newTheme);
|
|
updateThemeIcon();
|
|
});
|
|
|
|
function updateThemeIcon() {
|
|
const currentTheme = html.getAttribute('data-bs-theme');
|
|
const icon = themeToggle.querySelector('i');
|
|
if (currentTheme === 'dark') {
|
|
icon.classList.remove('fa-moon');
|
|
icon.classList.add('fa-sun');
|
|
themeToggle.classList.remove('btn-primary');
|
|
themeToggle.classList.add('btn-warning');
|
|
} else {
|
|
icon.classList.add('fa-moon');
|
|
icon.classList.remove('fa-sun');
|
|
themeToggle.classList.add('btn-primary');
|
|
themeToggle.classList.remove('btn-warning');
|
|
}
|
|
}
|
|
</script>
|
|
</body>
|
|
|
|
</html>
|