feat: migrate Pagination Header and InputOTP with field and event regressions
This commit is contained in:
@@ -0,0 +1,154 @@
|
||||
/* Adapted from HeroUI v3, ce90ea3. Copyright 2025 NextUI Inc.
|
||||
* See third-party/HEROUI-LICENSE. Modified: hv- class prefix. */
|
||||
/* ==========================================================================
|
||||
Pagination - Page navigation component
|
||||
========================================================================== */
|
||||
|
||||
/* Base styles */
|
||||
.hv-pagination {
|
||||
@apply flex w-full flex-col items-center justify-between gap-4 sm:flex-row;
|
||||
}
|
||||
|
||||
/* Summary - left side info container */
|
||||
.hv-pagination__summary {
|
||||
@apply flex items-center gap-2 self-start text-sm text-muted sm:self-center;
|
||||
}
|
||||
|
||||
/* Content - container for pagination items */
|
||||
.hv-pagination__content {
|
||||
@apply flex items-center gap-1 self-start sm:self-center;
|
||||
}
|
||||
|
||||
/* Item - list item wrapper */
|
||||
.hv-pagination__item {
|
||||
@apply inline-flex;
|
||||
}
|
||||
|
||||
/* Link - page number button (ghost button style) */
|
||||
.hv-pagination__link {
|
||||
@apply relative isolate inline-flex size-9 origin-center items-center justify-center rounded-3xl text-sm font-medium whitespace-nowrap outline-none select-none no-highlight md:size-8;
|
||||
|
||||
cursor: var(--cursor-interactive);
|
||||
|
||||
/**
|
||||
* Transitions
|
||||
* CRITICAL: motion-reduce must be AFTER transition for correct override specificity
|
||||
*/
|
||||
transition:
|
||||
transform 250ms var(--ease-smooth),
|
||||
background-color 100ms var(--ease-out),
|
||||
box-shadow 100ms var(--ease-out);
|
||||
@apply transform-gpu motion-reduce:transition-none;
|
||||
|
||||
/* Ghost button tokens */
|
||||
--pagination-link-bg: transparent;
|
||||
--pagination-link-bg-hover: var(--default-hover);
|
||||
--pagination-link-bg-pressed: var(--default-hover);
|
||||
--pagination-link-fg: var(--default-foreground);
|
||||
|
||||
background-color: var(--pagination-link-bg);
|
||||
color: var(--pagination-link-fg);
|
||||
|
||||
/* Focus state */
|
||||
&:focus-visible,
|
||||
&[data-focus-visible="true"] {
|
||||
@apply status-focused;
|
||||
}
|
||||
|
||||
/* Disabled state */
|
||||
&:disabled,
|
||||
&[aria-disabled="true"] {
|
||||
@apply status-disabled;
|
||||
}
|
||||
|
||||
/* Hover state */
|
||||
@media (hover: hover) {
|
||||
&:hover,
|
||||
&[data-hovered="true"] {
|
||||
background-color: var(--pagination-link-bg-hover);
|
||||
}
|
||||
}
|
||||
|
||||
/* Active / pressed */
|
||||
&:active,
|
||||
&[data-pressed="true"] {
|
||||
background-color: var(--pagination-link-bg-pressed);
|
||||
transform: scale(0.97);
|
||||
}
|
||||
|
||||
/* Active page - tertiary button style */
|
||||
&[data-active="true"] {
|
||||
--pagination-link-bg: var(--default);
|
||||
--pagination-link-bg-hover: var(--default-hover);
|
||||
--pagination-link-bg-pressed: var(--default-hover);
|
||||
}
|
||||
}
|
||||
|
||||
/* Ellipsis */
|
||||
.hv-pagination__ellipsis {
|
||||
@apply inline-flex size-9 items-center justify-center text-sm text-muted select-none md:size-8;
|
||||
}
|
||||
|
||||
/* Navigation buttons (Previous / Next) */
|
||||
.hv-pagination__link--nav {
|
||||
@apply w-auto gap-1.5 px-2.5;
|
||||
|
||||
& [data-slot="pagination-previous-icon"],
|
||||
& [data-slot="pagination-next-icon"] {
|
||||
@apply rtl:rotate-180;
|
||||
}
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Size variants
|
||||
========================================================================== */
|
||||
|
||||
.hv-pagination--sm {
|
||||
.hv-pagination__link {
|
||||
@apply size-8 text-xs md:size-7;
|
||||
|
||||
&:active,
|
||||
&[data-pressed="true"] {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
}
|
||||
|
||||
.hv-pagination__link--nav {
|
||||
@apply w-auto px-2;
|
||||
}
|
||||
|
||||
.hv-pagination__ellipsis {
|
||||
@apply size-8 text-xs md:size-7;
|
||||
}
|
||||
|
||||
.hv-pagination__summary {
|
||||
@apply text-xs;
|
||||
}
|
||||
}
|
||||
|
||||
.hv-pagination--md {
|
||||
/* No styles as this is the default size */
|
||||
}
|
||||
|
||||
.hv-pagination--lg {
|
||||
.hv-pagination__link {
|
||||
@apply size-10 text-base md:size-9;
|
||||
|
||||
&:active,
|
||||
&[data-pressed="true"] {
|
||||
transform: scale(0.96);
|
||||
}
|
||||
}
|
||||
|
||||
.hv-pagination__link--nav {
|
||||
@apply w-auto px-3;
|
||||
}
|
||||
|
||||
.hv-pagination__ellipsis {
|
||||
@apply size-10 text-base md:size-9;
|
||||
}
|
||||
|
||||
.hv-pagination__summary {
|
||||
@apply text-base;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user