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

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 (58) 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/components/AddBuyingPolicyDrawer/AddBuyingPolicyDrawer.tsx +4 -0
  15. package/src/features/buying-policies/components/BasicBuyingPolicyDrawer/BasicBuyingPolicyDrawer.tsx +35 -4
  16. package/src/features/buying-policies/components/BasicBuyingPolicyDrawer/basic-buying-policy-drawer.scss +2 -1
  17. package/src/features/buying-policies/components/BudgetCriteriaSelector/BudgetCriteriaSelector.tsx +113 -0
  18. package/src/features/buying-policies/components/BudgetCriteriaSelector/budget-criteria-selector.scss +139 -0
  19. package/src/features/buying-policies/components/BudgetCriteriaSelector/index.ts +4 -0
  20. package/src/features/buying-policies/components/BuyingPolicyDropdownMenu/BuyingPolicyDropdownMenu.tsx +5 -0
  21. package/src/features/buying-policies/components/UpdateBuyingPolicyDrawer/UpdateBuyingPolicyDrawer.tsx +5 -0
  22. package/src/features/buying-policies/layouts/BuyingPoliciesLayout/BuyingPoliciesLayout.tsx +66 -46
  23. package/src/features/buying-policies/layouts/BuyingPoliciesLayout/buying-policies-layout.scss +64 -70
  24. package/src/features/buying-policies/utils/index.ts +4 -1
  25. package/src/features/buying-policies/utils/orderFieldsCriteriaOptions.ts +12 -9
  26. package/src/features/collections/components/CollectionsTable/CollectionsTable.tsx +12 -18
  27. package/src/features/collections/components/CollectionsTable/collections-table.scss +138 -118
  28. package/src/features/collections/components/table/AddCollectionsDrawerTable.tsx +48 -54
  29. package/src/features/collections/components/table/add-collections-drawer-table.scss +57 -56
  30. package/src/features/credit-cards/layouts/CreditCardsLayout/CreditCardLayout.tsx +55 -61
  31. package/src/features/credit-cards/layouts/CreditCardsLayout/credit-card-layout.scss +63 -153
  32. package/src/features/payment-methods/components/AddPaymentMethodsDrawer/AddPaymentMethodsDrawer.tsx +58 -49
  33. package/src/features/payment-methods/components/AddPaymentMethodsDrawer/add-payment-methods-drawer.scss +58 -63
  34. package/src/features/payment-methods/layouts/PaymentMethodsLayout/PaymentMethodsLayout.tsx +15 -12
  35. package/src/features/roles/layout/RoleDetailsLayout/RoleDetailsLayout.tsx +57 -26
  36. package/src/features/roles/layout/RoleDetailsLayout/role-details-layout.scss +77 -0
  37. package/src/features/roles/layout/RolesLayout/RolesLayout.tsx +4 -12
  38. package/src/features/roles/layout/RolesLayout/roles-layout.scss +8 -22
  39. package/src/features/shared/components/CustomField/table/CustomFieldTable.tsx +67 -110
  40. package/src/features/shared/components/CustomField/table/custom-field-table.scss +39 -144
  41. package/src/features/shared/components/IconBookmarked/IconBookmarked.tsx +9 -0
  42. package/src/features/shared/components/IconBookmarked/icon-bookmarked.scss +9 -0
  43. package/src/features/shared/components/Table/Table.tsx +7 -2
  44. package/src/features/shared/components/Table/TableCell/TableCell.tsx +15 -3
  45. package/src/features/shared/components/Table/TableCell/table-cell.scss +34 -0
  46. package/src/features/shared/components/Table/TableHead/TableHead.tsx +34 -6
  47. package/src/features/shared/components/Table/TableHead/table-head.scss +53 -49
  48. package/src/features/shared/components/Table/TableLoading/TableLoading.tsx +16 -6
  49. package/src/features/shared/components/Table/TableLoading/table-loading.scss +13 -8
  50. package/src/features/shared/components/Table/TableRow/TableRow.tsx +65 -42
  51. package/src/features/shared/components/Table/TableRow/table-row.scss +104 -68
  52. package/src/features/shared/components/Table/table.scss +11 -6
  53. package/src/features/shared/components/Table/utils/tableColumns.ts +30 -33
  54. package/src/features/shared/components/index.ts +1 -0
  55. package/src/features/users/layouts/UsersLayout/UsersLayout.tsx +20 -27
  56. package/src/pages/budgets.tsx +1 -1
  57. package/src/pages/buying-policies.tsx +14 -1
  58. package/src/themes/layouts.scss +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtex/faststore-plugin-buyer-portal",
3
- "version": "1.1.95",
3
+ "version": "1.1.97",
4
4
  "description": "A plugin for faststore with buyer portal",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -11,6 +11,7 @@ import {
11
11
  Table,
12
12
  } from "../../../shared/components";
13
13
  import { EmptyState } from "../../../shared/components/EmptyState/EmptyState";
14
+ import { getTableColumns } from "../../../shared/components/Table/utils/tableColumns";
14
15
  import {
15
16
  useBuyerPortal,
16
17
  useDrawerProps,
@@ -109,6 +110,10 @@ export const AddressLocationsList = forwardRef<
109
110
  refreshLocations: handleRefreshLocations,
110
111
  }));
111
112
 
113
+ const columns = getTableColumns({
114
+ actionsLength: 2,
115
+ });
116
+
112
117
  return (
113
118
  <div data-fs-bp-address-tabs-list data-fs-bp-address-location-list>
114
119
  <div data-fs-bp-address-tabs-filter>
@@ -137,53 +142,37 @@ export const AddressLocationsList = forwardRef<
137
142
  </EmptyState>
138
143
  ) : (
139
144
  <div data-fs-bp-address-tabs-table>
140
- <Table>
141
- <Table.Head
142
- columns={[
143
- {
144
- key: "name",
145
- label: "Name",
146
- align: "left",
147
- },
148
- {
149
- key: "actions",
150
- label: "",
151
- align: "right",
152
- size: "large",
153
- },
154
- ]}
155
- />
145
+ <Table layoutFixed>
146
+ <Table.Head columns={columns} />
156
147
  <Table.Body>
157
148
  {isLoading ? (
158
- <Table.Loading />
149
+ <Table.Loading columns={columns.length} />
159
150
  ) : (
160
151
  locations.map((item) => (
161
152
  <Table.Row
162
153
  key={item.id}
163
154
  title={item.value}
164
155
  searchTerm={search}
165
- actionIcons={
166
- <div data-fs-bp-address-tabs-actions>
167
- <IconButton
168
- data-fs-bp-address-tabs-actions-icon
169
- icon={<Icon name="Trash" width={20} height={20} />}
170
- aria-label={"remove location action"}
171
- onClick={() => {
172
- selectLocation(item);
173
- openDeleteLocation();
174
- }}
175
- />
176
- <IconButton
177
- data-fs-bp-address-tabs-actions-icon
178
- icon={<Icon name="Edit" width={20} height={20} />}
179
- aria-label={"edit location action"}
180
- onClick={() => {
181
- selectLocation(item);
182
- openEditLocation();
183
- }}
184
- />
185
- </div>
186
- }
156
+ actionIcons={[
157
+ <IconButton
158
+ data-fs-bp-address-tabs-actions-icon
159
+ icon={<Icon name="Trash" width={20} height={20} />}
160
+ aria-label={"remove location action"}
161
+ onClick={() => {
162
+ selectLocation(item);
163
+ openDeleteLocation();
164
+ }}
165
+ />,
166
+ <IconButton
167
+ data-fs-bp-address-tabs-actions-icon
168
+ icon={<Icon name="Edit" width={20} height={20} />}
169
+ aria-label={"edit location action"}
170
+ onClick={() => {
171
+ selectLocation(item);
172
+ openEditLocation();
173
+ }}
174
+ />,
175
+ ]}
187
176
  />
188
177
  ))
189
178
  )}
@@ -11,6 +11,7 @@ import {
11
11
  Table,
12
12
  } from "../../../shared/components";
13
13
  import { EmptyState } from "../../../shared/components/EmptyState/EmptyState";
14
+ import { getTableColumns } from "../../../shared/components/Table/utils/tableColumns";
14
15
  import { useBuyerPortal, useDrawerProps } from "../../../shared/hooks";
15
16
  import {
16
17
  PAGE_PARAMS,
@@ -111,30 +112,42 @@ export const AddressRecipientsList = forwardRef<
111
112
  } = useDrawerProps();
112
113
 
113
114
  const renderActions = (recipient: RecipientData) => {
114
- return (
115
- <div data-fs-bp-address-tabs-actions>
116
- <IconButton
117
- data-fs-bp-address-tabs-actions-icon
118
- icon={<Icon name="Trash" width={20} height={20} />}
119
- aria-label={"remove recipient action"}
120
- onClick={() => {
121
- setCurrentRecipient(recipient);
122
- openDeleteRecipientsAddressDrawer();
123
- }}
124
- />
125
- <IconButton
126
- data-fs-bp-address-tabs-actions-icon
127
- icon={<Icon name="Edit" width={20} height={20} />}
128
- aria-label={"Edit recipient action"}
129
- onClick={() => {
130
- setCurrentRecipient(recipient);
131
- openEditRecipientsAddressDrawer();
132
- }}
133
- />
134
- </div>
135
- );
115
+ return [
116
+ <IconButton
117
+ data-fs-bp-address-tabs-actions-icon
118
+ icon={<Icon name="Trash" width={20} height={20} />}
119
+ aria-label={"remove recipient action"}
120
+ onClick={() => {
121
+ setCurrentRecipient(recipient);
122
+ openDeleteRecipientsAddressDrawer();
123
+ }}
124
+ />,
125
+ <IconButton
126
+ data-fs-bp-address-tabs-actions-icon
127
+ icon={<Icon name="Edit" width={20} height={20} />}
128
+ aria-label={"Edit recipient action"}
129
+ onClick={() => {
130
+ setCurrentRecipient(recipient);
131
+ openEditRecipientsAddressDrawer();
132
+ }}
133
+ />,
134
+ ];
136
135
  };
137
136
 
137
+ const columns = getTableColumns({
138
+ actionsLength: 2,
139
+ nameColumnSize: "11.125rem",
140
+ extraColumns: [
141
+ {
142
+ key: "phone",
143
+ label: "Phone",
144
+ align: "left",
145
+ size: "100%",
146
+ hideOnScreenSize: "phonemid",
147
+ },
148
+ ],
149
+ });
150
+
138
151
  return (
139
152
  <div data-fs-bp-address-tabs-list>
140
153
  <div data-fs-bp-address-tabs-filter>
@@ -155,25 +168,12 @@ export const AddressRecipientsList = forwardRef<
155
168
  />
156
169
  ) : (
157
170
  <div data-fs-bp-address-tabs-table>
158
- <Table>
159
- <Table.Head
160
- columns={[
161
- {
162
- key: "name",
163
- label: "Name",
164
- align: "left",
165
- },
166
- {
167
- key: "phone",
168
- label: "Phone",
169
- align: "left",
170
- },
171
- ]}
172
- />
171
+ <Table layoutFixed>
172
+ <Table.Head columns={columns} />
173
173
 
174
174
  <Table.Body>
175
175
  {isLoading ? (
176
- <Table.Loading />
176
+ <Table.Loading columns={columns.length} />
177
177
  ) : (
178
178
  recipients.map((recipient) => (
179
179
  <Table.Row
@@ -181,13 +181,13 @@ export const AddressRecipientsList = forwardRef<
181
181
  title={recipient.firstName + " " + recipient.lastName}
182
182
  searchTerm={search}
183
183
  children={
184
- recipient.phone ? (
185
- <td>
184
+ <Table.Cell hideOnScreenSize="phonemid">
185
+ {recipient.phone ? (
186
186
  <span>
187
187
  {maskPhoneNumber(recipient.phone, countryCode)}
188
188
  </span>
189
- </td>
190
- ) : null
189
+ ) : null}
190
+ </Table.Cell>
191
191
  }
192
192
  actionIcons={renderActions(recipient as RecipientData)}
193
193
  />