@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
@@ -8,155 +8,148 @@
8
8
  @import "../../components/DeleteAddressLocationDrawer/delete-address-location-drawer.scss";
9
9
 
10
10
  [data-fs-addresses-section] {
11
- @import "@faststore/ui/src/components/atoms/Icon/styles.scss";
12
- @import "@faststore/ui/src/components/molecules/Toggle/styles.scss";
13
- @import "../../components/AddressLine/address-line.scss";
14
- @import "../../../shared/components/InternalSearch/internal-search.scss";
15
- @import "../../../shared/components/DropdownFilter/dropdown-filter.scss";
16
- @import "../../../shared/components/Tag/tag.scss";
17
- @import "../../../shared/components/SortFilter/sort-filter.scss";
18
- @import "../../../shared/components/HeaderInside/header-inside.scss";
19
- @import "../../../shared/components/Table/table.scss";
20
- @import "../../../shared/components/EmptyState/empty-state.scss";
21
- @import "../../../shared/components/Paginator/paginator.scss";
22
-
23
- padding-top: 0;
24
- display: flex;
25
- flex-direction: column;
26
- height: 100%;
27
-
28
- @include media("<=tablet") {
29
- padding: 0;
30
- }
31
-
32
- [data-fs-bp-header-inside] {
33
- [data-fs-bp-header-buttons] > button {
34
- display: flex;
35
- }
36
- @include media("<=tablet") {
37
- [data-fs-header-inside-button]:nth-child(3) {
38
- position: fixed;
39
- bottom: 20px;
40
- right: 20px;
41
- cursor: pointer;
42
- z-index: 1000;
43
- }
44
- }
45
- }
46
-
47
- [data-fs-bp-table-row-default-icon] {
48
- display: flex;
49
- justify-content: flex-end;
50
- padding-right: var(--fs-spacing-1);
51
- color: #0366dd;
52
- }
53
-
54
- [data-fs-bp-address-tabs-paginator-last] {
55
- display: flex;
56
- justify-content: flex-end;
57
- align-items: center;
58
-
59
- margin-top: var(--fs-spacing-0);
60
- padding: var(--fs-spacing-2) 0;
61
-
62
- @include media(">=tablet") {
63
- display: none;
64
- }
65
- }
66
-
67
- [data-fs-topbar-actions-wrapper] {
68
- display: flex;
69
- flex-direction: row;
70
- [data-fs-topbar-dropdown-filter-trigger] {
71
- display: flex;
72
- align-items: center;
73
- cursor: pointer;
74
-
75
- [data-fs-topbar-dropdown-filter-trigger-label] {
76
- font-weight: var(--fs-text-weight-medium);
77
- font-size: var(--fs-text-size-2);
78
- color: #1f1f1f;
79
- }
80
-
81
- [data-fs-topbar-dropdown-filter-trigger-icon] {
82
- color: #707070;
83
- }
84
- }
85
-
86
- [data-fs-topbar-dropdown-add-trigger] {
87
- background-color: #0366dd;
88
- display: flex;
89
- align-items: center;
90
- justify-content: space-between;
91
- padding: calc(var(--fs-spacing-2) - var(--fs-spacing-0))
92
- var(--fs-spacing-2);
93
- border-radius: var(--fs-border-radius-pill);
94
- color: white;
95
- cursor: pointer;
96
-
97
- [data-fs-topbar-dropdown-add-trigger-label] {
98
- font-weight: var(--fs-text-weight-semibold);
99
- font-size: var(--fs-text-size-1);
100
- line-height: calc(var(--fs-spacing-3) + var(--fs-spacing-0));
101
- }
102
-
103
- svg {
104
- color: white;
105
- }
106
- }
107
- }
108
-
109
- [data-fs-buyer-portal-address-filter] {
110
- display: flex;
111
- justify-content: space-between;
112
- padding: 0 0 var(--fs-spacing-4);
113
-
114
- @include media("<=tablet") {
115
- [data-fs-buyer-portal-internal-search] {
116
- width: 100%;
117
- }
118
-
119
- [data-fs-bp-paginator-counter] {
120
- display: none;
121
- }
122
- }
123
- }
124
-
125
- [data-fs-addresses-table] {
126
- padding-bottom: var(--fs-spacing-9);
127
-
128
- [data-fs-bp-addresses-paginator-last] {
129
- display: flex;
130
- justify-content: flex-end;
131
- align-items: center;
132
-
133
- margin-top: var(--fs-spacing-0);
134
- padding: var(--fs-spacing-2) 0;
135
-
136
- @include media(">=tablet") {
137
- display: none;
138
- }
139
- }
140
- }
141
-
142
- [data-fs-bp-table-head] {
143
- [data-fs-bp-table-head-column-action] {
144
- &:empty {
145
- width: var(--fs-spacing-6);
146
- }
147
- }
148
- }
149
-
150
- [data-fs-bp-addresses-paginator] {
151
- display: flex;
152
- align-items: center;
153
- justify-content: flex-start;
154
- margin-top: var(--fs-spacing-2);
155
- padding: var(--fs-spacing-2) 0;
156
-
157
- @include media("<=phonemid") {
158
- padding: var(--fs-spacing-3) 0;
159
- margin-bottom: 5rem;
160
- }
161
- }
11
+ @import "@faststore/ui/src/components/atoms/Icon/styles.scss";
12
+ @import "@faststore/ui/src/components/molecules/Toggle/styles.scss";
13
+ @import "../../components/AddressLine/address-line.scss";
14
+ @import "../../../shared/components/InternalSearch/internal-search.scss";
15
+ @import "../../../shared/components/DropdownFilter/dropdown-filter.scss";
16
+ @import "../../../shared/components/Tag/tag.scss";
17
+ @import "../../../shared/components/SortFilter/sort-filter.scss";
18
+ @import "../../../shared/components/HeaderInside/header-inside.scss";
19
+ @import "../../../shared/components/Table/table.scss";
20
+ @import "../../../shared/components/EmptyState/empty-state.scss";
21
+ @import "../../../shared/components/Paginator/paginator.scss";
22
+ @import "../../../shared/components/IconBookmarked/icon-bookmarked.scss";
23
+
24
+ padding-top: 0;
25
+ display: flex;
26
+ flex-direction: column;
27
+ height: 100%;
28
+
29
+ @include media("<=tablet") {
30
+ padding: 0;
31
+ }
32
+
33
+ [data-fs-bp-header-inside] {
34
+ [data-fs-bp-header-buttons] > button {
35
+ display: flex;
36
+ }
37
+ @include media("<=tablet") {
38
+ [data-fs-header-inside-button]:nth-child(3) {
39
+ position: fixed;
40
+ bottom: calc(var(--fs-spacing-3) + var(--fs-spacing-0));
41
+ right: calc(var(--fs-spacing-3) + var(--fs-spacing-0));
42
+ cursor: pointer;
43
+ z-index: 1000;
44
+ }
45
+ }
46
+ }
47
+
48
+ [data-fs-bp-address-tabs-paginator-last] {
49
+ display: flex;
50
+ justify-content: flex-end;
51
+ align-items: center;
52
+
53
+ margin-top: var(--fs-spacing-0);
54
+ padding: var(--fs-spacing-2) 0;
55
+
56
+ @include media(">=tablet") {
57
+ display: none;
58
+ }
59
+ }
60
+
61
+ [data-fs-topbar-actions-wrapper] {
62
+ display: flex;
63
+ flex-direction: row;
64
+ [data-fs-topbar-dropdown-filter-trigger] {
65
+ display: flex;
66
+ align-items: center;
67
+ cursor: pointer;
68
+
69
+ [data-fs-topbar-dropdown-filter-trigger-label] {
70
+ font-weight: var(--fs-text-weight-medium);
71
+ font-size: var(--fs-text-size-2);
72
+ color: #1f1f1f;
73
+ }
74
+
75
+ [data-fs-topbar-dropdown-filter-trigger-icon] {
76
+ color: #707070;
77
+ }
78
+ }
79
+
80
+ [data-fs-topbar-dropdown-add-trigger] {
81
+ background-color: #0366dd;
82
+ display: flex;
83
+ align-items: center;
84
+ justify-content: space-between;
85
+ padding: calc(var(--fs-spacing-2) - var(--fs-spacing-0)) var(--fs-spacing-2);
86
+ border-radius: var(--fs-border-radius-pill);
87
+ color: white;
88
+ cursor: pointer;
89
+
90
+ [data-fs-topbar-dropdown-add-trigger-label] {
91
+ font-weight: var(--fs-text-weight-semibold);
92
+ font-size: var(--fs-text-size-1);
93
+ line-height: calc(var(--fs-spacing-3) + var(--fs-spacing-0));
94
+ }
95
+
96
+ svg {
97
+ color: white;
98
+ }
99
+ }
100
+ }
101
+
102
+ [data-fs-buyer-portal-address-filter] {
103
+ display: flex;
104
+ justify-content: space-between;
105
+ padding: 0 0 var(--fs-spacing-4);
106
+
107
+ @include media("<=tablet") {
108
+ [data-fs-buyer-portal-internal-search] {
109
+ width: 100%;
110
+ }
111
+
112
+ [data-fs-bp-paginator-counter] {
113
+ display: none;
114
+ }
115
+ }
116
+ }
117
+
118
+ [data-fs-addresses-table] {
119
+ padding-bottom: var(--fs-spacing-9);
120
+
121
+ [data-fs-bp-addresses-paginator-last] {
122
+ display: flex;
123
+ justify-content: flex-end;
124
+ align-items: center;
125
+
126
+ margin-top: var(--fs-spacing-0);
127
+ padding: var(--fs-spacing-2) 0;
128
+
129
+ @include media(">=tablet") {
130
+ display: none;
131
+ }
132
+ }
133
+ }
134
+
135
+ [data-fs-bp-table-head] {
136
+ [data-fs-bp-table-head-column-action] {
137
+ &:empty {
138
+ width: var(--fs-spacing-6);
139
+ }
140
+ }
141
+ }
142
+
143
+ [data-fs-bp-addresses-paginator] {
144
+ display: flex;
145
+ align-items: center;
146
+ justify-content: flex-start;
147
+ margin-top: var(--fs-spacing-2);
148
+ padding: var(--fs-spacing-2) 0;
149
+
150
+ @include media("<=phonemid") {
151
+ padding: var(--fs-spacing-3) 0;
152
+ margin-bottom: var(--fs-spacing-11);
153
+ }
154
+ }
162
155
  }
@@ -6,20 +6,16 @@ import {
6
6
  DropdownButton,
7
7
  DropdownItem,
8
8
  DropdownMenu,
9
- Table,
10
- TableBody,
11
- TableCell,
12
- TableHead,
13
- TableRow,
14
9
  Tooltip,
15
10
  } from "@faststore/ui";
16
11
 
17
- import { Icon, InternalSearch, Tag } from "../../../shared/components";
12
+ import { Icon, InternalSearch, Table, Tag } from "../../../shared/components";
18
13
  import { Pagination } from "../../../shared/components/Pagination/Pagination";
14
+ import { type TableColumn } from "../../../shared/components/Table/TableHead/TableHead";
15
+ import { getTableColumns } from "../../../shared/components/Table/utils/tableColumns";
19
16
  import { useBuyerPortal } from "../../../shared/hooks";
20
17
  import { IPagination } from "../../../shared/types";
21
18
  import { Dictionary } from "../../../shared/utils";
22
- import BudgetSkeleton from "../BudgetSkeleton/BudgetSkeleton";
23
19
 
24
20
  import type { BudgetAllocationsSelectionDataType } from "../../types";
25
21
 
@@ -123,6 +119,39 @@ export const BudgetAllocationsSelection = ({
123
119
  );
124
120
  };
125
121
 
122
+ const columns: TableColumn[] = [
123
+ {
124
+ key: "check",
125
+ size: "2.5rem",
126
+ align: "center",
127
+ label: (
128
+ <Checkbox
129
+ data-fs-bp-budget-allocation-row-checked
130
+ ref={selectAllRef}
131
+ onChange={handleChangeCheckboxAll}
132
+ checked={
133
+ selected.length > 0 &&
134
+ selected.filter((selectedItem) =>
135
+ data.find((item) => item.id === selectedItem.id)
136
+ ).length === data.length
137
+ }
138
+ />
139
+ ),
140
+ },
141
+ ...getTableColumns({
142
+ nameColumnSize: "14rem",
143
+ extraColumns: [
144
+ {
145
+ key: "contract",
146
+ label: "Contract",
147
+ align: "left",
148
+ size: "100%",
149
+ hideOnScreenSize: "phonemid",
150
+ },
151
+ ],
152
+ }),
153
+ ];
154
+
126
155
  return (
127
156
  <div data-fs-bp-budget-allocation-table>
128
157
  <div data-fs-bp-budget-allocation-wrapper>
@@ -190,68 +219,43 @@ export const BudgetAllocationsSelection = ({
190
219
  )}
191
220
  </div>
192
221
 
193
- <Table variant="bordered">
194
- <TableHead>
195
- <TableRow>
196
- <TableCell scope="col" variant="header" align="center">
197
- <Checkbox
198
- ref={selectAllRef}
199
- checked={
200
- selected.length > 0 &&
201
- selected.filter((selectedItem) =>
202
- data.find((item) => item.id === selectedItem.id)
203
- ).length === data.length
204
- }
205
- onChange={handleChangeCheckboxAll}
206
- data-fs-bp-budget-allocation-row-checked
207
- data-fs-bp-budget-allocation-row-select-all
208
- />
209
- </TableCell>
210
- <TableCell scope="col" variant="header" align="left">
211
- Name
212
- </TableCell>
213
- <TableCell scope="col" variant="header" align="left">
214
- Contract
215
- </TableCell>
216
- </TableRow>
217
- </TableHead>
218
- <TableBody>
222
+ <Table layoutFixed>
223
+ <Table.Head columns={columns} />
224
+ <Table.Body>
219
225
  {loading ? (
220
- <BudgetSkeleton />
226
+ <Table.Loading columns={columns.length} />
221
227
  ) : (
222
228
  data.map((option) => {
223
229
  const isChecked = !!selected.find(
224
230
  (item) => item.id === option.id
225
231
  );
226
-
227
232
  return (
228
- <TableRow
233
+ <Table.Row
229
234
  key={option.id}
230
- data-fs-bp-budget-allocation-row-selection={isChecked}
235
+ iconName="TableEdit"
236
+ iconSize={24}
237
+ title={option.value}
238
+ selected={isChecked || option.isAllocation}
239
+ enabled={!option.isAllocation}
240
+ prependColumns={
241
+ <Table.Cell align="center">
242
+ <Checkbox
243
+ checked={isChecked || option.isAllocation}
244
+ disabled={option.isAllocation}
245
+ data-fs-bp-budget-allocation-row-checked
246
+ onChange={() => toggleChecked(option, isChecked)}
247
+ />
248
+ </Table.Cell>
249
+ }
231
250
  >
232
- <TableCell align="center">
233
- <Checkbox
234
- checked={isChecked || option.isAllocation}
235
- disabled={option.isAllocation}
236
- data-fs-bp-budget-allocation-row-checked
237
- onChange={() => toggleChecked(option, isChecked)}
238
- />
239
- </TableCell>
240
- <TableCell
241
- align="center"
242
- data-fs-bp-budget-allocation-row-name-td
243
- >
244
- <div data-fs-bp-budget-allocation-row-name>
245
- <Icon name="TableEdit" width={24} height={24} />
246
- {option.value}
247
- </div>
248
- </TableCell>
249
- <TableCell align="left">{contract?.name}</TableCell>
250
- </TableRow>
251
+ <Table.Cell align="left" hideOnScreenSize="phonemid">
252
+ {contract?.name}
253
+ </Table.Cell>
254
+ </Table.Row>
251
255
  );
252
256
  })
253
257
  )}
254
- </TableBody>
258
+ </Table.Body>
255
259
  </Table>
256
260
 
257
261
  <Pagination