@farmzone/fz-react-ui 1.2.4 → 1.2.6

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.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as react from 'react';
2
- import react__default, { ReactNode, ButtonHTMLAttributes, Ref, CSSProperties, InputHTMLAttributes, TextareaHTMLAttributes, ComponentProps, HTMLAttributes, RefObject, SVGProps } from 'react';
2
+ import react__default, { ReactNode, ComponentProps, CSSProperties, ButtonHTMLAttributes, Ref, InputHTMLAttributes, TextareaHTMLAttributes, HTMLAttributes, RefObject, ReactElement, SVGProps } from 'react';
3
+ import * as TooltipPrimitive from '@radix-ui/react-tooltip';
3
4
  import * as SwitchPrimitive from '@radix-ui/react-switch';
4
5
  import * as SelectPrimitive from '@radix-ui/react-select';
5
6
  import * as class_variance_authority_types from 'class-variance-authority/types';
@@ -28,25 +29,16 @@ interface BadgeProps {
28
29
  }
29
30
  declare function Badge(props: BadgeProps): react.JSX.Element;
30
31
 
31
- type ButtonVariant = "outline" | "save" | "delete" | "reset" | "search" | "file" | "carousel" | "accent" | "ghost" | "link" | "metal" | "inkstone" | "inkstone-outline" | "inkstone-ghost" | "inkstone-danger";
32
- type ButtonSize = "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | "link";
33
- interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
34
- ref?: Ref<HTMLButtonElement>;
35
- asChild?: boolean;
36
- variant?: ButtonVariant;
37
- size?: ButtonSize;
38
- tooltip?: ReactNode;
39
- tooltipPosition?: "top" | "bottom";
40
- tooltipClassName?: string;
41
- tooltipContentClassName?: string;
42
- }
43
- declare function Button(props: ButtonProps): react.JSX.Element;
32
+ declare function TooltipContent({ className, sideOffset, children, arrowClassName, ...props }: react.ComponentProps<typeof TooltipPrimitive.Content> & {
33
+ arrowClassName?: string;
34
+ }): react.JSX.Element;
44
35
 
36
+ type TooltipPosition = NonNullable<ComponentProps<typeof TooltipContent>["side"]>;
45
37
  interface TooltipProps {
46
38
  children: ReactNode;
47
39
  text?: ReactNode;
48
40
  content: ReactNode;
49
- position?: "top" | "bottom";
41
+ position?: TooltipPosition;
50
42
  className?: string;
51
43
  triggerClassName?: string;
52
44
  arrowClassName?: string;
@@ -62,6 +54,20 @@ interface TooltipProps {
62
54
  }
63
55
  declare function Tooltip(props: TooltipProps): react.JSX.Element;
64
56
 
57
+ type ButtonVariant = "outline" | "save" | "delete" | "reset" | "search" | "file" | "carousel" | "accent" | "ghost" | "link" | "metal" | "inkstone" | "inkstone-outline" | "inkstone-ghost" | "inkstone-danger";
58
+ type ButtonSize = "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | "link";
59
+ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
60
+ ref?: Ref<HTMLButtonElement>;
61
+ asChild?: boolean;
62
+ variant?: ButtonVariant;
63
+ size?: ButtonSize;
64
+ tooltip?: ReactNode;
65
+ tooltipPosition?: TooltipPosition;
66
+ tooltipClassName?: string;
67
+ tooltipContentClassName?: string;
68
+ }
69
+ declare function Button(props: ButtonProps): react.JSX.Element;
70
+
65
71
  interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "defaultChecked" | "checked"> {
66
72
  checked: boolean;
67
73
  label?: string;
@@ -343,6 +349,11 @@ interface PaginationProps {
343
349
  totalPages: number;
344
350
  onPageChange?: (page: number) => void;
345
351
  showTotalCount?: boolean;
352
+ /**
353
+ * '첫 페이지' · '마지막 페이지' 버튼은 전체 페이지 수가 이 값 이상일 때만 둔다. 생략하면 항상 둔다.
354
+ * 예: 6 → 페이지가 5개를 넘을 때만.
355
+ */
356
+ edgeButtonsMinPages?: number;
346
357
  }
347
358
  declare function Pagination(props: PaginationProps): react.JSX.Element;
348
359
 
@@ -1266,7 +1277,10 @@ interface MenuChild {
1266
1277
  children?: Array<MenuGrandchild>;
1267
1278
  }
1268
1279
  interface MenuItem {
1269
- icon: LucideIcon;
1280
+ /** 드래그 순서 변경 · 렌더 key용 식별자. 생략하면 label을 쓴다(같은 이름이 둘이면 넣을 것). */
1281
+ id?: string;
1282
+ /** Lucide 아이콘 컴포넌트, 또는 그대로 그릴 요소(프로젝트 색 아이콘 등 — 16px 정도로). */
1283
+ icon: LucideIcon | ReactElement;
1270
1284
  label: string;
1271
1285
  path?: string;
1272
1286
  /** 라벨 오른쪽에 붙는 작은 표시(건수 등). */
@@ -1276,6 +1290,11 @@ interface MenuItem {
1276
1290
  interface MenuSection {
1277
1291
  title?: string;
1278
1292
  items: Array<MenuItem>;
1293
+ /**
1294
+ * 주면 이 섹션의 1depth 항목을 드래그해서 순서를 바꿀 수 있다. 놓으면 바뀐 순서의 items를 넘긴다 —
1295
+ * 저장과 다음 렌더의 items 반영은 호출부 몫이다.
1296
+ */
1297
+ onReorder?: (items: Array<MenuItem>) => void;
1279
1298
  }
1280
1299
  type SidebarVariant = "light" | "dark" | "system-dark" | "system-light" | "inkstone";
1281
1300
  interface SidebarHeaderRenderProps {
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as react from 'react';
2
- import react__default, { ReactNode, ButtonHTMLAttributes, Ref, CSSProperties, InputHTMLAttributes, TextareaHTMLAttributes, ComponentProps, HTMLAttributes, RefObject, SVGProps } from 'react';
2
+ import react__default, { ReactNode, ComponentProps, CSSProperties, ButtonHTMLAttributes, Ref, InputHTMLAttributes, TextareaHTMLAttributes, HTMLAttributes, RefObject, ReactElement, SVGProps } from 'react';
3
+ import * as TooltipPrimitive from '@radix-ui/react-tooltip';
3
4
  import * as SwitchPrimitive from '@radix-ui/react-switch';
4
5
  import * as SelectPrimitive from '@radix-ui/react-select';
5
6
  import * as class_variance_authority_types from 'class-variance-authority/types';
@@ -28,25 +29,16 @@ interface BadgeProps {
28
29
  }
29
30
  declare function Badge(props: BadgeProps): react.JSX.Element;
30
31
 
31
- type ButtonVariant = "outline" | "save" | "delete" | "reset" | "search" | "file" | "carousel" | "accent" | "ghost" | "link" | "metal" | "inkstone" | "inkstone-outline" | "inkstone-ghost" | "inkstone-danger";
32
- type ButtonSize = "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | "link";
33
- interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
34
- ref?: Ref<HTMLButtonElement>;
35
- asChild?: boolean;
36
- variant?: ButtonVariant;
37
- size?: ButtonSize;
38
- tooltip?: ReactNode;
39
- tooltipPosition?: "top" | "bottom";
40
- tooltipClassName?: string;
41
- tooltipContentClassName?: string;
42
- }
43
- declare function Button(props: ButtonProps): react.JSX.Element;
32
+ declare function TooltipContent({ className, sideOffset, children, arrowClassName, ...props }: react.ComponentProps<typeof TooltipPrimitive.Content> & {
33
+ arrowClassName?: string;
34
+ }): react.JSX.Element;
44
35
 
36
+ type TooltipPosition = NonNullable<ComponentProps<typeof TooltipContent>["side"]>;
45
37
  interface TooltipProps {
46
38
  children: ReactNode;
47
39
  text?: ReactNode;
48
40
  content: ReactNode;
49
- position?: "top" | "bottom";
41
+ position?: TooltipPosition;
50
42
  className?: string;
51
43
  triggerClassName?: string;
52
44
  arrowClassName?: string;
@@ -62,6 +54,20 @@ interface TooltipProps {
62
54
  }
63
55
  declare function Tooltip(props: TooltipProps): react.JSX.Element;
64
56
 
57
+ type ButtonVariant = "outline" | "save" | "delete" | "reset" | "search" | "file" | "carousel" | "accent" | "ghost" | "link" | "metal" | "inkstone" | "inkstone-outline" | "inkstone-ghost" | "inkstone-danger";
58
+ type ButtonSize = "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | "link";
59
+ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
60
+ ref?: Ref<HTMLButtonElement>;
61
+ asChild?: boolean;
62
+ variant?: ButtonVariant;
63
+ size?: ButtonSize;
64
+ tooltip?: ReactNode;
65
+ tooltipPosition?: TooltipPosition;
66
+ tooltipClassName?: string;
67
+ tooltipContentClassName?: string;
68
+ }
69
+ declare function Button(props: ButtonProps): react.JSX.Element;
70
+
65
71
  interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "defaultChecked" | "checked"> {
66
72
  checked: boolean;
67
73
  label?: string;
@@ -343,6 +349,11 @@ interface PaginationProps {
343
349
  totalPages: number;
344
350
  onPageChange?: (page: number) => void;
345
351
  showTotalCount?: boolean;
352
+ /**
353
+ * '첫 페이지' · '마지막 페이지' 버튼은 전체 페이지 수가 이 값 이상일 때만 둔다. 생략하면 항상 둔다.
354
+ * 예: 6 → 페이지가 5개를 넘을 때만.
355
+ */
356
+ edgeButtonsMinPages?: number;
346
357
  }
347
358
  declare function Pagination(props: PaginationProps): react.JSX.Element;
348
359
 
@@ -1266,7 +1277,10 @@ interface MenuChild {
1266
1277
  children?: Array<MenuGrandchild>;
1267
1278
  }
1268
1279
  interface MenuItem {
1269
- icon: LucideIcon;
1280
+ /** 드래그 순서 변경 · 렌더 key용 식별자. 생략하면 label을 쓴다(같은 이름이 둘이면 넣을 것). */
1281
+ id?: string;
1282
+ /** Lucide 아이콘 컴포넌트, 또는 그대로 그릴 요소(프로젝트 색 아이콘 등 — 16px 정도로). */
1283
+ icon: LucideIcon | ReactElement;
1270
1284
  label: string;
1271
1285
  path?: string;
1272
1286
  /** 라벨 오른쪽에 붙는 작은 표시(건수 등). */
@@ -1276,6 +1290,11 @@ interface MenuItem {
1276
1290
  interface MenuSection {
1277
1291
  title?: string;
1278
1292
  items: Array<MenuItem>;
1293
+ /**
1294
+ * 주면 이 섹션의 1depth 항목을 드래그해서 순서를 바꿀 수 있다. 놓으면 바뀐 순서의 items를 넘긴다 —
1295
+ * 저장과 다음 렌더의 items 반영은 호출부 몫이다.
1296
+ */
1297
+ onReorder?: (items: Array<MenuItem>) => void;
1279
1298
  }
1280
1299
  type SidebarVariant = "light" | "dark" | "system-dark" | "system-light" | "inkstone";
1281
1300
  interface SidebarHeaderRenderProps {