minka-ds 0.2.1 → 0.2.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "minka-ds",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Minka product design system — tokenized component library",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -109,6 +109,7 @@ interface DataTableProps<TData, TValue> {
109
109
  batchSize?: number
110
110
  onRowClick?: (row: TData) => void
111
111
  variant?: "default" | "compact"
112
+ initialColumnVisibility?: VisibilityState
112
113
  className?: string
113
114
  }
114
115
 
@@ -118,11 +119,12 @@ function DataTable<TData, TValue>({
118
119
  batchSize = 40,
119
120
  onRowClick,
120
121
  variant = "default",
122
+ initialColumnVisibility,
121
123
  className,
122
124
  }: DataTableProps<TData, TValue>) {
123
125
  const compact = variant === "compact"
124
126
  const [sorting, setSorting] = React.useState<SortingState>([])
125
- const [columnVisibility, setColumnVisibility] = React.useState<VisibilityState>({})
127
+ const [columnVisibility, setColumnVisibility] = React.useState<VisibilityState>(initialColumnVisibility ?? {})
126
128
  const [displayCount, setDisplayCount] = React.useState(batchSize)
127
129
  const [hasMore, setHasMore] = React.useState(data.length > batchSize)
128
130