@samkwang/ui-kit 0.3.0 → 0.4.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.
package/dist/index.d.cts CHANGED
@@ -1,12 +1,12 @@
1
1
  import * as class_variance_authority_types from 'class-variance-authority/types';
2
2
  import * as React$1 from 'react';
3
- import { HTMLAttributes, ReactNode } from 'react';
3
+ import React__default, { HTMLAttributes, ReactNode } from 'react';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
  import * as LabelPrimitive from '@radix-ui/react-label';
6
6
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
7
7
  import * as SwitchPrimitive from '@radix-ui/react-switch';
8
8
  import * as react_jsx_runtime from 'react/jsx-runtime';
9
- import { ColumnDef, RowSelectionState, SortingState, Column } from '@tanstack/react-table';
9
+ import { ColumnDef, RowSelectionState, SortingState, Row, Column } from '@tanstack/react-table';
10
10
  import * as TabsPrimitive from '@radix-ui/react-tabs';
11
11
  import * as AccordionPrimitive from '@radix-ui/react-accordion';
12
12
  import * as DialogPrimitive from '@radix-ui/react-dialog';
@@ -136,7 +136,7 @@ declare function TablePagination({ pageIndex, pageCount, onPageChange, className
136
136
  type DataTableVariant = "service-desk" | "data-table" | "project-task";
137
137
  interface SortButtonProps<TData> {
138
138
  column: Column<TData, unknown>;
139
- children: React.ReactNode;
139
+ children: React__default.ReactNode;
140
140
  variant: DataTableVariant;
141
141
  sortButtonClassName?: string;
142
142
  }
@@ -153,6 +153,8 @@ interface DataTableProps<TData> {
153
153
  onSelectedRowChange?: (rowId: string | null, row: TData | null) => void;
154
154
  /** 멀티 행 선택 (체크박스 기반) — enableRowSelection과 독립 동작 */
155
155
  enableMultiSelect?: boolean;
156
+ /** 자식 행(Tree 등에서 depth > 0 인 행)의 체크박스를 숨길지 여부 */
157
+ hideChildRowSelection?: boolean;
156
158
  selectedRowIds?: RowSelectionState;
157
159
  onSelectedRowsChange?: (selectedIds: RowSelectionState, selectedRows: TData[]) => void;
158
160
  rowClassName?: (row: TData) => string | undefined;
@@ -164,8 +166,16 @@ interface DataTableProps<TData> {
164
166
  enableSorting?: boolean;
165
167
  /** 설정 시 클라이언트 페이지네이션 및 하단 페이지 바 표시 */
166
168
  pageSize?: number;
167
- }
168
- declare function DataTable<TData>({ data, columns: userColumns, getRowId, onRowClick, enableRowSelection, selectedRowId, onSelectedRowChange, enableMultiSelect, selectedRowIds: controlledRowSelection, onSelectedRowsChange, rowClassName, emptyMessage, variant, wrapClassName, tableClassName, initialSorting, enableSorting, pageSize, }: DataTableProps<TData>): react_jsx_runtime.JSX.Element;
169
+ /** 자식 행 접근자 (Case 1: 동일 구조 Tree 형태) */
170
+ getSubRows?: (originalRow: TData) => TData[] | undefined;
171
+ /** 확장 컴포넌트 렌더러 (Case 2: 상이한 구조 Sub-Component 형태) */
172
+ renderSubComponent?: (props: {
173
+ row: Row<TData>;
174
+ }) => React__default.ReactNode;
175
+ /** 자동으로 확장 상태 리셋 여부 (기본값 false 권장) */
176
+ autoResetExpanded?: boolean;
177
+ }
178
+ declare function DataTable<TData>({ data, columns: userColumns, getRowId, onRowClick, enableRowSelection, selectedRowId, onSelectedRowChange, enableMultiSelect, hideChildRowSelection, selectedRowIds: controlledRowSelection, onSelectedRowsChange, rowClassName, emptyMessage, variant, wrapClassName, tableClassName, initialSorting, enableSorting, pageSize, getSubRows, renderSubComponent, autoResetExpanded, }: DataTableProps<TData>): react_jsx_runtime.JSX.Element;
169
179
 
170
180
  declare const Tabs: React$1.ForwardRefExoticComponent<TabsPrimitive.TabsProps & React$1.RefAttributes<HTMLDivElement>>;
171
181
  declare const TabsList: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
package/dist/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import * as class_variance_authority_types from 'class-variance-authority/types';
2
2
  import * as React$1 from 'react';
3
- import { HTMLAttributes, ReactNode } from 'react';
3
+ import React__default, { HTMLAttributes, ReactNode } from 'react';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
  import * as LabelPrimitive from '@radix-ui/react-label';
6
6
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
7
7
  import * as SwitchPrimitive from '@radix-ui/react-switch';
8
8
  import * as react_jsx_runtime from 'react/jsx-runtime';
9
- import { ColumnDef, RowSelectionState, SortingState, Column } from '@tanstack/react-table';
9
+ import { ColumnDef, RowSelectionState, SortingState, Row, Column } from '@tanstack/react-table';
10
10
  import * as TabsPrimitive from '@radix-ui/react-tabs';
11
11
  import * as AccordionPrimitive from '@radix-ui/react-accordion';
12
12
  import * as DialogPrimitive from '@radix-ui/react-dialog';
@@ -136,7 +136,7 @@ declare function TablePagination({ pageIndex, pageCount, onPageChange, className
136
136
  type DataTableVariant = "service-desk" | "data-table" | "project-task";
137
137
  interface SortButtonProps<TData> {
138
138
  column: Column<TData, unknown>;
139
- children: React.ReactNode;
139
+ children: React__default.ReactNode;
140
140
  variant: DataTableVariant;
141
141
  sortButtonClassName?: string;
142
142
  }
@@ -153,6 +153,8 @@ interface DataTableProps<TData> {
153
153
  onSelectedRowChange?: (rowId: string | null, row: TData | null) => void;
154
154
  /** 멀티 행 선택 (체크박스 기반) — enableRowSelection과 독립 동작 */
155
155
  enableMultiSelect?: boolean;
156
+ /** 자식 행(Tree 등에서 depth > 0 인 행)의 체크박스를 숨길지 여부 */
157
+ hideChildRowSelection?: boolean;
156
158
  selectedRowIds?: RowSelectionState;
157
159
  onSelectedRowsChange?: (selectedIds: RowSelectionState, selectedRows: TData[]) => void;
158
160
  rowClassName?: (row: TData) => string | undefined;
@@ -164,8 +166,16 @@ interface DataTableProps<TData> {
164
166
  enableSorting?: boolean;
165
167
  /** 설정 시 클라이언트 페이지네이션 및 하단 페이지 바 표시 */
166
168
  pageSize?: number;
167
- }
168
- declare function DataTable<TData>({ data, columns: userColumns, getRowId, onRowClick, enableRowSelection, selectedRowId, onSelectedRowChange, enableMultiSelect, selectedRowIds: controlledRowSelection, onSelectedRowsChange, rowClassName, emptyMessage, variant, wrapClassName, tableClassName, initialSorting, enableSorting, pageSize, }: DataTableProps<TData>): react_jsx_runtime.JSX.Element;
169
+ /** 자식 행 접근자 (Case 1: 동일 구조 Tree 형태) */
170
+ getSubRows?: (originalRow: TData) => TData[] | undefined;
171
+ /** 확장 컴포넌트 렌더러 (Case 2: 상이한 구조 Sub-Component 형태) */
172
+ renderSubComponent?: (props: {
173
+ row: Row<TData>;
174
+ }) => React__default.ReactNode;
175
+ /** 자동으로 확장 상태 리셋 여부 (기본값 false 권장) */
176
+ autoResetExpanded?: boolean;
177
+ }
178
+ declare function DataTable<TData>({ data, columns: userColumns, getRowId, onRowClick, enableRowSelection, selectedRowId, onSelectedRowChange, enableMultiSelect, hideChildRowSelection, selectedRowIds: controlledRowSelection, onSelectedRowsChange, rowClassName, emptyMessage, variant, wrapClassName, tableClassName, initialSorting, enableSorting, pageSize, getSubRows, renderSubComponent, autoResetExpanded, }: DataTableProps<TData>): react_jsx_runtime.JSX.Element;
169
179
 
170
180
  declare const Tabs: React$1.ForwardRefExoticComponent<TabsPrimitive.TabsProps & React$1.RefAttributes<HTMLDivElement>>;
171
181
  declare const TabsList: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {