@stella-source/stellasource-dsl 0.1.7 → 0.2.1
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/dist/cjs/index.js +4566 -105
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/styles.css +1 -1
- package/dist/cjs/types/components/IconButton/IconButton.d.ts +1 -1
- package/dist/cjs/types/components/IconButton/IconButton.stories.d.ts +1 -1
- package/dist/cjs/types/components/IconButton/types.d.ts +4 -1
- package/dist/cjs/types/components/Pagination/Pagination.d.ts +4 -0
- package/dist/cjs/types/components/Pagination/Pagination.stories.d.ts +13 -0
- package/dist/cjs/types/components/Pagination/styles.d.ts +14 -0
- package/dist/cjs/types/components/Pagination/types.d.ts +13 -0
- package/dist/cjs/types/components/StellaButton/StellaButton.d.ts +1 -1
- package/dist/cjs/types/components/StellaButton/StellaButton.stories.d.ts +1 -1
- package/dist/cjs/types/components/StellaButton/types.d.ts +1 -0
- package/dist/cjs/types/components/StellaIcon/types.d.ts +1 -1
- package/dist/cjs/types/components/Sync/Sync.d.ts +4 -0
- package/dist/cjs/types/components/Sync/Sync.stories.d.ts +20 -0
- package/dist/cjs/types/components/Sync/styles.d.ts +7 -0
- package/dist/cjs/types/components/Sync/types.d.ts +8 -0
- package/dist/cjs/types/components/Table/Table.d.ts +4 -0
- package/dist/cjs/types/components/Table/Table.stories.d.ts +23 -0
- package/dist/cjs/types/components/Table/TableComponents/IndeterminateCheckbox.d.ts +8 -0
- package/dist/cjs/types/components/Table/TableComponents/RowOptions.d.ts +12 -0
- package/dist/cjs/types/components/Table/TableComponents/TableHeaderCell.d.ts +18 -0
- package/dist/cjs/types/components/Table/TableModule.d.ts +6 -0
- package/dist/cjs/types/components/Table/styles.d.ts +44 -0
- package/dist/cjs/types/components/Table/types.d.ts +51 -0
- package/dist/cjs/types/components/TextField/PasswordInput/styles.d.ts +1 -1
- package/dist/cjs/types/index.d.ts +5 -1
- package/dist/cjs/types/shared/utils/dateHelpers.d.ts +3 -0
- package/dist/cjs/types/shared/utils/testing.d.ts +1 -1
- package/dist/esm/index.esm.js +5008 -551
- package/dist/esm/index.esm.js.map +1 -1
- package/dist/esm/styles.css +1 -1
- package/dist/esm/types/components/IconButton/IconButton.d.ts +1 -1
- package/dist/esm/types/components/IconButton/IconButton.stories.d.ts +1 -1
- package/dist/esm/types/components/IconButton/types.d.ts +4 -1
- package/dist/esm/types/components/Pagination/Pagination.d.ts +4 -0
- package/dist/esm/types/components/Pagination/Pagination.stories.d.ts +13 -0
- package/dist/esm/types/components/Pagination/styles.d.ts +14 -0
- package/dist/esm/types/components/Pagination/types.d.ts +13 -0
- package/dist/esm/types/components/StellaButton/StellaButton.d.ts +1 -1
- package/dist/esm/types/components/StellaButton/StellaButton.stories.d.ts +1 -1
- package/dist/esm/types/components/StellaButton/types.d.ts +1 -0
- package/dist/esm/types/components/StellaIcon/types.d.ts +1 -1
- package/dist/esm/types/components/Sync/Sync.d.ts +4 -0
- package/dist/esm/types/components/Sync/Sync.stories.d.ts +20 -0
- package/dist/esm/types/components/Sync/styles.d.ts +7 -0
- package/dist/esm/types/components/Sync/types.d.ts +8 -0
- package/dist/esm/types/components/Table/Table.d.ts +4 -0
- package/dist/esm/types/components/Table/Table.stories.d.ts +23 -0
- package/dist/esm/types/components/Table/TableComponents/IndeterminateCheckbox.d.ts +8 -0
- package/dist/esm/types/components/Table/TableComponents/RowOptions.d.ts +12 -0
- package/dist/esm/types/components/Table/TableComponents/TableHeaderCell.d.ts +18 -0
- package/dist/esm/types/components/Table/TableModule.d.ts +6 -0
- package/dist/esm/types/components/Table/styles.d.ts +44 -0
- package/dist/esm/types/components/Table/types.d.ts +51 -0
- package/dist/esm/types/components/TextField/PasswordInput/styles.d.ts +1 -1
- package/dist/esm/types/index.d.ts +5 -1
- package/dist/esm/types/shared/utils/dateHelpers.d.ts +3 -0
- package/dist/esm/types/shared/utils/testing.d.ts +1 -1
- package/dist/index.d.ts +113 -5
- package/package.json +14 -9
package/dist/esm/styles.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { IconButtonProps } from "./types";
|
|
3
|
-
declare const IconButton:
|
|
3
|
+
declare const IconButton: React.ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
4
|
export default IconButton;
|
|
@@ -2,7 +2,7 @@ import { IconButtonProps } from "./types";
|
|
|
2
2
|
import { StellaButtonVariant } from "../StellaButton/types";
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: (
|
|
5
|
+
component: import("react").ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
6
6
|
tags: string[];
|
|
7
7
|
parameters: {};
|
|
8
8
|
argTypes: {
|
|
@@ -5,11 +5,14 @@ export interface IconButtonProps {
|
|
|
5
5
|
iconName: `${StellaIconDefinition}`;
|
|
6
6
|
ariaLabel: string;
|
|
7
7
|
size?: number;
|
|
8
|
-
onClick: () => void;
|
|
8
|
+
onClick: (e?: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
9
9
|
id?: string;
|
|
10
10
|
className?: string;
|
|
11
11
|
isLoading?: boolean;
|
|
12
12
|
disabled?: boolean;
|
|
13
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
14
|
+
preventDefault?: boolean;
|
|
15
|
+
dataTestId?: string;
|
|
13
16
|
variant?: `${StellaButtonVariant}`;
|
|
14
17
|
htmlProps?: HTMLAttributes<HTMLButtonElement>;
|
|
15
18
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PaginationProps } from "./types";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ isLoading, rowsPerPage, totalRows, ariaLabel, onPageChange, startingPage, id, className, htmlProps, }: PaginationProps) => import("react").JSX.Element;
|
|
5
|
+
tags: string[];
|
|
6
|
+
parameters: {};
|
|
7
|
+
argTypes: {};
|
|
8
|
+
args: PaginationProps;
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
11
|
+
export declare const Pagination: {
|
|
12
|
+
args: {};
|
|
13
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const PaginationContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, never>> & string;
|
|
2
|
+
declare const CustomSelect: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, never>> & string;
|
|
3
|
+
declare const DarkText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
4
|
+
declare const LightText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
5
|
+
declare const CustomSelectContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
6
|
+
$currentPageCount: number;
|
|
7
|
+
}>> & string;
|
|
8
|
+
declare const SelectCaret: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("../StellaIcon/types").StellaIconProps, never>> & string & Omit<({ iconName, size, color, className, id, dataTestId, }: import("../StellaIcon/types").StellaIconProps) => import("react").JSX.Element, keyof import("react").Component<any, {}, any>>;
|
|
9
|
+
declare const RowInfo: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
10
|
+
declare const PageInfo: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
11
|
+
declare const LoadingContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
12
|
+
declare const PageText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
13
|
+
declare const PageTotals: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
14
|
+
export { PaginationContainer, LoadingContainer, RowInfo, PageInfo, CustomSelect, CustomSelectContainer, SelectCaret, DarkText, LightText, PageTotals, PageText, };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
export interface PaginationProps {
|
|
3
|
+
id?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
htmlProps?: HTMLAttributes<HTMLElement>;
|
|
6
|
+
isLoading?: boolean;
|
|
7
|
+
rowsPerPage?: number;
|
|
8
|
+
ariaLabel?: string;
|
|
9
|
+
totalRows: number;
|
|
10
|
+
onPageChange?: (page: number, pageSize: number) => void;
|
|
11
|
+
startingPage?: number;
|
|
12
|
+
resetTrigger?: number;
|
|
13
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { StellaButtonProps } from "./types";
|
|
3
|
-
declare const StellaButton:
|
|
3
|
+
declare const StellaButton: React.ForwardRefExoticComponent<Omit<StellaButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
4
|
export default StellaButton;
|
|
@@ -2,7 +2,7 @@ import { StellaButtonVariant } from "./types";
|
|
|
2
2
|
import { StellaButtonIcons, StellaButtonProps } from "./types";
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: (
|
|
5
|
+
component: import("react").ForwardRefExoticComponent<Omit<StellaButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
6
6
|
tags: string[];
|
|
7
7
|
parameters: {};
|
|
8
8
|
argTypes: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type StellaIconDefinition = "search" | "required" | "help" | "info" | "kebab-menu" | "error" | "warning" | "filter" | "sort" | "close" | "add" | "stella-logo" | "chevron-right" | "chevron-down" | "caret-right" | "caret-down" | "success" | "in-progress" | "complete" | "calendar" | "unlocked" | "locked" | "settings" | "preferences" | "account-settings" | "user" | "company-details" | "collapse" | "expand" | "star-filled" | "star-outline" | "dashboard" | "shopping-cart" | "calculator" | "pricing-strategies" | "stella-finance" | "resource-center" | "line-item-pricing" | "basket-pricing" | "paperclip" | "thumbs-up" | "thumbs-down" | "send" | "palette" | "eye" | "eye-slash";
|
|
1
|
+
export type StellaIconDefinition = "search" | "required" | "help" | "info" | "kebab-menu" | "error" | "warning" | "filter" | "sort" | "close" | "add" | "stella-logo" | "chevron-right" | "chevron-down" | "caret-right" | "caret-down" | "success" | "in-progress" | "complete" | "calendar" | "unlocked" | "locked" | "settings" | "preferences" | "account-settings" | "user" | "company-details" | "collapse" | "expand" | "star-filled" | "star-outline" | "dashboard" | "shopping-cart" | "calculator" | "pricing-strategies" | "stella-finance" | "resource-center" | "line-item-pricing" | "basket-pricing" | "paperclip" | "thumbs-up" | "thumbs-down" | "send" | "palette" | "eye" | "eye-slash" | "sync" | "chevron-left";
|
|
2
2
|
export interface StellaIconProps {
|
|
3
3
|
iconName: StellaIconDefinition;
|
|
4
4
|
size?: number;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SyncProps } from "./types";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ dataTestId, onClick, className, id, showTime, labelPosition, }: SyncProps) => import("react").JSX.Element;
|
|
5
|
+
tags: string[];
|
|
6
|
+
parameters: {};
|
|
7
|
+
argTypes: {
|
|
8
|
+
labelPosition: {
|
|
9
|
+
options: string[];
|
|
10
|
+
control: {
|
|
11
|
+
type: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
args: SyncProps;
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
18
|
+
export declare const Sync: {
|
|
19
|
+
args: {};
|
|
20
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface SyncContainerProps {
|
|
2
|
+
$labelPosition?: "right" | "left";
|
|
3
|
+
}
|
|
4
|
+
declare const SyncContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, SyncContainerProps>> & string;
|
|
5
|
+
declare const CustomLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("../Label/types").LabelProps | import("../Label/types").LabelWithChildrenProps, import("styled-components/dist/types").BaseObject>> & string & Omit<({ hideLabel, labelValue, required, tooltipText, children, htmlFor, htmlProps, id, className, }: import("../Label/types").LabelProps | import("../Label/types").LabelWithChildrenProps) => import("react").JSX.Element, keyof import("react").Component<any, {}, any>>;
|
|
6
|
+
declare const CustomIconButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("../IconButton/types").IconButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>, never>> & string & Omit<import("react").ForwardRefExoticComponent<Omit<import("../IconButton/types").IconButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>, keyof import("react").Component<any, {}, any>>;
|
|
7
|
+
export { CustomIconButton, CustomLabel, SyncContainer };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TableProps } from "./types";
|
|
3
|
+
declare function Table<T>({ columns, data, isLoading, serverSide, onPageChange, onSortChange, onFilterChange, onRowSelect, rowStatuses, showSelection, showRowOptions, showPagination, variant, paginationDetails, selectionMenuItems, dataAuto, dataTestId, id, className, htmlProps, resetTrigger, }: TableProps<T>): React.JSX.Element;
|
|
4
|
+
export default Table;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import TableComponent from "./Table";
|
|
2
|
+
import { TableProps } from "./types";
|
|
3
|
+
interface Person {
|
|
4
|
+
id: number;
|
|
5
|
+
name: string;
|
|
6
|
+
access: string;
|
|
7
|
+
age: number;
|
|
8
|
+
status: string;
|
|
9
|
+
}
|
|
10
|
+
declare const _default: {
|
|
11
|
+
title: string;
|
|
12
|
+
component: typeof TableComponent;
|
|
13
|
+
tags: string[];
|
|
14
|
+
parameters: {};
|
|
15
|
+
argTypes: {};
|
|
16
|
+
args: TableProps<Person>;
|
|
17
|
+
};
|
|
18
|
+
export default _default;
|
|
19
|
+
export declare const Table: {
|
|
20
|
+
args: {
|
|
21
|
+
variant: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React, { ChangeEvent } from "react";
|
|
2
|
+
interface IndeterminateCheckboxProps {
|
|
3
|
+
isIndeterminate?: boolean;
|
|
4
|
+
isChecked?: boolean;
|
|
5
|
+
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
6
|
+
}
|
|
7
|
+
declare const IndeterminateCheckbox: ({ isIndeterminate, isChecked, onChange, }: IndeterminateCheckboxProps) => React.JSX.Element;
|
|
8
|
+
export default IndeterminateCheckbox;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Row } from "@tanstack/react-table";
|
|
2
|
+
import React from "react";
|
|
3
|
+
interface RowOptionsProps {
|
|
4
|
+
row: Row<any>;
|
|
5
|
+
selectionMenuItems?: {
|
|
6
|
+
label: string;
|
|
7
|
+
onClick: (row: Row<any>) => void;
|
|
8
|
+
conditional?: () => boolean;
|
|
9
|
+
}[];
|
|
10
|
+
}
|
|
11
|
+
declare const RowOptions: ({ row, selectionMenuItems }: RowOptionsProps) => React.JSX.Element;
|
|
12
|
+
export default RowOptions;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Header } from "@tanstack/react-table";
|
|
2
|
+
import React from "react";
|
|
3
|
+
interface HeaderCellProps {
|
|
4
|
+
serverSide?: boolean;
|
|
5
|
+
header: Header<any, unknown>;
|
|
6
|
+
filters: Record<string, (string | number)[]>;
|
|
7
|
+
sorting: {
|
|
8
|
+
id: string;
|
|
9
|
+
desc: boolean;
|
|
10
|
+
}[];
|
|
11
|
+
scrollPosition: {
|
|
12
|
+
atLeft: boolean;
|
|
13
|
+
atRight: boolean;
|
|
14
|
+
};
|
|
15
|
+
onFilterMenuInteraction?: (id: string | number, active: boolean) => void;
|
|
16
|
+
}
|
|
17
|
+
declare const TableHeaderCell: ({ header, serverSide, filters, sorting, scrollPosition, onFilterMenuInteraction, }: HeaderCellProps) => React.JSX.Element;
|
|
18
|
+
export default TableHeaderCell;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Column, SortDirection } from "@tanstack/react-table";
|
|
2
|
+
interface HeaderIconButtonProps {
|
|
3
|
+
$active: boolean;
|
|
4
|
+
$sort?: false | SortDirection;
|
|
5
|
+
}
|
|
6
|
+
declare const HeaderCell: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>, {
|
|
7
|
+
$isPinnedLeft?: boolean;
|
|
8
|
+
$isPinnedRight?: boolean;
|
|
9
|
+
$columnInfo: Column<any, unknown>;
|
|
10
|
+
$filterMenuOpen?: boolean;
|
|
11
|
+
}>> & string;
|
|
12
|
+
declare const HeaderCellPosition: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
13
|
+
declare const TableWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
14
|
+
declare const TableWrapperScroll: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
15
|
+
$filterMenuOpen: boolean;
|
|
16
|
+
}>> & string;
|
|
17
|
+
declare const StyledTable: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, never>> & string;
|
|
18
|
+
declare const CustomIconButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<import("../IconButton/types").IconButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>, HeaderIconButtonProps>> & string & Omit<import("react").ForwardRefExoticComponent<Omit<import("../IconButton/types").IconButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>, keyof import("react").Component<any, {}, any>>;
|
|
19
|
+
declare const SortButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<Omit<import("../IconButton/types").IconButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>, keyof HeaderIconButtonProps> & HeaderIconButtonProps, HeaderIconButtonProps>> & string;
|
|
20
|
+
declare const HeaderRow: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, never>> & string;
|
|
21
|
+
declare const CellRow: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, never>> & string;
|
|
22
|
+
declare const FilterMenu: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
23
|
+
declare const Checkbox: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>>, never>, never>> & string;
|
|
24
|
+
declare const MenuItemGroup: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
25
|
+
declare const BodyCell: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, {
|
|
26
|
+
$isPinnedLeft?: boolean;
|
|
27
|
+
$isPinnedRight?: boolean;
|
|
28
|
+
$columnInfo: Column<any, unknown>;
|
|
29
|
+
$isLastRow: boolean;
|
|
30
|
+
}>> & string;
|
|
31
|
+
declare const MenuButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
32
|
+
declare const MenuItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
33
|
+
declare const MenuItemOption: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
|
|
34
|
+
$applied: boolean;
|
|
35
|
+
}>> & string;
|
|
36
|
+
declare const FilterLabelTransparent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
37
|
+
declare const FilterBoxLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, never>> & string;
|
|
38
|
+
declare const LoadingShimmer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
39
|
+
$width?: string;
|
|
40
|
+
$height?: string;
|
|
41
|
+
}>> & string;
|
|
42
|
+
declare const CustomPagination: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("../Pagination/types").PaginationProps, never>> & string & Omit<({ isLoading, rowsPerPage, totalRows, ariaLabel, onPageChange, startingPage, id, className, htmlProps, }: import("../Pagination/types").PaginationProps) => import("react").JSX.Element, keyof import("react").Component<any, {}, any>>;
|
|
43
|
+
declare const KebabAlign: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
44
|
+
export { HeaderCell, TableWrapper, TableWrapperScroll, StyledTable, CustomIconButton, SortButton, HeaderRow, FilterMenu, Checkbox, BodyCell, HeaderCellPosition, MenuButton, MenuItem, FilterBoxLabel, LoadingShimmer, FilterLabelTransparent, CustomPagination, CellRow, MenuItemGroup, KebabAlign, MenuItemOption, };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ColumnDef, ColumnFiltersState, Row } from "@tanstack/react-table";
|
|
2
|
+
import { HTMLAttributes } from "react";
|
|
3
|
+
declare enum TableVariant {
|
|
4
|
+
PRIMARY = "Primary",
|
|
5
|
+
SECONDARY = "Secondary"
|
|
6
|
+
}
|
|
7
|
+
interface PaginationDetails {
|
|
8
|
+
startingPage: number;
|
|
9
|
+
totalRows: number;
|
|
10
|
+
rowsPerPage?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface TableProps<T> {
|
|
13
|
+
columns: ColumnDef<T, any>[];
|
|
14
|
+
data: T[];
|
|
15
|
+
isLoading?: boolean;
|
|
16
|
+
serverSide?: boolean;
|
|
17
|
+
onPageChange?: (page: number, pageSize: number) => void;
|
|
18
|
+
onSortChange?: (sort: {
|
|
19
|
+
id: string;
|
|
20
|
+
desc: boolean;
|
|
21
|
+
}[]) => void;
|
|
22
|
+
onFilterChange?: (filters: ColumnFiltersState) => void;
|
|
23
|
+
onRowSelect?: (rows: T[]) => void;
|
|
24
|
+
showSelection?: boolean;
|
|
25
|
+
showRowOptions?: boolean;
|
|
26
|
+
showPagination?: boolean;
|
|
27
|
+
variant?: `${TableVariant}`;
|
|
28
|
+
selectionMenuItems?: {
|
|
29
|
+
label: string;
|
|
30
|
+
onClick: (row: Row<T>) => void;
|
|
31
|
+
conditional?: () => boolean;
|
|
32
|
+
}[];
|
|
33
|
+
dataTestId?: string;
|
|
34
|
+
dataAuto?: string;
|
|
35
|
+
id?: string;
|
|
36
|
+
className?: string;
|
|
37
|
+
htmlProps?: HTMLAttributes<HTMLTableElement>;
|
|
38
|
+
paginationDetails?: PaginationDetails;
|
|
39
|
+
rowStatuses?: Record<number | string, RowStatus>;
|
|
40
|
+
resetTrigger?: number;
|
|
41
|
+
}
|
|
42
|
+
export interface CustomColumnMeta {
|
|
43
|
+
headerAlign?: "left" | "right";
|
|
44
|
+
cellAlign?: "left" | "right";
|
|
45
|
+
dataType?: "string" | "number";
|
|
46
|
+
pin?: "left" | "right";
|
|
47
|
+
filterOptions?: string[] | number[];
|
|
48
|
+
singleSelect?: boolean;
|
|
49
|
+
}
|
|
50
|
+
export type RowStatus = "action-pending" | "completed";
|
|
51
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const CustomIconButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("../../IconButton/types").IconButtonProps, never>> & string & Omit<(
|
|
1
|
+
declare const CustomIconButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("../../IconButton/types").IconButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>, never>> & string & Omit<import("react").ForwardRefExoticComponent<Omit<import("../../IconButton/types").IconButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>, keyof import("react").Component<any, {}, any>>;
|
|
2
2
|
export { CustomIconButton };
|
|
@@ -9,10 +9,14 @@ import IconButton from "./components/IconButton/IconButton";
|
|
|
9
9
|
import TextInput from "./components/TextField/TextInput/TextInput";
|
|
10
10
|
import PasswordInput from "./components/TextField/PasswordInput/PasswordInput";
|
|
11
11
|
import NumberInput from "./components/TextField/NumberInput/NumberInput";
|
|
12
|
+
import Table from "./components/Table/Table";
|
|
13
|
+
import Pagination from "./components/Pagination/Pagination";
|
|
14
|
+
import Sync from "./components/Sync/Sync";
|
|
15
|
+
import TableUnitsAndTotals from "./components/TableUnitsAndTotals/TableUnitsAndTotals";
|
|
12
16
|
/** Types */
|
|
13
17
|
import { StellaButtonVariant } from "./components/StellaButton/types";
|
|
14
18
|
/** Tokens */
|
|
15
19
|
import { Styles } from "./shared/tokens";
|
|
16
20
|
import "./shared/tokens/tokens.css";
|
|
17
21
|
export type { StellaIconDefinition } from "./components/StellaIcon/types";
|
|
18
|
-
export { Label, StellaButton, IconButton, Loader, HelperText, Tooltip, StellaIcon, TextInput, PasswordInput, NumberInput, StellaButtonVariant, Styles, };
|
|
22
|
+
export { Label, StellaButton, IconButton, Loader, HelperText, Tooltip, StellaIcon, TextInput, PasswordInput, NumberInput, Table, Pagination, Sync, TableUnitsAndTotals, StellaButtonVariant, Styles, };
|
|
@@ -4,7 +4,7 @@ import { Options } from "@testing-library/user-event";
|
|
|
4
4
|
declare const setup: (jsx: React.JSX.Element, setupOptions?: Options) => {
|
|
5
5
|
container: HTMLElement;
|
|
6
6
|
baseElement: HTMLElement;
|
|
7
|
-
debug: (baseElement?:
|
|
7
|
+
debug: (baseElement?: import("react-dom/client").Container | (Element | Document) | Array<import("react-dom/client").Container | (Element | Document)> | undefined, maxLength?: number | undefined, options?: import("pretty-format").OptionsReceived | undefined) => void;
|
|
8
8
|
rerender: (ui: React.ReactNode) => void;
|
|
9
9
|
unmount: () => void;
|
|
10
10
|
asFragment: () => DocumentFragment;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React$1, { HTMLAttributes, ReactElement } from 'react';
|
|
2
2
|
import { TooltipProps as TooltipProps$1 } from 'antd';
|
|
3
|
+
import { ColumnDef, ColumnFiltersState, Row } from '@tanstack/react-table';
|
|
3
4
|
|
|
4
5
|
interface LabelProps {
|
|
5
6
|
id: string;
|
|
@@ -47,10 +48,11 @@ interface StellaButtonProps {
|
|
|
47
48
|
disabled?: boolean;
|
|
48
49
|
preventDefault?: boolean;
|
|
49
50
|
variant?: `${StellaButtonVariant}`;
|
|
51
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
50
52
|
htmlProps?: HTMLAttributes<HTMLButtonElement>;
|
|
51
53
|
}
|
|
52
54
|
|
|
53
|
-
declare const StellaButton:
|
|
55
|
+
declare const StellaButton: React$1.ForwardRefExoticComponent<Omit<StellaButtonProps, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
54
56
|
|
|
55
57
|
interface LoaderProps {
|
|
56
58
|
size?: number;
|
|
@@ -94,7 +96,7 @@ interface TooltipProps {
|
|
|
94
96
|
|
|
95
97
|
declare const Tooltip: ({ title, placement, type, ariaLabel, iconSize, htmlProps, className, id, }: TooltipProps) => React$1.JSX.Element;
|
|
96
98
|
|
|
97
|
-
type StellaIconDefinition = "search" | "required" | "help" | "info" | "kebab-menu" | "error" | "warning" | "filter" | "sort" | "close" | "add" | "stella-logo" | "chevron-right" | "chevron-down" | "caret-right" | "caret-down" | "success" | "in-progress" | "complete" | "calendar" | "unlocked" | "locked" | "settings" | "preferences" | "account-settings" | "user" | "company-details" | "collapse" | "expand" | "star-filled" | "star-outline" | "dashboard" | "shopping-cart" | "calculator" | "pricing-strategies" | "stella-finance" | "resource-center" | "line-item-pricing" | "basket-pricing" | "paperclip" | "thumbs-up" | "thumbs-down" | "send" | "palette" | "eye" | "eye-slash";
|
|
99
|
+
type StellaIconDefinition = "search" | "required" | "help" | "info" | "kebab-menu" | "error" | "warning" | "filter" | "sort" | "close" | "add" | "stella-logo" | "chevron-right" | "chevron-down" | "caret-right" | "caret-down" | "success" | "in-progress" | "complete" | "calendar" | "unlocked" | "locked" | "settings" | "preferences" | "account-settings" | "user" | "company-details" | "collapse" | "expand" | "star-filled" | "star-outline" | "dashboard" | "shopping-cart" | "calculator" | "pricing-strategies" | "stella-finance" | "resource-center" | "line-item-pricing" | "basket-pricing" | "paperclip" | "thumbs-up" | "thumbs-down" | "send" | "palette" | "eye" | "eye-slash" | "sync" | "chevron-left";
|
|
98
100
|
interface StellaIconProps {
|
|
99
101
|
iconName: StellaIconDefinition;
|
|
100
102
|
size?: number;
|
|
@@ -110,16 +112,19 @@ interface IconButtonProps {
|
|
|
110
112
|
iconName: `${StellaIconDefinition}`;
|
|
111
113
|
ariaLabel: string;
|
|
112
114
|
size?: number;
|
|
113
|
-
onClick: () => void;
|
|
115
|
+
onClick: (e?: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
114
116
|
id?: string;
|
|
115
117
|
className?: string;
|
|
116
118
|
isLoading?: boolean;
|
|
117
119
|
disabled?: boolean;
|
|
120
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
121
|
+
preventDefault?: boolean;
|
|
122
|
+
dataTestId?: string;
|
|
118
123
|
variant?: `${StellaButtonVariant}`;
|
|
119
124
|
htmlProps?: HTMLAttributes<HTMLButtonElement>;
|
|
120
125
|
}
|
|
121
126
|
|
|
122
|
-
declare const IconButton:
|
|
127
|
+
declare const IconButton: React$1.ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
123
128
|
|
|
124
129
|
declare enum TextFieldAlignments {
|
|
125
130
|
LEFT = "left",
|
|
@@ -231,6 +236,109 @@ interface NumberInputProps {
|
|
|
231
236
|
|
|
232
237
|
declare const NumberInput: ({ id, className, htmlProps, leftCategory, rightCategory, label, onChange, onBlur, onFocus, value, isRequired, maxLength, tooltipText, helperText, endIcon, placeholder, textAlign, isTruncated, helperTextAffectLayout, hideLabel, disabled, isLoading, hasError, thousandSeparator, decimalPlaces, allowNegativeNumbers, ariaDescribedBy, }: NumberInputProps) => React$1.JSX.Element;
|
|
233
238
|
|
|
239
|
+
declare enum TableVariant {
|
|
240
|
+
PRIMARY = "Primary",
|
|
241
|
+
SECONDARY = "Secondary"
|
|
242
|
+
}
|
|
243
|
+
interface PaginationDetails {
|
|
244
|
+
startingPage: number;
|
|
245
|
+
totalRows: number;
|
|
246
|
+
rowsPerPage?: number;
|
|
247
|
+
}
|
|
248
|
+
interface TableProps<T> {
|
|
249
|
+
columns: ColumnDef<T, any>[];
|
|
250
|
+
data: T[];
|
|
251
|
+
isLoading?: boolean;
|
|
252
|
+
serverSide?: boolean;
|
|
253
|
+
onPageChange?: (page: number, pageSize: number) => void;
|
|
254
|
+
onSortChange?: (sort: {
|
|
255
|
+
id: string;
|
|
256
|
+
desc: boolean;
|
|
257
|
+
}[]) => void;
|
|
258
|
+
onFilterChange?: (filters: ColumnFiltersState) => void;
|
|
259
|
+
onRowSelect?: (rows: T[]) => void;
|
|
260
|
+
showSelection?: boolean;
|
|
261
|
+
showRowOptions?: boolean;
|
|
262
|
+
showPagination?: boolean;
|
|
263
|
+
variant?: `${TableVariant}`;
|
|
264
|
+
selectionMenuItems?: {
|
|
265
|
+
label: string;
|
|
266
|
+
onClick: (row: Row<T>) => void;
|
|
267
|
+
conditional?: () => boolean;
|
|
268
|
+
}[];
|
|
269
|
+
dataTestId?: string;
|
|
270
|
+
dataAuto?: string;
|
|
271
|
+
id?: string;
|
|
272
|
+
className?: string;
|
|
273
|
+
htmlProps?: HTMLAttributes<HTMLTableElement>;
|
|
274
|
+
paginationDetails?: PaginationDetails;
|
|
275
|
+
rowStatuses?: Record<number | string, RowStatus>;
|
|
276
|
+
resetTrigger?: number;
|
|
277
|
+
}
|
|
278
|
+
type RowStatus = "action-pending" | "completed";
|
|
279
|
+
|
|
280
|
+
declare function Table<T>({ columns, data, isLoading, serverSide, onPageChange, onSortChange, onFilterChange, onRowSelect, rowStatuses, showSelection, showRowOptions, showPagination, variant, paginationDetails, selectionMenuItems, dataAuto, dataTestId, id, className, htmlProps, resetTrigger, }: TableProps<T>): React$1.JSX.Element;
|
|
281
|
+
|
|
282
|
+
interface PaginationProps {
|
|
283
|
+
id?: string;
|
|
284
|
+
className?: string;
|
|
285
|
+
htmlProps?: HTMLAttributes<HTMLElement>;
|
|
286
|
+
isLoading?: boolean;
|
|
287
|
+
rowsPerPage?: number;
|
|
288
|
+
ariaLabel?: string;
|
|
289
|
+
totalRows: number;
|
|
290
|
+
onPageChange?: (page: number, pageSize: number) => void;
|
|
291
|
+
startingPage?: number;
|
|
292
|
+
resetTrigger?: number;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
declare const Pagination: ({ isLoading, rowsPerPage, totalRows, ariaLabel, onPageChange, startingPage, id, className, htmlProps, }: PaginationProps) => React$1.JSX.Element;
|
|
296
|
+
|
|
297
|
+
interface SyncProps {
|
|
298
|
+
id: string;
|
|
299
|
+
className?: string;
|
|
300
|
+
onClick?: (e?: React.MouseEvent<HTMLButtonElement, MouseEvent>, time?: string) => void;
|
|
301
|
+
dataTestId?: string;
|
|
302
|
+
showTime?: boolean;
|
|
303
|
+
labelPosition?: "right" | "left";
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
declare const Sync: ({ dataTestId, onClick, className, id, showTime, labelPosition, }: SyncProps) => React$1.JSX.Element;
|
|
307
|
+
|
|
308
|
+
declare enum QuoteVariants {
|
|
309
|
+
TOTAL_PRICE = "total-price",
|
|
310
|
+
TOTAL_WEIGHT = "total-weight"
|
|
311
|
+
}
|
|
312
|
+
declare enum QuoteCategory {
|
|
313
|
+
ITEM = "/item",
|
|
314
|
+
HOUR = "/hr",
|
|
315
|
+
CWT = "CWT",
|
|
316
|
+
LBS = "lbs",
|
|
317
|
+
KG = "kg",
|
|
318
|
+
TON = "ton"
|
|
319
|
+
}
|
|
320
|
+
interface TableUnitsAndTotalsProps {
|
|
321
|
+
id?: string;
|
|
322
|
+
className?: string;
|
|
323
|
+
value: number;
|
|
324
|
+
subValue?: number;
|
|
325
|
+
rightCategory?: `${QuoteCategory}`;
|
|
326
|
+
}
|
|
327
|
+
interface TotalPriceProps {
|
|
328
|
+
variant: QuoteVariants.TOTAL_PRICE;
|
|
329
|
+
leftCategory?: `${TableUnitsAndTotalsLeftCategory}`;
|
|
330
|
+
}
|
|
331
|
+
interface TotalWeightProps {
|
|
332
|
+
variant: QuoteVariants.TOTAL_WEIGHT;
|
|
333
|
+
leftCategory?: never;
|
|
334
|
+
}
|
|
335
|
+
type TableUnitsAndTotals$1 = TableUnitsAndTotalsProps & (TotalPriceProps | TotalWeightProps);
|
|
336
|
+
declare enum TableUnitsAndTotalsLeftCategory {
|
|
337
|
+
US_CURRENCY = "$"
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
declare const TableUnitsAndTotals: ({ id, className, value, subValue, variant, leftCategory, rightCategory, }: TableUnitsAndTotals$1) => React$1.JSX.Element;
|
|
341
|
+
|
|
234
342
|
declare const Styles: {
|
|
235
343
|
color: {
|
|
236
344
|
white: string;
|
|
@@ -292,5 +400,5 @@ declare const Styles: {
|
|
|
292
400
|
};
|
|
293
401
|
};
|
|
294
402
|
|
|
295
|
-
export { HelperText, IconButton, Label, Loader, NumberInput, PasswordInput, StellaButton, StellaButtonVariant, StellaIcon, Styles, TextInput, Tooltip };
|
|
403
|
+
export { HelperText, IconButton, Label, Loader, NumberInput, Pagination, PasswordInput, StellaButton, StellaButtonVariant, StellaIcon, Styles, Sync, Table, TableUnitsAndTotals, TextInput, Tooltip };
|
|
296
404
|
export type { StellaIconDefinition };
|