Tabs: gradientowe wygaszenie krawedzi scrolla - uciety tekst nie styka sie ze strzalka
This commit is contained in:
@@ -266,25 +266,42 @@ export function Tabs({
|
||||
<ChevronLeft className="h-4 w-4" />
|
||||
</button>
|
||||
)}
|
||||
<div
|
||||
ref={scrollRef}
|
||||
onScroll={updateArrows}
|
||||
className="flex min-w-0 flex-1 gap-1 overflow-x-auto [scroll-snap-type:x_mandatory] [scroll-padding-inline:4px] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden"
|
||||
>
|
||||
{tabs.map((t) => (
|
||||
<button
|
||||
key={t.id}
|
||||
type="button"
|
||||
data-tab-id={t.id}
|
||||
data-active={active === t.id || undefined}
|
||||
onClick={() => onChange(t.id)}
|
||||
className={`px-3.5 py-2 rounded-[10px] text-[0.9rem] font-semibold whitespace-nowrap cursor-pointer transition-all duration-150 [scroll-snap-align:start] ${
|
||||
active === t.id ? 'bg-card text-ink border border-line shadow-card' : 'border border-transparent text-dim hover:text-ink'
|
||||
}`}
|
||||
>
|
||||
{t.label}
|
||||
</button>
|
||||
))}
|
||||
<div className="relative min-w-0 flex-1">
|
||||
<div
|
||||
ref={scrollRef}
|
||||
onScroll={updateArrows}
|
||||
className="flex gap-1 overflow-x-auto [scroll-snap-type:x_mandatory] [scroll-padding-inline:4px] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden"
|
||||
>
|
||||
{tabs.map((t) => (
|
||||
<button
|
||||
key={t.id}
|
||||
type="button"
|
||||
data-tab-id={t.id}
|
||||
data-active={active === t.id || undefined}
|
||||
onClick={() => onChange(t.id)}
|
||||
className={`px-3.5 py-2 rounded-[10px] text-[0.9rem] font-semibold whitespace-nowrap cursor-pointer transition-all duration-150 [scroll-snap-align:start] ${
|
||||
active === t.id ? 'bg-card text-ink border border-line shadow-card' : 'border border-transparent text-dim hover:text-ink'
|
||||
}`}
|
||||
>
|
||||
{t.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
{/* miękkie wygaszenie krawędzi — ucięty tekst znika zanim dojdzie do strzałki */}
|
||||
{canPrev && (
|
||||
<div
|
||||
aria-hidden="true"
|
||||
className="pointer-events-none absolute inset-y-0 left-0 w-6"
|
||||
style={{ background: 'linear-gradient(to right, var(--color-input), transparent)' }}
|
||||
/>
|
||||
)}
|
||||
{canNext && (
|
||||
<div
|
||||
aria-hidden="true"
|
||||
className="pointer-events-none absolute inset-y-0 right-0 w-6"
|
||||
style={{ background: 'linear-gradient(to left, var(--color-input), transparent)' }}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
{canNext && (
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user