@vtex/faststore-plugin-buyer-portal 1.1.95 → 1.1.96

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 (46) hide show
  1. package/package.json +1 -1
  2. package/src/features/addresses/components/AddressLocationsList/AddressLocationsList.tsx +28 -39
  3. package/src/features/addresses/components/AddressRecipientsList/AddressRecipientsList.tsx +42 -42
  4. package/src/features/addresses/layouts/AddressDetailsLayout/address-details-layout.scss +285 -286
  5. package/src/features/addresses/layouts/AddressesLayout/AddressesLayout.tsx +26 -29
  6. package/src/features/addresses/layouts/AddressesLayout/addresses-layout.scss +144 -151
  7. package/src/features/budgets/components/BudgetAllocationsSelection/BudgetAllocationsSelection.tsx +61 -57
  8. package/src/features/budgets/components/BudgetAllocationsSelection/budget-allocations-selection.scss +131 -232
  9. package/src/features/budgets/components/BudgetAllocationsTable/BudgetAllocationsTable.tsx +104 -91
  10. package/src/features/budgets/components/BudgetAllocationsTable/budget-allocations-table.scss +80 -182
  11. package/src/features/budgets/components/BudgetsTable/BudgetsTable.tsx +90 -107
  12. package/src/features/budgets/components/BudgetsTable/budgets-table.scss +128 -126
  13. package/src/features/budgets/layouts/BudgetsLayout/BudgetsLayout.tsx +0 -15
  14. package/src/features/buying-policies/layouts/BuyingPoliciesLayout/BuyingPoliciesLayout.tsx +61 -46
  15. package/src/features/buying-policies/layouts/BuyingPoliciesLayout/buying-policies-layout.scss +64 -70
  16. package/src/features/collections/components/CollectionsTable/CollectionsTable.tsx +12 -18
  17. package/src/features/collections/components/CollectionsTable/collections-table.scss +138 -118
  18. package/src/features/collections/components/table/AddCollectionsDrawerTable.tsx +48 -54
  19. package/src/features/collections/components/table/add-collections-drawer-table.scss +57 -56
  20. package/src/features/credit-cards/layouts/CreditCardsLayout/CreditCardLayout.tsx +55 -61
  21. package/src/features/credit-cards/layouts/CreditCardsLayout/credit-card-layout.scss +63 -153
  22. package/src/features/payment-methods/components/AddPaymentMethodsDrawer/AddPaymentMethodsDrawer.tsx +58 -49
  23. package/src/features/payment-methods/components/AddPaymentMethodsDrawer/add-payment-methods-drawer.scss +58 -63
  24. package/src/features/payment-methods/layouts/PaymentMethodsLayout/PaymentMethodsLayout.tsx +15 -12
  25. package/src/features/roles/layout/RoleDetailsLayout/RoleDetailsLayout.tsx +57 -26
  26. package/src/features/roles/layout/RoleDetailsLayout/role-details-layout.scss +77 -0
  27. package/src/features/roles/layout/RolesLayout/RolesLayout.tsx +4 -12
  28. package/src/features/roles/layout/RolesLayout/roles-layout.scss +8 -22
  29. package/src/features/shared/components/CustomField/table/CustomFieldTable.tsx +67 -110
  30. package/src/features/shared/components/CustomField/table/custom-field-table.scss +39 -144
  31. package/src/features/shared/components/IconBookmarked/IconBookmarked.tsx +9 -0
  32. package/src/features/shared/components/IconBookmarked/icon-bookmarked.scss +9 -0
  33. package/src/features/shared/components/Table/Table.tsx +7 -2
  34. package/src/features/shared/components/Table/TableCell/TableCell.tsx +15 -3
  35. package/src/features/shared/components/Table/TableCell/table-cell.scss +34 -0
  36. package/src/features/shared/components/Table/TableHead/TableHead.tsx +34 -6
  37. package/src/features/shared/components/Table/TableHead/table-head.scss +53 -49
  38. package/src/features/shared/components/Table/TableLoading/TableLoading.tsx +16 -6
  39. package/src/features/shared/components/Table/TableLoading/table-loading.scss +13 -8
  40. package/src/features/shared/components/Table/TableRow/TableRow.tsx +65 -42
  41. package/src/features/shared/components/Table/TableRow/table-row.scss +104 -68
  42. package/src/features/shared/components/Table/table.scss +11 -6
  43. package/src/features/shared/components/Table/utils/tableColumns.ts +30 -33
  44. package/src/features/shared/components/index.ts +1 -0
  45. package/src/features/users/layouts/UsersLayout/UsersLayout.tsx +20 -27
  46. package/src/themes/layouts.scss +1 -0
@@ -1,11 +1,21 @@
1
1
  import type React from "react";
2
2
 
3
+ export type TableColumnSize =
4
+ | "small"
5
+ | "medium"
6
+ | "large"
7
+ | `${number}px`
8
+ | `${number}rem`
9
+ | `${number}%`;
10
+
3
11
  export type TableColumn<T extends string = string> = {
4
12
  key: T;
5
13
  label: React.ReactNode;
6
14
  align?: "left" | "center" | "right";
7
- size?: "small" | "medium" | "large";
15
+ size?: TableColumnSize;
8
16
  colspan?: number;
17
+ hideOnScreenSize?: "phonemid" | "tablet";
18
+ fullWidthOnScreenSize?: "phonemid" | "tablet";
9
19
  };
10
20
 
11
21
  export interface TableHeadProps {
@@ -14,6 +24,22 @@ export interface TableHeadProps {
14
24
  }
15
25
 
16
26
  export const TableHead = ({ columns, rowProps }: TableHeadProps) => {
27
+ const thSize = (size?: TableColumnSize): React.CSSProperties => {
28
+ if (!size) {
29
+ return {};
30
+ }
31
+
32
+ const sizes: { [key in TableColumnSize]: string } = {
33
+ small: "15%",
34
+ medium: "25%",
35
+ large: "40%",
36
+ };
37
+
38
+ return {
39
+ width: sizes[size] ?? size,
40
+ };
41
+ };
42
+
17
43
  return (
18
44
  <thead data-fs-bp-table-head>
19
45
  <tr {...rowProps} data-fs-bp-table-head-row>
@@ -21,17 +47,19 @@ export const TableHead = ({ columns, rowProps }: TableHeadProps) => {
21
47
  <th
22
48
  key={col.key}
23
49
  data-fs-bp-table-head-column
24
- data-fs-bp-table-head-column-size={col.size}
25
50
  data-fs-bp-table-head-align={col.align || undefined}
51
+ data-fs-bp-table-head-hide-on-screen-size={
52
+ col.hideOnScreenSize || undefined
53
+ }
54
+ data-fs-bp-table-head-full-width-on-screen-size={
55
+ col.fullWidthOnScreenSize || undefined
56
+ }
26
57
  colSpan={col.colspan}
58
+ style={thSize(col.size)}
27
59
  >
28
60
  {col.label}
29
61
  </th>
30
62
  ))}
31
- <th
32
- data-fs-bp-table-head-column
33
- data-fs-bp-table-head-column-action
34
- ></th>
35
63
  </tr>
36
64
  </thead>
37
65
  );
@@ -1,51 +1,55 @@
1
1
  [data-fs-bp-table-head] {
2
- border-bottom: var(--fs-border-width) solid #e0e0e0;
3
-
4
- &[data-fs-bp-table-cell-align="left"] {
5
- justify-content: flex-start;
6
- }
7
- &[data-fs-bp-table-cell-align="right"] {
8
- justify-content: flex-end;
9
- }
10
-
11
- [data-fs-bp-table-head-column] {
12
- color: #5c5c5c;
13
- font-size: var(--fs-text-size-1);
14
- font-weight: var(--fs-text-weight-regular);
15
- padding-top: var(--fs-spacing-2);
16
- padding-bottom: var(--fs-spacing-2);
17
- padding-left: 0;
18
- }
19
-
20
- [data-fs-bp-table-head-align="left"] {
21
- text-align: left;
22
- }
23
-
24
- [data-fs-bp-table-head-align="right"] {
25
- text-align: right;
26
- }
27
-
28
- [data-fs-bp-table-head-align="center"] {
29
- text-align: center;
30
- }
31
-
32
- [data-fs-bp-table-head-column-size="small"] {
33
- width: 15%;
34
- }
35
-
36
- [data-fs-bp-table-head-column-size="medium"] {
37
- width: 25%;
38
- }
39
-
40
- [data-fs-bp-table-head-column-size="large"] {
41
- width: 40%;
42
- }
43
-
44
- [data-fs-bp-table-head-column-action] {
45
- width: var(--fs-spacing-6);
46
-
47
- &:empty {
48
- width: 0;
49
- }
50
- }
2
+ border-bottom: var(--fs-border-width) solid #e0e0e0;
3
+
4
+ &[data-fs-bp-table-cell-align="left"] {
5
+ justify-content: flex-start;
6
+ }
7
+ &[data-fs-bp-table-cell-align="right"] {
8
+ justify-content: flex-end;
9
+ }
10
+
11
+ [data-fs-bp-table-head-hide-on-screen-size="phonemid"] {
12
+ @include media("<=phonemid") {
13
+ display: none;
14
+ }
15
+ }
16
+
17
+ [data-fs-bp-table-head-hide-on-screen-size="tablet"] {
18
+ @include media("<=tablet") {
19
+ display: none;
20
+ }
21
+ }
22
+
23
+ [data-fs-bp-table-head-full-width-on-screen-size="phonemid"] {
24
+ @include media("<=phonemid") {
25
+ width: 100% !important; // important to override inline CSS
26
+ }
27
+ }
28
+
29
+ [data-fs-bp-table-head-full-width-on-screen-size="tablet"] {
30
+ @include media("<=tablet") {
31
+ width: 100% !important; // important to override inline CSS
32
+ }
33
+ }
34
+
35
+ [data-fs-bp-table-head-column] {
36
+ color: #5c5c5c;
37
+ font-size: var(--fs-text-size-1);
38
+ font-weight: var(--fs-text-weight-regular);
39
+ padding-top: var(--fs-spacing-2);
40
+ padding-bottom: var(--fs-spacing-2);
41
+ padding-left: 0;
42
+ }
43
+
44
+ [data-fs-bp-table-head-align="left"] {
45
+ text-align: left;
46
+ }
47
+
48
+ [data-fs-bp-table-head-align="right"] {
49
+ text-align: right;
50
+ }
51
+
52
+ [data-fs-bp-table-head-align="center"] {
53
+ text-align: center;
54
+ }
51
55
  }
@@ -1,13 +1,23 @@
1
1
  import { Skeleton } from "@faststore/ui";
2
2
 
3
- export const TableLoading = () => {
3
+ type TableLoadingProps = {
4
+ columns?: number;
5
+ rows?: number;
6
+ };
7
+
8
+ export const TableLoading = ({ columns = 1, rows = 5 }: TableLoadingProps) => {
4
9
  return (
5
10
  <>
6
- {Array.from({ length: 5 }).map((_, index) => (
7
- <tr data-fs-bp-table-row-loading key={index}>
8
- <td colSpan={5}>
9
- <Skeleton size={{ width: "100%", height: "1.5rem" }} />
10
- </td>
11
+ {Array.from({ length: rows }).map((_, rowIndex) => (
12
+ <tr key={`row_${rowIndex}`} data-fs-bp-table-row-loading>
13
+ {Array.from({ length: columns }).map((_, colIndex) => (
14
+ <td>
15
+ <Skeleton
16
+ key={`cell_${rowIndex}_${colIndex}`}
17
+ size={{ height: "2.5rem", width: "100%" }}
18
+ />
19
+ </td>
20
+ ))}
11
21
  </tr>
12
22
  ))}
13
23
  </>
@@ -1,11 +1,16 @@
1
1
  [data-fs-bp-table-row-loading] {
2
- @import "@faststore/ui/src/components/atoms/Skeleton/styles.scss";
3
- border-top: var(--fs-border-width) solid #e0e0e0;
4
- padding: var(--fs-spacing-2) 0;
2
+ @import "@faststore/ui/src/components/atoms/Skeleton/styles.scss";
3
+ border-bottom: var(--fs-border-width) solid #e0e0e0;
5
4
 
6
- td {
7
- padding: var(--fs-spacing-2) 0;
8
- font-size: var(--fs-text-size-1);
9
- color: #1f1f1f;
10
- }
5
+ td {
6
+ padding: var(--fs-spacing-1) var(--fs-spacing-0);
7
+
8
+ &:first-child {
9
+ padding-left: 0;
10
+ }
11
+
12
+ &:last-child {
13
+ padding-right: 0;
14
+ }
15
+ }
11
16
  }
@@ -5,19 +5,21 @@ import { Dropdown } from "@faststore/components";
5
5
  import { BasicDropdownMenu } from "../../BasicDropdownMenu/BasicDropdownMenu";
6
6
  import { Icon } from "../../Icon";
7
7
  import { SearchHighlight } from "../../SearchHighlight/SearchHighlight";
8
+ import { Table } from "../Table";
8
9
 
9
10
  export type TableRowProps = {
10
11
  children?: ReactNode;
11
- title: string;
12
+ title: string | ReactNode;
12
13
  iconName?: string;
13
14
  iconSize?: number;
14
15
  dropdownMenu?: ReactNode;
15
16
  href?: string;
16
17
  searchTerm?: string;
17
- actionIcons?: ReactNode;
18
- defaultItemIcon?: ReactNode;
18
+ actionIcons?: ReactNode | ReactNode[];
19
19
  onClick?: () => void;
20
20
  enabled?: boolean;
21
+ prependColumns?: ReactNode;
22
+ selected?: boolean;
21
23
  };
22
24
 
23
25
  export const TableRow = ({
@@ -29,57 +31,78 @@ export const TableRow = ({
29
31
  href,
30
32
  searchTerm = "",
31
33
  actionIcons,
32
- defaultItemIcon,
33
34
  onClick,
34
35
  enabled = true,
36
+ selected = false,
37
+ prependColumns,
35
38
  ...otherProps
36
39
  }: TableRowProps) => {
37
- const ClickComponent = href ? "a" : "button";
40
+ const classNames = () => {
41
+ const classes: string[] = [];
42
+
43
+ if (href) {
44
+ classes.push("is-link");
45
+ }
46
+
47
+ if (selected) {
48
+ classes.push("selected");
49
+ }
50
+
51
+ if (!enabled) {
52
+ classes.push("disabled");
53
+ }
54
+
55
+ return classes.join(" ");
56
+ };
38
57
 
39
58
  return (
40
59
  <tr
41
60
  data-fs-bp-table-row
61
+ data-fs-bp-table-is-link={!!href}
62
+ data-fs-bp-table-row-selected={selected}
63
+ className={classNames()}
42
64
  {...otherProps}
43
- className={!enabled ? "disabled" : ""}
44
65
  >
45
- {iconName && (
46
- <td data-fs-bp-table-row-icon-cell>
47
- <Icon
48
- data-fs-bp-table-row-icon
49
- name={iconName}
50
- width={iconSize}
51
- height={iconSize}
52
- />
53
- </td>
54
- )}
55
-
56
- <td>
57
- <span data-fs-bp-table-row-title>
58
- <SearchHighlight text={title} highlight={searchTerm} />
59
- </span>
60
- </td>
66
+ {prependColumns}
67
+ <Table.Cell data-fs-bp-table-row-title-cell>
68
+ <div data-fs-bp-table-row-title-content>
69
+ {iconName && (
70
+ <span data-fs-bp-table-row-icon-cell>
71
+ <Icon
72
+ data-fs-bp-table-row-icon
73
+ name={iconName}
74
+ width={iconSize}
75
+ height={iconSize}
76
+ />
77
+ </span>
78
+ )}
79
+ {typeof title === "string" ? (
80
+ <p data-fs-bp-table-row-title-text>
81
+ <SearchHighlight text={title} highlight={searchTerm} />
82
+ </p>
83
+ ) : (
84
+ title
85
+ )}
86
+ </div>
87
+ </Table.Cell>
61
88
  {children}
62
89
 
63
- {defaultItemIcon && <td>{defaultItemIcon}</td>}
64
- <td data-fs-bp-table-row-dropdown>
65
- {dropdownMenu && (
66
- <Dropdown>
67
- <BasicDropdownMenu.Trigger />
68
- {dropdownMenu}
69
- </Dropdown>
70
- )}
71
- </td>
72
-
73
- <td data-fs-bp-table-row-actions>
74
- {href && (
75
- <ClickComponent
76
- data-fs-bp-table-row-link
77
- href={href}
78
- onClick={onClick}
79
- />
80
- )}
81
- {actionIcons ? actionIcons : null}
82
- </td>
90
+ <Table.Cell data-fs-bp-table-row-actions>
91
+ <div data-fs-bp-table-row-actions-content>
92
+ {actionIcons ? actionIcons : null}
93
+ {dropdownMenu && (
94
+ <Dropdown>
95
+ <BasicDropdownMenu.Trigger />
96
+ {dropdownMenu}
97
+ </Dropdown>
98
+ )}
99
+ </div>
100
+ </Table.Cell>
101
+ {href && (
102
+ <Table.Cell data-fs-bp-table-row-link>
103
+ <a href={href} onClick={onClick} />
104
+ </Table.Cell>
105
+ )}
83
106
  </tr>
84
107
  );
85
108
  };
@@ -1,72 +1,108 @@
1
1
  @import "../../BasicDropdownMenu/basic-dropdown-menu.scss";
2
+ @import "@faststore/ui/src/components/atoms/Checkbox/styles.scss";
2
3
 
3
4
  [data-fs-bp-table-row] {
4
- &:hover {
5
- background-color: #f5f5f5;
6
- }
7
-
8
- &.disabled {
9
- cursor: not-allowed;
10
- background-color: lightgray;
11
- :hover {
12
- background-color: lightgray;
13
- }
14
- border-bottom: var(--fs-border-width) solid lightgray;
15
- }
16
-
17
- @import "../../SearchHighlight/search-highlight.scss";
18
- border-bottom: var(--fs-border-width) solid #e0e0e0;
19
- cursor: pointer;
20
- position: relative;
21
-
22
- td {
23
- padding: var(--fs-spacing-2) 0;
24
- font-size: var(--fs-text-size-1);
25
- color: #1f1f1f;
26
- }
27
-
28
- [data-fs-bp-table-row-link] {
29
- position: absolute;
30
- left: 0;
31
- right: 0;
32
- top: 0;
33
- bottom: 0;
34
- }
35
-
36
- [data-fs-bp-table-row-icon-cell] {
37
- width: var(--fs-spacing-7);
38
-
39
- [data-fs-bp-table-row-icon] {
40
- color: #0366dd;
41
- margin: calc(var(--fs-spacing-2) - var(--fs-spacing-0));
42
- margin-right: var(--fs-spacing-2);
43
- }
44
- }
45
-
46
- [data-fs-bp-table-row-dropdown] {
47
- position: relative;
48
- cursor: pointer;
49
-
50
- [data-fs-bp-basic-dropdown-menu-trigger] {
51
- position: absolute;
52
- right: 0;
53
- bottom: 0;
54
- top: 0;
55
- margin: auto;
56
- z-index: 1;
57
-
58
- [data-fs-icon] {
59
- margin-right: 0;
60
- }
61
- }
62
- }
63
-
64
- [data-fs-bp-table-row-title] {
65
- font-weight: 500;
66
- font-size: var(--fs-text-size-1);
67
- line-height: calc(var(--fs-spacing-4) - var(--fs-spacing-0));
68
- color: #1f1f1f;
69
- z-index: 1;
70
- pointer-events: none;
71
- }
5
+ &.is-link {
6
+ cursor: pointer;
7
+
8
+ &:hover {
9
+ background-color: #f5f5f5;
10
+ }
11
+
12
+ &:has([data-fs-bp-table-row-actions]:hover) {
13
+ cursor: default;
14
+ background-color: transparent;
15
+ }
16
+ }
17
+
18
+ &.selected {
19
+ background-color: #f1f8fd;
20
+ }
21
+
22
+ &.disabled {
23
+ cursor: not-allowed;
24
+ background-color: #f5f5f5;
25
+ border-bottom: var(--fs-border-width) solid #e0e0e0;
26
+
27
+ &:hover,
28
+ &:has([data-fs-bp-table-row-actions]:hover) {
29
+ background-color: #f5f5f5;
30
+ }
31
+
32
+ & > td {
33
+ color: #858585;
34
+ }
35
+ }
36
+
37
+ &:not(.disabled) {
38
+ [data-fs-bp-table-row-title-text] {
39
+ color: #1f1f1f;
40
+ }
41
+ }
42
+
43
+ @import "../../SearchHighlight/search-highlight.scss";
44
+ border-bottom: var(--fs-border-width) solid #e0e0e0;
45
+ position: relative;
46
+
47
+ [data-fs-bp-table-row-link] {
48
+ position: absolute;
49
+ left: 0;
50
+ right: 0;
51
+ top: 0;
52
+ bottom: 0;
53
+ padding: 0;
54
+ z-index: 0;
55
+
56
+ a {
57
+ display: block;
58
+ width: 100%;
59
+ height: 100%;
60
+ }
61
+ }
62
+
63
+ [data-fs-bp-table-row-title-cell] {
64
+ [data-fs-bp-table-row-title-content] {
65
+ display: flex;
66
+ align-items: center;
67
+ width: 100%;
68
+ gap: var(--fs-spacing-0);
69
+ }
70
+
71
+ [data-fs-bp-table-row-title-text] {
72
+ font-size: var(--fs-text-size-1);
73
+ font-weight: var(--fs-text-weight-medium);
74
+ line-height: var(--fs-text-size-3);
75
+ flex: 1;
76
+ white-space: nowrap;
77
+ overflow: hidden;
78
+ text-overflow: ellipsis;
79
+ padding-right: var(--fs-spacing-1);
80
+ }
81
+
82
+ [data-fs-bp-table-row-icon-cell] {
83
+ flex: none;
84
+ display: inline-flex;
85
+ width: var(--fs-spacing-6);
86
+ height: var(--fs-spacing-6);
87
+ align-items: center;
88
+ justify-content: center;
89
+ color: #0366dd;
90
+ }
91
+ }
92
+
93
+ [data-fs-bp-table-row-actions] {
94
+ z-index: 1;
95
+
96
+ [data-fs-bp-table-row-actions-content] {
97
+ display: flex;
98
+ align-items: center;
99
+ gap: var(--fs-spacing-1);
100
+ justify-content: flex-end;
101
+
102
+ &:empty {
103
+ padding: 0;
104
+ display: none;
105
+ }
106
+ }
107
+ }
72
108
  }
@@ -1,13 +1,18 @@
1
+ @import "./TableCell/table-cell.scss";
1
2
  @import "./TableRow/table-row.scss";
2
3
  @import "./TableHead/table-head.scss";
3
4
  @import "./TableLoading/table-loading.scss";
4
5
 
5
6
  [data-fs-bp-table] {
6
- width: 100%;
7
- border-collapse: collapse;
7
+ width: 100%;
8
+ border-collapse: collapse;
8
9
 
9
- [data-fs-bp-icon] {
10
- width: auto;
11
- height: auto;
12
- }
10
+ [data-fs-bp-icon] {
11
+ width: auto;
12
+ height: auto;
13
+ }
14
+
15
+ &[data-fs-bp-table-layout-fixed="true"] {
16
+ table-layout: fixed;
17
+ }
13
18
  }
@@ -1,43 +1,40 @@
1
- import { TableColumn } from "../TableHead/TableHead";
1
+ import type { TableColumn, TableColumnSize } from "../TableHead/TableHead";
2
2
 
3
- type GetColumnsOptions = {
4
- withType?: boolean;
5
- withActions?: boolean;
3
+ type GetTableColumns = {
4
+ nameColumnLabel?: string;
5
+ nameColumnKey?: string;
6
+ nameColumnSize?: TableColumnSize;
7
+ nameFullWidthOnMobile?: boolean;
8
+ actionsLength?: number;
9
+ extraColumns?: TableColumn[];
6
10
  };
7
11
 
8
- export const getTableColumns = <T extends string = string>(
9
- options: GetColumnsOptions = {}
10
- ): TableColumn<T>[] => {
11
- const base: TableColumn<T>[] = [
12
+ export const getTableColumns = ({
13
+ nameColumnLabel = "Name",
14
+ nameColumnSize = "100%",
15
+ nameColumnKey = "name",
16
+ nameFullWidthOnMobile = true,
17
+ actionsLength = 0,
18
+ extraColumns = [],
19
+ }: GetTableColumns): TableColumn[] => {
20
+ const columns: TableColumn[] = [
12
21
  {
13
- key: "name" as T,
14
- label: "Name",
22
+ key: nameColumnKey,
23
+ size: nameColumnSize,
24
+ label: nameColumnLabel,
25
+ fullWidthOnScreenSize: nameFullWidthOnMobile ? "phonemid" : undefined,
15
26
  align: "left",
16
- colspan: 2,
17
27
  },
28
+ ...extraColumns,
18
29
  ];
19
30
 
20
- const typeColumn: TableColumn<T>[] = options.withType
21
- ? [
22
- {
23
- key: "type" as T,
24
- label: "Type",
25
- align: "left",
26
- size: "medium",
27
- },
28
- ]
29
- : [];
31
+ if (actionsLength > 0) {
32
+ columns.push({
33
+ key: "actions",
34
+ label: "",
35
+ size: `${actionsLength * 3}rem`,
36
+ });
37
+ }
30
38
 
31
- const actions: TableColumn<T>[] = options.withActions
32
- ? [
33
- {
34
- key: "actions" as T,
35
- label: "",
36
- align: "right",
37
- size: "medium",
38
- },
39
- ]
40
- : [];
41
-
42
- return [...base, ...typeColumn, ...actions];
39
+ return columns;
43
40
  };
@@ -75,3 +75,4 @@ export { EmptyState, type EmptyStateProps } from "./EmptyState/EmptyState";
75
75
  export { ErrorBoundary } from "./ErrorBoundary/ErrorBoundary";
76
76
  export { withErrorBoundary } from "./withErrorBoundary/withErrorBoundary";
77
77
  export { default as Error } from "./Error/Error";
78
+ export { IconBookmarked } from "./IconBookmarked/IconBookmarked";