@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.
Files changed (32) hide show
  1. package/dist/cjs/index.js +236 -31
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/styles.css +2 -0
  4. package/dist/cjs/types/components/Table/Table.d.ts +1 -1
  5. package/dist/cjs/types/components/Table/styles.d.ts +4 -1
  6. package/dist/cjs/types/components/Table/types.d.ts +9 -1
  7. package/dist/cjs/types/components/Tabs/Styles.d.ts +8 -0
  8. package/dist/cjs/types/components/Tabs/Tab.d.ts +13 -0
  9. package/dist/cjs/types/components/Tabs/Tabs.d.ts +4 -0
  10. package/dist/cjs/types/components/Tabs/Tabs.stories.d.ts +18 -0
  11. package/dist/cjs/types/components/Tabs/types.d.ts +26 -0
  12. package/dist/cjs/types/index.d.ts +2 -1
  13. package/dist/cjs/types/shared/tokens/index.d.ts +2 -0
  14. package/dist/cjs/types/shared/tokens/storybook/color.d.ts +4 -0
  15. package/dist/cjs/types/shared/utils/useDebounceCallback.d.ts +10 -0
  16. package/dist/esm/index.esm.js +237 -33
  17. package/dist/esm/index.esm.js.map +1 -1
  18. package/dist/esm/styles.css +2 -0
  19. package/dist/esm/types/components/Table/Table.d.ts +1 -1
  20. package/dist/esm/types/components/Table/styles.d.ts +4 -1
  21. package/dist/esm/types/components/Table/types.d.ts +9 -1
  22. package/dist/esm/types/components/Tabs/Styles.d.ts +8 -0
  23. package/dist/esm/types/components/Tabs/Tab.d.ts +13 -0
  24. package/dist/esm/types/components/Tabs/Tabs.d.ts +4 -0
  25. package/dist/esm/types/components/Tabs/Tabs.stories.d.ts +18 -0
  26. package/dist/esm/types/components/Tabs/types.d.ts +26 -0
  27. package/dist/esm/types/index.d.ts +2 -1
  28. package/dist/esm/types/shared/tokens/index.d.ts +2 -0
  29. package/dist/esm/types/shared/tokens/storybook/color.d.ts +4 -0
  30. package/dist/esm/types/shared/utils/useDebounceCallback.d.ts +10 -0
  31. package/dist/index.d.ts +39 -2
  32. package/package.json +1 -1
@@ -21,7 +21,9 @@
21
21
  --pale-grey: #f5f5f5;
22
22
  --grey50: #e9edf5;
23
23
  --grey100: #d5dbe5;
24
+ --grey200: #bcc2ce;
24
25
  --grey500: #687182;
26
+ --grey700: #464f60;
25
27
  /* oranges */
26
28
  --orange: #ff7600;
27
29
  --light-orange: #ff9133;
@@ -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").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>>;
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
- singleSelect?: boolean;
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,4 @@
1
+ import React from "react";
2
+ import { TabsProps } from "./types";
3
+ declare const Tabs: ({ id, className, tabs, htmlProps, onTabClick, defaultActiveTab, variant, isPill, }: TabsProps) => React.JSX.Element;
4
+ export default Tabs;
@@ -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, };
@@ -20,7 +20,9 @@ declare const Styles: {
20
20
  pale: string;
21
21
  50: string;
22
22
  100: string;
23
+ 200: string;
23
24
  500: string;
25
+ 700: string;
24
26
  };
25
27
  blue: {
26
28
  darkNavy: string;
@@ -34,8 +34,12 @@ declare const colorTokens: {
34
34
  50: string;
35
35
  /** #d5dbe5 */
36
36
  100: string;
37
+ /** #BCC2CE */
38
+ 200: string;
37
39
  /** #687182 */
38
40
  500: string;
41
+ /** #464F60 */
42
+ 700: string;
39
43
  };
40
44
  blue: {
41
45
  /** #1f4168 */
@@ -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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stella-source/stellasource-dsl",
3
- "version": "1.4.3",
3
+ "version": "2.0.0",
4
4
  "description": "Design System owned and operated by Stella Source.",
5
5
  "files": [
6
6
  "dist"