@tesouro/embedded-components-react 0.11.55 → 0.11.58

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 (38) hide show
  1. package/README.md +2 -2
  2. package/dist/index.css +0 -21
  3. package/dist/index.d.ts +31 -6
  4. package/dist/lib/ProductsWidget.d.ts +30 -5
  5. package/dist/lib/ReceivablesWidget.d.ts +27 -5
  6. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +1 -1
  7. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/ProductsWidget.js +99 -92
  8. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/useProductDelete.js +24 -21
  9. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/useProductsWidget.js +79 -75
  10. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/mocks/labels.js +5 -5
  11. package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index2.js +9 -7
  12. package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index3.js +7 -9
  13. package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index4.js +103 -118
  14. package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index5.js +28 -50
  15. package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index6.js +118 -147
  16. package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index7.js +24 -27
  17. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  18. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/index.js +16 -14
  19. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/MeasureUnitCreateDialogContainer.js +38 -0
  20. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/MeasureUnitsManagerContainer.js +73 -123
  21. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/ProductSelector.js +1 -1
  22. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/helpers.js +6 -2
  23. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/labels.js +7 -7
  24. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/useMeasureUnitForm.js +83 -0
  25. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/useProductForm.js +17 -4
  26. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index.js +6 -4
  27. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index2.js +45 -17
  28. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index3.js +121 -123
  29. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index4.js +36 -61
  30. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index5.js +26 -194
  31. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index6.js +115 -49
  32. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index7.js +62 -113
  33. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index8.js +51 -0
  34. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index9.js +117 -0
  35. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +14 -14
  36. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/StatePanel/NoAccessState.js +10 -2
  37. package/dist/packages/shared-ui-shadcn/dist/index.js +1648 -1526
  38. package/package.json +1 -1
package/README.md CHANGED
@@ -714,7 +714,7 @@ Manages an organization's products and services: a filterable, sortable table wi
714
714
  | `formLabels` | `PartialDeep<ProductFormSheetLabels>` | English labels | Create sheet and inline edit form copy. |
715
715
  | `detailsLabels` | `PartialDeep<ProductDetailsSheetLabels>` | English labels | Details sheet copy. |
716
716
  | `deleteLabels` | `Partial<ProductDeleteDialogLabels>` | English labels | Product delete confirmation copy. |
717
- | `measureUnitsLabels` | `Partial<MeasureUnitsManagerLabels>` | English labels | Measure-units manager copy. |
717
+ | `measureUnitsLabels` | `PartialDeep<MeasureUnitsManagerLabels>` | English labels | Measure-units manager and its add / edit dialog copy. |
718
718
  | `measureUnitDeleteLabels` | `Partial<MeasureUnitDeleteDialogLabels>` | English labels | Measure-unit delete confirmation copy. |
719
719
  | `messageLabels` | `Partial<ProductMessageLabels>` | English labels | Validation, error and toast messages produced by the widget. |
720
720
 
@@ -745,7 +745,7 @@ Lists, creates, edits and acts on an organization's invoices, including sending
745
745
  | `actionLabels` | `Partial<ReceivableActionDialogLabels>` | English labels | Confirmation dialog buttons; per-action titles come from `messageLabels`. |
746
746
  | `actionsModalLabels` | `Partial<ReceivableActionsModalLabels>` | English labels | Copy of the modal shown after a create, and of its email step on Send for an issued invoice: the email step and the save-items-as-products step. Its titles, email-step dismiss buttons, toasts and select-all toggle are in `messageLabels`. |
747
747
  | `counterpartFormLabels` | `PartialDeep<CounterpartFormSheetLabels>` | English labels | Inline customer creation copy. |
748
- | `measureUnitsLabels` | `Partial<MeasureUnitsManagerLabels>` | English labels | Measure-unit manager copy. |
748
+ | `measureUnitsLabels` | `PartialDeep<MeasureUnitsManagerLabels>` | English labels | Measure-unit manager and its add / edit dialog copy. |
749
749
  | `measureUnitDeleteLabels` | `Partial<MeasureUnitDeleteDialogLabels>` | English labels | Measure-unit delete confirmation copy. |
750
750
  | `messageLabels` | `Partial<ReceivableMessageLabels>` | English labels | Validation, fallback, details panel, reminder and confirmation messages, including the form's save and issue buttons and a new reminder's subject and body. |
751
751
  | `productMessageLabels` | `Partial<ProductMessageLabels>` | English labels | Product validation and error messages, and the measure-unit toasts. |
package/dist/index.css CHANGED
@@ -1012,9 +1012,6 @@
1012
1012
  .ttw\:w-32 {
1013
1013
  width: calc(var(--ttw-spacing) * 32);
1014
1014
  }
1015
- .ttw\:w-35 {
1016
- width: calc(var(--ttw-spacing) * 35);
1017
- }
1018
1015
  .ttw\:w-36 {
1019
1016
  width: calc(var(--ttw-spacing) * 36);
1020
1017
  }
@@ -1099,24 +1096,15 @@
1099
1096
  .ttw\:w-\[18\.75rem\] {
1100
1097
  width: 18.75rem;
1101
1098
  }
1102
- .ttw\:w-\[20\%\] {
1103
- width: 20%;
1104
- }
1105
1099
  .ttw\:w-\[27\.5rem\] {
1106
1100
  width: 27.5rem;
1107
1101
  }
1108
- .ttw\:w-\[30\%\] {
1109
- width: 30%;
1110
- }
1111
1102
  .ttw\:w-\[36rem\] {
1112
1103
  width: 36rem;
1113
1104
  }
1114
1105
  .ttw\:w-\[42px\] {
1115
1106
  width: 42px;
1116
1107
  }
1117
- .ttw\:w-\[50\%\] {
1118
- width: 50%;
1119
- }
1120
1108
  .ttw\:w-\[60\%\] {
1121
1109
  width: 60%;
1122
1110
  }
@@ -1246,9 +1234,6 @@
1246
1234
  .ttw\:max-w-100 {
1247
1235
  max-width: calc(var(--ttw-spacing) * 100);
1248
1236
  }
1249
- .ttw\:max-w-130 {
1250
- max-width: calc(var(--ttw-spacing) * 130);
1251
- }
1252
1237
  .ttw\:max-w-140 {
1253
1238
  max-width: calc(var(--ttw-spacing) * 140);
1254
1239
  }
@@ -2273,9 +2258,6 @@
2273
2258
  .ttw\:bg-background {
2274
2259
  background-color: var(--ttw-background);
2275
2260
  }
2276
- .ttw\:bg-background\! {
2277
- background-color: var(--ttw-background) !important;
2278
- }
2279
2261
  .ttw\:bg-background\/80 {
2280
2262
  background-color: var(--ttw-background);
2281
2263
  @supports (color: color-mix(in lab, red, red)) {
@@ -4040,9 +4022,6 @@
4040
4022
  .ttw\:pr-3 {
4041
4023
  padding-right: calc(var(--ttw-spacing) * 3);
4042
4024
  }
4043
- .ttw\:pr-4 {
4044
- padding-right: calc(var(--ttw-spacing) * 4);
4045
- }
4046
4025
  .ttw\:pr-8 {
4047
4026
  padding-right: calc(var(--ttw-spacing) * 8);
4048
4027
  }
package/dist/index.d.ts CHANGED
@@ -5449,8 +5449,10 @@ interface ProductFormSheetLabels {
5449
5449
  /** Heading of the inline edit form. `{type}` is replaced with the product/service word. */
5450
5450
  editingBanner: string;
5451
5451
  nameLabel: string;
5452
+ /** @deprecated Unused: placeholders carry format hints only. */
5452
5453
  namePlaceholder: string;
5453
5454
  descriptionLabel: string;
5455
+ /** @deprecated Unused: placeholders carry format hints only. */
5454
5456
  descriptionPlaceholder: string;
5455
5457
  /** `{count}` is replaced with the current character count. */
5456
5458
  descriptionCount: string;
@@ -5463,6 +5465,7 @@ interface ProductFormSheetLabels {
5463
5465
  noUnit: string;
5464
5466
  unitEmpty: string;
5465
5467
  unitClearAriaLabel: string;
5468
+ addUnit: string;
5466
5469
  priceLabel: string;
5467
5470
  pricePlaceholder: string;
5468
5471
  cancelButton: string;
@@ -5479,9 +5482,13 @@ interface MeasureUnitsManagerLabels {
5479
5482
  title: string;
5480
5483
  hiddenDescription: string;
5481
5484
  searchPlaceholder: string;
5485
+ searchLabel: string;
5482
5486
  columnLabel: string;
5483
5487
  columnDescription: string;
5488
+ noDescription: string;
5489
+ /** @deprecated Unused: placeholders carry format hints only. */
5484
5490
  namePlaceholder: string;
5491
+ /** @deprecated Unused: placeholders carry format hints only. */
5485
5492
  descriptionPlaceholder: string;
5486
5493
  addButton: string;
5487
5494
  doneButton: string;
@@ -5489,15 +5496,28 @@ interface MeasureUnitsManagerLabels {
5489
5496
  deleteAction: string;
5490
5497
  saveAction: string;
5491
5498
  cancelAction: string;
5499
+ /** @deprecated Use `emptyTitle` and `emptyDescription`. */
5492
5500
  emptyText: string;
5493
- /** Accessible label for the per-row actions-menu trigger button. */
5501
+ emptyTitle: string;
5502
+ emptyDescription: string;
5503
+ searchEmptyTitle: string;
5504
+ searchEmptyDescription: string;
5505
+ loadingLabel: string;
5506
+ errorTitle: string;
5507
+ errorDescription: string;
5508
+ errorRetry: string;
5494
5509
  moreActionsLabel: string;
5495
- /** Screen-reader name and tooltip of the sheet's close (X) button. */
5496
5510
  close: string;
5511
+ createTitle: string;
5512
+ editTitle: string;
5513
+ nameLabel: string;
5514
+ descriptionLabel: string;
5515
+ fieldMarkers: LabelLabels;
5497
5516
  }
5498
5517
  interface MeasureUnitDeleteDialogLabels {
5499
5518
  /** `{name}` is replaced with the unit name. */
5500
5519
  title: string;
5520
+ /** @deprecated Unused: `messageNoItemsHint` alone covers a unit no product uses. */
5501
5521
  messageNoItems: string;
5502
5522
  messageNoItemsHint: string;
5503
5523
  messageWithItems: string;
@@ -5506,6 +5526,7 @@ interface MeasureUnitDeleteDialogLabels {
5506
5526
  cancelButton: string;
5507
5527
  /** Screen-reader name and tooltip of the dialog's close (X) button. */
5508
5528
  close: string;
5529
+ loadingProducts: string;
5509
5530
  }
5510
5531
 
5511
5532
  /**
@@ -5536,8 +5557,9 @@ interface ProductMessageLabels {
5536
5557
  productUpdated: string;
5537
5558
  /** Success toast after editing a service; `{name}` is replaced with its name. */
5538
5559
  serviceUpdated: string;
5560
+ /** Success toast after deleting a product; `{name}` is replaced with its name. */
5539
5561
  productDeleted: string;
5540
- /** Error toast when a product delete fails without a server message. */
5562
+ /** Error toast when a product delete fails; `{name}` is replaced with its name. */
5541
5563
  deleteProductError: string;
5542
5564
  /** Success toast after creating a measure unit; `{name}` is replaced with its name. */
5543
5565
  measureUnitCreated: string;
@@ -5545,7 +5567,7 @@ interface ProductMessageLabels {
5545
5567
  measureUnitUpdated: string;
5546
5568
  /** Success toast after deleting a measure unit; `{name}` is replaced with its name. */
5547
5569
  measureUnitDeleted: string;
5548
- /** Error toast when a measure unit delete fails without a server message. */
5570
+ /** Error toast when a measure unit delete fails; `{name}` is replaced with its name. */
5549
5571
  deleteMeasureUnitError: string;
5550
5572
  }
5551
5573
 
@@ -5594,6 +5616,7 @@ interface ProductsScreenLabels {
5594
5616
  typeBadge: ProductTypeBadgeLabels;
5595
5617
  }
5596
5618
  interface ProductDetailsSheetLabels {
5619
+ /** @deprecated Unused: the sheet has no description while it loads. */
5597
5620
  hiddenDescription: string;
5598
5621
  /** `{type}` and `{createdAt}` are replaced at render time. */
5599
5622
  subtitle: string;
@@ -5619,6 +5642,8 @@ interface ProductDetailsSheetLabels {
5619
5642
  deleteProductOption: string;
5620
5643
  editButton: string;
5621
5644
  loadingTitle: string;
5645
+ unavailableTitle: string;
5646
+ loadingLabel: string;
5622
5647
  errorTitle: string;
5623
5648
  errorDescription: string;
5624
5649
  typeBadge: ProductTypeBadgeLabels;
@@ -5639,7 +5664,7 @@ interface ProductsWidgetOwnProps {
5639
5664
  formLabels?: PartialDeep<ProductFormSheetLabels>;
5640
5665
  detailsLabels?: PartialDeep<ProductDetailsSheetLabels>;
5641
5666
  deleteLabels?: Partial<ProductDeleteDialogLabels>;
5642
- measureUnitsLabels?: Partial<MeasureUnitsManagerLabels>;
5667
+ measureUnitsLabels?: PartialDeep<MeasureUnitsManagerLabels>;
5643
5668
  measureUnitDeleteLabels?: Partial<MeasureUnitDeleteDialogLabels>;
5644
5669
  /** Overrides for validation / error messages produced by the widget. */
5645
5670
  messageLabels?: Partial<ProductMessageLabels>;
@@ -6399,7 +6424,7 @@ interface ReceivablesWidgetOwnProps {
6399
6424
  actionLabels?: Partial<ReceivableActionDialogLabels>;
6400
6425
  actionsModalLabels?: Partial<ReceivableActionsModalLabels>;
6401
6426
  counterpartFormLabels?: PartialDeep<CounterpartFormSheetLabels>;
6402
- measureUnitsLabels?: Partial<MeasureUnitsManagerLabels>;
6427
+ measureUnitsLabels?: PartialDeep<MeasureUnitsManagerLabels>;
6403
6428
  measureUnitDeleteLabels?: Partial<MeasureUnitDeleteDialogLabels>;
6404
6429
  messageLabels?: Partial<ReceivableMessageLabels>;
6405
6430
  productMessageLabels?: Partial<ProductMessageLabels>;
@@ -650,8 +650,10 @@ interface ProductFormSheetLabels {
650
650
  /** Heading of the inline edit form. `{type}` is replaced with the product/service word. */
651
651
  editingBanner: string;
652
652
  nameLabel: string;
653
+ /** @deprecated Unused: placeholders carry format hints only. */
653
654
  namePlaceholder: string;
654
655
  descriptionLabel: string;
656
+ /** @deprecated Unused: placeholders carry format hints only. */
655
657
  descriptionPlaceholder: string;
656
658
  /** `{count}` is replaced with the current character count. */
657
659
  descriptionCount: string;
@@ -664,6 +666,7 @@ interface ProductFormSheetLabels {
664
666
  noUnit: string;
665
667
  unitEmpty: string;
666
668
  unitClearAriaLabel: string;
669
+ addUnit: string;
667
670
  priceLabel: string;
668
671
  pricePlaceholder: string;
669
672
  cancelButton: string;
@@ -680,9 +683,13 @@ interface MeasureUnitsManagerLabels {
680
683
  title: string;
681
684
  hiddenDescription: string;
682
685
  searchPlaceholder: string;
686
+ searchLabel: string;
683
687
  columnLabel: string;
684
688
  columnDescription: string;
689
+ noDescription: string;
690
+ /** @deprecated Unused: placeholders carry format hints only. */
685
691
  namePlaceholder: string;
692
+ /** @deprecated Unused: placeholders carry format hints only. */
686
693
  descriptionPlaceholder: string;
687
694
  addButton: string;
688
695
  doneButton: string;
@@ -690,15 +697,28 @@ interface MeasureUnitsManagerLabels {
690
697
  deleteAction: string;
691
698
  saveAction: string;
692
699
  cancelAction: string;
700
+ /** @deprecated Use `emptyTitle` and `emptyDescription`. */
693
701
  emptyText: string;
694
- /** Accessible label for the per-row actions-menu trigger button. */
702
+ emptyTitle: string;
703
+ emptyDescription: string;
704
+ searchEmptyTitle: string;
705
+ searchEmptyDescription: string;
706
+ loadingLabel: string;
707
+ errorTitle: string;
708
+ errorDescription: string;
709
+ errorRetry: string;
695
710
  moreActionsLabel: string;
696
- /** Screen-reader name and tooltip of the sheet's close (X) button. */
697
711
  close: string;
712
+ createTitle: string;
713
+ editTitle: string;
714
+ nameLabel: string;
715
+ descriptionLabel: string;
716
+ fieldMarkers: LabelLabels;
698
717
  }
699
718
  interface MeasureUnitDeleteDialogLabels {
700
719
  /** `{name}` is replaced with the unit name. */
701
720
  title: string;
721
+ /** @deprecated Unused: `messageNoItemsHint` alone covers a unit no product uses. */
702
722
  messageNoItems: string;
703
723
  messageNoItemsHint: string;
704
724
  messageWithItems: string;
@@ -707,6 +727,7 @@ interface MeasureUnitDeleteDialogLabels {
707
727
  cancelButton: string;
708
728
  /** Screen-reader name and tooltip of the dialog's close (X) button. */
709
729
  close: string;
730
+ loadingProducts: string;
710
731
  }
711
732
 
712
733
  /**
@@ -737,8 +758,9 @@ interface ProductMessageLabels {
737
758
  productUpdated: string;
738
759
  /** Success toast after editing a service; `{name}` is replaced with its name. */
739
760
  serviceUpdated: string;
761
+ /** Success toast after deleting a product; `{name}` is replaced with its name. */
740
762
  productDeleted: string;
741
- /** Error toast when a product delete fails without a server message. */
763
+ /** Error toast when a product delete fails; `{name}` is replaced with its name. */
742
764
  deleteProductError: string;
743
765
  /** Success toast after creating a measure unit; `{name}` is replaced with its name. */
744
766
  measureUnitCreated: string;
@@ -746,7 +768,7 @@ interface ProductMessageLabels {
746
768
  measureUnitUpdated: string;
747
769
  /** Success toast after deleting a measure unit; `{name}` is replaced with its name. */
748
770
  measureUnitDeleted: string;
749
- /** Error toast when a measure unit delete fails without a server message. */
771
+ /** Error toast when a measure unit delete fails; `{name}` is replaced with its name. */
750
772
  deleteMeasureUnitError: string;
751
773
  }
752
774
 
@@ -795,6 +817,7 @@ interface ProductsScreenLabels {
795
817
  typeBadge: ProductTypeBadgeLabels;
796
818
  }
797
819
  interface ProductDetailsSheetLabels {
820
+ /** @deprecated Unused: the sheet has no description while it loads. */
798
821
  hiddenDescription: string;
799
822
  /** `{type}` and `{createdAt}` are replaced at render time. */
800
823
  subtitle: string;
@@ -820,6 +843,8 @@ interface ProductDetailsSheetLabels {
820
843
  deleteProductOption: string;
821
844
  editButton: string;
822
845
  loadingTitle: string;
846
+ unavailableTitle: string;
847
+ loadingLabel: string;
823
848
  errorTitle: string;
824
849
  errorDescription: string;
825
850
  typeBadge: ProductTypeBadgeLabels;
@@ -840,7 +865,7 @@ interface ProductsWidgetOwnProps {
840
865
  formLabels?: PartialDeep<ProductFormSheetLabels>;
841
866
  detailsLabels?: PartialDeep<ProductDetailsSheetLabels>;
842
867
  deleteLabels?: Partial<ProductDeleteDialogLabels>;
843
- measureUnitsLabels?: Partial<MeasureUnitsManagerLabels>;
868
+ measureUnitsLabels?: PartialDeep<MeasureUnitsManagerLabels>;
844
869
  measureUnitDeleteLabels?: Partial<MeasureUnitDeleteDialogLabels>;
845
870
  /** Overrides for validation / error messages produced by the widget. */
846
871
  messageLabels?: Partial<ProductMessageLabels>;
@@ -874,8 +874,10 @@ interface ProductFormSheetLabels {
874
874
  /** Heading of the inline edit form. `{type}` is replaced with the product/service word. */
875
875
  editingBanner: string;
876
876
  nameLabel: string;
877
+ /** @deprecated Unused: placeholders carry format hints only. */
877
878
  namePlaceholder: string;
878
879
  descriptionLabel: string;
880
+ /** @deprecated Unused: placeholders carry format hints only. */
879
881
  descriptionPlaceholder: string;
880
882
  /** `{count}` is replaced with the current character count. */
881
883
  descriptionCount: string;
@@ -888,6 +890,7 @@ interface ProductFormSheetLabels {
888
890
  noUnit: string;
889
891
  unitEmpty: string;
890
892
  unitClearAriaLabel: string;
893
+ addUnit: string;
891
894
  priceLabel: string;
892
895
  pricePlaceholder: string;
893
896
  cancelButton: string;
@@ -904,9 +907,13 @@ interface MeasureUnitsManagerLabels {
904
907
  title: string;
905
908
  hiddenDescription: string;
906
909
  searchPlaceholder: string;
910
+ searchLabel: string;
907
911
  columnLabel: string;
908
912
  columnDescription: string;
913
+ noDescription: string;
914
+ /** @deprecated Unused: placeholders carry format hints only. */
909
915
  namePlaceholder: string;
916
+ /** @deprecated Unused: placeholders carry format hints only. */
910
917
  descriptionPlaceholder: string;
911
918
  addButton: string;
912
919
  doneButton: string;
@@ -914,15 +921,28 @@ interface MeasureUnitsManagerLabels {
914
921
  deleteAction: string;
915
922
  saveAction: string;
916
923
  cancelAction: string;
924
+ /** @deprecated Use `emptyTitle` and `emptyDescription`. */
917
925
  emptyText: string;
918
- /** Accessible label for the per-row actions-menu trigger button. */
926
+ emptyTitle: string;
927
+ emptyDescription: string;
928
+ searchEmptyTitle: string;
929
+ searchEmptyDescription: string;
930
+ loadingLabel: string;
931
+ errorTitle: string;
932
+ errorDescription: string;
933
+ errorRetry: string;
919
934
  moreActionsLabel: string;
920
- /** Screen-reader name and tooltip of the sheet's close (X) button. */
921
935
  close: string;
936
+ createTitle: string;
937
+ editTitle: string;
938
+ nameLabel: string;
939
+ descriptionLabel: string;
940
+ fieldMarkers: LabelLabels;
922
941
  }
923
942
  interface MeasureUnitDeleteDialogLabels {
924
943
  /** `{name}` is replaced with the unit name. */
925
944
  title: string;
945
+ /** @deprecated Unused: `messageNoItemsHint` alone covers a unit no product uses. */
926
946
  messageNoItems: string;
927
947
  messageNoItemsHint: string;
928
948
  messageWithItems: string;
@@ -931,6 +951,7 @@ interface MeasureUnitDeleteDialogLabels {
931
951
  cancelButton: string;
932
952
  /** Screen-reader name and tooltip of the dialog's close (X) button. */
933
953
  close: string;
954
+ loadingProducts: string;
934
955
  }
935
956
 
936
957
  /**
@@ -961,8 +982,9 @@ interface ProductMessageLabels {
961
982
  productUpdated: string;
962
983
  /** Success toast after editing a service; `{name}` is replaced with its name. */
963
984
  serviceUpdated: string;
985
+ /** Success toast after deleting a product; `{name}` is replaced with its name. */
964
986
  productDeleted: string;
965
- /** Error toast when a product delete fails without a server message. */
987
+ /** Error toast when a product delete fails; `{name}` is replaced with its name. */
966
988
  deleteProductError: string;
967
989
  /** Success toast after creating a measure unit; `{name}` is replaced with its name. */
968
990
  measureUnitCreated: string;
@@ -970,7 +992,7 @@ interface ProductMessageLabels {
970
992
  measureUnitUpdated: string;
971
993
  /** Success toast after deleting a measure unit; `{name}` is replaced with its name. */
972
994
  measureUnitDeleted: string;
973
- /** Error toast when a measure unit delete fails without a server message. */
995
+ /** Error toast when a measure unit delete fails; `{name}` is replaced with its name. */
974
996
  deleteMeasureUnitError: string;
975
997
  }
976
998
 
@@ -1732,7 +1754,7 @@ interface ReceivablesWidgetOwnProps {
1732
1754
  actionLabels?: Partial<ReceivableActionDialogLabels>;
1733
1755
  actionsModalLabels?: Partial<ReceivableActionsModalLabels>;
1734
1756
  counterpartFormLabels?: PartialDeep<CounterpartFormSheetLabels>;
1735
- measureUnitsLabels?: Partial<MeasureUnitsManagerLabels>;
1757
+ measureUnitsLabels?: PartialDeep<MeasureUnitsManagerLabels>;
1736
1758
  measureUnitDeleteLabels?: Partial<MeasureUnitDeleteDialogLabels>;
1737
1759
  messageLabels?: Partial<ReceivableMessageLabels>;
1738
1760
  productMessageLabels?: Partial<ProductMessageLabels>;
@@ -54,7 +54,7 @@ var a = { all: "All invoices" }, o = {
54
54
  unitLabel: "Units",
55
55
  unitPlaceholder: "Select",
56
56
  unitNone: "None",
57
- manageUnitsOption: "Manage measure units",
57
+ manageUnitsOption: "Manage units of measure",
58
58
  priceLabel: "Price",
59
59
  taxableLabel: "Taxable",
60
60
  taxRateLabel: "Tax rate",
@@ -9,126 +9,133 @@ import { WidgetProvider as n } from "../../../../../shared/feature/dist/lib/Widg
9
9
  import "../../../../../shared/feature/dist/index.js";
10
10
  import { ProductFormSheet as r } from "../../../../../shared/product-catalog/ui/dist/index4.js";
11
11
  import { MeasureUnitsManagerContainer as i } from "../../../../../shared/product-catalog/feature/dist/lib/MeasureUnitsManagerContainer.js";
12
+ import { MeasureUnitCreateDialogContainer as a } from "../../../../../shared/product-catalog/feature/dist/lib/MeasureUnitCreateDialogContainer.js";
12
13
  import "../../../../../shared/product-catalog/feature/dist/index.js";
13
- import { ProductsWidgetAnalyticsEvent as a, WIDGET_NAME as o } from "../analytics/events.js";
14
- import { PAGE_SIZE_OPTIONS as s } from "./constants.js";
15
- import { productsWidgetTestIds as c } from "./testIds.js";
16
- import { ProductsScreen as l } from "../../../../ui/dist/index4.js";
17
- import { ProductDetailsSheet as u } from "../../../../ui/dist/index6.js";
18
- import { ProductDeleteDialog as d } from "../../../../ui/dist/index7.js";
14
+ import { ProductsWidgetAnalyticsEvent as o, WIDGET_NAME as s } from "../analytics/events.js";
15
+ import { PAGE_SIZE_OPTIONS as c } from "./constants.js";
16
+ import { productsWidgetTestIds as l } from "./testIds.js";
17
+ import { ProductsScreen as u } from "../../../../ui/dist/index4.js";
18
+ import { ProductDetailsSheet as d } from "../../../../ui/dist/index6.js";
19
+ import { ProductDeleteDialog as f } from "../../../../ui/dist/index7.js";
19
20
  import "../../../../ui/dist/index.js";
20
- import { useProductsWidget as f } from "./useProductsWidget.js";
21
- import { useEffect as p } from "react";
22
- import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
21
+ import { useProductsWidget as p } from "./useProductsWidget.js";
22
+ import { useEffect as m } from "react";
23
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
23
24
  // ../../libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/ProductsWidget.js
24
- function _({ pageSizeOptions: n = s, screenLabels: o, formLabels: _, detailsLabels: v, deleteLabels: y, measureUnitsLabels: b, measureUnitDeleteLabels: x, messageLabels: S }) {
25
- let C = t();
26
- p(() => {
27
- C(a.Mounted);
28
- }, [C]);
29
- let { view: w, units: T, table: E, details: D, form: O, del: k, permissions: A, isPermissionLoading: j, isTableLoading: M, hasInitError: N, refetchWidgetInit: P, measureUnitsOpen: F, actionsSuspended: I, editForm: L, handleRowClick: R, openMeasureUnits: z, closeMeasureUnits: B, submitForm: V, confirmDelete: H } = f({
30
- messageLabels: S,
31
- screenLabels: o,
32
- formLabels: _
25
+ function v({ pageSizeOptions: n = c, screenLabels: s, formLabels: v, detailsLabels: y, deleteLabels: b, measureUnitsLabels: x, measureUnitDeleteLabels: S, messageLabels: C }) {
26
+ let w = t();
27
+ m(() => {
28
+ w(o.Mounted);
29
+ }, [w]);
30
+ let { view: T, units: E, table: D, details: O, form: k, del: A, permissions: j, isPermissionLoading: M, isTableLoading: N, hasInitError: P, refetchWidgetInit: F, measureUnitsOpen: I, actionsSuspended: L, editForm: R, handleRowClick: z, openMeasureUnits: B, closeMeasureUnits: V, addUnitOpen: H, openAddUnit: U, closeAddUnit: W, selectAddedUnit: G, submitForm: K, confirmDelete: q } = p({
31
+ messageLabels: C,
32
+ screenLabels: s,
33
+ formLabels: v
33
34
  });
34
- return /* @__PURE__ */ g(m, { children: [
35
- /* @__PURE__ */ h(e, {}),
36
- /* @__PURE__ */ h(l, {
37
- products: E.rows,
38
- isLoading: M,
39
- isError: N || E.isError,
40
- sorting: E.sorting,
41
- onSortingChange: E.onSortingChange,
42
- pageSize: E.pageSize,
43
- onPageSizeChange: E.onPageSizeChange,
35
+ return /* @__PURE__ */ _(h, { children: [
36
+ /* @__PURE__ */ g(e, {}),
37
+ /* @__PURE__ */ g(u, {
38
+ products: D.rows,
39
+ isLoading: N,
40
+ isError: P || D.isError,
41
+ sorting: D.sorting,
42
+ onSortingChange: D.onSortingChange,
43
+ pageSize: D.pageSize,
44
+ onPageSizeChange: D.onPageSizeChange,
44
45
  pageSizeOptions: n,
45
- hasNextPage: E.hasNextPage,
46
- hasPrevPage: E.hasPrevPage,
47
- onNextPage: E.onNextPage,
48
- onPrevPage: E.onPrevPage,
49
- filters: E.filters,
50
- isFiltering: E.isFiltering,
51
- canCreate: A.canCreate,
52
- canManageUnits: A.canCreate,
53
- isAccessRestricted: !j && !N && !A.canRead,
54
- onCreateClick: O.openCreate,
55
- onManageUnitsClick: z,
56
- onRowClick: R,
57
- onRetry: N ? P : E.onRetry,
58
- labels: o,
46
+ hasNextPage: D.hasNextPage,
47
+ hasPrevPage: D.hasPrevPage,
48
+ onNextPage: D.onNextPage,
49
+ onPrevPage: D.onPrevPage,
50
+ filters: D.filters,
51
+ isFiltering: D.isFiltering,
52
+ canCreate: j.canCreate,
53
+ canManageUnits: j.canCreate,
54
+ isAccessRestricted: !M && !P && !j.canRead,
55
+ onCreateClick: k.openCreate,
56
+ onManageUnitsClick: B,
57
+ onRowClick: z,
58
+ onRetry: P ? F : D.onRetry,
59
+ labels: s,
59
60
  testIds: {
60
- empty: c.empty,
61
- accessRestricted: c.accessRestricted
61
+ empty: l.empty,
62
+ accessRestricted: l.accessRestricted
62
63
  }
63
64
  }),
64
- /* @__PURE__ */ h(r, {
65
- open: w === "create",
65
+ /* @__PURE__ */ g(r, {
66
+ open: T === "create",
66
67
  onOpenChange: (e) => {
67
- e || O.close();
68
+ e || k.close();
68
69
  },
69
- values: O.values,
70
- errors: O.errors,
71
- unitOptions: T.unitOptions,
72
- pricePrefix: O.pricePrefix,
73
- inProgress: O.isSubmitting || I,
74
- onChange: (e) => O.setValues((t) => ({
75
- ...t,
76
- ...e
77
- })),
78
- onSubmit: V,
79
- onCancel: O.close,
80
- labels: _
70
+ values: k.values,
71
+ errors: k.errors,
72
+ unitOptions: E.unitOptions,
73
+ pricePrefix: k.pricePrefix,
74
+ inProgress: k.isSubmitting || L,
75
+ onChange: k.change,
76
+ onSubmit: K,
77
+ onCancel: k.close,
78
+ onAddUnit: j.canCreate ? U : void 0,
79
+ labels: v
81
80
  }),
82
- /* @__PURE__ */ h(u, {
83
- open: w === "details" || w === "edit",
81
+ /* @__PURE__ */ g(d, {
82
+ open: T === "details" || T === "edit",
84
83
  onOpenChange: (e) => {
85
- e || O.close();
84
+ e || k.close();
86
85
  },
87
- product: D.detailsView,
88
- isLoading: D.isLoading,
89
- isError: D.isError,
90
- onEdit: O.openEdit,
91
- onDelete: k.requestDelete,
92
- canEdit: A.canUpdate,
93
- canDelete: A.canDelete,
94
- editForm: L,
95
- labels: v
96
- }),
97
- /* @__PURE__ */ h(d, {
98
- open: k.open,
99
- onOpenChange: k.onOpenChange,
100
- productName: D.productName,
101
- isDeleting: k.isDeleting || I,
102
- onConfirm: H,
103
- onCancel: k.cancel,
86
+ product: O.detailsView,
87
+ isLoading: O.isLoading,
88
+ isError: O.isError,
89
+ onEdit: k.openEdit,
90
+ onDelete: A.requestDelete,
91
+ canEdit: j.canUpdate,
92
+ canDelete: j.canDelete,
93
+ editForm: R,
104
94
  labels: y
105
95
  }),
106
- /* @__PURE__ */ h(i, {
107
- open: F,
108
- onClose: B,
109
- suspended: I,
110
- managerLabels: b,
111
- deleteLabels: x,
112
- messageLabels: S
96
+ /* @__PURE__ */ g(f, {
97
+ open: A.open,
98
+ onOpenChange: A.onOpenChange,
99
+ productName: O.productName,
100
+ isDeleting: A.isDeleting || L,
101
+ onConfirm: q,
102
+ onCancel: A.cancel,
103
+ labels: b
104
+ }),
105
+ /* @__PURE__ */ g(a, {
106
+ open: H,
107
+ onClose: W,
108
+ onCreated: G,
109
+ suspended: L,
110
+ labels: x,
111
+ messageLabels: C
112
+ }),
113
+ /* @__PURE__ */ g(i, {
114
+ open: I,
115
+ onClose: V,
116
+ suspended: L,
117
+ managerLabels: x,
118
+ deleteLabels: S,
119
+ messageLabels: C
113
120
  })
114
121
  ] });
115
122
  }
116
- function v({ baseUrl: e, widgetToken: t, organizationId: r, configClient: i, gatewayRouting: a, linkComponent: s, uiFramework: c, errorFallback: l, onError: u, analytics: d, disclosuresAcceptance: f, providerLabels: p, ...m }) {
117
- return /* @__PURE__ */ h(n, {
118
- widgetName: o,
123
+ function y({ baseUrl: e, widgetToken: t, organizationId: r, configClient: i, gatewayRouting: a, linkComponent: o, uiFramework: c, errorFallback: l, onError: u, analytics: d, disclosuresAcceptance: f, providerLabels: p, ...m }) {
124
+ return /* @__PURE__ */ g(n, {
125
+ widgetName: s,
119
126
  baseUrl: e,
120
127
  widgetToken: t,
121
128
  organizationId: r,
122
129
  configClient: i,
123
130
  gatewayRouting: a,
124
- linkComponent: s,
131
+ linkComponent: o,
125
132
  uiFramework: c,
126
133
  errorFallback: l,
127
134
  onError: u,
128
135
  analytics: d,
129
136
  disclosuresAcceptance: f,
130
137
  providerLabels: p,
131
- children: /* @__PURE__ */ h(_, { ...m })
138
+ children: /* @__PURE__ */ g(v, { ...m })
132
139
  });
133
140
  }
134
- export { v as ProductsWidget, v as default };
141
+ export { y as ProductsWidget, y as default };