@aivex/ui 1.1.0-dev.17 → 1.1.0-dev.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,19 +1,25 @@
1
- import type { AnchorHTMLAttributes, HTMLAttributes, Ref } from "react";
2
- export interface BreadCrumbItemProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
3
- label: string;
4
- href?: string;
5
- current?: boolean;
6
- ref?: Ref<HTMLAnchorElement>;
7
- }
8
- declare function BreadCrumbItem({ className, label, href, current, ref, ...props }: BreadCrumbItemProps): import("react/jsx-runtime").JSX.Element;
1
+ import type { ElementType, HTMLAttributes, ReactNode, Ref } from "react";
9
2
  export interface BreadCrumbItemDef {
10
- label: string;
3
+ label: ReactNode;
4
+ /**
5
+ * 렌더링할 컴포넌트를 직접 지정합니다.
6
+ * 예: Next.js `Link`, React Router `NavLink` 등
7
+ * 지정하지 않으면 href 유무에 따라 <a> 또는 <button>으로 자동 선택됩니다.
8
+ */
9
+ as?: ElementType;
10
+ /** 있으면 <a href> 로 렌더링 (시맨틱 / 새 탭 열기 지원) */
11
11
  href?: string;
12
- current?: boolean;
12
+ /** 클릭 핸들러 (SPA 라우팅 등) */
13
+ onClick?: () => void;
13
14
  }
14
15
  export interface BreadCrumbProps extends HTMLAttributes<HTMLElement> {
15
16
  items: BreadCrumbItemDef[];
17
+ /**
18
+ * 이 값을 초과하면 중간 항목을 ··· 으로 축소합니다.
19
+ * 예: maxItems=3이고 항목이 5개면 → 첫번째 / ··· / 마지막
20
+ */
21
+ maxItems?: number;
16
22
  ref?: Ref<HTMLElement>;
17
23
  }
18
- declare function BreadCrumb({ className, items, ref, ...props }: BreadCrumbProps): import("react/jsx-runtime").JSX.Element;
19
- export { BreadCrumb, BreadCrumbItem };
24
+ declare function BreadCrumb({ className, items, maxItems, ref, ...props }: BreadCrumbProps): import("react/jsx-runtime").JSX.Element;
25
+ export { BreadCrumb };
@@ -1,2 +1,2 @@
1
- export type { BreadCrumbItemDef, BreadCrumbItemProps, BreadCrumbProps } from "./BreadCrumb";
2
- export { BreadCrumb, BreadCrumbItem } from "./BreadCrumb";
1
+ export type { BreadCrumbItemDef, BreadCrumbProps } from "./BreadCrumb";
2
+ export { BreadCrumb } from "./BreadCrumb";
@@ -1,11 +1,25 @@
1
1
  import { type HTMLAttributes, type Ref } from "react";
2
2
  export interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, "onChange"> {
3
- total: number;
4
- page?: number;
5
- defaultPage?: number;
6
- pageSize?: number;
7
- onChange?: (page: number) => void;
3
+ /**
4
+ * undefined면 컴포넌트를 렌더하지 않음 (최초 로드 시).
5
+ * 한 번 정의된 후 다시 undefined가 되면 직전 값을 유지해서 깜빡임 방지.
6
+ */
7
+ totalPages?: number;
8
+ page: number;
9
+ pageSize: number;
10
+ /** 명시적으로 모든 상호작용 비활성화 (refetch 중, 권한 없음 등) */
11
+ disabled?: boolean;
12
+ /**
13
+ * 페이지 사이즈 셀렉터 옵션. 생략하면 셀렉터가 숨겨짐.
14
+ * @example [{ value: 10, label: "10 each" }, { value: 50, label: "50 each" }]
15
+ */
16
+ pageSizeOptions?: Array<{
17
+ value: number;
18
+ label: string;
19
+ }>;
20
+ onChange: (page: number) => void;
21
+ onPageSizeChange?: (pageSize: number) => void;
8
22
  ref?: Ref<HTMLElement>;
9
23
  }
10
- declare function Pagination({ className, total, page, defaultPage, pageSize, onChange, ref, ...props }: PaginationProps): import("react/jsx-runtime").JSX.Element;
24
+ declare function Pagination({ className, totalPages, page, pageSize, disabled, pageSizeOptions, onChange, onPageSizeChange, ref, ...props }: PaginationProps): import("react/jsx-runtime").JSX.Element | null;
11
25
  export { Pagination };