@1d1s/design-system 1.4.0 → 1.5.0

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,5 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  import { DateRange } from 'react-day-picker';
3
+ import { Calendar as CalendarView } from '../Calendar';
3
4
  interface BasePickerProps {
4
5
  className?: string;
5
6
  placeholder?: string;
@@ -13,7 +14,18 @@ interface BasePickerProps {
13
14
  mobileSheet?: boolean;
14
15
  /** 바텀시트 상단 제목 (모바일에서만 표시). 기본값은 placeholder. */
15
16
  sheetTitle?: string;
17
+ /**
18
+ * 내부 Calendar(react-day-picker)로 그대로 전달되는 옵션.
19
+ * 비활성 날짜(`disabled` 매처), 선택 가능 범위(`fromDate`/`toDate`),
20
+ * 초기 표시 월(`defaultMonth`) 등을 지정할 수 있다.
21
+ * `mode`/`selected`/`onSelect`는 내부에서 제어하므로 무시된다.
22
+ *
23
+ * @example calendarProps={{ disabled: { before: new Date() } }}
24
+ */
25
+ calendarProps?: CalendarPassthroughProps;
16
26
  }
27
+ /** DatePicker가 내부 Calendar로 넘기는 옵션 (제어 prop 제외) */
28
+ export type CalendarPassthroughProps = Omit<React.ComponentProps<typeof CalendarView>, "mode" | "selected" | "onSelect" | "className">;
17
29
  export interface DatePickerProps extends BasePickerProps {
18
30
  value: Date | undefined;
19
31
  onChange(date: Date | undefined): void;
@@ -26,10 +38,10 @@ export interface RangeDatePickerProps extends BasePickerProps {
26
38
  * DatePicker
27
39
  * 단일 날짜를 선택하는 시안형 Date Picker 컴포넌트.
28
40
  */
29
- export declare function DatePicker({ value, onChange, className, placeholder, disabled, disableClickPropagation, mobileSheet, sheetTitle, }: DatePickerProps): React.ReactElement;
41
+ export declare function DatePicker({ value, onChange, className, placeholder, disabled, disableClickPropagation, mobileSheet, sheetTitle, calendarProps, }: DatePickerProps): React.ReactElement;
30
42
  /**
31
43
  * RangeDatePicker
32
44
  * 시작일/종료일 범위를 선택하는 시안형 Date Range Picker 컴포넌트.
33
45
  */
34
- export declare function RangeDatePicker({ value, onChange, className, placeholder, disabled, disableClickPropagation, mobileSheet, sheetTitle, }: RangeDatePickerProps): React.ReactElement;
46
+ export declare function RangeDatePicker({ value, onChange, className, placeholder, disabled, disableClickPropagation, mobileSheet, sheetTitle, calendarProps, }: RangeDatePickerProps): React.ReactElement;
35
47
  export {};
@@ -0,0 +1,28 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import * as React from "react";
3
+ declare const itemVariants: (props?: ({
4
+ size?: "sm" | "md" | "lg" | null | undefined;
5
+ active?: boolean | null | undefined;
6
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
+ export interface PaginationProps extends Omit<React.HTMLAttributes<HTMLElement>, "onChange">, VariantProps<typeof itemVariants> {
8
+ /** 전체 페이지 수 */
9
+ count: number;
10
+ /** 현재 페이지 (1-indexed, controlled) */
11
+ page?: number;
12
+ /** 초기 페이지 (1-indexed, uncontrolled) */
13
+ defaultPage?: number;
14
+ onPageChange?(page: number): void;
15
+ /** 현재 페이지 양옆에 노출할 형제 페이지 수 (기본 1) */
16
+ siblingCount?: number;
17
+ }
18
+ /**
19
+ * Pagination
20
+ * 페이지 번호 + 이전/다음 화살표. 페이지 수가 많으면 "…"로 축약한다.
21
+ *
22
+ * @example
23
+ * ```tsx
24
+ * <Pagination count={20} defaultPage={1} onPageChange={(p) => fetchPage(p)} />
25
+ * ```
26
+ */
27
+ export declare function Pagination({ count, page, defaultPage, onPageChange, siblingCount, size, className, ...props }: PaginationProps): React.ReactElement;
28
+ export {};
@@ -0,0 +1 @@
1
+ export * from './Pagination';
@@ -25,6 +25,7 @@ export type { IconName, IconProps } from './Icons/Icon';
25
25
  export * from './ImagePicker';
26
26
  export * from './ImagePlaceholder';
27
27
  export * from './PageWatermark';
28
+ export * from './Pagination';
28
29
  export * from './ProgressBar';
29
30
  export * from './Radio';
30
31
  export * from './ScheduleCalendar';