@stella-source/stellasource-dsl 1.4.3 → 2.0.0
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 +236 -31
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/styles.css +2 -0
- package/dist/cjs/types/components/Table/Table.d.ts +1 -1
- package/dist/cjs/types/components/Table/styles.d.ts +4 -1
- package/dist/cjs/types/components/Table/types.d.ts +9 -1
- package/dist/cjs/types/components/Tabs/Styles.d.ts +8 -0
- package/dist/cjs/types/components/Tabs/Tab.d.ts +13 -0
- package/dist/cjs/types/components/Tabs/Tabs.d.ts +4 -0
- package/dist/cjs/types/components/Tabs/Tabs.stories.d.ts +18 -0
- package/dist/cjs/types/components/Tabs/types.d.ts +26 -0
- package/dist/cjs/types/index.d.ts +2 -1
- package/dist/cjs/types/shared/tokens/index.d.ts +2 -0
- package/dist/cjs/types/shared/tokens/storybook/color.d.ts +4 -0
- package/dist/cjs/types/shared/utils/useDebounceCallback.d.ts +10 -0
- package/dist/esm/index.esm.js +237 -33
- package/dist/esm/index.esm.js.map +1 -1
- package/dist/esm/styles.css +2 -0
- package/dist/esm/types/components/Table/Table.d.ts +1 -1
- package/dist/esm/types/components/Table/styles.d.ts +4 -1
- package/dist/esm/types/components/Table/types.d.ts +9 -1
- package/dist/esm/types/components/Tabs/Styles.d.ts +8 -0
- package/dist/esm/types/components/Tabs/Tab.d.ts +13 -0
- package/dist/esm/types/components/Tabs/Tabs.d.ts +4 -0
- package/dist/esm/types/components/Tabs/Tabs.stories.d.ts +18 -0
- package/dist/esm/types/components/Tabs/types.d.ts +26 -0
- package/dist/esm/types/index.d.ts +2 -1
- package/dist/esm/types/shared/tokens/index.d.ts +2 -0
- package/dist/esm/types/shared/tokens/storybook/color.d.ts +4 -0
- package/dist/esm/types/shared/utils/useDebounceCallback.d.ts +10 -0
- package/dist/index.d.ts +39 -2
- package/package.json +1 -1
package/dist/esm/styles.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { TableProps } from "./types";
|
|
3
|
-
declare function Table<T>({ columns, data, isLoading, serverSide, onPageChange, onSortChange, onFilterChange, onRowSelect, onRowClick, rowStatuses, showSelection, showRowOptions, showPagination, variant, paginationDetails, selectionMenuItems, dataAuto, dataTestId, id, className, htmlProps, resetTrigger, emptyTableState, }: TableProps<T>): React.JSX.Element;
|
|
3
|
+
declare function Table<T>({ columns, data, isLoading, serverSide, onPageChange, onSortChange, onFilterChange, onRowSelect, onRowClick, rowStatuses, showSelection, showRowOptions, showPagination, variant, paginationDetails, selectionMenuItems, dataAuto, dataTestId, id, className, htmlProps, resetTrigger, emptyTableState, defaultFilters, staticFilters, }: TableProps<T>): React.JSX.Element;
|
|
4
4
|
export default Table;
|
|
@@ -3,6 +3,9 @@ interface HeaderIconButtonProps {
|
|
|
3
3
|
$active: boolean;
|
|
4
4
|
$sort?: false | SortDirection;
|
|
5
5
|
}
|
|
6
|
+
interface PaginationProps {
|
|
7
|
+
$hasData?: boolean;
|
|
8
|
+
}
|
|
6
9
|
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
10
|
$isPinnedLeft?: boolean;
|
|
8
11
|
$isPinnedRight?: boolean;
|
|
@@ -41,7 +44,7 @@ declare const LoadingShimmer: import("styled-components/dist/types").IStyledComp
|
|
|
41
44
|
$width?: string;
|
|
42
45
|
$height?: string;
|
|
43
46
|
}>> & string;
|
|
44
|
-
declare const CustomPagination: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").
|
|
47
|
+
declare const CustomPagination: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("../Pagination/types").PaginationProps, PaginationProps>> & 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>>;
|
|
45
48
|
declare const KebabAlign: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
46
49
|
declare const EmptyTableCell: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, never>> & string;
|
|
47
50
|
declare const EmptyTableSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {
|
|
@@ -45,6 +45,14 @@ export interface TableProps<T> {
|
|
|
45
45
|
showClearFilterButton?: boolean;
|
|
46
46
|
onClearFilters?: () => void;
|
|
47
47
|
};
|
|
48
|
+
defaultFilters?: {
|
|
49
|
+
id: string;
|
|
50
|
+
value: unknown;
|
|
51
|
+
}[];
|
|
52
|
+
staticFilters?: {
|
|
53
|
+
id: string;
|
|
54
|
+
value: unknown;
|
|
55
|
+
}[];
|
|
48
56
|
}
|
|
49
57
|
export interface CustomColumnMeta {
|
|
50
58
|
headerAlign?: "left" | "right";
|
|
@@ -52,7 +60,7 @@ export interface CustomColumnMeta {
|
|
|
52
60
|
dataType?: "string" | "number";
|
|
53
61
|
pin?: "left" | "right";
|
|
54
62
|
filterOptions?: string[] | number[];
|
|
55
|
-
|
|
63
|
+
filterMode?: "singleSelect" | "multiSelect" | "search";
|
|
56
64
|
}
|
|
57
65
|
export type RowStatus = "action-pending" | "completed";
|
|
58
66
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TabsVariant } from "./types";
|
|
2
|
+
interface TabsStylesProps {
|
|
3
|
+
$variant: `${TabsVariant}`;
|
|
4
|
+
$isPill?: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const TabsBar: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, TabsStylesProps>> & string;
|
|
7
|
+
declare const TabButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, TabsStylesProps>> & string;
|
|
8
|
+
export { TabsBar, TabButton };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { HTMLAttributes } from "react";
|
|
2
|
+
import { TabsVariant } from "./types";
|
|
3
|
+
interface TabProps {
|
|
4
|
+
id?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
onClick?: (tabLabel: string) => void;
|
|
7
|
+
htmlProps?: HTMLAttributes<HTMLButtonElement>;
|
|
8
|
+
active?: boolean;
|
|
9
|
+
variant?: `${TabsVariant}`;
|
|
10
|
+
label: string;
|
|
11
|
+
}
|
|
12
|
+
declare const Tab: ({ id, className, onClick, htmlProps, label, variant, active, }: TabProps) => React.JSX.Element;
|
|
13
|
+
export default Tab;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TabsProps, TabsVariant } from "./types";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ id, className, tabs, htmlProps, onTabClick, defaultActiveTab, variant, isPill, }: TabsProps) => import("react").JSX.Element;
|
|
5
|
+
tags: string[];
|
|
6
|
+
parameters: {};
|
|
7
|
+
argTypes: {
|
|
8
|
+
variant: {
|
|
9
|
+
options: TabsVariant[];
|
|
10
|
+
control: {
|
|
11
|
+
type: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
args: TabsProps;
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
18
|
+
export declare const Tabs: {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
export declare enum TabsVariant {
|
|
3
|
+
LIGHT = "light",
|
|
4
|
+
DARK = "dark"
|
|
5
|
+
}
|
|
6
|
+
interface TabsBaseProps {
|
|
7
|
+
id?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
activeTab?: string;
|
|
10
|
+
htmlProps?: HTMLAttributes<HTMLElement>;
|
|
11
|
+
defaultActiveTab?: string;
|
|
12
|
+
isPill?: boolean;
|
|
13
|
+
variant?: `${TabsVariant}`;
|
|
14
|
+
tabs: string[];
|
|
15
|
+
onTabClick: (label?: string) => void;
|
|
16
|
+
}
|
|
17
|
+
interface TabsPropsLight {
|
|
18
|
+
variant?: `${TabsVariant.LIGHT}`;
|
|
19
|
+
isPill?: boolean;
|
|
20
|
+
}
|
|
21
|
+
interface TabsPropsDark {
|
|
22
|
+
variant?: `${TabsVariant.DARK}`;
|
|
23
|
+
isPill?: never;
|
|
24
|
+
}
|
|
25
|
+
export type TabsProps = TabsBaseProps & (TabsPropsLight | TabsPropsDark);
|
|
26
|
+
export {};
|
|
@@ -15,6 +15,7 @@ import Pagination from "./components/Pagination/Pagination";
|
|
|
15
15
|
import Sync from "./components/Sync/Sync";
|
|
16
16
|
import TableUnitsAndTotals from "./components/TableUnitsAndTotals/TableUnitsAndTotals";
|
|
17
17
|
import PaymentStatus from "./components/PaymentStatus/PaymentStatus";
|
|
18
|
+
import Tabs from "./components/Tabs/Tabs";
|
|
18
19
|
/** Types */
|
|
19
20
|
import { StellaButtonVariant } from "./components/StellaButton/types";
|
|
20
21
|
/** Tokens */
|
|
@@ -22,4 +23,4 @@ import { Styles } from "./shared/tokens";
|
|
|
22
23
|
import "./shared/tokens/tokens.css";
|
|
23
24
|
/**Exports */
|
|
24
25
|
export type { StellaIconDefinition } from "./components/StellaIcon/types";
|
|
25
|
-
export { Label, StellaButton, IconButton, Loader, HelperText, Tooltip, StellaIcon, TextInput, PasswordInput, NumberInput, Table, Pagination, Sync, TableUnitsAndTotals, StellaButtonVariant, PaymentStatus, Styles, };
|
|
26
|
+
export { Tabs, Label, StellaButton, IconButton, Loader, HelperText, Tooltip, StellaIcon, TextInput, PasswordInput, NumberInput, Table, Pagination, Sync, TableUnitsAndTotals, StellaButtonVariant, PaymentStatus, Styles, };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type DebouncedCallback<T extends (...args: any[]) => any> = (...args: Parameters<T>) => void;
|
|
2
|
+
type DebounceControls<T extends (...args: any[]) => any> = {
|
|
3
|
+
flush: () => void;
|
|
4
|
+
cancel: () => void;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Returns a debounced version of a callback, along with flush and cancel methods.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useDebounceCallback<T extends (...args: any[]) => any>(callback: T, delay: number): [DebouncedCallback<T>, DebounceControls<T>];
|
|
10
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -266,10 +266,18 @@ interface TableProps<T> {
|
|
|
266
266
|
showClearFilterButton?: boolean;
|
|
267
267
|
onClearFilters?: () => void;
|
|
268
268
|
};
|
|
269
|
+
defaultFilters?: {
|
|
270
|
+
id: string;
|
|
271
|
+
value: unknown;
|
|
272
|
+
}[];
|
|
273
|
+
staticFilters?: {
|
|
274
|
+
id: string;
|
|
275
|
+
value: unknown;
|
|
276
|
+
}[];
|
|
269
277
|
}
|
|
270
278
|
type RowStatus = "action-pending" | "completed";
|
|
271
279
|
|
|
272
|
-
declare function Table<T>({ columns, data, isLoading, serverSide, onPageChange, onSortChange, onFilterChange, onRowSelect, onRowClick, rowStatuses, showSelection, showRowOptions, showPagination, variant, paginationDetails, selectionMenuItems, dataAuto, dataTestId, id, className, htmlProps, resetTrigger, emptyTableState, }: TableProps<T>): React$1.JSX.Element;
|
|
280
|
+
declare function Table<T>({ columns, data, isLoading, serverSide, onPageChange, onSortChange, onFilterChange, onRowSelect, onRowClick, rowStatuses, showSelection, showRowOptions, showPagination, variant, paginationDetails, selectionMenuItems, dataAuto, dataTestId, id, className, htmlProps, resetTrigger, emptyTableState, defaultFilters, staticFilters, }: TableProps<T>): React$1.JSX.Element;
|
|
273
281
|
|
|
274
282
|
interface PaginationProps {
|
|
275
283
|
id?: string;
|
|
@@ -336,6 +344,33 @@ interface PaymentStatusProps {
|
|
|
336
344
|
|
|
337
345
|
declare const PaymentStatus: ({ variant, id, className }: PaymentStatusProps) => React$1.JSX.Element;
|
|
338
346
|
|
|
347
|
+
declare enum TabsVariant {
|
|
348
|
+
LIGHT = "light",
|
|
349
|
+
DARK = "dark"
|
|
350
|
+
}
|
|
351
|
+
interface TabsBaseProps {
|
|
352
|
+
id?: string;
|
|
353
|
+
className?: string;
|
|
354
|
+
activeTab?: string;
|
|
355
|
+
htmlProps?: HTMLAttributes<HTMLElement>;
|
|
356
|
+
defaultActiveTab?: string;
|
|
357
|
+
isPill?: boolean;
|
|
358
|
+
variant?: `${TabsVariant}`;
|
|
359
|
+
tabs: string[];
|
|
360
|
+
onTabClick: (label?: string) => void;
|
|
361
|
+
}
|
|
362
|
+
interface TabsPropsLight {
|
|
363
|
+
variant?: `${TabsVariant.LIGHT}`;
|
|
364
|
+
isPill?: boolean;
|
|
365
|
+
}
|
|
366
|
+
interface TabsPropsDark {
|
|
367
|
+
variant?: `${TabsVariant.DARK}`;
|
|
368
|
+
isPill?: never;
|
|
369
|
+
}
|
|
370
|
+
type TabsProps = TabsBaseProps & (TabsPropsLight | TabsPropsDark);
|
|
371
|
+
|
|
372
|
+
declare const Tabs: ({ id, className, tabs, htmlProps, onTabClick, defaultActiveTab, variant, isPill, }: TabsProps) => React$1.JSX.Element;
|
|
373
|
+
|
|
339
374
|
declare const Styles: {
|
|
340
375
|
color: {
|
|
341
376
|
white: string;
|
|
@@ -358,7 +393,9 @@ declare const Styles: {
|
|
|
358
393
|
pale: string;
|
|
359
394
|
50: string;
|
|
360
395
|
100: string;
|
|
396
|
+
200: string;
|
|
361
397
|
500: string;
|
|
398
|
+
700: string;
|
|
362
399
|
};
|
|
363
400
|
blue: {
|
|
364
401
|
darkNavy: string;
|
|
@@ -397,5 +434,5 @@ declare const Styles: {
|
|
|
397
434
|
};
|
|
398
435
|
};
|
|
399
436
|
|
|
400
|
-
export { HelperText, IconButton, Label, Loader, NumberInput, Pagination, PasswordInput, PaymentStatus, StellaButton, StellaButtonVariant, StellaIcon, Styles, Sync, Table, TableUnitsAndTotals, TextInput, Tooltip };
|
|
437
|
+
export { HelperText, IconButton, Label, Loader, NumberInput, Pagination, PasswordInput, PaymentStatus, StellaButton, StellaButtonVariant, StellaIcon, Styles, Sync, Table, TableUnitsAndTotals, Tabs, TextInput, Tooltip };
|
|
401
438
|
export type { StellaIconDefinition };
|