@max-ts/kit 1.6.0 → 1.7.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 +1 @@
1
- {"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAM1D,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC;AAEpD,eAAO,MAAM,QAAQ,GAAI,yBAAyB,aAAa,gCAU9D,CAAC"}
1
+ {"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAM1D,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC;AAEpD,eAAO,MAAM,QAAQ,GAAI,yBAAyB,aAAa,gCAW9D,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export declare const root: string;
2
2
  export declare const indicator: string;
3
- export declare const icon: string;
3
+ export declare const checkIcon: string;
4
+ export declare const minusIcon: string;
4
5
  //# sourceMappingURL=checkbox.css.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.css.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/checkbox.css.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,IAAI,QAyBf,CAAC;AAEH,eAAO,MAAM,SAAS,QAIpB,CAAC;AAEH,eAAO,MAAM,IAAI,QAKf,CAAC"}
1
+ {"version":3,"file":"checkbox.css.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/checkbox.css.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,IAAI,QAyBf,CAAC;AAEH,eAAO,MAAM,SAAS,QAIpB,CAAC;AAEH,eAAO,MAAM,SAAS,QAMpB,CAAC;AAEH,eAAO,MAAM,SAAS,QAMpB,CAAC"}
@@ -1,6 +1,9 @@
1
1
  import type { DataGridProps } from '../DataGrid';
2
- export type BodyProps<TRow> = Pick<DataGridProps<TRow>, 'emptyState' | 'errorState' | 'isLoading' | 'isError' | 'columns' | 'rows' | 'onRowClick' | 'keyId'> & {
2
+ import type { DataGridRowId } from '../types';
3
+ export type BodyProps<TRow> = Pick<DataGridProps<TRow>, 'emptyState' | 'errorState' | 'isLoading' | 'isError' | 'columns' | 'rows' | 'onRowClick' | 'keyId' | 'isRowSelectionEnabled'> & {
3
4
  rowHeight: number;
5
+ selectedRowIdSet: Set<DataGridRowId>;
6
+ onRowSelectionChange: (rowId: DataGridRowId, isSelected: boolean) => void;
4
7
  };
5
- export declare function Body<TRow>({ isError, isLoading, emptyState, errorState, columns, rows, rowHeight, keyId, onRowClick, }: BodyProps<TRow>): import("react").JSX.Element;
8
+ export declare function Body<TRow>({ isError, isLoading, emptyState, errorState, columns, rows, rowHeight, keyId, onRowClick, isRowSelectionEnabled, selectedRowIdSet, onRowSelectionChange, }: BodyProps<TRow>): import("react").JSX.Element;
6
9
  //# sourceMappingURL=Body.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Body.d.ts","sourceRoot":"","sources":["../../../../src/components/DataGrid/Body/Body.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,MAAM,MAAM,SAAS,CAAC,IAAI,IAAI,IAAI,CACjC,aAAa,CAAC,IAAI,CAAC,EACjB,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,SAAS,GACT,SAAS,GACT,MAAM,GACN,YAAY,GACZ,OAAO,CACT,GAAG;IACH,SAAS,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,wBAAgB,IAAI,CAAC,IAAI,EAAE,EAC1B,OAAO,EACP,SAAS,EACT,UAAU,EACV,UAAU,EACV,OAAO,EACP,IAAI,EACJ,SAAS,EACT,KAAK,EACL,UAAU,GACV,EAAE,SAAS,CAAC,IAAI,CAAC,+BAgCjB"}
1
+ {"version":3,"file":"Body.d.ts","sourceRoot":"","sources":["../../../../src/components/DataGrid/Body/Body.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C,MAAM,MAAM,SAAS,CAAC,IAAI,IAAI,IAAI,CACjC,aAAa,CAAC,IAAI,CAAC,EACjB,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,SAAS,GACT,SAAS,GACT,MAAM,GACN,YAAY,GACZ,OAAO,GACP,uBAAuB,CACzB,GAAG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC;IACrC,oBAAoB,EAAE,CAAC,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1E,CAAC;AAEF,wBAAgB,IAAI,CAAC,IAAI,EAAE,EAC1B,OAAO,EACP,SAAS,EACT,UAAU,EACV,UAAU,EACV,OAAO,EACP,IAAI,EACJ,SAAS,EACT,KAAK,EACL,UAAU,EACV,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,GACpB,EAAE,SAAS,CAAC,IAAI,CAAC,+BAqCjB"}
@@ -1,6 +1,6 @@
1
1
  import { type CSSProperties, type ReactNode } from 'react';
2
2
  import type { ContentStateProps } from '../ContentState';
3
- import type { DataGridColumn, DataGridEmptyState, DataGridSorting, DataGridSortMode } from './types';
3
+ import type { DataGridColumn, DataGridEmptyState, DataGridRowId, DataGridSorting, DataGridSortMode } from './types';
4
4
  export type DataGridProps<TRow> = {
5
5
  rows: TRow[];
6
6
  columns: DataGridColumn<TRow>[];
@@ -17,10 +17,14 @@ export type DataGridProps<TRow> = {
17
17
  sorting?: DataGridSorting<TRow>;
18
18
  onSortingChange?: (sorting: DataGridSorting<TRow>) => void;
19
19
  sortMode?: DataGridSortMode;
20
+ isRowSelectionEnabled?: boolean;
21
+ selectedRowIds?: DataGridRowId[];
22
+ defaultSelectedRowIds?: DataGridRowId[];
23
+ onSelectedRowIdsChange?: (rowIds: DataGridRowId[]) => void;
20
24
  onSelectRow?: (row: TRow[]) => void;
21
25
  onRowClick?: (row: TRow) => void;
22
26
  title?: string;
23
27
  footer?: ReactNode;
24
28
  };
25
- export declare function DataGrid<TRow>({ rows, columns, height, className, rowHeight, headerHeight, keyId, onRowClick, isLoading, isDisabled, isError, emptyState, errorState, sorting, onSortingChange, sortMode, footer, title, }: DataGridProps<TRow>): import("react").JSX.Element;
29
+ export declare function DataGrid<TRow>({ rows, columns, height, className, rowHeight, headerHeight, keyId, onRowClick, isLoading, isDisabled, isError, emptyState, errorState, sorting, onSortingChange, sortMode, isRowSelectionEnabled, selectedRowIds, defaultSelectedRowIds, onSelectedRowIdsChange, onSelectRow, footer, title, }: DataGridProps<TRow>): import("react").JSX.Element;
26
30
  //# sourceMappingURL=DataGrid.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DataGrid.d.ts","sourceRoot":"","sources":["../../../src/components/DataGrid/DataGrid.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAazD,OAAO,KAAK,EACX,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,aAAa,CAAC,IAAI,IAAI;IACjC,IAAI,EAAE,IAAI,EAAE,CAAC;IACb,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IACjC,SAAS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C,IAAI,EAAE,EAC9B,IAAI,EACJ,OAAO,EACP,MAAe,EACf,SAAS,EACT,SAAsB,EACtB,YAAyB,EACzB,KAAK,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,OAAO,EACP,UAAU,EACV,UAAU,EACV,OAAO,EACP,eAAe,EACf,QAAmB,EACnB,qBAAqB,EACrB,cAAc,EACd,qBAA0B,EAC1B,sBAAsB,EACtB,WAAW,EACX,MAAM,EACN,KAAK,GACL,EAAE,aAAa,CAAC,IAAI,CAAC,+BAoJrB"}
@@ -5,7 +5,12 @@ type HeaderProps<TData> = {
5
5
  height: CSSProperties['height'];
6
6
  sorting?: DataGridSorting<TData>;
7
7
  onSortingChange?: (sorting: DataGridSorting<TData>) => void;
8
+ isSelectionEnabled?: boolean;
9
+ isAllRowsSelected?: boolean;
10
+ isSomeRowsSelected?: boolean;
11
+ isSelectionDisabled?: boolean;
12
+ onAllRowsSelectionChange?: (isSelected: boolean) => void;
8
13
  };
9
- export declare function Header<TData>({ columns, height, sorting, onSortingChange, }: HeaderProps<TData>): import("react").JSX.Element;
14
+ export declare function Header<TData>({ columns, height, sorting, onSortingChange, isSelectionEnabled, isAllRowsSelected, isSomeRowsSelected, isSelectionDisabled, onAllRowsSelectionChange, }: HeaderProps<TData>): import("react").JSX.Element;
10
15
  export {};
11
16
  //# sourceMappingURL=Header.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../../src/components/DataGrid/Header/Header.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGhE,KAAK,WAAW,CAAC,KAAK,IAAI;IACzB,OAAO,EAAE,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;IACjC,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChC,OAAO,CAAC,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC;IACjC,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;CAC5D,CAAC;AAEF,wBAAgB,MAAM,CAAC,KAAK,EAAE,EAC7B,OAAO,EACP,MAAM,EACN,OAAO,EACP,eAAe,GACf,EAAE,WAAW,CAAC,KAAK,CAAC,+BAiBpB"}
1
+ {"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../../src/components/DataGrid/Header/Header.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAG3C,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGhE,KAAK,WAAW,CAAC,KAAK,IAAI;IACzB,OAAO,EAAE,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;IACjC,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChC,OAAO,CAAC,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC;IACjC,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;IAC5D,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,wBAAwB,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;CACzD,CAAC;AAEF,wBAAgB,MAAM,CAAC,KAAK,EAAE,EAC7B,OAAO,EACP,MAAM,EACN,OAAO,EACP,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,GACxB,EAAE,WAAW,CAAC,KAAK,CAAC,+BAgCpB"}
@@ -1,2 +1,3 @@
1
1
  export declare const headerRow: string;
2
+ export declare const selectionHeaderCell: string;
2
3
  //# sourceMappingURL=styles.css.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../../../../src/components/DataGrid/Header/styles.css.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,QAIpB,CAAC"}
1
+ {"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../../../../src/components/DataGrid/Header/styles.css.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS,QAIpB,CAAC;AAEH,eAAO,MAAM,mBAAmB,QAK9B,CAAC"}
@@ -1,12 +1,15 @@
1
- import type { DataGridColumn } from '../types';
1
+ import type { DataGridColumn, DataGridRowId } from '../types';
2
2
  type RowProps<TRow> = {
3
3
  row: TRow;
4
4
  columns: DataGridColumn<TRow>[];
5
5
  rowIndex: number;
6
- rowId: string;
6
+ rowId: DataGridRowId;
7
7
  rowHeight: number;
8
8
  onRowClick?: (row: TRow) => void;
9
+ isSelectionEnabled?: boolean;
10
+ isSelected?: boolean;
11
+ onSelectionChange?: (rowId: DataGridRowId, isSelected: boolean) => void;
9
12
  };
10
- export declare function Row<TRow>({ row, rowHeight, onRowClick, columns, rowIndex, rowId, }: RowProps<TRow>): import("react").JSX.Element;
13
+ export declare function Row<TRow>({ row, rowHeight, onRowClick, columns, rowIndex, rowId, isSelectionEnabled, isSelected, onSelectionChange, }: RowProps<TRow>): import("react").JSX.Element;
11
14
  export {};
12
15
  //# sourceMappingURL=Row.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Row.d.ts","sourceRoot":"","sources":["../../../../src/components/DataGrid/Row/Row.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG/C,KAAK,QAAQ,CAAC,IAAI,IAAI;IACrB,GAAG,EAAE,IAAI,CAAC;IACV,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,IAAI,CAAC;CACjC,CAAC;AACF,wBAAgB,GAAG,CAAC,IAAI,EAAE,EACzB,GAAG,EACH,SAAS,EACT,UAAU,EACV,OAAO,EACP,QAAQ,EACR,KAAK,GACL,EAAE,QAAQ,CAAC,IAAI,CAAC,+BA2BhB"}
1
+ {"version":3,"file":"Row.d.ts","sourceRoot":"","sources":["../../../../src/components/DataGrid/Row/Row.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9D,KAAK,QAAQ,CAAC,IAAI,IAAI;IACrB,GAAG,EAAE,IAAI,CAAC;IACV,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,aAAa,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,IAAI,CAAC;IACjC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;CACxE,CAAC;AACF,wBAAgB,GAAG,CAAC,IAAI,EAAE,EACzB,GAAG,EACH,SAAS,EACT,UAAU,EACV,OAAO,EACP,QAAQ,EACR,KAAK,EACL,kBAAkB,EAClB,UAAU,EACV,iBAAiB,GACjB,EAAE,QAAQ,CAAC,IAAI,CAAC,+BAyChB"}
@@ -1,3 +1,4 @@
1
1
  export declare const rowClass: string;
2
2
  export declare const selectableClass: string;
3
+ export declare const selectionCellClass: string;
3
4
  //# sourceMappingURL=styles.css.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../../../../src/components/DataGrid/Row/styles.css.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ,QAGnB,CAAC;AAMH,eAAO,MAAM,eAAe,QAK1B,CAAC"}
1
+ {"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../../../../src/components/DataGrid/Row/styles.css.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ,QAGnB,CAAC;AAMH,eAAO,MAAM,eAAe,QAK1B,CAAC;AAEH,eAAO,MAAM,kBAAkB,QAK7B,CAAC"}
@@ -23,6 +23,7 @@ export type DataGridSorting<TRow> = {
23
23
  order: DataGridSortOrder;
24
24
  } | null;
25
25
  export type DataGridSortMode = 'client' | 'manual';
26
+ export type DataGridRowId = string | number;
26
27
  export type DataGridEmptyState = {
27
28
  text: string;
28
29
  imgSrc?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/DataGrid/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAErD,MAAM,MAAM,cAAc,CAAC,IAAI,IAAI;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;IAChD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;IACxE,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IA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AC;AAEnE,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,MAAM,CAAC;AAE/C,MAAM,MAAM,eAAe,CAAC,IAAI,IAAI;IACnC,GAAG,EAAE,MAAM,IAAI,CAAC;IAChB,KAAK,EAAE,iBAAiB,CAAC;CACzB,GAAG,IAAI,CAAC;AAET,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEnD,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,CAAC;AAE5C,MAAM,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,YAAY,CAAC;CACvB,CAAC"}
package/lib/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Accordion, Checkbox } from "@base-ui/react";
3
3
  import clsx_0, { clsx } from "clsx";
4
- import { ArrowDownNarrowWide, ArrowDownUp, ArrowDownWideNarrow, ArrowLeft, ArrowRight, Calendar1, Check, CheckIcon, ChevronDown, ChevronDownIcon, ChevronLeft, ChevronRight, ChevronRightIcon, ChevronUp, CircleCheck, CircleIcon, Copy, Ellipsis as external_lucide_react_Ellipsis, EllipsisVertical, Info, Loader, MoreHorizontalIcon, OctagonAlert, PanelLeftIcon, TriangleAlert, XIcon } from "lucide-react";
4
+ import { ArrowDownNarrowWide, ArrowDownUp, ArrowDownWideNarrow, ArrowLeft, ArrowRight, Calendar1, Check, CheckIcon, ChevronDown, ChevronDownIcon, ChevronLeft, ChevronRight, ChevronRightIcon, ChevronUp, CircleCheck, CircleIcon, Copy, Ellipsis as external_lucide_react_Ellipsis, EllipsisVertical, Info, Loader, Minus, MoreHorizontalIcon, OctagonAlert, PanelLeftIcon, TriangleAlert, XIcon } from "lucide-react";
5
5
  import { AlertDialog } from "@base-ui/react/alert-dialog";
6
6
  import { Button } from "@base-ui/react/button";
7
7
  import react, { Component as external_react_Component, createContext, createElement, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
@@ -1610,18 +1610,24 @@ Carousel.Content = Content_Content;
1610
1610
  Carousel.Item = Item_Item;
1611
1611
  Carousel.Arrows = Arrows;
1612
1612
  Carousel.Dots = Dots;
1613
- var checkbox_css_icon = 'style__b7yo4k2';
1613
+ var checkIcon = 'style__b7yo4k2';
1614
1614
  var indicator = 'style__b7yo4k1';
1615
+ var minusIcon = 'style__b7yo4k3';
1615
1616
  var checkbox_css_root = 'style__b7yo4k0';
1616
1617
  const Checkbox_Checkbox = ({ className, ...props })=>/*#__PURE__*/ jsx(Checkbox.Root, {
1617
1618
  "data-slot": "checkbox",
1618
1619
  className: clsx(checkbox_css_root, className),
1619
1620
  ...props,
1620
- children: /*#__PURE__*/ jsx(Checkbox.Indicator, {
1621
+ children: /*#__PURE__*/ jsxs(Checkbox.Indicator, {
1621
1622
  className: indicator,
1622
- children: /*#__PURE__*/ jsx(Check, {
1623
- className: checkbox_css_icon
1624
- })
1623
+ children: [
1624
+ /*#__PURE__*/ jsx(Check, {
1625
+ className: checkIcon
1626
+ }),
1627
+ /*#__PURE__*/ jsx(Minus, {
1628
+ className: minusIcon
1629
+ })
1630
+ ]
1625
1631
  })
1626
1632
  });
1627
1633
  function Collapsible_Collapsible({ ...props }) {
@@ -2103,28 +2109,45 @@ function Cell({ row, column, rowIndex, height }) {
2103
2109
  }
2104
2110
  var rowClass = 'style__gsm9mv0';
2105
2111
  var selectableClass = 'style__gsm9mv1';
2106
- function Row({ row, rowHeight, onRowClick, columns, rowIndex, rowId }) {
2112
+ var selectionCellClass = 'style__gsm9mv2';
2113
+ function Row({ row, rowHeight, onRowClick, columns, rowIndex, rowId, isSelectionEnabled, isSelected, onSelectionChange }) {
2107
2114
  const handleSelect = useCallback(()=>{
2108
2115
  onRowClick?.(row);
2109
2116
  }, [
2110
2117
  onRowClick,
2111
2118
  row
2112
2119
  ]);
2113
- return /*#__PURE__*/ jsx("tr", {
2120
+ return /*#__PURE__*/ jsxs("tr", {
2114
2121
  onClick: handleSelect,
2115
2122
  onKeyDown: handleSelect,
2116
2123
  className: clsx(rowClass, {
2117
2124
  [selectableClass]: Boolean(onRowClick)
2118
2125
  }),
2119
- children: columns.map((column, index)=>{
2120
- const cellId = `${rowId}-${index}`;
2121
- return /*#__PURE__*/ jsx(Cell, {
2122
- row: row,
2123
- rowIndex: rowIndex,
2124
- column: column,
2125
- height: rowHeight
2126
- }, cellId);
2127
- })
2126
+ children: [
2127
+ isSelectionEnabled && /*#__PURE__*/ jsx("td", {
2128
+ className: selectionCellClass,
2129
+ style: {
2130
+ height: rowHeight,
2131
+ width: rowHeight
2132
+ },
2133
+ children: /*#__PURE__*/ jsx(Checkbox_Checkbox, {
2134
+ checked: isSelected,
2135
+ "aria-label": "Select row",
2136
+ onClick: (event)=>event.stopPropagation(),
2137
+ onKeyDown: (event)=>event.stopPropagation(),
2138
+ onCheckedChange: (checked)=>onSelectionChange?.(rowId, checked)
2139
+ })
2140
+ }),
2141
+ columns.map((column, index)=>{
2142
+ const cellId = `${rowId}-${index}`;
2143
+ return /*#__PURE__*/ jsx(Cell, {
2144
+ row: row,
2145
+ rowIndex: rowIndex,
2146
+ column: column,
2147
+ height: rowHeight
2148
+ }, cellId);
2149
+ })
2150
+ ]
2128
2151
  });
2129
2152
  }
2130
2153
  var cell = 'style__15m2ib82';
@@ -2185,9 +2208,10 @@ function State({ isLoading, isEmpty, columnsLength, emptyState = {
2185
2208
  return null;
2186
2209
  }
2187
2210
  var Body_styles_css_container = 'style__82af400';
2188
- function Body({ isError, isLoading, emptyState, errorState, columns, rows, rowHeight, keyId, onRowClick }) {
2211
+ function Body({ isError, isLoading, emptyState, errorState, columns, rows, rowHeight, keyId, onRowClick, isRowSelectionEnabled, selectedRowIdSet, onRowSelectionChange }) {
2189
2212
  const isEmpty = 0 === rows.length;
2190
2213
  const isStateVisible = isError || isLoading || isEmpty;
2214
+ const columnsLength = columns.length + (isRowSelectionEnabled ? 1 : 0);
2191
2215
  return isStateVisible ? /*#__PURE__*/ jsx("tbody", {
2192
2216
  className: Body_styles_css_container,
2193
2217
  children: /*#__PURE__*/ jsx(State, {
@@ -2196,23 +2220,30 @@ function Body({ isError, isLoading, emptyState, errorState, columns, rows, rowHe
2196
2220
  isEmpty: isEmpty,
2197
2221
  isError: isError,
2198
2222
  isLoading: isLoading,
2199
- columnsLength: columns.length
2223
+ columnsLength: columnsLength
2200
2224
  })
2201
2225
  }) : /*#__PURE__*/ jsx("tbody", {
2202
2226
  className: Body_styles_css_container,
2203
2227
  children: rows.map((row, index)=>{
2204
- const rowId = String(row[keyId]);
2228
+ const rowId = getRowId(row[keyId]);
2205
2229
  return /*#__PURE__*/ jsx(Row, {
2206
2230
  row: row,
2207
2231
  rowId: rowId,
2208
2232
  rowHeight: rowHeight,
2209
2233
  columns: columns,
2210
2234
  onRowClick: onRowClick,
2211
- rowIndex: index
2212
- }, row[keyId]);
2235
+ rowIndex: index,
2236
+ isSelectionEnabled: isRowSelectionEnabled,
2237
+ isSelected: selectedRowIdSet.has(rowId),
2238
+ onSelectionChange: onRowSelectionChange
2239
+ }, rowId);
2213
2240
  })
2214
2241
  });
2215
2242
  }
2243
+ function getRowId(value) {
2244
+ if ('string' == typeof value || 'number' == typeof value) return value;
2245
+ return String(value);
2246
+ }
2216
2247
  var styles_css_footerClass = 'style__2s55b60';
2217
2248
  function Footer_Footer({ children, className }) {
2218
2249
  return /*#__PURE__*/ jsx("footer", {
@@ -2280,17 +2311,35 @@ function HeaderCell({ column, height, width, sorting, onSortingChange }) {
2280
2311
  });
2281
2312
  }
2282
2313
  var headerRow = 'style__fkgoub0';
2283
- function Header_Header({ columns, height, sorting, onSortingChange }) {
2314
+ var selectionHeaderCell = 'style__fkgoub1';
2315
+ function Header_Header({ columns, height, sorting, onSortingChange, isSelectionEnabled, isAllRowsSelected, isSomeRowsSelected, isSelectionDisabled, onAllRowsSelectionChange }) {
2284
2316
  return /*#__PURE__*/ jsx("thead", {
2285
- children: /*#__PURE__*/ jsx("tr", {
2317
+ children: /*#__PURE__*/ jsxs("tr", {
2286
2318
  className: clsx(headerRow),
2287
- children: columns.map((col)=>/*#__PURE__*/ jsx(HeaderCell, {
2288
- column: col,
2289
- height: height,
2290
- width: col.width,
2291
- sorting: sorting,
2292
- onSortingChange: onSortingChange
2293
- }, col.label))
2319
+ children: [
2320
+ isSelectionEnabled && /*#__PURE__*/ jsx("th", {
2321
+ className: selectionHeaderCell,
2322
+ style: {
2323
+ height,
2324
+ width: height
2325
+ },
2326
+ "aria-label": "Select all rows",
2327
+ children: /*#__PURE__*/ jsx(Checkbox_Checkbox, {
2328
+ checked: isAllRowsSelected,
2329
+ indeterminate: !isAllRowsSelected && isSomeRowsSelected,
2330
+ disabled: isSelectionDisabled,
2331
+ "aria-label": "Select all rows",
2332
+ onCheckedChange: onAllRowsSelectionChange
2333
+ })
2334
+ }),
2335
+ columns.map((col)=>/*#__PURE__*/ jsx(HeaderCell, {
2336
+ column: col,
2337
+ height: height,
2338
+ width: col.width,
2339
+ sorting: sorting,
2340
+ onSortingChange: onSortingChange
2341
+ }, col.label))
2342
+ ]
2294
2343
  })
2295
2344
  });
2296
2345
  }
@@ -2300,7 +2349,8 @@ var fullHeight = 'style__1gqvluf2';
2300
2349
  var DataGrid_styles_css_loading = 'style__1gqvluf4';
2301
2350
  var table = 'style__1gqvluf1';
2302
2351
  var titleClass = 'style__1gqvluf5';
2303
- function DataGrid({ rows, columns, height = '100%', className, rowHeight = 40, headerHeight = 40, keyId, onRowClick, isLoading, isDisabled, isError, emptyState, errorState, sorting, onSortingChange, sortMode = 'client', footer, title }) {
2352
+ function DataGrid({ rows, columns, height = '100%', className, rowHeight = 40, headerHeight = 40, keyId, onRowClick, isLoading, isDisabled, isError, emptyState, errorState, sorting, onSortingChange, sortMode = 'client', isRowSelectionEnabled, selectedRowIds, defaultSelectedRowIds = [], onSelectedRowIdsChange, onSelectRow, footer, title }) {
2353
+ const [uncontrolledSelectedRowIds, setUncontrolledSelectedRowIds] = useState(defaultSelectedRowIds);
2304
2354
  const sortedRows = useMemo(()=>{
2305
2355
  if (!sorting || 'manual' === sortMode) return rows;
2306
2356
  const column = columns.find(({ field })=>field === sorting.key);
@@ -2318,6 +2368,49 @@ function DataGrid({ rows, columns, height = '100%', className, rowHeight = 40, h
2318
2368
  sortMode,
2319
2369
  sorting
2320
2370
  ]);
2371
+ const activeSelectedRowIds = selectedRowIds ?? uncontrolledSelectedRowIds;
2372
+ const selectedRowIdSet = useMemo(()=>new Set(activeSelectedRowIds), [
2373
+ activeSelectedRowIds
2374
+ ]);
2375
+ const visibleRowIds = useMemo(()=>sortedRows.map((row)=>DataGrid_getRowId(row[keyId])), [
2376
+ keyId,
2377
+ sortedRows
2378
+ ]);
2379
+ const isAllRowsSelected = visibleRowIds.length > 0 && visibleRowIds.every((rowId)=>selectedRowIdSet.has(rowId));
2380
+ const isSomeRowsSelected = visibleRowIds.some((rowId)=>selectedRowIdSet.has(rowId));
2381
+ const handleSelectedRowIdsChange = useCallback((nextSelectedRowIds)=>{
2382
+ if (!selectedRowIds) setUncontrolledSelectedRowIds(nextSelectedRowIds);
2383
+ onSelectedRowIdsChange?.(nextSelectedRowIds);
2384
+ if (onSelectRow) {
2385
+ const nextSelectedRowIdSet = new Set(nextSelectedRowIds);
2386
+ onSelectRow(rows.filter((row)=>nextSelectedRowIdSet.has(DataGrid_getRowId(row[keyId]))));
2387
+ }
2388
+ }, [
2389
+ keyId,
2390
+ onSelectRow,
2391
+ onSelectedRowIdsChange,
2392
+ rows,
2393
+ selectedRowIds
2394
+ ]);
2395
+ const handleRowSelectionChange = useCallback((rowId, isSelected)=>{
2396
+ const nextSelectedRowIdSet = new Set(activeSelectedRowIds);
2397
+ if (isSelected) nextSelectedRowIdSet.add(rowId);
2398
+ else nextSelectedRowIdSet.delete(rowId);
2399
+ handleSelectedRowIdsChange(Array.from(nextSelectedRowIdSet));
2400
+ }, [
2401
+ activeSelectedRowIds,
2402
+ handleSelectedRowIdsChange
2403
+ ]);
2404
+ const handleAllRowsSelectionChange = useCallback((isSelected)=>{
2405
+ const nextSelectedRowIdSet = new Set(activeSelectedRowIds);
2406
+ for (const rowId of visibleRowIds)if (isSelected) nextSelectedRowIdSet.add(rowId);
2407
+ else nextSelectedRowIdSet.delete(rowId);
2408
+ handleSelectedRowIdsChange(Array.from(nextSelectedRowIdSet));
2409
+ }, [
2410
+ activeSelectedRowIds,
2411
+ handleSelectedRowIdsChange,
2412
+ visibleRowIds
2413
+ ]);
2321
2414
  const isFullHeight = isLoading || isError || 0 === rows.length;
2322
2415
  return /*#__PURE__*/ jsxs("div", {
2323
2416
  "data-slot": "data-grid",
@@ -2341,7 +2434,12 @@ function DataGrid({ rows, columns, height = '100%', className, rowHeight = 40, h
2341
2434
  columns: columns,
2342
2435
  height: headerHeight,
2343
2436
  sorting: sorting,
2344
- onSortingChange: onSortingChange
2437
+ onSortingChange: onSortingChange,
2438
+ isSelectionEnabled: isRowSelectionEnabled,
2439
+ isAllRowsSelected: isAllRowsSelected,
2440
+ isSomeRowsSelected: isSomeRowsSelected,
2441
+ isSelectionDisabled: 0 === visibleRowIds.length,
2442
+ onAllRowsSelectionChange: handleAllRowsSelectionChange
2345
2443
  }),
2346
2444
  /*#__PURE__*/ jsx(Body, {
2347
2445
  rows: sortedRows,
@@ -2352,7 +2450,10 @@ function DataGrid({ rows, columns, height = '100%', className, rowHeight = 40, h
2352
2450
  isLoading: isLoading,
2353
2451
  emptyState: emptyState,
2354
2452
  errorState: errorState,
2355
- isError: isError
2453
+ isError: isError,
2454
+ isRowSelectionEnabled: isRowSelectionEnabled,
2455
+ selectedRowIdSet: selectedRowIdSet,
2456
+ onRowSelectionChange: handleRowSelectionChange
2356
2457
  })
2357
2458
  ]
2358
2459
  }),
@@ -2362,6 +2463,10 @@ function DataGrid({ rows, columns, height = '100%', className, rowHeight = 40, h
2362
2463
  ]
2363
2464
  });
2364
2465
  }
2466
+ function DataGrid_getRowId(value) {
2467
+ if ('string' == typeof value || 'number' == typeof value) return value;
2468
+ return String(value);
2469
+ }
2365
2470
  function compareValues(a, b) {
2366
2471
  if (null == a && null == b) return 0;
2367
2472
  if (null == a) return -1;
@@ -8,4 +8,7 @@ declare const _default: {
8
8
  };
9
9
  export default _default;
10
10
  export declare const Default: () => import("react").JSX.Element;
11
+ export declare const Checked: () => import("react").JSX.Element;
12
+ export declare const Indeterminate: () => import("react").JSX.Element;
13
+ export declare const Disabled: () => import("react").JSX.Element;
11
14
  //# sourceMappingURL=Checkbox.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.stories.d.ts","sourceRoot":"","sources":["../../src/stories/Checkbox.stories.tsx"],"names":[],"mappings":";;;;;;;;AAIA,wBAOkC;AAElC,eAAO,MAAM,OAAO,mCAUnB,CAAC"}
1
+ {"version":3,"file":"Checkbox.stories.d.ts","sourceRoot":"","sources":["../../src/stories/Checkbox.stories.tsx"],"names":[],"mappings":";;;;;;;;AAIA,wBAOkC;AAElC,eAAO,MAAM,OAAO,mCAUnB,CAAC;AAEF,eAAO,MAAM,OAAO,mCAUnB,CAAC;AAEF,eAAO,MAAM,aAAa,mCAUzB,CAAC;AAEF,eAAO,MAAM,QAAQ,mCAQpB,CAAC"}
@@ -11,6 +11,7 @@ export default _default;
11
11
  export declare const BaseExample: () => import("react").JSX.Element;
12
12
  export declare const WithActions: () => import("react").JSX.Element;
13
13
  export declare const WithSorting: () => import("react").JSX.Element;
14
+ export declare const WithSelection: () => import("react").JSX.Element;
14
15
  export declare const Loading: () => import("react").JSX.Element;
15
16
  export declare const ErrorState: () => import("react").JSX.Element;
16
17
  export declare const EmptyState: () => import("react").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"DataGrid.stories.d.ts","sourceRoot":"","sources":["../../src/stories/DataGrid.stories.tsx"],"names":[],"mappings":"AAGA,OAAO,EACN,QAAQ,EAKR,MAAM,cAAc,CAAC;;;;;;;;;AAGtB,wBAOkC;AA6JlC,eAAO,MAAM,WAAW,mCAMvB,CAAC;AAEF,eAAO,MAAM,WAAW,mCA6BvB,CAAC;AAEF,eAAO,MAAM,WAAW,mCAoCvB,CAAC;AAEF,eAAO,MAAM,OAAO,mCAEnB,CAAC;AAEF,eAAO,MAAM,UAAU,mCAEtB,CAAC;AAEF,eAAO,MAAM,UAAU,mCAEtB,CAAC;AAEF,eAAO,MAAM,cAAc,mCAsB1B,CAAC"}
1
+ {"version":3,"file":"DataGrid.stories.d.ts","sourceRoot":"","sources":["../../src/stories/DataGrid.stories.tsx"],"names":[],"mappings":"AAGA,OAAO,EACN,QAAQ,EAMR,MAAM,cAAc,CAAC;;;;;;;;;AAGtB,wBAOkC;AA6JlC,eAAO,MAAM,WAAW,mCAMvB,CAAC;AAEF,eAAO,MAAM,WAAW,mCA6BvB,CAAC;AAEF,eAAO,MAAM,WAAW,mCAoCvB,CAAC;AAEF,eAAO,MAAM,aAAa,mCAgBzB,CAAC;AAEF,eAAO,MAAM,OAAO,mCAEnB,CAAC;AAEF,eAAO,MAAM,UAAU,mCAEtB,CAAC;AAEF,eAAO,MAAM,UAAU,mCAEtB,CAAC;AAEF,eAAO,MAAM,cAAc,mCAsB1B,CAAC"}
package/lib/styles.css CHANGED
@@ -2104,11 +2104,12 @@ a.outline__1af895x4:hover {
2104
2104
  border: 1px solid var(--colors-primary);
2105
2105
  background-color: var(--colors-background-paper);
2106
2106
  cursor: pointer;
2107
- border-radius: .2rem;
2107
+ border-radius: 4px;
2108
2108
  flex-shrink: 0;
2109
2109
  width: 1rem;
2110
2110
  height: 1rem;
2111
2111
  transition: all .2s;
2112
+ display: block;
2112
2113
  position: relative;
2113
2114
  }
2114
2115
 
@@ -2134,10 +2135,23 @@ a.outline__1af895x4:hover {
2134
2135
  }
2135
2136
 
2136
2137
  .style__b7yo4k2 {
2137
- width: 1rem;
2138
- height: 1rem;
2138
+ width: 100%;
2139
+ height: 100%;
2139
2140
  stroke: var(--colors-foreground-primary);
2140
2141
  stroke-width: 3px;
2142
+ display: none;
2143
+ }
2144
+
2145
+ .style__b7yo4k3 {
2146
+ width: 100%;
2147
+ height: 100%;
2148
+ stroke: var(--colors-primary);
2149
+ stroke-width: 3px;
2150
+ display: none;
2151
+ }
2152
+
2153
+ .style__b7yo4k1[data-checked] .style__b7yo4k2, .style__b7yo4k1[data-indeterminate] .style__b7yo4k3 {
2154
+ display: block;
2141
2155
  }
2142
2156
 
2143
2157
  @keyframes style__1xy4jvu0 {
@@ -2542,6 +2556,13 @@ a.outline__1af895x4:hover {
2542
2556
  background-color: var(--colors-background-elementHover);
2543
2557
  }
2544
2558
 
2559
+ .style__gsm9mv2 {
2560
+ border-bottom: 1px solid var(--colors-border);
2561
+ justify-content: center;
2562
+ align-items: center;
2563
+ display: flex;
2564
+ }
2565
+
2545
2566
  .style__15m2ib80 {
2546
2567
  width: 100%;
2547
2568
  height: 100%;
@@ -2639,6 +2660,13 @@ a.outline__1af895x4:hover {
2639
2660
  top: 0;
2640
2661
  }
2641
2662
 
2663
+ .style__fkgoub1 {
2664
+ border-bottom: 1px solid var(--colors-border);
2665
+ justify-content: center;
2666
+ align-items: center;
2667
+ display: flex;
2668
+ }
2669
+
2642
2670
  .style__1gqvluf0 {
2643
2671
  background-color: var(--colors-background-paper);
2644
2672
  border: 1px solid var(--colors-border);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@max-ts/kit",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./lib/index.mjs",
6
6
  "types": "./lib/index.d.ts",