@stella-source/stellasource-dsl 1.5.3 → 3.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 (30) hide show
  1. package/dist/cjs/index.js +241 -37
  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 +12 -2
  8. package/dist/cjs/types/components/Tabs/Tab.d.ts +6 -2
  9. package/dist/cjs/types/components/Tabs/Tabs.d.ts +1 -1
  10. package/dist/cjs/types/components/Tabs/Tabs.stories.d.ts +10 -3
  11. package/dist/cjs/types/components/Tabs/types.d.ts +22 -2
  12. package/dist/cjs/types/shared/tokens/index.d.ts +2 -0
  13. package/dist/cjs/types/shared/tokens/storybook/color.d.ts +4 -0
  14. package/dist/cjs/types/shared/utils/useDebounceCallback.d.ts +10 -0
  15. package/dist/esm/index.esm.js +242 -38
  16. package/dist/esm/index.esm.js.map +1 -1
  17. package/dist/esm/styles.css +2 -0
  18. package/dist/esm/types/components/Table/Table.d.ts +1 -1
  19. package/dist/esm/types/components/Table/styles.d.ts +4 -1
  20. package/dist/esm/types/components/Table/types.d.ts +9 -1
  21. package/dist/esm/types/components/Tabs/Styles.d.ts +12 -2
  22. package/dist/esm/types/components/Tabs/Tab.d.ts +6 -2
  23. package/dist/esm/types/components/Tabs/Tabs.d.ts +1 -1
  24. package/dist/esm/types/components/Tabs/Tabs.stories.d.ts +10 -3
  25. package/dist/esm/types/components/Tabs/types.d.ts +22 -2
  26. package/dist/esm/types/shared/tokens/index.d.ts +2 -0
  27. package/dist/esm/types/shared/tokens/storybook/color.d.ts +4 -0
  28. package/dist/esm/types/shared/utils/useDebounceCallback.d.ts +10 -0
  29. package/dist/index.d.ts +33 -4
  30. 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 {};
@@ -1,2 +1,12 @@
1
- declare const TabsBar: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, never>> & string;
2
- export { TabsBar };
1
+ import { TabsVariant } from "./types";
2
+ interface TabsStylesProps {
3
+ $variant: `${TabsVariant}`;
4
+ $isPill?: boolean;
5
+ }
6
+ interface NotificationBubbleProps {
7
+ $isActive?: boolean;
8
+ }
9
+ 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;
10
+ 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;
11
+ declare const NotificationBubble: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, NotificationBubbleProps>> & string;
12
+ export { TabsBar, TabButton, NotificationBubble };
@@ -1,10 +1,14 @@
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
+ notifications?: number;
11
+ label: string;
8
12
  }
9
- declare const Tab: ({ id, className, onClick, htmlProps, label }: TabProps) => React.JSX.Element;
13
+ declare const Tab: ({ id, className, onClick, htmlProps, label, variant, active, notifications, }: TabProps) => React.JSX.Element;
10
14
  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, activeTab, htmlProps, onTabClick, }: TabsProps) => React.JSX.Element;
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, activeTab, htmlProps, onTabClick, }: TabsProps) => import("react").JSX.Element;
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,29 @@
1
1
  import { HTMLAttributes } from "react";
2
- export interface TabsProps {
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>;
7
- tabs: string[];
11
+ defaultActiveTab?: string;
12
+ isPill?: boolean;
13
+ variant?: `${TabsVariant}`;
14
+ tabs: {
15
+ label: string;
16
+ notifications?: number;
17
+ }[];
8
18
  onTabClick: (label?: string) => void;
9
19
  }
20
+ interface TabsPropsLight {
21
+ variant?: `${TabsVariant.LIGHT}`;
22
+ isPill?: boolean;
23
+ }
24
+ interface TabsPropsDark {
25
+ variant?: `${TabsVariant.DARK}`;
26
+ isPill?: never;
27
+ }
28
+ export type TabsProps = TabsBaseProps & (TabsPropsLight | TabsPropsDark);
29
+ export {};
@@ -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,16 +344,35 @@ interface PaymentStatusProps {
336
344
 
337
345
  declare const PaymentStatus: ({ variant, id, className }: PaymentStatusProps) => React$1.JSX.Element;
338
346
 
339
- interface TabsProps {
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>;
344
- tabs: string[];
356
+ defaultActiveTab?: string;
357
+ isPill?: boolean;
358
+ variant?: `${TabsVariant}`;
359
+ tabs: {
360
+ label: string;
361
+ notifications?: number;
362
+ }[];
345
363
  onTabClick: (label?: string) => void;
346
364
  }
365
+ interface TabsPropsLight {
366
+ variant?: `${TabsVariant.LIGHT}`;
367
+ isPill?: boolean;
368
+ }
369
+ interface TabsPropsDark {
370
+ variant?: `${TabsVariant.DARK}`;
371
+ isPill?: never;
372
+ }
373
+ type TabsProps = TabsBaseProps & (TabsPropsLight | TabsPropsDark);
347
374
 
348
- declare const Tabs: ({ id, className, tabs, activeTab, htmlProps, onTabClick, }: TabsProps) => React$1.JSX.Element;
375
+ declare const Tabs: ({ id, className, tabs, htmlProps, onTabClick, defaultActiveTab, variant, isPill, }: TabsProps) => React$1.JSX.Element;
349
376
 
350
377
  declare const Styles: {
351
378
  color: {
@@ -369,7 +396,9 @@ declare const Styles: {
369
396
  pale: string;
370
397
  50: string;
371
398
  100: string;
399
+ 200: string;
372
400
  500: string;
401
+ 700: string;
373
402
  };
374
403
  blue: {
375
404
  darkNavy: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stella-source/stellasource-dsl",
3
- "version": "1.5.3",
3
+ "version": "3.0.0",
4
4
  "description": "Design System owned and operated by Stella Source.",
5
5
  "files": [
6
6
  "dist"