flikkui 0.2.0-beta.4 → 0.2.0-beta.5
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/README.md +92 -0
- package/dist/components/core/Table/Table.animations.d.ts +5 -16
- package/dist/components/core/Table/Table.animations.js +46 -0
- package/dist/components/core/Table/Table.d.ts +0 -27
- package/dist/components/core/Table/Table.js +58 -156
- package/dist/components/core/Table/Table.theme.js +28 -19
- package/dist/components/core/Table/Table.types.d.ts +95 -8
- package/dist/components/core/Table/Table.utils.d.ts +7 -0
- package/dist/components/core/Table/Table.utils.js +11 -1
- package/dist/components/core/Table/{components/TableActions/TableActions.d.ts → TableActions.d.ts} +3 -3
- package/dist/components/core/Table/{components/TableActions/TableActions.js → TableActions.js} +14 -24
- package/dist/components/core/Table/{components/TableActions/TableActionsMenu.d.ts → TableActionsMenu.d.ts} +1 -1
- package/dist/components/core/Table/{components/TableActions/TableActionsMenu.js → TableActionsMenu.js} +4 -4
- package/dist/components/core/Table/{components/core/TableBody.d.ts → TableBody.d.ts} +1 -1
- package/dist/components/core/Table/{components/core/TableBody.js → TableBody.js} +14 -20
- package/dist/components/core/Table/{components/core/TableCell.d.ts → TableCell.d.ts} +1 -9
- package/dist/components/core/Table/{components/core/TableCell.js → TableCell.js} +5 -13
- package/dist/components/core/Table/TableColumnManager.d.ts +3 -0
- package/dist/components/core/Table/TableColumnManager.js +34 -0
- package/dist/components/core/Table/{components/DeclarativeComponents.d.ts → TableDeclarative.d.ts} +1 -1
- package/dist/components/core/Table/{components/DeclarativeComponents.js → TableDeclarative.js} +6 -56
- package/dist/components/core/Table/TableFilter.d.ts +3 -0
- package/dist/components/core/Table/TableFilter.js +122 -0
- package/dist/components/core/Table/{components/core/TableHeader.d.ts → TableHeader.d.ts} +1 -1
- package/dist/components/core/Table/{components/core/TableHeader.js → TableHeader.js} +15 -29
- package/dist/components/core/Table/TablePagination.d.ts +7 -0
- package/dist/components/core/Table/{components/TablePagination/TablePagination.js → TablePagination.js} +5 -16
- package/dist/components/core/Table/TableRow.d.ts +8 -0
- package/dist/components/core/Table/TableRow.js +45 -0
- package/dist/components/core/Table/TableSelectionHeader.d.ts +7 -0
- package/dist/components/core/Table/{components/TableSelectionHeader/TableSelectionHeader.js → TableSelectionHeader.js} +4 -5
- package/dist/components/core/Table/hooks/index.d.ts +10 -0
- package/dist/components/core/Table/hooks/useTableColumns.d.ts +16 -0
- package/dist/components/core/Table/hooks/useTableColumns.js +67 -0
- package/dist/components/core/Table/hooks/useTableExpansion.d.ts +8 -0
- package/dist/components/core/Table/hooks/useTableExpansion.js +15 -0
- package/dist/components/core/Table/hooks/useTableFilter.d.ts +12 -0
- package/dist/components/core/Table/hooks/useTableFilter.js +37 -0
- package/dist/components/core/Table/hooks/useTablePagination.d.ts +12 -0
- package/dist/components/core/Table/hooks/useTablePagination.js +13 -0
- package/dist/components/core/Table/hooks/useTableSelection.d.ts +17 -0
- package/dist/components/core/Table/hooks/useTableSelection.js +40 -0
- package/dist/components/core/Table/index.d.ts +9 -8
- package/dist/components/core/Table/index.js +7 -5
- package/dist/components/core/index.js +9 -3
- package/dist/index.js +9 -3
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/components/core/Table/components/TableActions/TableActions.types.d.ts +0 -40
- package/dist/components/core/Table/components/TableActions/index.d.ts +0 -3
- package/dist/components/core/Table/components/TableActionsMenu.d.ts +0 -6
- package/dist/components/core/Table/components/TablePagination/TablePagination.d.ts +0 -17
- package/dist/components/core/Table/components/TablePagination/TablePagination.types.d.ts +0 -21
- package/dist/components/core/Table/components/TablePagination/index.d.ts +0 -2
- package/dist/components/core/Table/components/TableSelectionHeader/TableSelectionHeader.d.ts +0 -15
- package/dist/components/core/Table/components/TableSelectionHeader/index.d.ts +0 -3
- package/dist/components/core/Table/components/core/TableRow.d.ts +0 -3
- package/dist/components/core/Table/components/core/TableRow.js +0 -44
- package/dist/components/core/Table/components/core/index.d.ts +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flikkui",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.5",
|
|
4
4
|
"description": "A modern React component library built with TypeScript, Tailwind CSS v4, and Framer Motion. Follows the shadcn philosophy with complete className override support.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
export type ActionVariant = 'default' | 'danger';
|
|
2
|
-
export type ActionPriority = 'high' | 'normal';
|
|
3
|
-
export interface ActionItem<T = any> {
|
|
4
|
-
/** Unique identifier for the action */
|
|
5
|
-
id: string;
|
|
6
|
-
/** Display label for the action */
|
|
7
|
-
label: string;
|
|
8
|
-
/** Icon component to display */
|
|
9
|
-
icon: React.ComponentType<{
|
|
10
|
-
className?: string;
|
|
11
|
-
}>;
|
|
12
|
-
/** Click handler that receives the row data */
|
|
13
|
-
onClick: (row: T) => void;
|
|
14
|
-
/** Visual variant for styling (default: 'default') */
|
|
15
|
-
variant?: ActionVariant;
|
|
16
|
-
/** Priority level for display ordering (default: 'normal') */
|
|
17
|
-
priority?: ActionPriority;
|
|
18
|
-
/** Function to determine if action should be disabled */
|
|
19
|
-
disabled?: (row: T) => boolean;
|
|
20
|
-
}
|
|
21
|
-
export interface TableActionsProps<T = any> {
|
|
22
|
-
/** Array of action items to display */
|
|
23
|
-
actions: ActionItem<T>[];
|
|
24
|
-
/** Row data to pass to action handlers */
|
|
25
|
-
row: T;
|
|
26
|
-
/** Maximum number of actions to show inline before using menu (default: 2) */
|
|
27
|
-
maxVisibleActions?: number;
|
|
28
|
-
/** Additional CSS class name */
|
|
29
|
-
className?: string;
|
|
30
|
-
}
|
|
31
|
-
export interface TableActionsMenuProps<T = any> {
|
|
32
|
-
/** Array of action items to display in menu */
|
|
33
|
-
actions: ActionItem<T>[];
|
|
34
|
-
/** Row data to pass to action handlers */
|
|
35
|
-
row: T;
|
|
36
|
-
/** Function to close the menu */
|
|
37
|
-
onClose: () => void;
|
|
38
|
-
/** Additional CSS class name */
|
|
39
|
-
className?: string;
|
|
40
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TableActionsMenuProps } from './TableActions/TableActions.types';
|
|
3
|
-
/**
|
|
4
|
-
* TableActionsMenu component for displaying actions in an overflow menu
|
|
5
|
-
*/
|
|
6
|
-
export declare const TableActionsMenu: <T>({ actions, row, onClose, className, }: TableActionsMenuProps<T>) => React.JSX.Element;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { TablePaginationProps } from "./TablePagination.types";
|
|
3
|
-
/**
|
|
4
|
-
* TablePagination provides a standardized pagination interface for tables
|
|
5
|
-
* Combines the core Pagination component with page size selection controls
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* <Table.Pagination
|
|
9
|
-
* currentPage={currentPage}
|
|
10
|
-
* totalItems={data.length}
|
|
11
|
-
* pageSize={pageSize}
|
|
12
|
-
* onPageChange={setCurrentPage}
|
|
13
|
-
* onPageSizeChange={setPageSize}
|
|
14
|
-
* pageSizeOptions={[10, 25, 50, 100]}
|
|
15
|
-
* />
|
|
16
|
-
*/
|
|
17
|
-
export declare const TablePagination: React.FC<TablePaginationProps>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TablePagination component props for seamless integration with Table component
|
|
3
|
-
*/
|
|
4
|
-
export interface TablePaginationProps {
|
|
5
|
-
/** Current active page number (1-based) */
|
|
6
|
-
currentPage: number;
|
|
7
|
-
/** Total number of items across all pages */
|
|
8
|
-
totalItems: number;
|
|
9
|
-
/** Number of items per page */
|
|
10
|
-
pageSize: number;
|
|
11
|
-
/** Available page size options */
|
|
12
|
-
pageSizeOptions?: number[];
|
|
13
|
-
/** Callback when page changes */
|
|
14
|
-
onPageChange: (page: number) => void;
|
|
15
|
-
/** Callback when page size changes */
|
|
16
|
-
onPageSizeChange: (pageSize: number) => void;
|
|
17
|
-
/** Whether to show the page size selector */
|
|
18
|
-
showPageSizeSelector?: boolean;
|
|
19
|
-
/** Additional CSS classes */
|
|
20
|
-
className?: string;
|
|
21
|
-
}
|
package/dist/components/core/Table/components/TableSelectionHeader/TableSelectionHeader.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { BulkAction } from "../../Table.types";
|
|
3
|
-
export interface TableSelectionHeaderProps {
|
|
4
|
-
selectedCount: number;
|
|
5
|
-
totalCount: number;
|
|
6
|
-
selectedRows: string[];
|
|
7
|
-
bulkActions?: BulkAction[];
|
|
8
|
-
onClearSelection: () => void;
|
|
9
|
-
className?: string;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Selection header that appears when rows are selected
|
|
13
|
-
* Shows selection count and bulk action buttons
|
|
14
|
-
*/
|
|
15
|
-
export declare const TableSelectionHeader: React.FC<TableSelectionHeaderProps>;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
2
|
-
import { TableCell } from './TableCell.js';
|
|
3
|
-
import { Button } from '../../../Button/Button.js';
|
|
4
|
-
import { Checkbox } from '../../../../forms/Checkbox/Checkbox.js';
|
|
5
|
-
import { Radio } from '../../../../forms/Radio/Radio.js';
|
|
6
|
-
import { MinusIcon, PlusIcon } from '@heroicons/react/24/outline';
|
|
7
|
-
|
|
8
|
-
function TableRowComponent({ row, rowId, columns, expandedRowRender, isExpanded = false, onExpandChange, selectable, selectionType, isSelected = false, onSelectionChange, freezeFirstColumn, freezeLastColumn, theme, }) {
|
|
9
|
-
const rowClasses = [
|
|
10
|
-
(theme === null || theme === void 0 ? void 0 : theme.rowStyle) || "",
|
|
11
|
-
isSelected ? (theme === null || theme === void 0 ? void 0 : theme.selectedRowStyle) || "" : ""
|
|
12
|
-
].filter(Boolean).join(" ");
|
|
13
|
-
const handleExpandClick = (e) => {
|
|
14
|
-
e.stopPropagation();
|
|
15
|
-
onExpandChange === null || onExpandChange === void 0 ? void 0 : onExpandChange(!isExpanded);
|
|
16
|
-
};
|
|
17
|
-
return (React__default.createElement(React__default.Fragment, null,
|
|
18
|
-
React__default.createElement("tr", { className: rowClasses, "data-selected": isSelected, role: "row", "aria-selected": selectable ? isSelected : undefined, "aria-expanded": Boolean(expandedRowRender) ? isExpanded : undefined },
|
|
19
|
-
selectable && (React__default.createElement(TableCell, { column: {
|
|
20
|
-
id: 'selection',
|
|
21
|
-
header: '',
|
|
22
|
-
accessor: () => '',
|
|
23
|
-
width: '48px',
|
|
24
|
-
align: 'center'
|
|
25
|
-
}, row: row, rowId: rowId, theme: theme }, selectionType === "checkbox" ? (React__default.createElement(Checkbox, { id: `table-checkbox-${rowId}`, name: `table-selection-${rowId}`, value: String(rowId), checked: isSelected, onChange: (checked) => onSelectionChange === null || onSelectionChange === void 0 ? void 0 : onSelectionChange(checked), onClick: (e) => e.stopPropagation(), "aria-label": "Select row" })) : (React__default.createElement("div", { onClick: (e) => e.stopPropagation() },
|
|
26
|
-
React__default.createElement(Radio, { id: `table-radio-${rowId}`, name: "table-selection", value: String(rowId), checked: isSelected, onChange: (checked) => onSelectionChange === null || onSelectionChange === void 0 ? void 0 : onSelectionChange(checked), "aria-label": "Select row" }))))),
|
|
27
|
-
expandedRowRender && (React__default.createElement(TableCell, { column: {
|
|
28
|
-
id: 'expand',
|
|
29
|
-
header: '',
|
|
30
|
-
accessor: () => '',
|
|
31
|
-
width: '48px',
|
|
32
|
-
align: 'center'
|
|
33
|
-
}, row: row, rowId: rowId, theme: theme },
|
|
34
|
-
React__default.createElement(Button, { color: "primary", variant: "ghost", size: "sm", onClick: handleExpandClick, "aria-label": isExpanded ? "Collapse row" : "Expand row" }, isExpanded ? React__default.createElement(MinusIcon, { className: "w-4 h-4", strokeWidth: 2 }) : React__default.createElement(PlusIcon, { className: "w-4 h-4", strokeWidth: 2 })))),
|
|
35
|
-
columns.map((column, index) => (React__default.createElement(TableCell, { key: column.id, column: column, row: row, rowId: rowId, isFrozen: freezeFirstColumn && index === 0, isLastFrozen: freezeLastColumn && index === columns.length - 1, theme: theme })))),
|
|
36
|
-
isExpanded && expandedRowRender && (React__default.createElement("tr", null,
|
|
37
|
-
React__default.createElement("td", { colSpan: columns.length +
|
|
38
|
-
(selectable ? 1 : 0) +
|
|
39
|
-
1 }, expandedRowRender(row))))));
|
|
40
|
-
}
|
|
41
|
-
// Export with proper type annotation
|
|
42
|
-
const TableRow = TableRowComponent;
|
|
43
|
-
|
|
44
|
-
export { TableRow };
|