@wavv/ui 2.0.0-alpha.8 → 2.0.0-alpha.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.
@@ -0,0 +1,12 @@
1
+ import { ReactNode } from 'react';
2
+ type Props = {
3
+ children?: ReactNode;
4
+ /** The element/string to display when the table is empty */
5
+ emptyFallback?: ReactNode;
6
+ /** If true, shows a loading spinner in the body */
7
+ loading?: boolean;
8
+ /** If true, shows a loading spinner at the bottom of the body */
9
+ fetching?: boolean;
10
+ };
11
+ declare const Body: ({ children, emptyFallback, fetching, loading }: Props) => import("react/jsx-runtime").JSX.Element;
12
+ export default Body;
@@ -0,0 +1,5 @@
1
+ type Props = {
2
+ spinnerSize?: 'small';
3
+ };
4
+ declare const LoadingRow: ({ spinnerSize }: Props) => import("react/jsx-runtime").JSX.Element;
5
+ export default LoadingRow;
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { Padding } from '../types';
2
+ import { Height, Padding } from '../types';
3
3
  type Props = {
4
4
  children: ReactNode;
5
5
  /** Function called when the row is clicked */
@@ -10,6 +10,6 @@ type Props = {
10
10
  backgroundColor?: string;
11
11
  /** If true, adds a left border to the row. If a string, sets the left border color of the row */
12
12
  emphasis?: boolean | string;
13
- } & Padding;
13
+ } & Padding & Height;
14
14
  declare const Row: ({ children, onClick, disabled, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
15
15
  export default Row;
@@ -5,9 +5,11 @@ import type { Data, TableChildren } from './types';
5
5
  type Props<T> = {
6
6
  /** Background color of the table */
7
7
  backgroundColor?: string;
8
- } & TableChildren<T> & MarginPadding & Omit<TableProps, 'children' | 'sortDescriptor' | 'onSortChange'>;
8
+ /** The function to be called when the end of a scrolling table has been reached */
9
+ onScrollEnd?: () => void;
10
+ } & TableChildren<T> & MarginPadding & Omit<TableProps, 'children' | 'sortDescriptor' | 'onSortChange' | 'onScroll'>;
9
11
  declare const Table: {
10
- <DataType extends Data>({ children, data, ...props }: Props<DataType>): import("react/jsx-runtime").JSX.Element;
12
+ <DataType extends Data>({ children, data, onScrollEnd, ...props }: Props<DataType>): import("react/jsx-runtime").JSX.Element;
11
13
  Header: import("@emotion/styled").StyledComponent<import("react-aria-components").TableHeaderProps<object> & import("react").RefAttributes<HTMLTableSectionElement> & {
12
14
  theme?: import("@emotion/react").Theme | undefined;
13
15
  } & {
@@ -20,14 +22,19 @@ declare const Table: {
20
22
  sorted?: import("./types").SortDir | undefined;
21
23
  sortKey?: string | undefined;
22
24
  } & Padding & import("./contentStyles").ContentProps & Omit<import("react-aria-components").ColumnProps, "children" | "allowsSorting">) => import("react/jsx-runtime").JSX.Element;
23
- Body: <T extends object>(props: import("react-aria-components").TableBodyProps<T> & import("react").RefAttributes<HTMLTableSectionElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
25
+ Body: ({ children, emptyFallback, fetching, loading }: {
26
+ children?: ReactNode;
27
+ emptyFallback?: ReactNode;
28
+ loading?: boolean | undefined;
29
+ fetching?: boolean | undefined;
30
+ }) => import("react/jsx-runtime").JSX.Element;
24
31
  Row: ({ children, onClick, disabled, ...rest }: {
25
32
  children: ReactNode;
26
33
  onClick?: (() => void) | undefined;
27
34
  disabled?: boolean | undefined;
28
35
  backgroundColor?: string | undefined;
29
36
  emphasis?: string | boolean | undefined;
30
- } & Padding) => import("react/jsx-runtime").JSX.Element;
37
+ } & Padding & import("../types").Height) => import("react/jsx-runtime").JSX.Element;
31
38
  Cell: ({ children, defaultValue, direction, justify, align, gap, ...props }: {
32
39
  children?: ReactNode;
33
40
  defaultValue?: string | undefined;
package/build/index.d.ts CHANGED
@@ -2564,9 +2564,11 @@ type SortDir = 'asc' | 'desc' | 'inactive';
2564
2564
  type Props$2<T> = {
2565
2565
  /** Background color of the table */
2566
2566
  backgroundColor?: string;
2567
- } & TableChildren<T> & MarginPadding & Omit<TableProps, 'children' | 'sortDescriptor' | 'onSortChange'>;
2567
+ /** The function to be called when the end of a scrolling table has been reached */
2568
+ onScrollEnd?: () => void;
2569
+ } & TableChildren<T> & MarginPadding & Omit<TableProps, 'children' | 'sortDescriptor' | 'onSortChange' | 'onScroll'>;
2568
2570
  declare const Table: {
2569
- <DataType extends Data>({ children, data, ...props }: Props$2<DataType>): react_jsx_runtime.JSX.Element;
2571
+ <DataType extends Data>({ children, data, onScrollEnd, ...props }: Props$2<DataType>): react_jsx_runtime.JSX.Element;
2570
2572
  Header: _emotion_styled.StyledComponent<react_aria_components.TableHeaderProps<object> & react.RefAttributes<HTMLTableSectionElement> & {
2571
2573
  theme?: _emotion_react.Theme | undefined;
2572
2574
  } & {
@@ -2579,14 +2581,19 @@ declare const Table: {
2579
2581
  sorted?: SortDir | undefined;
2580
2582
  sortKey?: string | undefined;
2581
2583
  } & Padding & ContentProps & Omit<react_aria_components.ColumnProps, "children" | "allowsSorting">) => react_jsx_runtime.JSX.Element;
2582
- Body: <T extends object>(props: react_aria_components.TableBodyProps<T> & react.RefAttributes<HTMLTableSectionElement>) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
2584
+ Body: ({ children, emptyFallback, fetching, loading }: {
2585
+ children?: ReactNode;
2586
+ emptyFallback?: ReactNode;
2587
+ loading?: boolean | undefined;
2588
+ fetching?: boolean | undefined;
2589
+ }) => react_jsx_runtime.JSX.Element;
2583
2590
  Row: ({ children, onClick, disabled, ...rest }: {
2584
2591
  children: ReactNode;
2585
2592
  onClick?: (() => void) | undefined;
2586
2593
  disabled?: boolean | undefined;
2587
2594
  backgroundColor?: string | undefined;
2588
2595
  emphasis?: string | boolean | undefined;
2589
- } & Padding) => react_jsx_runtime.JSX.Element;
2596
+ } & Padding & Height) => react_jsx_runtime.JSX.Element;
2590
2597
  Cell: ({ children, defaultValue, direction, justify, align, gap, ...props }: {
2591
2598
  children?: ReactNode;
2592
2599
  defaultValue?: string | undefined;
@@ -0,0 +1,12 @@
1
+ import { ReactNode } from 'react';
2
+ type Props = {
3
+ children?: ReactNode;
4
+ /** The element/string to display when the table is empty */
5
+ emptyFallback?: ReactNode;
6
+ /** If true, shows a loading spinner in the body */
7
+ loading?: boolean;
8
+ /** If true, shows a loading spinner at the bottom of the body */
9
+ fetching?: boolean;
10
+ };
11
+ declare const Body: ({ children, emptyFallback, fetching, loading }: Props) => import("react/jsx-runtime").JSX.Element;
12
+ export default Body;
@@ -0,0 +1,5 @@
1
+ type Props = {
2
+ spinnerSize?: 'small';
3
+ };
4
+ declare const LoadingRow: ({ spinnerSize }: Props) => import("react/jsx-runtime").JSX.Element;
5
+ export default LoadingRow;
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { Padding } from '../types';
2
+ import { Height, Padding } from '../types';
3
3
  type Props = {
4
4
  children: ReactNode;
5
5
  /** Function called when the row is clicked */
@@ -10,6 +10,6 @@ type Props = {
10
10
  backgroundColor?: string;
11
11
  /** If true, adds a left border to the row. If a string, sets the left border color of the row */
12
12
  emphasis?: boolean | string;
13
- } & Padding;
13
+ } & Padding & Height;
14
14
  declare const Row: ({ children, onClick, disabled, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
15
15
  export default Row;
@@ -5,9 +5,11 @@ import type { Data, TableChildren } from './types';
5
5
  type Props<T> = {
6
6
  /** Background color of the table */
7
7
  backgroundColor?: string;
8
- } & TableChildren<T> & MarginPadding & Omit<TableProps, 'children' | 'sortDescriptor' | 'onSortChange'>;
8
+ /** The function to be called when the end of a scrolling table has been reached */
9
+ onScrollEnd?: () => void;
10
+ } & TableChildren<T> & MarginPadding & Omit<TableProps, 'children' | 'sortDescriptor' | 'onSortChange' | 'onScroll'>;
9
11
  declare const Table: {
10
- <DataType extends Data>({ children, data, ...props }: Props<DataType>): import("react/jsx-runtime").JSX.Element;
12
+ <DataType extends Data>({ children, data, onScrollEnd, ...props }: Props<DataType>): import("react/jsx-runtime").JSX.Element;
11
13
  Header: import("@emotion/styled").StyledComponent<import("react-aria-components").TableHeaderProps<object> & import("react").RefAttributes<HTMLTableSectionElement> & {
12
14
  theme?: import("@emotion/react").Theme | undefined;
13
15
  } & {
@@ -20,14 +22,19 @@ declare const Table: {
20
22
  sorted?: import("./types").SortDir | undefined;
21
23
  sortKey?: string | undefined;
22
24
  } & Padding & import("./contentStyles").ContentProps & Omit<import("react-aria-components").ColumnProps, "children" | "allowsSorting">) => import("react/jsx-runtime").JSX.Element;
23
- Body: <T extends object>(props: import("react-aria-components").TableBodyProps<T> & import("react").RefAttributes<HTMLTableSectionElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
25
+ Body: ({ children, emptyFallback, fetching, loading }: {
26
+ children?: ReactNode;
27
+ emptyFallback?: ReactNode;
28
+ loading?: boolean | undefined;
29
+ fetching?: boolean | undefined;
30
+ }) => import("react/jsx-runtime").JSX.Element;
24
31
  Row: ({ children, onClick, disabled, ...rest }: {
25
32
  children: ReactNode;
26
33
  onClick?: (() => void) | undefined;
27
34
  disabled?: boolean | undefined;
28
35
  backgroundColor?: string | undefined;
29
36
  emphasis?: string | boolean | undefined;
30
- } & Padding) => import("react/jsx-runtime").JSX.Element;
37
+ } & Padding & import("../types").Height) => import("react/jsx-runtime").JSX.Element;
31
38
  Cell: ({ children, defaultValue, direction, justify, align, gap, ...props }: {
32
39
  children?: ReactNode;
33
40
  defaultValue?: string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavv/ui",
3
- "version": "2.0.0-alpha.8",
3
+ "version": "2.0.0-alpha.9",
4
4
  "files": [
5
5
  "build/**/*"
6
6
  ],