feat: implement CustomSelect component and add global application styles
This commit is contained in:
@@ -10,11 +10,9 @@ export default function CustomSelect({ value, onChange, options, label }) {
|
|||||||
{label && <label>{label}</label>}
|
{label && <label>{label}</label>}
|
||||||
<Listbox value={value} onChange={onChange}>
|
<Listbox value={value} onChange={onChange}>
|
||||||
<div className="relative mt-1">
|
<div className="relative mt-1">
|
||||||
<Listbox.Button className="select-custom text-left flex justify-between items-center w-full">
|
<Listbox.Button className="select-custom text-left w-full">
|
||||||
<span className="block truncate">{selectedOption.name}</span>
|
<span className="block truncate">{selectedOption.name}</span>
|
||||||
<span className="pointer-events-none">
|
<ChevronDown className="h-4 w-4 text-muted pointer-events-none" aria-hidden="true" />
|
||||||
<ChevronDown className="h-4 w-4 text-muted" aria-hidden="true" />
|
|
||||||
</span>
|
|
||||||
</Listbox.Button>
|
</Listbox.Button>
|
||||||
<Transition
|
<Transition
|
||||||
as={Fragment}
|
as={Fragment}
|
||||||
@@ -22,7 +20,7 @@ export default function CustomSelect({ value, onChange, options, label }) {
|
|||||||
leaveFrom="opacity-100"
|
leaveFrom="opacity-100"
|
||||||
leaveTo="opacity-0"
|
leaveTo="opacity-0"
|
||||||
>
|
>
|
||||||
<Listbox.Options className="absolute z-50 mt-1 max-height-60 w-full overflow-auto rounded-md bg-dark-glass py-1 text-base shadow-lg ring-1 ring-white/10 focus:outline-none sm:text-sm backdrop-blur-xl border border-white/10">
|
<Listbox.Options className="absolute z-50 mt-1 max-height-60 w-full overflow-auto bg-dark-glass py-1 focus:outline-none shadow-lg">
|
||||||
{options.map((option) => (
|
{options.map((option) => (
|
||||||
<Listbox.Option
|
<Listbox.Option
|
||||||
key={option.id}
|
key={option.id}
|
||||||
@@ -33,7 +31,7 @@ export default function CustomSelect({ value, onChange, options, label }) {
|
|||||||
}
|
}
|
||||||
value={option.id}
|
value={option.id}
|
||||||
>
|
>
|
||||||
{({ selected, active }) => (
|
{({ selected }) => (
|
||||||
<>
|
<>
|
||||||
<span className={`block truncate ${selected ? 'font-medium' : 'font-normal'}`}>
|
<span className={`block truncate ${selected ? 'font-medium' : 'font-normal'}`}>
|
||||||
{option.name}
|
{option.name}
|
||||||
|
|||||||
+68
-23
@@ -43,10 +43,12 @@ body {
|
|||||||
|
|
||||||
/* Glassmorphism utility */
|
/* Glassmorphism utility */
|
||||||
.glass {
|
.glass {
|
||||||
background: var(--panel-bg);
|
background: rgba(255, 255, 255, 0.03);
|
||||||
backdrop-filter: blur(12px);
|
backdrop-filter: blur(16px);
|
||||||
border: 1px solid var(--glass-border);
|
-webkit-backdrop-filter: blur(16px);
|
||||||
border-radius: 12px;
|
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||||
|
border-radius: 16px;
|
||||||
|
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Custom Titlebar */
|
/* Custom Titlebar */
|
||||||
@@ -268,39 +270,52 @@ body {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
background: rgba(255, 255, 255, 0.05);
|
background: rgba(255, 255, 255, 0.05);
|
||||||
border: 1px solid var(--glass-border);
|
border: 1px solid var(--glass-border);
|
||||||
border-radius: 8px;
|
border-radius: 10px;
|
||||||
padding: 10px 12px;
|
padding: 12px 16px;
|
||||||
color: var(--text-main);
|
color: var(--text-main);
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
outline: none;
|
outline: none;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: border-color 0.2s;
|
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select-custom:hover {
|
||||||
|
background: rgba(255, 255, 255, 0.08);
|
||||||
|
border-color: rgba(0, 242, 255, 0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
.select-custom:focus {
|
.select-custom:focus {
|
||||||
border-color: var(--primary-cyan);
|
border-color: var(--primary-cyan);
|
||||||
|
box-shadow: 0 0 0 2px rgba(0, 242, 255, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-primary {
|
.btn-primary {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 14px;
|
padding: 16px;
|
||||||
border-radius: 30px;
|
border-radius: 12px;
|
||||||
border: none;
|
border: none;
|
||||||
background: linear-gradient(90deg, #8a2be2, #4b0082);
|
background: linear-gradient(135deg, var(--primary-cyan), var(--primary-magenta));
|
||||||
color: white;
|
color: #0b0c14;
|
||||||
font-weight: 600;
|
font-weight: 700;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
letter-spacing: 1px;
|
letter-spacing: 2px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.3s;
|
transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
||||||
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
|
box-shadow: 0 0 20px rgba(0, 242, 255, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-primary:hover {
|
.btn-primary:hover {
|
||||||
transform: translateY(-2px);
|
transform: translateY(-3px) scale(1.02);
|
||||||
box-shadow: 0 6px 20px rgba(138, 43, 226, 0.4);
|
box-shadow: 0 10px 25px rgba(255, 0, 229, 0.4);
|
||||||
filter: brightness(1.2);
|
filter: brightness(1.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-primary:active {
|
||||||
|
transform: translateY(-1px) scale(0.98);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Status Bar */
|
/* Status Bar */
|
||||||
@@ -333,26 +348,40 @@ body {
|
|||||||
/* Custom Select Styles */
|
/* Custom Select Styles */
|
||||||
.relative { position: relative; }
|
.relative { position: relative; }
|
||||||
.absolute { position: absolute; }
|
.absolute { position: absolute; }
|
||||||
|
.inset-y-0 { top: 0; bottom: 0; }
|
||||||
|
.left-0 { left: 0; }
|
||||||
|
.right-0 { right: 0; }
|
||||||
.z-50 { z-index: 50; }
|
.z-50 { z-index: 50; }
|
||||||
.mt-1 { margin-top: 4px; }
|
.mt-1 { margin-top: 4px; }
|
||||||
.w-full { width: 100%; }
|
.w-full { width: 100%; }
|
||||||
|
.flex { display: flex; }
|
||||||
|
.items-center { align-items: center; }
|
||||||
|
.justify-between { justify-content: space-between; }
|
||||||
|
.text-left { text-align: left; }
|
||||||
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||||
|
.block { display: block; }
|
||||||
|
.h-4 { height: 16px; }
|
||||||
|
.w-4 { width: 16px; }
|
||||||
|
|
||||||
.bg-dark-glass {
|
.bg-dark-glass {
|
||||||
background: rgba(15, 15, 25, 0.9);
|
background: rgba(15, 15, 25, 0.95);
|
||||||
backdrop-filter: blur(20px);
|
backdrop-filter: blur(20px);
|
||||||
-webkit-backdrop-filter: blur(20px);
|
-webkit-backdrop-filter: blur(20px);
|
||||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
border: 1px solid rgba(255, 255, 255, 0.15);
|
||||||
border-radius: 10px;
|
border-radius: 12px;
|
||||||
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
|
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.max-height-60 { max-height: 240px; }
|
.max-height-60 { max-height: 240px; }
|
||||||
|
.overflow-auto { overflow: auto; }
|
||||||
|
.rounded-md { border-radius: 8px; }
|
||||||
|
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
|
||||||
.py-1 { padding-top: 4px; padding-bottom: 4px; }
|
.py-1 { padding-top: 4px; padding-bottom: 4px; }
|
||||||
.py-2 { padding-top: 8px; padding-bottom: 8px; }
|
.py-2 { padding-top: 8px; padding-bottom: 8px; }
|
||||||
|
.pl-3 { padding-left: 12px; }
|
||||||
.pl-10 { padding-left: 40px; }
|
.pl-10 { padding-left: 40px; }
|
||||||
.pr-4 { padding-right: 16px; }
|
.pr-4 { padding-right: 16px; }
|
||||||
.pl-3 { padding-left: 12px; }
|
|
||||||
|
|
||||||
.select-none { user-select: none; }
|
.select-none { user-select: none; }
|
||||||
.cursor-default { cursor: default; }
|
.cursor-default { cursor: default; }
|
||||||
@@ -360,6 +389,22 @@ body {
|
|||||||
.font-medium { font-weight: 500; }
|
.font-medium { font-weight: 500; }
|
||||||
|
|
||||||
.text-primary-cyan { color: var(--primary-cyan); }
|
.text-primary-cyan { color: var(--primary-cyan); }
|
||||||
|
.text-white { color: #ffffff; }
|
||||||
|
|
||||||
|
/* Scrollbar styling for dropdown */
|
||||||
|
.bg-dark-glass::-webkit-scrollbar {
|
||||||
|
width: 6px;
|
||||||
|
}
|
||||||
|
.bg-dark-glass::-webkit-scrollbar-track {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
.bg-dark-glass::-webkit-scrollbar-thumb {
|
||||||
|
background: rgba(255, 255, 255, 0.1);
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
.bg-dark-glass::-webkit-scrollbar-thumb:hover {
|
||||||
|
background: rgba(255, 255, 255, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
/* Animation for select dropdown */
|
/* Animation for select dropdown */
|
||||||
.transition { transition-property: opacity, transform; }
|
.transition { transition-property: opacity, transform; }
|
||||||
|
|||||||
Reference in New Issue
Block a user