Card content here
" footer_content="" class="additional-classes" %} ``` ### Input Component ```django {% include "components/ui/input.html" with name="field_name" label="Field Label" type="text" {# text|email|password|number|textarea #} placeholder="Placeholder text" value="" required=False disabled=False error="Error message" hint="Helper text" %} ``` ### Dialog/Modal Component ```django {% include "components/ui/dialog.html" with id="modal-id" title="Dialog Title" description="Optional description" content="Dialog content
" footer="" size="default" {# sm|default|lg|xl|full #} closable=True open=True %} ``` ### Icon Component ```django {% include "components/ui/icon.html" with name="search" {# Icon name from library #} size="md" {# xs|sm|md|lg|xl #} class="text-primary" {# Additional classes #} %} ``` Available icons: search, menu, close, chevron-up, chevron-down, chevron-left, chevron-right, arrow-up, arrow-down, arrow-left, arrow-right, user, users, settings, cog, heart, heart-filled, star, star-filled, home, edit, trash, copy, external-link, download, upload, check, check-circle, x-circle, info, warning, error, plus, minus, filter, sort, calendar, clock, map-pin, phone, mail, globe, link, image, camera, play, pause, volume, bell, bookmark, share, refresh, eye, eye-off, lock, unlock, sun, moon, loader ## Utility Classes ### Responsive Utilities ```css /* Visibility */ .hidden-mobile /* Hidden on mobile */ .hidden-sm /* Hidden on sm breakpoint */ .show-mobile /* Only visible on mobile */ .show-lg /* Only visible on lg breakpoint */ /* Grid */ .grid-responsive-2 /* 1 col mobile, 2 cols sm+ */ .grid-responsive-3 /* 1 col mobile, 2 cols sm+, 3 cols lg+ */ .grid-responsive-4 /* 1 col mobile, 2 cols sm+, 4 cols lg+ */ .grid-auto-fit /* Auto-fit grid with 300px min */ /* Flex */ .stack-to-row /* Column on mobile, row on sm+ */ .stack-to-row-lg /* Column on mobile/tablet, row on lg+ */ /* Spacing */ .py-responsive /* 16px mobile, 24px sm, 32px lg */ .px-responsive /* Same for horizontal */ .gap-responsive /* Responsive gap */ ``` ### Container Classes ```css .container /* max-width: 1280px */ .container-sm /* max-width: 640px */ .container-md /* max-width: 768px */ .container-lg /* max-width: 1024px */ .container-xl /* max-width: 1280px */ .container-2xl /* max-width: 1536px */ ``` ### Accessibility Utilities ```css .sr-only /* Visually hidden, screen reader accessible */ .sr-only-focusable /* sr-only that becomes visible on focus */ .focus-ring /* Focus ring on :focus-visible */ .touch-target /* Minimum 44x44px touch target */ .skip-link /* Skip to content link */ ``` ## Alpine.js Stores ### Theme Store ```javascript // Access Alpine.store('theme') // Properties $store.theme.isDark // Current theme state $store.theme.systemTheme // System preference // Methods $store.theme.toggle() // Toggle theme $store.theme.set('dark') // Set specific theme ``` ### Toast Store ```javascript // Show notifications Alpine.store('toast').show('Message', 'success') Alpine.store('toast').success('Success message') Alpine.store('toast').error('Error message') Alpine.store('toast').warning('Warning message') Alpine.store('toast').info('Info message') ``` ### Auth Store ```javascript // Access current user $store.auth.user // User object or null $store.auth.isLoggedIn // Boolean $store.auth.hasPermission('permission_name') ``` ### UI Store ```javascript // Modal management Alpine.store('ui').openModal('modal-id') Alpine.store('ui').closeModal('modal-id') Alpine.store('ui').isModalOpen('modal-id') // Sidebar Alpine.store('ui').toggleSidebar() $store.ui.isSidebarOpen ``` ## Dark Mode Dark mode is automatically supported through CSS custom properties. Toggle with: ```html ``` Or use the theme toggle component in the navbar. ## Accessibility ### Focus Management All interactive elements have visible focus indicators using `:focus-visible`. Custom focus rings can be added with `.focus-ring`. ### Reduced Motion Animations are automatically disabled for users who prefer reduced motion: ```css @media (prefers-reduced-motion: reduce) { * { animation-duration: 0.01ms !important; } } ``` ### Screen Reader Support Use `.sr-only` for screen reader text: ```html ``` ### Touch Targets Ensure interactive elements meet minimum touch target size (44x44px): ```html ``` ## Testing Visit `/design-system-test/` (development only) to see all components rendered with their various states and options. ## Migration from Legacy System If migrating from the legacy system: 1. Replace HSL color variables with design token references 2. Replace Font Awesome icons with `{% include "components/ui/icon.html" %}` 3. Update button classes from `.btn-primary` to the button component 4. Replace inline Alpine.js stores with centralized stores from `stores/index.js` 5. Update responsive classes to use new utility classes See `MIGRATION.md` for detailed migration steps.