@wavv/ui 1.7.8 → 1.7.9

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,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { TableHeaderRow } from './types';
3
- declare const Header: ({ children, columns, ...rest }: TableHeaderRow) => JSX.Element;
3
+ declare const Header: ({ children, columns, columnStyles, ...rest }: TableHeaderRow) => JSX.Element;
4
4
  export default Header;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { TableHeaderRow } from './types';
3
- declare const Row: ({ children, columns, onClick, ...rest }: TableHeaderRow) => JSX.Element;
3
+ declare const Row: ({ children, columns, onClick, columnStyles, ...rest }: TableHeaderRow) => JSX.Element;
4
4
  export default Row;
@@ -2,7 +2,7 @@ import { ReactNode } from 'react';
2
2
  import { Data, TableProps } from './types';
3
3
  declare const Table: {
4
4
  <DataType extends Data>({ children, columns, data, ...rest }: TableProps<DataType>): JSX.Element;
5
- Header: ({ children, columns, ...rest }: import("./types").TableHeaderRow) => JSX.Element;
5
+ Header: ({ children, columns, columnStyles, ...rest }: import("./types").TableHeaderRow) => JSX.Element;
6
6
  HeaderCell: ({ children, onClick, contentPosition, sorted, sortKey }: {
7
7
  children?: ReactNode;
8
8
  contentPosition?: import("../types").FlexPosition | undefined;
@@ -13,7 +13,7 @@ declare const Table: {
13
13
  Body: ({ children, height, maxHeight, ...rest }: {
14
14
  children: ReactNode;
15
15
  } & import("../types").Height & import("../types").MaxHeight & Omit<import("react").HTMLProps<HTMLTableSectionElement>, "as"> & import("../types").As) => JSX.Element;
16
- Row: ({ children, columns, onClick, ...rest }: import("./types").TableHeaderRow) => JSX.Element;
16
+ Row: ({ children, columns, onClick, columnStyles, ...rest }: import("./types").TableHeaderRow) => JSX.Element;
17
17
  Column: ({ children, contentPosition, defaultValue, padding, paddingTop, paddingBottom, paddingRight, paddingLeft, }: {
18
18
  children?: ReactNode;
19
19
  contentPosition?: import("../types").FlexPosition | undefined;
@@ -1,9 +1,9 @@
1
- import React, { HTMLProps, ReactNode } from 'react';
2
- import { As, MarginPadding, Width, ThemeProp, Padding } from '../types';
1
+ import { CSSProperties, Dispatch, HTMLProps, ReactNode, SetStateAction } from 'react';
2
+ import { As, MarginPadding, Padding, ThemeProp, Width } from '../types';
3
3
  export type Data = {
4
4
  [key: string]: unknown;
5
5
  };
6
- export type SetData<DataType> = React.Dispatch<React.SetStateAction<DataType[]>>;
6
+ export type SetData<DataType> = Dispatch<SetStateAction<DataType[]>>;
7
7
  export type Columns = number | string;
8
8
  export type SortedChildFunc<DataType> = (data: DataType[]) => ReactNode;
9
9
  type Default = {
@@ -22,7 +22,10 @@ type TableBase = {
22
22
  columns?: Columns;
23
23
  } & Width & MarginPadding;
24
24
  export type TableProps<DataType> = TableBase & TableTypes<DataType> & DefaultTableProps;
25
- export type TableHeaderRow = TableBase & HTMLProps<HTMLTableRowElement>;
25
+ export type TableHeaderRow = {
26
+ /** CSS styles to be passed to every th/td element in the Header/Row */
27
+ columnStyles?: CSSProperties;
28
+ } & TableBase & HTMLProps<HTMLTableRowElement>;
26
29
  export type TableElements = {
27
30
  as?: string;
28
31
  } & ThemeProp & Padding;
@@ -31,7 +34,7 @@ export type ActiveColumn = {
31
34
  key: string;
32
35
  dir: 'asc' | 'desc';
33
36
  };
34
- type SetColumn = React.Dispatch<React.SetStateAction<ActiveColumn | undefined>>;
37
+ type SetColumn = Dispatch<SetStateAction<ActiveColumn | undefined>>;
35
38
  export type Context = {
36
39
  parentColumns?: Columns;
37
40
  activeColumn?: ActiveColumn;
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import { CSSProperties, ReactNode } from 'react';
2
2
  import { Data } from './types';
3
- export declare const wrappedChildren: (children: ReactNode, type: string) => (JSX.Element | null)[];
3
+ export declare const wrappedChildren: (children: ReactNode, type: 'th' | 'td', style?: CSSProperties) => (JSX.Element | null)[];
4
4
  export declare const isEqualContents: (array1?: Data[], array2?: Data[]) => boolean;