@paygreen/pgui 3.0.12 → 3.0.13

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,9 @@
1
+ import { ReactNode } from 'react';
2
+ interface TableEmptyStateProps {
3
+ isLoading: boolean;
4
+ emptyState: ReactNode;
5
+ variant?: 'mobile' | 'desktop';
6
+ colSpan?: number;
7
+ }
8
+ export declare const TableEmptyState: ({ isLoading, emptyState, variant, colSpan, }: TableEmptyStateProps) => import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,14 @@
1
+ import { IconButtonProps } from '@chakra-ui/react';
2
+ import { DataTablePagination } from '../data-table';
3
+ interface TablePaginationFooterProps {
4
+ pagination?: DataTablePagination;
5
+ paginationButtonProps?: Partial<IconButtonProps>;
6
+ countLabel?: {
7
+ singular: string;
8
+ plural: string;
9
+ };
10
+ isTableLoading?: boolean;
11
+ variant?: 'mobile' | 'desktop';
12
+ }
13
+ export declare const TablePaginationFooter: ({ pagination, paginationButtonProps, countLabel, isTableLoading, variant, }: TablePaginationFooterProps) => import("react/jsx-runtime").JSX.Element | null;
14
+ export {};
@@ -0,0 +1,15 @@
1
+ import { ReactNode } from 'react';
2
+ interface TableRowWrapperProps {
3
+ children: ReactNode;
4
+ index: number;
5
+ variant: 'simple' | 'striped';
6
+ colorPalette?: 'blue' | 'orange';
7
+ onClick?: (e: React.MouseEvent) => void;
8
+ onAuxClick?: (e: React.MouseEvent) => void;
9
+ cursor?: 'pointer' | 'default';
10
+ isLoading?: boolean;
11
+ bg: string | Record<string, string>;
12
+ hoverBg: string | Record<string, string>;
13
+ }
14
+ export declare const TableRowWrapper: ({ children, onClick, onAuxClick, cursor, isLoading, bg, hoverBg, }: TableRowWrapperProps) => import("react/jsx-runtime").JSX.Element;
15
+ export {};
@@ -25,7 +25,7 @@ export interface DataTableProps<TData> {
25
25
  isLoading?: boolean;
26
26
  onFilterChange?: (filters: ColumnFiltersState) => void;
27
27
  onSortingChange?: (sorting: SortingState) => void;
28
- onRowClick?: (row: TData) => void;
28
+ onRowClick?: (row: TData, event: React.MouseEvent) => void;
29
29
  paginationButtonProps?: Partial<IconButtonProps>;
30
30
  countLabel?: {
31
31
  singular: string;
@@ -6,3 +6,10 @@ import { Cell } from '@tanstack/react-table';
6
6
  * @param emptyState The content to display if the cell is empty (defaults to '-')
7
7
  */
8
8
  export declare const renderCell: <TData>(cell: Cell<TData, unknown>, emptyState?: React.ReactNode) => string | number | bigint | boolean | import("react").JSX.Element | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> | null | undefined;
9
+ /**
10
+ * Format pagination results text based on whether there are multiple pages
11
+ */
12
+ export declare const formatPaginationText: (hasMultiplePages: boolean, page: number, maxPerPage: number, totalResults: number, countLabel?: {
13
+ singular: string;
14
+ plural: string;
15
+ }) => string;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Handle row click events with support for middle click/ctrl+click
3
+ */
4
+ export declare const useTableRowInteraction: <TData>(onRowClick?: (row: TData, event: React.MouseEvent) => void) => {
5
+ handleRowInteraction: (row: TData, event: React.MouseEvent) => void;
6
+ handleClick: (row: TData, e: React.MouseEvent) => void;
7
+ handleAuxClick: (row: TData, e: React.MouseEvent) => void;
8
+ };
@@ -0,0 +1,51 @@
1
+ export declare const useTableStyling: (variant: "simple" | "striped", colorPalette?: "blue" | "orange") => {
2
+ headerBg: {
3
+ readonly base: "lm_cello.80";
4
+ readonly _dark: "bg.muted";
5
+ } | {
6
+ readonly base: "lm_orange.80";
7
+ readonly _dark: "lm_orange.30/20";
8
+ } | {
9
+ readonly base: "lm_gray.90";
10
+ readonly _dark: "lm_gray.30/20";
11
+ };
12
+ headerHover: {
13
+ readonly base: "lm_cello.70";
14
+ readonly _dark: "bg.emphasized";
15
+ } | {
16
+ readonly base: "lm_orange.70";
17
+ readonly _dark: "lm_orange.30/40";
18
+ } | {
19
+ readonly base: "lm_gray.80";
20
+ readonly _dark: "lm_gray.30/40";
21
+ };
22
+ getRowBg: (index: number) => "bg" | {
23
+ readonly base: "lm_cello.80";
24
+ readonly _dark: "bg.muted";
25
+ } | {
26
+ readonly base: "lm_orange.80";
27
+ readonly _dark: "lm_orange.30/20";
28
+ } | {
29
+ readonly base: "lm_gray.90";
30
+ readonly _dark: "lm_gray.30/20";
31
+ };
32
+ getRowHoverBg: (index: number) => {
33
+ readonly base: "lm_cello.80";
34
+ readonly _dark: "bg.muted";
35
+ } | {
36
+ readonly base: "lm_cello.70";
37
+ readonly _dark: "bg.emphasized";
38
+ } | {
39
+ readonly base: "lm_orange.80";
40
+ readonly _dark: "lm_orange.30/20";
41
+ } | {
42
+ readonly base: "lm_orange.70";
43
+ readonly _dark: "lm_orange.30/40";
44
+ } | {
45
+ readonly base: "lm_gray.90";
46
+ readonly _dark: "lm_gray.30/20";
47
+ } | {
48
+ readonly base: "lm_gray.80";
49
+ readonly _dark: "lm_gray.30/40";
50
+ };
51
+ };