UNPKG

vj-ui-components

Version:

A collection of beautiful, customizable React UI components including versatile navigation with dual layout support (sidebar/top), stylish input fields with icon support, advanced search with recommendations and autocomplete, elegant modals with animation

463 lines (390 loc) 8.52 kB
/* Modal Component Styles */ .ui-modal-backdrop { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 1050; display: flex; align-items: center; justify-content: center; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } .ui-modal-content { position: relative; display: flex; flex-direction: column; overflow: hidden; outline: none; } /* Header Styles */ .ui-modal-header { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; } .ui-modal-header h1, .ui-modal-header h2, .ui-modal-header h3, .ui-modal-header h4, .ui-modal-header h5, .ui-modal-header h6 { margin: 0; flex: 1; line-height: 1.4; } /* Body Styles */ .ui-modal-body { flex: 1; min-height: 0; line-height: 1.6; } .ui-modal-body::-webkit-scrollbar { width: 6px; } .ui-modal-body::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.05); border-radius: 3px; } .ui-modal-body::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.2); border-radius: 3px; } .ui-modal-body::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.3); } /* Footer Styles */ .ui-modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-shrink: 0; } /* Button Styles */ .ui-modal-button { padding: 8px 16px; border-radius: 8px; border: none; font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: all 0.2s ease; font-family: inherit; display: inline-flex; align-items: center; justify-content: center; min-width: 80px; } .ui-modal-button:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); } .ui-modal-button:active { transform: translateY(0); } .ui-modal-button:focus { outline: 2px solid currentColor; outline-offset: 2px; } /* Close Button */ .ui-modal-close { background: none; border: none; cursor: pointer; padding: 8px; border-radius: 6px; display: flex; align-items: center; opacity: 0.7; transition: all 0.2s ease; } .ui-modal-close:hover { opacity: 1; background: rgba(220, 38, 38, 0.1); color: #dc2626; transform: scale(1.1); } .ui-modal-close:active { transform: scale(0.95); } /* Maximize Button */ .ui-modal-maximize { background: none; border: none; cursor: pointer; padding: 8px; border-radius: 6px; display: flex; align-items: center; opacity: 0.7; transition: all 0.2s ease; } .ui-modal-maximize:hover { opacity: 1; background: rgba(0, 0, 0, 0.1); transform: scale(1.1); } .ui-modal-maximize:active { transform: scale(0.95); } /* Animation Classes */ .ui-modal-fade-enter { opacity: 0; } .ui-modal-fade-enter-active { opacity: 1; transition: opacity 300ms ease-in-out; } .ui-modal-fade-exit { opacity: 1; } .ui-modal-fade-exit-active { opacity: 0; transition: opacity 300ms ease-in-out; } .ui-modal-scale-enter { opacity: 0; transform: scale(0.95); } .ui-modal-scale-enter-active { opacity: 1; transform: scale(1); transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1); } .ui-modal-scale-exit { opacity: 1; transform: scale(1); } .ui-modal-scale-exit-active { opacity: 0; transform: scale(0.95); transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1); } .ui-modal-slide-up-enter { opacity: 0; transform: translateY(20px); } .ui-modal-slide-up-enter-active { opacity: 1; transform: translateY(0); transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1); } .ui-modal-slide-up-exit { opacity: 1; transform: translateY(0); } .ui-modal-slide-up-exit-active { opacity: 0; transform: translateY(20px); transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1); } /* Size Variants */ .ui-modal-xs .ui-modal-content { width: 90%; max-width: 300px; max-height: 90vh; } .ui-modal-sm .ui-modal-content { width: 90%; max-width: 400px; max-height: 90vh; } .ui-modal-md .ui-modal-content { width: 90%; max-width: 600px; max-height: 90vh; } .ui-modal-lg .ui-modal-content { width: 90%; max-width: 800px; max-height: 90vh; } .ui-modal-xl .ui-modal-content { width: 90%; max-width: 1200px; max-height: 90vh; } .ui-modal-full .ui-modal-content { width: 95vw; height: 95vh; max-width: none; max-height: none; } .ui-modal-fullscreen .ui-modal-content { width: 100vw; height: 100vh; max-width: none; max-height: none; border-radius: 0 !important; margin: 0; } /* Variant Styles */ .ui-modal-glassmorphism .ui-modal-content { backdrop-filter: blur(20px); box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3); } .ui-modal-glassmorphism .ui-modal-header, .ui-modal-glassmorphism .ui-modal-footer { background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(10px); } .ui-modal-minimal .ui-modal-content { background: #ffffff; border: 1px solid #e5e7eb; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); } .ui-modal-minimal .ui-modal-header { border-bottom: 1px solid #e5e7eb; } .ui-modal-minimal .ui-modal-footer { border-top: 1px solid #e5e7eb; } .ui-modal-card .ui-modal-content { background: #ffffff; border: 1px solid #e5e7eb; border-radius: 12px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2); } /* Loading State */ .ui-modal-loading { position: relative; overflow: hidden; } .ui-modal-loading::after { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient( 90deg, transparent, rgba(255, 255, 255, 0.2), transparent ); animation: loading-shine 1.5s infinite; } @keyframes loading-shine { 0% { left: -100%; } 100% { left: 100%; } } /* Focus Trap */ .ui-modal-content:focus { outline: none; } /* Backdrop Effects */ .ui-modal-backdrop-blur { backdrop-filter: blur(4px); } .ui-modal-backdrop-dark { background: rgba(0, 0, 0, 0.7); } .ui-modal-backdrop-light { background: rgba(255, 255, 255, 0.8); } /* Responsive Design */ @media (max-width: 768px) { .ui-modal-backdrop { padding: 16px; align-items: flex-end; } .ui-modal-content { width: 100% !important; max-width: none !important; max-height: 85vh; border-radius: 16px 16px 0 0 !important; } .ui-modal-fullscreen .ui-modal-content { border-radius: 0 !important; max-height: 100vh; } .ui-modal-header, .ui-modal-footer { padding: 16px 20px; } .ui-modal-body { padding: 20px; } .ui-modal-button { min-width: 70px; padding: 10px 16px; } } @media (max-width: 480px) { .ui-modal-backdrop { padding: 8px; } .ui-modal-content { max-height: 90vh; } .ui-modal-header { flex-direction: column; align-items: flex-start; gap: 12px; } .ui-modal-header .ui-modal-controls { align-self: flex-end; } .ui-modal-footer { flex-direction: column-reverse; gap: 8px; } .ui-modal-button { width: 100%; justify-content: center; } } /* Dark Theme Support */ @media (prefers-color-scheme: dark) { .ui-modal-backdrop { background: rgba(0, 0, 0, 0.8); } .ui-modal-content { background: rgba(17, 24, 39, 0.95); color: #f9fafb; } .ui-modal-minimal .ui-modal-content { background: #1f2937; border-color: #374151; } .ui-modal-minimal .ui-modal-header, .ui-modal-minimal .ui-modal-footer { border-color: #374151; } .ui-modal-glassmorphism .ui-modal-content { background: linear-gradient(135deg, rgba(17, 24, 39, 0.95), rgba(31, 41, 55, 0.8)); } } /* High Contrast Mode */ @media (prefers-contrast: high) { .ui-modal-content { border: 2px solid currentColor; } .ui-modal-button { border: 2px solid currentColor; } } /* Reduced Motion */ @media (prefers-reduced-motion: reduce) { .ui-modal-backdrop, .ui-modal-content, .ui-modal-button, .ui-modal-close, .ui-modal-maximize { transition: none; animation: none; } } /* Print Styles */ @media print { .ui-modal-backdrop { display: none; } }