@ztwoint/z-ui 0.1.79 → 0.1.80

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.
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ export interface ColumnVisibilitySelectProps {
3
+ value: string;
4
+ onChange: (value: string) => void;
5
+ className?: string;
6
+ options?: {
7
+ value: string;
8
+ label: string;
9
+ }[];
10
+ }
11
+ export declare const ColumnVisibilitySelect: React.FC<ColumnVisibilitySelectProps>;
12
+ export default ColumnVisibilitySelect;
@@ -0,0 +1,24 @@
1
+ import type { ColumnType } from './column-reorder.type';
2
+ export type ColumnVisibilityValue = string;
3
+ export interface UseColumnVisibilityOptions {
4
+ /** Initial map of columnId -> visibility value */
5
+ initial?: Record<string, ColumnVisibilityValue>;
6
+ /** Default value to use when a column has no entry */
7
+ defaultValue?: ColumnVisibilityValue;
8
+ }
9
+ export interface UseColumnVisibilityResult {
10
+ /** Map of columnId -> visibility setting */
11
+ settings: Record<string, ColumnVisibilityValue>;
12
+ /** Read a column's visibility with default fallback */
13
+ get: (columnId: string) => ColumnVisibilityValue;
14
+ /** Update a column's visibility */
15
+ set: (columnId: string, value: ColumnVisibilityValue) => void;
16
+ /** Bulk set/reset settings (replaces entire state) */
17
+ setAll: (next: Record<string, ColumnVisibilityValue>) => void;
18
+ }
19
+ /**
20
+ * Manages per-column visibility settings with sensible defaults.
21
+ * Keeps UI concerns separate from state management.
22
+ */
23
+ export declare function useColumnVisibility(columns: ColumnType[], options?: UseColumnVisibilityOptions): UseColumnVisibilityResult;
24
+ export default useColumnVisibility;
@@ -1,4 +1,5 @@
1
1
  import { type Edge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';
2
+ import type { ReactNode } from 'react';
2
3
  import { ColumnType } from '../../column-reorder.type';
3
4
  export type ColumnItemState = {
4
5
  type: 'idle';
@@ -15,5 +16,5 @@ export interface ColumnItemProps {
15
16
  column: ColumnType;
16
17
  index: number;
17
18
  onRemove?: (columnId: string) => void;
18
- renderAction?: (column: ColumnType, onRemove?: (columnId: string) => void) => React.ReactNode;
19
+ renderAction?: (column: ColumnType, onRemove?: (columnId: string) => void) => ReactNode;
19
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ztwoint/z-ui",
3
- "version": "0.1.79",
3
+ "version": "0.1.80",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",