@stella-source/stellasource-dsl 1.5.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 +228 -37
- 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 -2
- package/dist/cjs/types/components/Tabs/Tab.d.ts +5 -2
- package/dist/cjs/types/components/Tabs/Tabs.d.ts +1 -1
- package/dist/cjs/types/components/Tabs/Tabs.stories.d.ts +10 -3
- package/dist/cjs/types/components/Tabs/types.d.ts +18 -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 +229 -38
- 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 -2
- package/dist/esm/types/components/Tabs/Tab.d.ts +5 -2
- package/dist/esm/types/components/Tabs/Tabs.d.ts +1 -1
- package/dist/esm/types/components/Tabs/Tabs.stories.d.ts +10 -3
- package/dist/esm/types/components/Tabs/types.d.ts +18 -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 +29 -3
- 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 {};
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 };
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import React, { HTMLAttributes } from "react";
|
|
2
|
+
import { TabsVariant } from "./types";
|
|
2
3
|
interface TabProps {
|
|
3
4
|
id?: string;
|
|
4
5
|
className?: string;
|
|
5
6
|
onClick?: (tabLabel: string) => void;
|
|
6
|
-
label: string;
|
|
7
7
|
htmlProps?: HTMLAttributes<HTMLButtonElement>;
|
|
8
|
+
active?: boolean;
|
|
9
|
+
variant?: `${TabsVariant}`;
|
|
10
|
+
label: string;
|
|
8
11
|
}
|
|
9
|
-
declare const Tab: ({ id, className, onClick, htmlProps, label }: TabProps) => React.JSX.Element;
|
|
12
|
+
declare const Tab: ({ id, className, onClick, htmlProps, label, variant, active, }: TabProps) => React.JSX.Element;
|
|
10
13
|
export default Tab;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { TabsProps } from "./types";
|
|
3
|
-
declare const Tabs: ({ id, className, tabs,
|
|
3
|
+
declare const Tabs: ({ id, className, tabs, htmlProps, onTabClick, defaultActiveTab, variant, isPill, }: TabsProps) => React.JSX.Element;
|
|
4
4
|
export default Tabs;
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
import { TabsProps } from "./types";
|
|
1
|
+
import { TabsProps, TabsVariant } from "./types";
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: ({ id, className, tabs,
|
|
4
|
+
component: ({ id, className, tabs, htmlProps, onTabClick, defaultActiveTab, variant, isPill, }: TabsProps) => import("react").JSX.Element;
|
|
5
5
|
tags: string[];
|
|
6
6
|
parameters: {};
|
|
7
|
-
argTypes: {
|
|
7
|
+
argTypes: {
|
|
8
|
+
variant: {
|
|
9
|
+
options: TabsVariant[];
|
|
10
|
+
control: {
|
|
11
|
+
type: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
8
15
|
args: TabsProps;
|
|
9
16
|
};
|
|
10
17
|
export default _default;
|
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
import { HTMLAttributes } from "react";
|
|
2
|
-
export
|
|
2
|
+
export declare enum TabsVariant {
|
|
3
|
+
LIGHT = "light",
|
|
4
|
+
DARK = "dark"
|
|
5
|
+
}
|
|
6
|
+
interface TabsBaseProps {
|
|
3
7
|
id?: string;
|
|
4
8
|
className?: string;
|
|
5
9
|
activeTab?: string;
|
|
6
10
|
htmlProps?: HTMLAttributes<HTMLElement>;
|
|
11
|
+
defaultActiveTab?: string;
|
|
12
|
+
isPill?: boolean;
|
|
13
|
+
variant?: `${TabsVariant}`;
|
|
7
14
|
tabs: string[];
|
|
8
15
|
onTabClick: (label?: string) => void;
|
|
9
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 {};
|
|
@@ -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,16 +344,32 @@ interface PaymentStatusProps {
|
|
|
336
344
|
|
|
337
345
|
declare const PaymentStatus: ({ variant, id, className }: PaymentStatusProps) => React$1.JSX.Element;
|
|
338
346
|
|
|
339
|
-
|
|
347
|
+
declare enum TabsVariant {
|
|
348
|
+
LIGHT = "light",
|
|
349
|
+
DARK = "dark"
|
|
350
|
+
}
|
|
351
|
+
interface TabsBaseProps {
|
|
340
352
|
id?: string;
|
|
341
353
|
className?: string;
|
|
342
354
|
activeTab?: string;
|
|
343
355
|
htmlProps?: HTMLAttributes<HTMLElement>;
|
|
356
|
+
defaultActiveTab?: string;
|
|
357
|
+
isPill?: boolean;
|
|
358
|
+
variant?: `${TabsVariant}`;
|
|
344
359
|
tabs: string[];
|
|
345
360
|
onTabClick: (label?: string) => void;
|
|
346
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);
|
|
347
371
|
|
|
348
|
-
declare const Tabs: ({ id, className, tabs,
|
|
372
|
+
declare const Tabs: ({ id, className, tabs, htmlProps, onTabClick, defaultActiveTab, variant, isPill, }: TabsProps) => React$1.JSX.Element;
|
|
349
373
|
|
|
350
374
|
declare const Styles: {
|
|
351
375
|
color: {
|
|
@@ -369,7 +393,9 @@ declare const Styles: {
|
|
|
369
393
|
pale: string;
|
|
370
394
|
50: string;
|
|
371
395
|
100: string;
|
|
396
|
+
200: string;
|
|
372
397
|
500: string;
|
|
398
|
+
700: string;
|
|
373
399
|
};
|
|
374
400
|
blue: {
|
|
375
401
|
darkNavy: string;
|