@shipengine/elements 0.20.1 → 0.21.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 (159) hide show
  1. package/index.cjs +1131 -949
  2. package/index.js +995 -817
  3. package/package.json +3 -3
  4. package/src/components/add-funds-form/add-funds-schema.d.ts +7 -7
  5. package/src/components/address-preference-context/address-preference-context.d.ts +42 -0
  6. package/src/components/address-preference-context/index.d.ts +1 -0
  7. package/src/components/auto-funding-form/auto-funding-schema.d.ts +10 -10
  8. package/src/components/date-range-combo/date-range-combo.d.ts +12 -0
  9. package/src/components/date-range-combo/index.d.ts +1 -0
  10. package/src/components/date-range-select/date-range-select.d.ts +8 -0
  11. package/src/components/date-range-select/date-range-select.styles.d.ts +1 -0
  12. package/src/components/date-range-select/index.d.ts +1 -0
  13. package/src/components/field/fields.d.ts +2 -1
  14. package/src/components/field/money-input/hooks/use-utils.d.ts +1 -1
  15. package/src/components/field/money-input/money-input.d.ts +1 -1
  16. package/src/components/field/rate-card/cost-breakdown/cost-breakdown.d.ts +1 -1
  17. package/src/components/field/select-auto-complete/index.d.ts +1 -0
  18. package/src/components/field/select-auto-complete/select-auto-complete.d.ts +7 -0
  19. package/src/components/history/history-card/history-card.d.ts +5 -0
  20. package/src/components/history/history-card/history-card.styles.d.ts +1 -0
  21. package/src/components/history/history-card/index.d.ts +1 -0
  22. package/src/components/history/index.d.ts +1 -1
  23. package/src/components/index.d.ts +3 -1
  24. package/src/components/inline-label/inline-label.d.ts +5 -1
  25. package/src/components/inline-label/inline-label.styles.d.ts +1 -0
  26. package/src/components/items-breakdown/items-breakdown.d.ts +1 -1
  27. package/src/components/label/index.d.ts +1 -0
  28. package/src/components/label/label.d.ts +10 -0
  29. package/src/components/label/label.styles.d.ts +2 -0
  30. package/src/components/label-layout/index.d.ts +2 -0
  31. package/src/components/label-layout/label-layout-purchase.d.ts +4 -3
  32. package/src/components/label-layout/label-layout-settings.d.ts +3 -2
  33. package/src/components/label-layout/label-layout.styles.d.ts +1 -1
  34. package/src/components/section/index.d.ts +1 -0
  35. package/src/components/section/section.d.ts +10 -0
  36. package/src/components/section/section.styles.d.ts +1 -0
  37. package/src/components/templates/add-carrier-form/add-carrier-form-schema.d.ts +1 -1
  38. package/src/components/templates/add-carrier-form/add-carrier-form.d.ts +1 -1
  39. package/src/components/templates/address-display/address-display.d.ts +1 -1
  40. package/src/components/templates/address-form/address-form-schema.d.ts +1 -1
  41. package/src/components/templates/address-form/address-form.d.ts +1 -1
  42. package/src/components/templates/address-form/address-schema.d.ts +2 -1
  43. package/src/components/templates/address-preference-display/address-preference-display.d.ts +1 -1
  44. package/src/components/templates/address-preference-select/address-preference-select.d.ts +24 -0
  45. package/src/components/templates/address-preference-select/index.d.ts +1 -0
  46. package/src/components/templates/carrier-recovery-form/carrier-recovery-form-schema.d.ts +2 -2
  47. package/src/components/templates/carrier-recovery-form/carrier-recovery-form.d.ts +1 -1
  48. package/src/components/templates/carrier-terms-form/carrier-terms-form.d.ts +1 -1
  49. package/src/components/templates/customs-item-form/customs-item-form-schema.d.ts +20 -20
  50. package/src/components/templates/customs-item-form/customs-item-form.d.ts +1 -1
  51. package/src/components/templates/customs-items-display/customs-items-display.d.ts +1 -1
  52. package/src/components/templates/edit-billing-form/edit-billing-form.styles.d.ts +1 -1
  53. package/src/components/templates/index.d.ts +2 -3
  54. package/src/components/templates/label/label.d.ts +1 -1
  55. package/src/components/templates/list-carriers/list-carriers.d.ts +1 -1
  56. package/src/components/templates/list-carriers-row/list-carriers-row.d.ts +1 -1
  57. package/src/components/templates/manage-wallet/manage-wallet.styles.d.ts +1 -1
  58. package/src/components/templates/manage-warehouses/manage-warehouses.d.ts +2 -6
  59. package/src/components/templates/onboarding/onboarding.d.ts +14 -8
  60. package/src/components/templates/onboarding/onboarding.styles.d.ts +1 -1
  61. package/src/components/templates/rate-form/rate-form.d.ts +1 -1
  62. package/src/components/templates/shipment/shipment.d.ts +1 -1
  63. package/src/components/templates/shipment-form/shipment-form.d.ts +1 -1
  64. package/src/components/templates/shipment-form/shipment-schema.d.ts +26 -2
  65. package/src/components/templates/suspend-sales-order/suspend-sales-order.d.ts +1 -1
  66. package/src/components/templates/suspend-shipment/suspend-shipment.d.ts +1 -1
  67. package/src/components/templates/void-label/void-label.d.ts +1 -1
  68. package/src/components/templates/wallet-card/wallet-card.styles.d.ts +1 -1
  69. package/src/components/templates/wallet-form/edit-wallet-address-form.d.ts +1 -1
  70. package/src/components/templates/wallet-form/wallet-form.d.ts +7 -6
  71. package/src/components/templates/wallet-form/wallet-form.styles.d.ts +1 -1
  72. package/src/components/templates/wallet-form/wallet-schema.d.ts +3 -3
  73. package/src/components/templates/warehouse-display/warehouse-display.d.ts +1 -1
  74. package/src/components/templates/warehouse-form/warehouse-form-schema.d.ts +3 -3
  75. package/src/components/templates/warehouse-form/warehouse-form.d.ts +1 -1
  76. package/src/components/unit-settings/index.d.ts +1 -0
  77. package/src/components/unit-settings/unit-settings.d.ts +4 -0
  78. package/src/elements/components/configure-shipment/configure-shipment.d.ts +1 -1
  79. package/src/elements/components/configure-shipment/hooks/use-address.d.ts +1 -1
  80. package/src/elements/components/configure-shipment/hooks/use-customs.d.ts +1 -1
  81. package/src/elements/components/configure-shipment/hooks/use-presets.d.ts +1 -1
  82. package/src/elements/components/configure-shipment/hooks/use-rates-form.d.ts +1 -1
  83. package/src/elements/components/configure-shipment/hooks/use-request-rates.d.ts +1 -1
  84. package/src/elements/components/configure-shipment/hooks/use-shipment-form.d.ts +1 -1
  85. package/src/elements/components/index.d.ts +0 -1
  86. package/src/elements/components/list-carriers/hooks/use-list-connected-carriers.d.ts +2 -2
  87. package/src/elements/components/purchase-label/hooks/use-configure-shipment.d.ts +1 -1
  88. package/src/elements/components/purchase-label/hooks/use-import-sales-order.d.ts +2 -2
  89. package/src/elements/components/purchase-label/hooks/use-load-shipment.d.ts +3 -3
  90. package/src/elements/components/purchase-label/hooks/use-pending-shipment.d.ts +1 -1
  91. package/src/elements/components/shipment/shipment.d.ts +1 -1
  92. package/src/elements/components/void-label/void-label.d.ts +1 -1
  93. package/src/elements/index.d.ts +0 -1
  94. package/src/factories/shipengine/address.d.ts +8 -1
  95. package/src/factories/shipengine/carrier.d.ts +1 -1
  96. package/src/factories/shipengine/label.d.ts +1 -1
  97. package/src/factories/shipengine/money.d.ts +1 -1
  98. package/src/factories/shipengine/order-source.d.ts +1 -1
  99. package/src/factories/shipengine/package.d.ts +1 -1
  100. package/src/factories/shipengine/resource.d.ts +1 -1
  101. package/src/factories/shipengine/sales-order.d.ts +1 -1
  102. package/src/factories/shipengine/service.d.ts +1 -1
  103. package/src/factories/shipengine/shipment.d.ts +1 -1
  104. package/src/factories/shipengine/wallet-history.d.ts +1 -1
  105. package/src/factories/shipengine/warehouse.d.ts +1 -3
  106. package/src/factories/shipengine/weight.d.ts +1 -1
  107. package/src/features/wallet-history/wallet-history.styles.d.ts +1 -0
  108. package/src/hooks/index.d.ts +1 -1
  109. package/src/hooks/options/index.d.ts +1 -0
  110. package/src/hooks/options/use-confirmation-options.d.ts +1 -1
  111. package/src/hooks/options/use-customs-contents-options.d.ts +1 -1
  112. package/src/hooks/options/use-customs-non-delivery-options.d.ts +1 -1
  113. package/src/hooks/options/use-date-range-options.d.ts +14 -0
  114. package/src/hooks/options/use-insurance-provider-options.d.ts +1 -1
  115. package/src/hooks/options/use-package-options.d.ts +1 -1
  116. package/src/hooks/options/use-rate-options.d.ts +1 -1
  117. package/src/hooks/options/use-service-code-options.d.ts +1 -1
  118. package/src/hooks/options/use-warehouse-options.d.ts +1 -1
  119. package/src/hooks/use-address-validation.d.ts +12 -0
  120. package/src/hooks/use-carrier-metadata.d.ts +1 -1
  121. package/src/hooks/use-elements.d.ts +2 -2
  122. package/src/hooks/use-scrub-errors.d.ts +1 -1
  123. package/src/locales/en/index.d.ts +32 -5
  124. package/src/mocks/carriers/handlers.d.ts +1 -1
  125. package/src/mocks/warehouses/handlers.d.ts +1 -1
  126. package/src/schemas/shipengine/money.d.ts +1 -1
  127. package/src/types/carrier-metadata.d.ts +1 -1
  128. package/src/types/shipping-preset/shipping-preset.d.ts +1 -1
  129. package/src/utilities/date.d.ts +8 -0
  130. package/src/utilities/money.d.ts +1 -1
  131. package/src/utilities/rates.d.ts +2 -1
  132. package/src/utilities/shipengine/address.d.ts +1 -1
  133. package/src/utilities/shipengine/dimensions.d.ts +1 -1
  134. package/src/utilities/shipengine/sales-order.d.ts +1 -1
  135. package/src/utilities/shipengine/shipment.d.ts +1 -1
  136. package/src/utilities/shipengine/weight.d.ts +1 -1
  137. package/src/components/accordion/accordion.d.ts +0 -12
  138. package/src/components/accordion/accordion.styles.d.ts +0 -7
  139. package/src/components/accordion/index.d.ts +0 -1
  140. package/src/components/history/history-actions/history-actions.d.ts +0 -1
  141. package/src/components/history/history-actions/history-actions.styles.d.ts +0 -1
  142. package/src/components/history/history-actions/index.d.ts +0 -1
  143. package/src/components/history/history-body/history-body.d.ts +0 -6
  144. package/src/components/history/history-body/index.d.ts +0 -1
  145. package/src/components/history/history-list/history-list.d.ts +0 -12
  146. package/src/components/history/history-list/index.d.ts +0 -1
  147. package/src/components/history/history-row/history-row.d.ts +0 -6
  148. package/src/components/history/history-row/index.d.ts +0 -1
  149. package/src/components/history/history.d.ts +0 -11
  150. package/src/components/templates/wallet-history/wallet-history.d.ts +0 -6
  151. package/src/components/templates/warehouse-preference-select/index.d.ts +0 -1
  152. package/src/components/templates/warehouse-preference-select/warehouse-preference-select.d.ts +0 -24
  153. package/src/components/templates/warehouse-preference-wizard/index.d.ts +0 -1
  154. package/src/components/templates/warehouse-preference-wizard/warehouse-preference-wizard.d.ts +0 -23
  155. package/src/elements/wallet-history.d.ts +0 -1
  156. package/src/hooks/use-warehouse-validation.d.ts +0 -14
  157. /package/src/{components/templates/wallet-history → features}/index.d.ts +0 -0
  158. /package/src/{elements/components → features}/wallet-history/index.d.ts +0 -0
  159. /package/src/{elements/components → features}/wallet-history/wallet-history.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/api";
1
+ import { SE } from "@shipengine/js-api";
2
2
  export declare const currencySymbol: Record<SE.Currency, string>;
3
3
  export declare const formatMoney: (value: SE.Money, locale?: string) => string;
4
4
  export declare const calculateTotal: (...values: SE.Money[]) => number;
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/api";
1
+ import { SE } from "@shipengine/js-api";
2
2
  export declare const getRateRequiresAcknowledgement: (serviceCode: string) => boolean;
3
3
  export declare const getTotalRateAmount: (rateCosts?: {
4
4
  confirmationAmount?: SE.Money;
@@ -7,3 +7,4 @@ export declare const getTotalRateAmount: (rateCosts?: {
7
7
  shippingAmount?: SE.Money;
8
8
  taxAmount?: SE.Money;
9
9
  }) => number;
10
+ export declare const overrideCarrierCodes: (carrier: string, overrides: object) => never;
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/api";
1
+ import { SE } from "@shipengine/js-api";
2
2
  /**
3
3
  * @category Utilities
4
4
  */
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/api";
1
+ import { SE } from "@shipengine/js-api";
2
2
  type ConvertDimensionsOptions = {
3
3
  allowAllZeroes?: boolean;
4
4
  };
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/api";
1
+ import { SE } from "@shipengine/js-api";
2
2
  /**
3
3
  * @category Utilities
4
4
  */
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/api";
1
+ import { SE } from "@shipengine/js-api";
2
2
  /**
3
3
  * @category Utilities
4
4
  */
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/api";
1
+ import { SE } from "@shipengine/js-api";
2
2
  /**
3
3
  * @category Utilities
4
4
  */
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- import { WithChildrenCommonProps } from "@packlink/giger";
3
- type AccordionProps = WithChildrenCommonProps<{
4
- /** Flag to indicate if the Accordion must appear expanded */
5
- initialExpanded?: boolean;
6
- /** Element to render at the right part of the summary */
7
- rightContent?: JSX.Element;
8
- /** Title to show */
9
- title?: string;
10
- }>;
11
- export declare const Accordion: ({ initialExpanded, title, children, rightContent, ...rest }: AccordionProps) => import("@emotion/react/jsx-runtime").JSX.Element;
12
- export {};
@@ -1,7 +0,0 @@
1
- import { SerializedStyles } from "@emotion/react";
2
- import { Theme } from "@packlink/giger-theme";
3
- export declare const getAccordionSummaryStyles: (theme: Theme) => SerializedStyles;
4
- export declare const getAccordionSummaryWrapperStyles: (theme: Theme) => SerializedStyles;
5
- export declare const getIconStyles: (theme: Theme) => SerializedStyles;
6
- export declare const getSectionStyles: (theme: Theme) => SerializedStyles;
7
- export declare const getRightContentWrapperStyles: () => SerializedStyles;
@@ -1 +0,0 @@
1
- export * from "./accordion";
@@ -1 +0,0 @@
1
- export declare const HistoryActions: () => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare const styles: Record<"dateRangeInput", import("@emotion/serialize").Interpolation<import("@packlink/giger-theme/dist/lib/Theme").Theme>>;
@@ -1 +0,0 @@
1
- export * from "./history-actions";
@@ -1,6 +0,0 @@
1
- import React from "react";
2
- import { WalletTransactionHistory } from "@shipengine/api";
3
- export type HistoryBodyProps = {
4
- historyData: WalletTransactionHistory;
5
- };
6
- export declare const HistoryBody: React.FC<HistoryBodyProps>;
@@ -1 +0,0 @@
1
- export * from "./history-body";
@@ -1,12 +0,0 @@
1
- import React from "react";
2
- import { WalletTransactionHistory } from "@shipengine/api";
3
- export type HistoryListProps = {
4
- historyData: WalletTransactionHistory;
5
- };
6
- /**
7
- * This component is the list of events that represent the history of a
8
- * specific entity. The events are displayed in reverse chronological order.
9
- *
10
- * @param historyData The history data to display.
11
- */
12
- export declare const HistoryList: React.FC<HistoryListProps>;
@@ -1 +0,0 @@
1
- export * from "./history-list";
@@ -1,6 +0,0 @@
1
- import { FC } from "react";
2
- export type HistoryRowProps = {
3
- key: number;
4
- rowItem: number;
5
- };
6
- export declare const HistoryRow: FC<HistoryRowProps>;
@@ -1 +0,0 @@
1
- export * from "./history-row";
@@ -1,11 +0,0 @@
1
- import * as React from "react";
2
- import { HistoryBodyProps } from "./history-body";
3
- import { HistoryListProps } from "./history-list";
4
- import { HistoryRowProps } from "./history-row";
5
- export type HistoryType = React.FC & {
6
- Actions: React.FC;
7
- Body: React.FC<HistoryBodyProps>;
8
- List: React.FC<HistoryListProps>;
9
- Row: React.FC<HistoryRowProps>;
10
- };
11
- export declare const History: HistoryType;
@@ -1,6 +0,0 @@
1
- import React from "react";
2
- import { WalletTransactionHistory } from "@shipengine/api";
3
- export type WalletHistoryProps = {
4
- historyData: WalletTransactionHistory;
5
- };
6
- export declare const WalletHistory: React.FC<WalletHistoryProps>;
@@ -1 +0,0 @@
1
- export * from "./warehouse-preference-select";
@@ -1,24 +0,0 @@
1
- import { SE } from "@shipengine/api";
2
- export type WarehouseSuggested = {
3
- validation: SE.AddressValidation;
4
- validationType: "SUGGESTED";
5
- };
6
- export type WarehouseError = {
7
- validation: SE.AddressValidation;
8
- validationType: "ERROR";
9
- };
10
- export type WarehouseExactOrSoft = {
11
- address: SE.Address;
12
- validationType: "EXACT" | "SOFT";
13
- };
14
- export type WarehouseAddressPreference = WarehouseSuggested | WarehouseError | WarehouseExactOrSoft;
15
- export type WarehousePreferenceFormProps = {
16
- onCancel: () => void;
17
- onSubmit: (payload: {
18
- originAddress: SE.Address;
19
- returnAddress?: SE.Address;
20
- }) => Promise<void> | void;
21
- originAddress: WarehouseAddressPreference;
22
- returnAddress?: WarehouseAddressPreference;
23
- };
24
- export declare const WarehousePreferenceSelect: ({ onCancel, onSubmit, originAddress, returnAddress, }: WarehousePreferenceFormProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export * from "./warehouse-preference-wizard";
@@ -1,23 +0,0 @@
1
- /// <reference types="react" />
2
- import { SE } from "@shipengine/api";
3
- import { ManageWarehousesProps, WarehousePayload } from "../manage-warehouses";
4
- import { WarehouseAddressPreference } from "../warehouse-preference-select";
5
- export type WarehousePreference = {
6
- isDefault?: boolean;
7
- name: string;
8
- originAddress: WarehouseAddressPreference;
9
- returnAddress?: WarehouseAddressPreference;
10
- };
11
- export type WarehousePreferenceWizardProps = {
12
- className?: string;
13
- formHeader?: React.ReactNode;
14
- isOnboarding?: boolean;
15
- onSubmit: (payload: WarehousePayload) => Promise<void> | void;
16
- onValidate: ManageWarehousesProps["onValidate"];
17
- onWarehouseDelete?: () => Promise<void> | void;
18
- onWarehouseFormCancel?: () => void;
19
- submitButtonTitle: string;
20
- warehouse?: SE.Warehouse;
21
- warehousePreference?: WarehousePreference;
22
- };
23
- export declare const WarehousePreferenceWizard: ({ className, formHeader, isOnboarding, onSubmit, onValidate, onWarehouseDelete, onWarehouseFormCancel, submitButtonTitle, warehouse, warehousePreference, }: WarehousePreferenceWizardProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare const Element: (props: Record<string, unknown>) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,14 +0,0 @@
1
- /// <reference types="react" />
2
- import { SE } from "@shipengine/api";
3
- import { Templates } from "../components";
4
- export declare const useWarehouseValidation: () => {
5
- errors: SE.CodedError[] | null;
6
- setWarehousePreference: import("react").Dispatch<import("react").SetStateAction<Templates.WarehousePreference | undefined>>;
7
- validate: (warehouse: Partial<SE.Warehouse> & Pick<SE.Warehouse, "name" | "originAddress" | "isDefault">) => Promise<{
8
- isDefault: boolean;
9
- name: string;
10
- originAddress: Templates.WarehouseAddressPreference;
11
- returnAddress: Templates.WarehouseAddressPreference;
12
- }>;
13
- warehousePreference: Templates.WarehousePreference | undefined;
14
- };