Skip to content

Commit 9d8cf9a

Browse files
committed
refactor(pagination): add support all nav element attributes with QwikIntrinsicElements['nav']
1 parent 2476236 commit 9d8cf9a

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

packages/kit-headless/src/components/pagination/pagination.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ export const Pagination = component$<PaginationProps>((props) => {
1616
previous: previousButtonLabel = 'PREV',
1717
next: nextButtonLabel = 'NEXT',
1818
} = {},
19-
class: _class,
2019
defaultClass,
2120
selectedClass,
2221
dividerClass,
22+
...rest
2323
} = props;
2424

2525
const isPrevButtonVisible = () => !hidePrevButton && selectedPage > 1;
@@ -33,7 +33,7 @@ export const Pagination = component$<PaginationProps>((props) => {
3333
);
3434

3535
return (
36-
<nav aria-label="pagination" data-testid="pagination" class={_class}>
36+
<nav aria-label="pagination" data-testid="pagination" {...rest}>
3737
{isPrevButtonVisible() && (
3838
<button
3939
aria-label={'prevAriaLabel'}

packages/kit-headless/src/components/pagination/types/pagination-api.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { PropFunction } from '@builder.io/qwik';
1+
import { PropFunction, QwikIntrinsicElements } from '@builder.io/qwik';
22

33
export interface PaginationCoreProps {
44
selectedPage: number;
@@ -7,7 +7,6 @@ export interface PaginationCoreProps {
77
}
88

99
export type PaginationStyling = {
10-
class?: string;
1110
gap?: string;
1211
defaultClass?: string;
1312
selectedClass?: string;
@@ -28,4 +27,7 @@ type ArrowLabels = {
2827
next: string;
2928
};
3029

31-
export type PaginationProps = PaginationCoreProps & PaginationStyling & PaginationConfig;
30+
export type PaginationProps = PaginationCoreProps &
31+
PaginationStyling &
32+
PaginationConfig &
33+
QwikIntrinsicElements['nav'];

0 commit comments

Comments
 (0)