Compare commits

...

24 Commits

Author SHA1 Message Date
Raunak Bhagat
1812849238 Merge branch 'main' into refactor/table-footer 2026-03-16 17:13:57 -07:00
Raunak Bhagat
8f24a5ea53 Merge branch 'main' into refactor/table-footer 2026-03-16 16:51:28 -07:00
Raunak Bhagat
ffcbb3134c Merge main 2026-03-16 16:25:01 -07:00
Raunak Bhagat
0807b8cff4 refactor: clean up Footer pagination usage
- Use singular/plural "item"/"items" for count variant units
- Limit pagination sizes to md/lg only
- Remove unused size prop from FooterSelectionModeProps
- Remove unused TableSize type import
2026-03-16 15:55:53 -07:00
Raunak Bhagat
886ae70fad chore: init refactor/table-footer branch 2026-03-16 15:55:04 -07:00
Raunak Bhagat
5d2dd6e7b8 refactor: rename showPages to hidePages (inverted default)
Users must now explicitly opt out of showing pages with hidePages,
rather than opt in with showPages. Default behavior unchanged.
2026-03-16 15:54:53 -07:00
Raunak Bhagat
bcd64cc2f6 fix: use sizeVariants.lg.height for go-to-page input 2026-03-16 15:39:18 -07:00
Raunak Bhagat
f1eeb9e372 refactor: unify pagination callbacks to onChange
Consolidate onArrowClick and onPageClick into a single onChange
callback across all variants. Fix React.ReactNode import in Footer.
2026-03-16 15:33:17 -07:00
Raunak Bhagat
aed3db2322 fix: remove unused ELLIPSIS_SIZE constant 2026-03-16 15:14:14 -07:00
Raunak Bhagat
7fe753c0ce fix: remove stale goto prop from README documentation 2026-03-16 15:02:50 -07:00
Raunak Bhagat
375da7aaa6 fix: make go-to-page popover size-independent and polish styling
- Remove size prop from GoToPagePopup so it renders consistently
- Fixed input height (36px), width (7rem), rounded-08, font-main-ui-body
- Popover uses rounded-12, p-1, gap-1
- Submit button always renders at lg size
2026-03-16 14:58:45 -07:00
Raunak Bhagat
d3b46f7d9b feat: add go-to-page popup to all Pagination variants
Replace the old `goto` callback prop with an inline popover that lets
users type a page number and jump directly to it. The popup is
activated by clicking the page indicator (simple/count) or the
ellipsis button (list). Input is number-only and the submit button
is disabled when the value is out of range.
2026-03-16 14:43:07 -07:00
Raunak Bhagat
5ba61c7331 fix: clamp currentPage upper bound to totalPages 2026-03-16 13:55:57 -07:00
Raunak Bhagat
2be27028a4 Fix spacing 2026-03-16 13:53:40 -07:00
Raunak Bhagat
ab1fc67204 fix: address PR review comments
- Use explicit named imports from react instead of React namespace
- Clamp nav button page values to prevent out-of-bounds
- Replace inline marginLeft styles with Tailwind ml-1
- Normalize currentPage alongside totalPages
- Use gap-1 token instead of gap-[4px] in PaginationCount
2026-03-16 13:34:16 -07:00
Raunak Bhagat
640590cfbf fix: remove unnecessary cn wrapper and unused size prop 2026-03-16 13:29:51 -07:00
Raunak Bhagat
0ff2fd4bca fix: remove conditional gap sizing in PaginationSimple 2026-03-16 13:24:36 -07:00
Raunak Bhagat
994ab1b4b7 refactor: rename showSummary to showPages in Pagination 2026-03-16 13:12:15 -07:00
Raunak Bhagat
50d821f233 fix: address PR review comments
- Combine duplicate @opal/components imports in Footer.tsx
- Add onPageClick to List story args to prevent throw on click
- Fix README size default from "varies" to "lg"
2026-03-16 13:09:49 -07:00
Raunak Bhagat
8d51546361 fix: set fixed width for count variant page number
Page number between arrows in variant="count" is now 28px for lg/md
and 20px for sm, ensuring consistent layout.
2026-03-16 13:03:36 -07:00
Raunak Bhagat
108652e86c fix: pagination list ellipsis threshold and slot width
Change ellipsis threshold to >7 pages (was >5). Always render exactly
7 slots when truncating for constant component width. Size ellipsis
slots to match icon-only Button dimensions (36/28/24px).
2026-03-16 12:51:59 -07:00
Raunak Bhagat
cdcb77d146 refactor: simplify Pagination list variant API
Replace onChange/onPageClick split with a single onPageClick callback
for the list variant. Remove PaginationBase (no longer shared). Default
size is now "lg" for all variants. Update all consumers, stories,
README, and JSDoc.
2026-03-16 12:34:09 -07:00
Raunak Bhagat
fd4202c5fd refactor: update Pagination count variant API and fix spacing
Update variant="count" to use onArrowClick, showSummary, units, and
goto props (matching simple variant pattern). Buttons section (arrows +
page number) renders with no internal gap. Fixed 4px gap between
summary, buttons, and goto sections. Update stories, README, and
JSDoc to reflect current API for all variants.
2026-03-16 12:28:16 -07:00
Raunak Bhagat
9f4d60090d refactor: move Pagination to opal with three-variant API
Move Pagination from refresh-components to @opal/components with a
discriminated union API: variant="simple" (arrows + summary),
variant="count" (range display), and variant="list" (numbered pages,
default). Inline table/Pagination.tsx into Footer.tsx then replace
with the opal import. Remove internal-only stories (Footer, DataTable)
and the old refresh-components Pagination + story.
2026-03-16 12:14:17 -07:00

View File

@@ -4,7 +4,6 @@ import { cn } from "@/lib/utils";
import { Button, Pagination } from "@opal/components";
import Text from "@/refresh-components/texts/Text";
import { useTableSize } from "@/refresh-components/table/TableSizeContext";
import type { TableSize } from "@/refresh-components/table/TableSizeContext";
import { SvgEye, SvgXCircle } from "@opal/icons";
import type { ReactNode } from "react";
@@ -41,8 +40,6 @@ interface FooterSelectionModeProps {
totalPages: number;
/** Called when the user navigates to a different page. */
onPageChange: (page: number) => void;
/** Controls overall footer sizing. `"regular"` (default) or `"small"`. */
size?: TableSize;
className?: string;
}
@@ -144,8 +141,8 @@ export default function Footer(props: FooterProps) {
currentPage={props.currentPage}
totalPages={props.totalPages}
onChange={props.onPageChange}
units="items"
size={isSmall ? "sm" : "md"}
units="item(s)"
size={isSmall ? "md" : "lg"}
/>
) : (
<Pagination