@shipengine/elements 2.26.4 → 2.27.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 (200) hide show
  1. package/dist/cjs/assets/xcover/logo.svg.cjs +44 -0
  2. package/dist/cjs/components/field/rate-select/rate-card/rate-attribute-item/index.cjs +7 -0
  3. package/dist/cjs/components/field/rate-select/rate-card/rate-attribute-item/rate-attribute-item.cjs +56 -0
  4. package/dist/cjs/components/field/rate-select/rate-card/rate-attribute-item/rate-attribute-item.styles.cjs +27 -0
  5. package/dist/cjs/components/field/rate-select/rate-card/rate-card.cjs +52 -42
  6. package/dist/cjs/components/field/rate-select/rate-card/rate-card.styles.cjs +4 -0
  7. package/dist/cjs/components/field/rate-select/rate-select.cjs +80 -49
  8. package/dist/cjs/components/forms/register-funding-source-insurance-form/register-funding-source-insurance-form.cjs +1 -1
  9. package/dist/cjs/components/shipment-not-found-error/shipment-not-found-error.cjs +2 -17
  10. package/dist/cjs/components/suspend-purchase/suspend-purchase.cjs +3 -3
  11. package/dist/cjs/data/insurance-provider-metadatas.json.cjs +10 -4
  12. package/dist/cjs/elements/customs-form/customs-form-element.cjs +294 -0
  13. package/dist/cjs/elements/customs-form/customs-form-element.stories.cjs +243 -0
  14. package/dist/cjs/elements/customs-form/customs-form-schema.cjs +59 -0
  15. package/dist/cjs/elements/customs-form/customs-form-types.cjs +63 -0
  16. package/dist/cjs/elements/customs-form/index.cjs +10 -0
  17. package/dist/cjs/elements/index.cjs +5 -0
  18. package/dist/cjs/elements/manage-carriers/manage-carriers.cjs +1 -1
  19. package/dist/cjs/elements/purchase-label/components/customs-forms/tax-ids/tax-ids.cjs +1 -1
  20. package/dist/cjs/elements/purchase-label/components/index.cjs +2 -0
  21. package/dist/cjs/elements/purchase-label/components/rate-form/rate-view.cjs +1 -1
  22. package/dist/cjs/elements/purchase-label/components/shipment-form/shipment-form.cjs +4 -3
  23. package/dist/cjs/elements/purchase-label/hooks/use-filter-visible-rate-options/use-filter-visible-rate-options.cjs +35 -11
  24. package/dist/cjs/elements/purchase-label/hooks/use-insurance-provider-options.cjs +2 -2
  25. package/dist/cjs/elements/purchase-label/purchase-label.cjs +1 -7
  26. package/dist/cjs/factories/shipengine/address.cjs +114 -0
  27. package/dist/cjs/factories/shipengine/money.cjs +21 -0
  28. package/dist/cjs/factories/shipengine/order-source.cjs +37 -0
  29. package/dist/cjs/factories/shipengine/package.cjs +41 -0
  30. package/dist/cjs/factories/shipengine/resource.cjs +23 -0
  31. package/dist/cjs/factories/shipengine/shipment.cjs +176 -0
  32. package/dist/cjs/factories/shipengine/weight.cjs +44 -0
  33. package/dist/cjs/factories/utils.cjs +19 -0
  34. package/dist/cjs/features/manage-carriers/hooks/use-list-funding-source-carriers.cjs +4 -6
  35. package/dist/cjs/features/manage-carriers/manage-carriers.cjs +8 -6
  36. package/dist/cjs/hooks/use-configure-shipment.cjs +3 -80
  37. package/dist/cjs/hooks/use-get-funding-source-insurance-provider.cjs +7 -7
  38. package/dist/cjs/hooks/use-manage-funding-source-insurance.cjs +15 -23
  39. package/dist/cjs/index.cjs +5 -0
  40. package/dist/cjs/locales/en/common.json.cjs +2 -2
  41. package/dist/cjs/locales/en/purchase-label.json.cjs +9 -8
  42. package/dist/cjs/package.json.cjs +1 -1
  43. package/dist/cjs/utilities/feature-flags/feature-flags.cjs +1 -0
  44. package/dist/cjs/utilities/shipengine/carrier.cjs +4 -0
  45. package/dist/cjs/utilities/shipengine/index.cjs +3 -0
  46. package/dist/cjs/utilities/shipengine/insurance.cjs +63 -0
  47. package/dist/cjs/workflows/label-workflow/label-workflow.cjs +2 -26
  48. package/dist/cjs/workflows/onboarding/components/confirmation-and-submission-step/use-confirmation-and-submission-step.cjs +9 -9
  49. package/dist/cjs/workflows/onboarding/components/terms-agreement-form/terms-agreement-form.cjs +3 -2
  50. package/dist/cjs/workflows/onboarding/components/terms-agreement-step/terms-agreement-step.cjs +8 -6
  51. package/dist/cjs/workflows/onboarding/components/terms-agreement-step/use-terms-agreement-step.cjs +4 -19
  52. package/dist/esm/assets/xcover/logo.svg.js +23 -0
  53. package/dist/esm/components/field/rate-select/rate-card/rate-attribute-item/index.js +1 -0
  54. package/dist/esm/components/field/rate-select/rate-card/rate-attribute-item/rate-attribute-item.js +54 -0
  55. package/dist/esm/components/field/rate-select/rate-card/rate-attribute-item/rate-attribute-item.styles.js +25 -0
  56. package/dist/esm/components/field/rate-select/rate-card/rate-card.js +52 -42
  57. package/dist/esm/components/field/rate-select/rate-card/rate-card.styles.js +4 -0
  58. package/dist/esm/components/field/rate-select/rate-select.js +80 -49
  59. package/dist/esm/components/forms/register-funding-source-insurance-form/register-funding-source-insurance-form.js +1 -1
  60. package/dist/esm/components/shipment-not-found-error/shipment-not-found-error.js +2 -17
  61. package/dist/esm/components/suspend-purchase/suspend-purchase.js +3 -3
  62. package/dist/esm/data/insurance-provider-metadatas.json.js +9 -4
  63. package/dist/esm/elements/customs-form/customs-form-element.js +291 -0
  64. package/dist/esm/elements/customs-form/customs-form-element.stories.js +232 -0
  65. package/dist/esm/elements/customs-form/customs-form-schema.js +56 -0
  66. package/dist/esm/elements/customs-form/customs-form-types.js +60 -0
  67. package/dist/esm/elements/customs-form/index.js +3 -0
  68. package/dist/esm/elements/index.js +3 -0
  69. package/dist/esm/elements/manage-carriers/manage-carriers.js +1 -1
  70. package/dist/esm/elements/purchase-label/components/customs-forms/tax-ids/tax-ids.js +1 -1
  71. package/dist/esm/elements/purchase-label/components/index.js +1 -0
  72. package/dist/esm/elements/purchase-label/components/rate-form/rate-view.js +1 -1
  73. package/dist/esm/elements/purchase-label/components/shipment-form/shipment-form.js +4 -3
  74. package/dist/esm/elements/purchase-label/hooks/use-filter-visible-rate-options/use-filter-visible-rate-options.js +35 -11
  75. package/dist/esm/elements/purchase-label/hooks/use-insurance-provider-options.js +2 -2
  76. package/dist/esm/elements/purchase-label/purchase-label.js +1 -7
  77. package/dist/esm/elements-provider/elements-context-provider.js +1 -1
  78. package/dist/esm/factories/shipengine/address.js +111 -0
  79. package/dist/esm/factories/shipengine/money.js +19 -0
  80. package/dist/esm/factories/shipengine/order-source.js +34 -0
  81. package/dist/esm/factories/shipengine/package.js +39 -0
  82. package/dist/esm/factories/shipengine/resource.js +21 -0
  83. package/dist/esm/factories/shipengine/shipment.js +168 -0
  84. package/dist/esm/factories/shipengine/weight.js +40 -0
  85. package/dist/esm/factories/utils.js +15 -0
  86. package/dist/esm/features/manage-carriers/hooks/use-list-funding-source-carriers.js +5 -7
  87. package/dist/esm/features/manage-carriers/manage-carriers.js +8 -6
  88. package/dist/esm/hooks/use-configure-shipment.js +3 -80
  89. package/dist/esm/hooks/use-get-funding-source-insurance-provider.js +7 -7
  90. package/dist/esm/hooks/use-manage-funding-source-insurance.js +15 -23
  91. package/dist/esm/index.js +3 -0
  92. package/dist/esm/locales/en/common.json.js +2 -2
  93. package/dist/esm/locales/en/purchase-label.json.js +9 -8
  94. package/dist/esm/package.json.js +1 -1
  95. package/dist/esm/utilities/feature-flags/feature-flags.js +1 -0
  96. package/dist/esm/utilities/shipengine/carrier.js +4 -0
  97. package/dist/esm/utilities/shipengine/index.js +1 -1
  98. package/dist/esm/utilities/shipengine/insurance.js +61 -1
  99. package/dist/esm/workflows/label-workflow/label-workflow.js +2 -26
  100. package/dist/esm/workflows/onboarding/components/confirmation-and-submission-step/use-confirmation-and-submission-step.js +9 -9
  101. package/dist/esm/workflows/onboarding/components/terms-agreement-form/terms-agreement-form.js +3 -2
  102. package/dist/esm/workflows/onboarding/components/terms-agreement-step/terms-agreement-step.js +8 -6
  103. package/dist/esm/workflows/onboarding/components/terms-agreement-step/use-terms-agreement-step.js +5 -20
  104. package/dist/types/components/field/rate-select/rate-card/rate-attribute-item/index.d.ts +2 -0
  105. package/dist/types/components/field/rate-select/rate-card/rate-attribute-item/index.d.ts.map +1 -0
  106. package/dist/types/components/field/rate-select/rate-card/rate-attribute-item/rate-attribute-item.d.ts +8 -0
  107. package/dist/types/components/field/rate-select/rate-card/rate-attribute-item/rate-attribute-item.d.ts.map +1 -0
  108. package/dist/types/components/field/rate-select/rate-card/rate-attribute-item/rate-attribute-item.styles.d.ts +22 -0
  109. package/dist/types/components/field/rate-select/rate-card/rate-attribute-item/rate-attribute-item.styles.d.ts.map +1 -0
  110. package/dist/types/components/field/rate-select/rate-card/rate-card.d.ts +3 -2
  111. package/dist/types/components/field/rate-select/rate-card/rate-card.d.ts.map +1 -1
  112. package/dist/types/components/field/rate-select/rate-card/rate-card.styles.d.ts +4 -0
  113. package/dist/types/components/field/rate-select/rate-card/rate-card.styles.d.ts.map +1 -1
  114. package/dist/types/components/field/rate-select/rate-select.d.ts.map +1 -1
  115. package/dist/types/components/forms/register-funding-source-insurance-form/register-funding-source-insurance-form.d.ts.map +1 -1
  116. package/dist/types/components/shipment-not-found-error/shipment-not-found-error.d.ts +2 -3
  117. package/dist/types/components/shipment-not-found-error/shipment-not-found-error.d.ts.map +1 -1
  118. package/dist/types/components/suspend-purchase/suspend-purchase.d.ts +2 -3
  119. package/dist/types/components/suspend-purchase/suspend-purchase.d.ts.map +1 -1
  120. package/dist/types/elements/customs-form/customs-form-element.d.ts +1219 -0
  121. package/dist/types/elements/customs-form/customs-form-element.d.ts.map +1 -0
  122. package/dist/types/elements/customs-form/customs-form-element.stories.d.ts +12 -0
  123. package/dist/types/elements/customs-form/customs-form-element.stories.d.ts.map +1 -0
  124. package/dist/types/elements/customs-form/customs-form-schema.d.ts +398 -0
  125. package/dist/types/elements/customs-form/customs-form-schema.d.ts.map +1 -0
  126. package/dist/types/elements/customs-form/customs-form-types.d.ts +139 -0
  127. package/dist/types/elements/customs-form/customs-form-types.d.ts.map +1 -0
  128. package/dist/types/elements/customs-form/index.d.ts +4 -0
  129. package/dist/types/elements/customs-form/index.d.ts.map +1 -0
  130. package/dist/types/elements/index.d.ts +1 -0
  131. package/dist/types/elements/index.d.ts.map +1 -1
  132. package/dist/types/elements/labels-grid/labels-grid.d.ts +9 -8
  133. package/dist/types/elements/labels-grid/labels-grid.d.ts.map +1 -1
  134. package/dist/types/elements/manage-carriers/manage-carriers.d.ts +9 -8
  135. package/dist/types/elements/manage-carriers/manage-carriers.d.ts.map +1 -1
  136. package/dist/types/elements/manage-external-carriers/manage-external-carriers.d.ts +9 -8
  137. package/dist/types/elements/manage-external-carriers/manage-external-carriers.d.ts.map +1 -1
  138. package/dist/types/elements/manage-funding/manage-funding-element.d.ts +9 -8
  139. package/dist/types/elements/manage-funding/manage-funding-element.d.ts.map +1 -1
  140. package/dist/types/elements/manage-warehouses/manage-warehouses.d.ts +9 -8
  141. package/dist/types/elements/manage-warehouses/manage-warehouses.d.ts.map +1 -1
  142. package/dist/types/elements/payment-method-settings/payment-method-settings-element.d.ts +9 -8
  143. package/dist/types/elements/payment-method-settings/payment-method-settings-element.d.ts.map +1 -1
  144. package/dist/types/elements/purchase-label/components/index.d.ts +1 -0
  145. package/dist/types/elements/purchase-label/components/index.d.ts.map +1 -1
  146. package/dist/types/elements/purchase-label/components/shipment-form/shipment-form.d.ts.map +1 -1
  147. package/dist/types/elements/purchase-label/hooks/use-filter-visible-rate-options/use-filter-visible-rate-options.d.ts +5 -1
  148. package/dist/types/elements/purchase-label/hooks/use-filter-visible-rate-options/use-filter-visible-rate-options.d.ts.map +1 -1
  149. package/dist/types/elements/purchase-label/hooks/use-insurance-provider-options.d.ts.map +1 -1
  150. package/dist/types/elements/purchase-label/purchase-label.d.ts +9 -8
  151. package/dist/types/elements/purchase-label/purchase-label.d.ts.map +1 -1
  152. package/dist/types/elements/select-label-layout/select-label-layout-element.d.ts +9 -8
  153. package/dist/types/elements/select-label-layout/select-label-layout-element.d.ts.map +1 -1
  154. package/dist/types/elements/shipment-summary/shipment-summary.d.ts +9 -8
  155. package/dist/types/elements/shipment-summary/shipment-summary.d.ts.map +1 -1
  156. package/dist/types/elements/shipments-grid/shipments-grid.d.ts +9 -8
  157. package/dist/types/elements/shipments-grid/shipments-grid.d.ts.map +1 -1
  158. package/dist/types/elements/theme-creator/theme-creator.d.ts +9 -8
  159. package/dist/types/elements/theme-creator/theme-creator.d.ts.map +1 -1
  160. package/dist/types/elements/transaction-history/transaction-history-element.d.ts +9 -8
  161. package/dist/types/elements/transaction-history/transaction-history-element.d.ts.map +1 -1
  162. package/dist/types/elements/unit-settings/unit-settings-element.d.ts +9 -8
  163. package/dist/types/elements/unit-settings/unit-settings-element.d.ts.map +1 -1
  164. package/dist/types/elements/vat-settings/vat-settings-element.d.ts +9 -8
  165. package/dist/types/elements/vat-settings/vat-settings-element.d.ts.map +1 -1
  166. package/dist/types/elements/void-label/void-label.d.ts +9 -8
  167. package/dist/types/elements/void-label/void-label.d.ts.map +1 -1
  168. package/dist/types/features/manage-carriers/hooks/use-list-funding-source-carriers.d.ts.map +1 -1
  169. package/dist/types/features/manage-carriers/manage-carriers.d.ts.map +1 -1
  170. package/dist/types/hooks/use-configure-shipment.d.ts.map +1 -1
  171. package/dist/types/hooks/use-get-funding-source-insurance-provider.d.ts.map +1 -1
  172. package/dist/types/hooks/use-manage-funding-source-insurance.d.ts +3 -4
  173. package/dist/types/hooks/use-manage-funding-source-insurance.d.ts.map +1 -1
  174. package/dist/types/locales/en/index.d.ts +9 -8
  175. package/dist/types/locales/en/index.d.ts.map +1 -1
  176. package/dist/types/types/insurance-metadata.d.ts +1 -1
  177. package/dist/types/types/insurance-metadata.d.ts.map +1 -1
  178. package/dist/types/types/rates.d.ts +1 -0
  179. package/dist/types/types/rates.d.ts.map +1 -1
  180. package/dist/types/utilities/feature-flags/feature-flags.d.ts.map +1 -1
  181. package/dist/types/utilities/feature-flags/types.d.ts +4 -0
  182. package/dist/types/utilities/feature-flags/types.d.ts.map +1 -1
  183. package/dist/types/utilities/shipengine/carrier.d.ts.map +1 -1
  184. package/dist/types/utilities/shipengine/insurance.d.ts +31 -0
  185. package/dist/types/utilities/shipengine/insurance.d.ts.map +1 -1
  186. package/dist/types/workflows/account-settings/account-settings.d.ts +9 -8
  187. package/dist/types/workflows/account-settings/account-settings.d.ts.map +1 -1
  188. package/dist/types/workflows/carrier-services/carrier-services.d.ts +9 -8
  189. package/dist/types/workflows/carrier-services/carrier-services.d.ts.map +1 -1
  190. package/dist/types/workflows/connect-external-carrier/connect-external-carrier.d.ts +9 -8
  191. package/dist/types/workflows/connect-external-carrier/connect-external-carrier.d.ts.map +1 -1
  192. package/dist/types/workflows/label-workflow/label-workflow.d.ts +9 -8
  193. package/dist/types/workflows/label-workflow/label-workflow.d.ts.map +1 -1
  194. package/dist/types/workflows/onboarding/components/confirmation-and-submission-step/use-confirmation-and-submission-step.d.ts.map +1 -1
  195. package/dist/types/workflows/onboarding/components/terms-agreement-step/terms-agreement-step.d.ts.map +1 -1
  196. package/dist/types/workflows/onboarding/components/terms-agreement-step/use-terms-agreement-step.d.ts +1 -5
  197. package/dist/types/workflows/onboarding/components/terms-agreement-step/use-terms-agreement-step.d.ts.map +1 -1
  198. package/dist/types/workflows/onboarding/onboarding.d.ts +9 -8
  199. package/dist/types/workflows/onboarding/onboarding.d.ts.map +1 -1
  200. package/package.json +3 -3
@@ -0,0 +1,294 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('@emotion/react/jsx-runtime');
4
+ var useShipmentMetadata = require('../../hooks/options/use-shipment-metadata.cjs');
5
+ var giger = require('@shipengine/giger');
6
+ var validation = require('../../utilities/validation.cjs');
7
+ var React = require('react');
8
+ var reactHookForm = require('react-hook-form');
9
+ var reactI18next = require('react-i18next');
10
+ var customsForms = require('../purchase-label/components/customs-forms/customs-forms.cjs');
11
+ var shipmentSchema = require('../purchase-label/components/shipment-form/shipment-schema.cjs');
12
+ var customsFormTypes = require('./customs-form-types.cjs');
13
+ var useWindsorFramework = require('../purchase-label/hooks/use-windsor-framework.cjs');
14
+ var index = require('../../locales/en/index.cjs');
15
+ var createElement = require('../../create-element/create-element.cjs');
16
+ var buttonGroup = require('../../components/button-group/button-group.cjs');
17
+ var errorFallback = require('../../components/error-fallback/error-fallback.cjs');
18
+
19
+ /**
20
+ * # Customs Form Element Component
21
+ *
22
+ * - The `<CustomsForm />` component is a standalone element that wraps the `CustomsForms`
23
+ * component with its own form management. This allows you to use customs forms independently
24
+ * outside of the full `PurchaseLabel` workflow while managing its own internal form state.
25
+ *
26
+ * @param CustomsFormProps The props necessary to render the `<CustomsForm />` component.
27
+ *
28
+ * @returns Element An EmotionJSX.Element that will render the `<CustomsForm />` component
29
+ * with all the appropriate wrappers.
30
+ *
31
+ * @example
32
+ * You can see how the `<Component />` is used in the `createElement` function call below.
33
+ * ```tsx
34
+ * export const Element = createElement(Component, ErrorFallback, {
35
+ * css: { width: "100%" },
36
+ * resources: { en },
37
+ * });
38
+ * ```
39
+ *
40
+ * <br />
41
+ *
42
+ * @see {@link CustomsForm.Element | The **Element** created to render `<CustomsForm />`}
43
+ */
44
+ const Component = ({
45
+ shipment,
46
+ betaEnableWindsorFramework = false,
47
+ currency,
48
+ harmonizedTariffCodes,
49
+ onModify,
50
+ onSubmit,
51
+ onCancel,
52
+ className,
53
+ "data-testid": dataTestId
54
+ }) => {
55
+ var _a, _b, _c, _d, _e, _f;
56
+ const {
57
+ t
58
+ } = reactI18next.useTranslation();
59
+ // Track additional state for tax identifiers and products that aren't directly in the form
60
+ const [taxIdentifiers, setTaxIdentifiers] = React.useState(shipment.taxIdentifiers || []);
61
+ // We onliy support a single package within Elements, so track products for only first package
62
+ const [products, setProducts] = React.useState(((_b = (_a = shipment.packages) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.products) || []);
63
+ // Get shipment metadata to determine form requirements
64
+ const {
65
+ isCustomsRequired,
66
+ isCanadaDeliveredDutyEligible,
67
+ isContentDescriptionRequired,
68
+ hasAllZeroMeasurements
69
+ } = useShipmentMetadata.useShipmentMetadata(shipment);
70
+ const {
71
+ requiresWindsorFramework
72
+ } = useWindsorFramework.useWindsorFramework(shipment, betaEnableWindsorFramework);
73
+ // Get the shipment schema for form validation
74
+ const shipmentSchema$1 = React.useMemo(() => {
75
+ var _a, _b, _c, _d, _e, _f;
76
+ return shipmentSchema.getShipmentSchema({
77
+ isCustomsRequired,
78
+ requiresWindsorFramework,
79
+ isContentDescriptionRequired,
80
+ requireMeasurements: !hasAllZeroMeasurements,
81
+ dimensionsUnit: (_c = (_b = (_a = shipment.packages) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.dimensions) === null || _c === void 0 ? void 0 : _c.unit,
82
+ weightUnit: (_f = (_e = (_d = shipment.packages) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.weight) === null || _f === void 0 ? void 0 : _f.unit
83
+ });
84
+ }, [isCustomsRequired, requiresWindsorFramework, isContentDescriptionRequired, hasAllZeroMeasurements, shipment.packages]);
85
+ // Create form with shipment data
86
+ const form = reactHookForm.useForm({
87
+ defaultValues: {
88
+ __mode: "browse_rates",
89
+ customs: shipment.customs ? {
90
+ contents: shipment.customs.contents,
91
+ nonDelivery: shipment.customs.nonDelivery
92
+ } : undefined,
93
+ packages: ((_c = shipment.packages) === null || _c === void 0 ? void 0 : _c.map(pkg => ({
94
+ type: {
95
+ code: pkg.packageCode || "package",
96
+ carrierId: null,
97
+ packageId: pkg.packageId
98
+ },
99
+ products: pkg.products || [],
100
+ dimensions: pkg.dimensions ? {
101
+ length: pkg.dimensions.length,
102
+ width: pkg.dimensions.width,
103
+ height: pkg.dimensions.height
104
+ } : null,
105
+ weight: pkg.weight ? {
106
+ whole: Math.floor(pkg.weight.value),
107
+ fractional: Math.round(pkg.weight.value % 1 * 16) // Convert decimal to oz
108
+ } : null,
109
+ contentDescription: pkg.contentDescription,
110
+ insuredValue: pkg.insuredValue
111
+ }))) || [{
112
+ type: {
113
+ code: "package",
114
+ carrierId: null,
115
+ packageId: null
116
+ },
117
+ products: [],
118
+ dimensions: null,
119
+ weight: null,
120
+ contentDescription: null,
121
+ insuredValue: null
122
+ }],
123
+ advancedOptions: {
124
+ additionalHandling: (_d = shipment.advancedOptions) === null || _d === void 0 ? void 0 : _d.additionalHandling,
125
+ canadaDeliveredDuty: (_e = shipment.advancedOptions) === null || _e === void 0 ? void 0 : _e.canadaDeliveredDuty,
126
+ windsorFrameworkDetails: (_f = shipment.advancedOptions) === null || _f === void 0 ? void 0 : _f.windsorFrameworkDetails
127
+ },
128
+ shipDate: new Date().toLocaleDateString(),
129
+ shipmentId: shipment.shipmentId
130
+ },
131
+ resolver: validation.validationResolver(shipmentSchema$1),
132
+ mode: "onChange"
133
+ });
134
+ // Watch for form changes and call onModify
135
+ const watchedValues = form.watch();
136
+ // Create updated shipment data with current form values and tracked state
137
+ const getUpdatedShipment = React.useCallback(() => {
138
+ var _a;
139
+ return Object.assign(Object.assign({}, shipment), {
140
+ customs: watchedValues.customs,
141
+ taxIdentifiers,
142
+ packages: ((_a = watchedValues.packages) === null || _a === void 0 ? void 0 : _a.map((pkg, index) => {
143
+ var _a, _b, _c;
144
+ return Object.assign(Object.assign(Object.assign({}, (_a = shipment.packages) === null || _a === void 0 ? void 0 : _a[index]), pkg), {
145
+ products: index === 0 ? products : pkg.products || ((_c = (_b = shipment.packages) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.products) || []
146
+ });
147
+ })) || [],
148
+ advancedOptions: Object.assign(Object.assign({}, shipment.advancedOptions), watchedValues.advancedOptions)
149
+ });
150
+ }, [shipment, watchedValues, taxIdentifiers, products]);
151
+ React.useEffect(() => {
152
+ if (onModify && form.formState.isDirty) {
153
+ // Extract customs data from the updated shipment
154
+ const updatedShipment = getUpdatedShipment();
155
+ const customsData = customsFormTypes.extractCustomsFormData(updatedShipment);
156
+ onModify(customsData);
157
+ }
158
+ }, [watchedValues, onModify, form.formState.isDirty, shipment, getUpdatedShipment]);
159
+ // Update tracked state when shipment changes
160
+ React.useEffect(() => {
161
+ var _a, _b;
162
+ setTaxIdentifiers(shipment.taxIdentifiers || []);
163
+ setProducts(((_b = (_a = shipment.packages) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.products) || []);
164
+ }, [shipment]);
165
+ // Handle form submission
166
+ const handleSubmit = React.useCallback(e => {
167
+ e.preventDefault();
168
+ if (onSubmit) {
169
+ const updatedShipment = getUpdatedShipment();
170
+ const customsData = customsFormTypes.extractCustomsFormData(updatedShipment);
171
+ void onSubmit(customsData);
172
+ }
173
+ }, [onSubmit, getUpdatedShipment]);
174
+ // Handle dirty state changes
175
+ const handleDirty = React.useCallback(() => {
176
+ // This is called by CustomsForms when the form becomes dirty
177
+ }, []);
178
+ // Handle customs updates - this updates the form and triggers onModify
179
+ const handleUpdateCustoms = React.useCallback((_customs, products) => {
180
+ setProducts(products);
181
+ const updatedShipment = getUpdatedShipment();
182
+ // Trigger onModify with the updated data
183
+ if (onModify) {
184
+ const customsData = customsFormTypes.extractCustomsFormData(updatedShipment);
185
+ onModify(customsData);
186
+ }
187
+ return Promise.resolve(updatedShipment);
188
+ }, [getUpdatedShipment, onModify]);
189
+ // Handle tax identifier updates - this updates our tracked state and triggers onModify
190
+ const handleUpdateTaxableIds = React.useCallback(updatedTaxIds => {
191
+ setTaxIdentifiers(updatedTaxIds);
192
+ const updatedShipment = Object.assign(Object.assign({}, getUpdatedShipment()), {
193
+ taxIdentifiers: updatedTaxIds
194
+ });
195
+ // Trigger onModify with the updated data
196
+ if (onModify) {
197
+ const customsData = customsFormTypes.extractCustomsFormData(updatedShipment);
198
+ onModify(customsData);
199
+ }
200
+ return Promise.resolve(updatedShipment);
201
+ }, [getUpdatedShipment, onModify]);
202
+ // Create enhanced shipment with current tracked state for CustomsForms
203
+ const enhancedShipment = React.useMemo(() => {
204
+ var _a;
205
+ return Object.assign(Object.assign({}, shipment), {
206
+ taxIdentifiers,
207
+ packages: ((_a = shipment.packages) === null || _a === void 0 ? void 0 : _a.map((pkg, index) => Object.assign(Object.assign({}, pkg), {
208
+ products: index === 0 ? products : pkg.products || []
209
+ }))) || []
210
+ });
211
+ }, [shipment, taxIdentifiers, products]);
212
+ return jsxRuntime.jsx("div", {
213
+ className: className,
214
+ "data-testid": dataTestId,
215
+ children: jsxRuntime.jsxs("form", {
216
+ onSubmit: handleSubmit,
217
+ children: [jsxRuntime.jsx(customsForms.CustomsForms, {
218
+ currency: currency,
219
+ form: form,
220
+ harmonizedTariffCodes: harmonizedTariffCodes,
221
+ isCanadaDeliveredDutyEligible: isCanadaDeliveredDutyEligible,
222
+ onDirty: handleDirty,
223
+ onUpdateCustoms: handleUpdateCustoms,
224
+ onUpdateTaxableIds: handleUpdateTaxableIds,
225
+ requiresWindsorFramework: requiresWindsorFramework,
226
+ shipment: enhancedShipment
227
+ }), (onSubmit || onCancel) && jsxRuntime.jsxs(buttonGroup.ButtonGroup, {
228
+ justify: "end",
229
+ children: [onCancel && jsxRuntime.jsx(giger.Button, {
230
+ bold: false,
231
+ onClick: onCancel,
232
+ type: "button",
233
+ variant: giger.ButtonVariant.OUTLINED,
234
+ children: t("actions.cancel")
235
+ }), onSubmit && jsxRuntime.jsx(giger.Button, {
236
+ bold: false,
237
+ disabled: !form.formState.isValid || form.formState.isSubmitting,
238
+ type: "submit",
239
+ variant: giger.ButtonVariant.FILLED,
240
+ children: form.formState.isSubmitting ? t("actions.submitting") : t("actions.submit")
241
+ })]
242
+ })]
243
+ })
244
+ });
245
+ };
246
+ Component.displayName = "CustomsForm";
247
+ /**
248
+ * # Registered Customs Form Element
249
+ *
250
+ * - This is the registered `<CustomsForm />` element that will be used to render the
251
+ * `<CustomsForm.Element />` component.
252
+ *
253
+ * @param ElementProps The props, callbacks, and resources necessary to render
254
+ * the `<CustomsForm.Element />` component.
255
+ *
256
+ * @example
257
+ * The `<Component />` is the source JSX that is rendered when you make use of the `CustomsForm`
258
+ * Element directly. Here is a brief example of how you would use it within your application.
259
+ * ```tsx
260
+ * <CustomsForm.Element
261
+ * shipment={salesOrderShipment}
262
+ * currency={SE.Currency.USD}
263
+ * harmonizedTariffCodes={htsCodes}
264
+ * betaEnableWindsorFramework={true}
265
+ * onModify={(customsData) => {
266
+ * console.log('Customs form modified:', customsData);
267
+ * }}
268
+ * onSubmit={async (customsData) => {
269
+ * console.log('Customs form submitted:', customsData);
270
+ * await updateShipmentCustoms(customsData);
271
+ * }}
272
+ * onCancel={() => {
273
+ * console.log('Form cancelled');
274
+ * }}
275
+ * />
276
+ * ```
277
+ *
278
+ * <br />
279
+ *
280
+ * @see {@link CustomsForm.ComponentProps | The **props** that can be passed into the `<CustomsForm.Element />` component}
281
+ *
282
+ * @see {@link PurchaseLabel.Element | See how this element is used within the full label purchase workflow `<PurchaseLabel.Element />`}
283
+ */
284
+ const Element = createElement.createElement(Component, errorFallback.ErrorFallback, {
285
+ css: {
286
+ width: "100%"
287
+ },
288
+ resources: {
289
+ en: index
290
+ }
291
+ });
292
+
293
+ exports.Component = Component;
294
+ exports.Element = Element;
@@ -0,0 +1,243 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _tslib = require('../../_virtual/_tslib.cjs');
6
+ var jsxRuntime = require('@emotion/react/jsx-runtime');
7
+ var addonActions = require('@storybook/addon-actions');
8
+ var reactApi = require('@shipengine/react-api');
9
+ var customsFormElement = require('./customs-form-element.cjs');
10
+ var shipment = require('../../factories/shipengine/shipment.cjs');
11
+
12
+ var customsFormElement_stories = {
13
+ title: "Label Workflow/Nested Elements/CustomsForm Element",
14
+ component: customsFormElement.Element,
15
+ parameters: {
16
+ controls: {
17
+ expanded: false
18
+ },
19
+ previewTabs: {
20
+ "storybook/docs/panel": {
21
+ hidden: true
22
+ }
23
+ },
24
+ viewMode: "story",
25
+ docs: {
26
+ description: {
27
+ component: "A higher-order component that wraps CustomsForms with its own react-hook-form context, allowing it to be used outside of existing form contexts."
28
+ }
29
+ }
30
+ },
31
+ argTypes: {
32
+ shipment: {
33
+ control: false,
34
+ description: "The shipment data to populate the form with"
35
+ },
36
+ currency: {
37
+ control: {
38
+ type: "select"
39
+ },
40
+ options: Object.values(reactApi.SE.Currency),
41
+ description: "Currency for monetary values"
42
+ },
43
+ betaEnableWindsorFramework: {
44
+ control: {
45
+ type: "boolean"
46
+ },
47
+ description: "Enable Windsor Framework features"
48
+ },
49
+ onModify: {
50
+ action: "onModify",
51
+ description: "Called when form data changes"
52
+ },
53
+ onSubmit: {
54
+ action: "onSubmit",
55
+ description: "Called when form is submitted"
56
+ },
57
+ onCancel: {
58
+ action: "onCancel",
59
+ description: "Called when cancel button is clicked"
60
+ }
61
+ }
62
+ };
63
+ const Template = args => {
64
+ return jsxRuntime.jsx("div", {
65
+ style: {
66
+ maxWidth: "800px",
67
+ padding: "20px"
68
+ },
69
+ children: jsxRuntime.jsx(customsFormElement.Element, Object.assign({}, args))
70
+ });
71
+ };
72
+ // Create mock shipment data for different scenarios
73
+ const createMockShipment = (isInternational = true, hasCustoms = true) => {
74
+ return shipment.salesOrderShipmentFactory.build({}, {
75
+ transient: {
76
+ isInternational
77
+ },
78
+ associations: {
79
+ customs: hasCustoms ? {
80
+ contents: reactApi.SE.CustomsContentsType.MERCHANDISE,
81
+ nonDelivery: reactApi.SE.CustomsNonDeliveryType.RETURN_TO_SENDER
82
+ } : undefined
83
+ }
84
+ });
85
+ };
86
+ const Default = Template.bind({});
87
+ Default.args = {
88
+ shipment: createMockShipment(true, true),
89
+ currency: reactApi.SE.Currency.USD,
90
+ onModify: addonActions.action("onModify"),
91
+ onSubmit: addonActions.action("onSubmit"),
92
+ onCancel: addonActions.action("onCancel")
93
+ };
94
+ Default.storyName = "Default International Shipment";
95
+ const DomesticShipment = Template.bind({});
96
+ DomesticShipment.args = {
97
+ shipment: createMockShipment(false, false),
98
+ currency: reactApi.SE.Currency.USD,
99
+ onModify: addonActions.action("onModify"),
100
+ onSubmit: addonActions.action("onSubmit")
101
+ };
102
+ DomesticShipment.storyName = "Domestic Shipment (No Customs)";
103
+ const CanadaDeliveredDuty = Template.bind({});
104
+ CanadaDeliveredDuty.args = {
105
+ shipment: shipment.salesOrderShipmentFactory.build({}, {
106
+ transient: {
107
+ isInternational: true
108
+ },
109
+ associations: {
110
+ shipTo: {
111
+ countryCode: "CA",
112
+ name: "John Doe",
113
+ phone: "555-123-4567",
114
+ addressLine1: "123 Main St",
115
+ cityLocality: "Toronto",
116
+ stateProvince: "ON",
117
+ postalCode: "M5V 3A8"
118
+ },
119
+ shipFrom: {
120
+ countryCode: "US",
121
+ name: "Warehouse",
122
+ phone: "555-987-6543",
123
+ addressLine1: "456 Warehouse Ave",
124
+ cityLocality: "Los Angeles",
125
+ stateProvince: "CA",
126
+ postalCode: "90210"
127
+ },
128
+ customs: {
129
+ contents: reactApi.SE.CustomsContentsType.GIFT,
130
+ nonDelivery: reactApi.SE.CustomsNonDeliveryType.RETURN_TO_SENDER
131
+ }
132
+ }
133
+ }),
134
+ currency: reactApi.SE.Currency.USD,
135
+ onModify: addonActions.action("onModify"),
136
+ onSubmit: addonActions.action("onSubmit")
137
+ };
138
+ CanadaDeliveredDuty.storyName = "Canada Delivered Duty Eligible";
139
+ const WithWindsorFramework = Template.bind({});
140
+ WithWindsorFramework.args = {
141
+ shipment: shipment.salesOrderShipmentFactory.build({}, {
142
+ transient: {
143
+ isInternational: true
144
+ },
145
+ associations: {
146
+ shipTo: {
147
+ countryCode: "IE",
148
+ // Ireland - EU country for Windsor Framework
149
+ name: "Jane Smith",
150
+ phone: "353-1-234-5678",
151
+ addressLine1: "789 Dublin St",
152
+ cityLocality: "Dublin",
153
+ stateProvince: "Dublin",
154
+ postalCode: "D01 F5P2"
155
+ },
156
+ shipFrom: {
157
+ countryCode: "GB",
158
+ // UK for Windsor Framework
159
+ name: "UK Warehouse",
160
+ phone: "44-20-7946-0958",
161
+ addressLine1: "123 London Rd",
162
+ cityLocality: "London",
163
+ stateProvince: "England",
164
+ postalCode: "SW1A 1AA"
165
+ },
166
+ customs: {
167
+ contents: reactApi.SE.CustomsContentsType.MERCHANDISE,
168
+ nonDelivery: reactApi.SE.CustomsNonDeliveryType.RETURN_TO_SENDER
169
+ }
170
+ }
171
+ }),
172
+ currency: reactApi.SE.Currency.GBP,
173
+ betaEnableWindsorFramework: true,
174
+ onModify: addonActions.action("onModify"),
175
+ onSubmit: addonActions.action("onSubmit")
176
+ };
177
+ WithWindsorFramework.storyName = "With Windsor Framework";
178
+ const WithExistingProducts = Template.bind({});
179
+ WithExistingProducts.args = {
180
+ shipment: shipment.salesOrderShipmentFactory.build({}, {
181
+ transient: {
182
+ isInternational: true
183
+ },
184
+ associations: {
185
+ customs: {
186
+ contents: reactApi.SE.CustomsContentsType.MERCHANDISE,
187
+ nonDelivery: reactApi.SE.CustomsNonDeliveryType.RETURN_TO_SENDER
188
+ }
189
+ }
190
+ }),
191
+ currency: reactApi.SE.Currency.USD,
192
+ harmonizedTariffCodes: [{
193
+ code: "6109.10.00",
194
+ description: "T-shirts, singlets and other vests, knitted or crocheted, of cotton"
195
+ }, {
196
+ code: "6912.00.48",
197
+ description: "Ceramic tableware, kitchenware, other household articles"
198
+ }],
199
+ onModify: addonActions.action("onModify"),
200
+ onSubmit: addonActions.action("onSubmit")
201
+ };
202
+ WithExistingProducts.storyName = "With Existing Products";
203
+ const InteractiveExample = Template.bind({});
204
+ InteractiveExample.args = {
205
+ shipment: createMockShipment(true, true),
206
+ currency: reactApi.SE.Currency.USD,
207
+ onModify: data => {
208
+ addonActions.action("onModify")(data);
209
+ console.log("Form modified:", data);
210
+ },
211
+ onSubmit: data => _tslib.__awaiter(void 0, void 0, void 0, function* () {
212
+ addonActions.action("onSubmit")(data);
213
+ console.log("Form submitted:", data);
214
+ // Simulate async operation
215
+ yield new Promise(resolve => setTimeout(resolve, 1000));
216
+ alert("Form submitted successfully! Check the console for data.");
217
+ }),
218
+ onCancel: () => {
219
+ addonActions.action("onCancel")();
220
+ console.log("Form cancelled");
221
+ alert("Form cancelled!");
222
+ }
223
+ };
224
+ InteractiveExample.storyName = "Interactive Example";
225
+ const WithoutButtons = Template.bind({});
226
+ WithoutButtons.args = {
227
+ shipment: createMockShipment(true, true),
228
+ currency: reactApi.SE.Currency.USD,
229
+ onModify: addonActions.action("onModify"),
230
+ // Explicitly set to undefined to override default actions and hide buttons
231
+ onSubmit: undefined,
232
+ onCancel: undefined
233
+ };
234
+ WithoutButtons.storyName = "Without Buttons (Form Only)";
235
+
236
+ exports.CanadaDeliveredDuty = CanadaDeliveredDuty;
237
+ exports.Default = Default;
238
+ exports.DomesticShipment = DomesticShipment;
239
+ exports.InteractiveExample = InteractiveExample;
240
+ exports.WithExistingProducts = WithExistingProducts;
241
+ exports.WithWindsorFramework = WithWindsorFramework;
242
+ exports.WithoutButtons = WithoutButtons;
243
+ exports.default = customsFormElement_stories;
@@ -0,0 +1,59 @@
1
+ 'use strict';
2
+
3
+ var reactApi = require('@shipengine/react-api');
4
+ var zod$1 = require('zod');
5
+ var zod = require('../../extensions/zod.cjs');
6
+ var canadaDdp = require('../../types/canada-ddp.cjs');
7
+ var money = require('../../schemas/shipengine/money.cjs');
8
+
9
+ zod.extendZod();
10
+ /**
11
+ * Creates a Zod schema for customs form data
12
+ */
13
+ const getCustomsFormSchema = ({
14
+ isCustomsRequired = true,
15
+ requiresWindsorFramework = false
16
+ } = {}) => {
17
+ const customsSchema = zod$1.z.object({
18
+ customs: zod$1.z.object({
19
+ contents: zod$1.z.nativeEnum(reactApi.SE.CustomsContentsType),
20
+ nonDelivery: zod$1.z.nativeEnum(reactApi.SE.CustomsNonDeliveryType)
21
+ }),
22
+ products: isCustomsRequired ? zod$1.z.array(zod$1.z.object({
23
+ countryOfOrigin: zod$1.z.string().nullishDefault(undefined),
24
+ description: zod$1.z.string().nullishDefault(undefined),
25
+ harmonizedTariffCode: zod$1.z.string().nullishDefault(undefined),
26
+ quantity: zod$1.z.number().int().positive(),
27
+ value: money.moneySchema
28
+ })).min(1, "At least one product is required") : zod$1.z.array(zod$1.z.object({
29
+ countryOfOrigin: zod$1.z.string().nullishDefault(undefined),
30
+ description: zod$1.z.string().nullishDefault(undefined),
31
+ harmonizedTariffCode: zod$1.z.string().nullishDefault(undefined),
32
+ quantity: zod$1.z.number().int().positive(),
33
+ value: money.moneySchema
34
+ })).optional(),
35
+ taxIdentifiers: zod$1.z.array(zod$1.z.any()).optional(),
36
+ // SE.TaxIdentifier type is complex, using any for now
37
+ advancedOptions: zod$1.z.object({
38
+ canadaDeliveredDuty: zod$1.z.nativeEnum(canadaDdp.CanadaDeliveredDutyOptions).nullish(),
39
+ windsorFrameworkDetails: requiresWindsorFramework ? zod$1.z.object({
40
+ movementIndicator: zod$1.z.nativeEnum(reactApi.SE.MovementIndicator),
41
+ notAtRisk: zod$1.z.boolean().optional().default(false)
42
+ }) : zod$1.z.object({
43
+ movementIndicator: zod$1.z.nativeEnum(reactApi.SE.MovementIndicator),
44
+ notAtRisk: zod$1.z.boolean().optional().default(false)
45
+ }).optional()
46
+ }).optional()
47
+ });
48
+ return customsSchema;
49
+ };
50
+ /**
51
+ * Default schema for customs forms
52
+ */
53
+ const defaultCustomsFormSchema = getCustomsFormSchema({
54
+ isCustomsRequired: true,
55
+ requiresWindsorFramework: false
56
+ });
57
+
58
+ exports.defaultCustomsFormSchema = defaultCustomsFormSchema;
59
+ exports.getCustomsFormSchema = getCustomsFormSchema;
@@ -0,0 +1,63 @@
1
+ 'use strict';
2
+
3
+ var reactApi = require('@shipengine/react-api');
4
+ var canadaDdp = require('../../types/canada-ddp.cjs');
5
+
6
+ /**
7
+ * Extracts customs form data from a `SalesOrderShipment` object.
8
+ *
9
+ * - This utility function transforms a `SalesOrderShipment` (or `Shipment`) into the `CustomsFormData`
10
+ * structure used by the `CustomsForm`. It extracts products from the first package and gathers
11
+ * all relevant customs information into a flat structure.
12
+ *
13
+ * @param shipment - The `SalesOrderShipment` to extract customs data from
14
+ * @returns CustomsFormData object containing customs information
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * const customsData = extractCustomsFormData(shipment);
19
+ * ```
20
+ *
21
+ * @see {@link CustomsFormData | The structure of the returned data}
22
+ */
23
+ const extractCustomsFormData = shipment => {
24
+ var _a, _b, _c, _d, _e, _f;
25
+ // Extract products from the first package (customs forms typically work with single package)
26
+ const products = ((_b = (_a = shipment.packages) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.products) || [];
27
+ return {
28
+ customs: {
29
+ contents: ((_c = shipment.customs) === null || _c === void 0 ? void 0 : _c.contents) || reactApi.SE.CustomsContentsType.MERCHANDISE,
30
+ nonDelivery: ((_d = shipment.customs) === null || _d === void 0 ? void 0 : _d.nonDelivery) || reactApi.SE.CustomsNonDeliveryType.RETURN_TO_SENDER
31
+ },
32
+ products,
33
+ taxIdentifiers: shipment.taxIdentifiers,
34
+ advancedOptions: {
35
+ canadaDeliveredDuty: (_e = shipment.advancedOptions) === null || _e === void 0 ? void 0 : _e.canadaDeliveredDuty,
36
+ windsorFrameworkDetails: (_f = shipment.advancedOptions) === null || _f === void 0 ? void 0 : _f.windsorFrameworkDetails
37
+ }
38
+ };
39
+ };
40
+ /**
41
+ * Returns default values for a new customs form.
42
+ *
43
+ * - Use this utility function when you need to initialize a customs form with sensible defaults
44
+ * before any shipment data is available. Sets MERCHANDISE as contents type and RETURN_TO_SENDER
45
+ * as the non-delivery option.
46
+ *
47
+ * @returns CustomsFormData object with default values
48
+ *
49
+ * @see {@link CustomsFormData | The structure of the returned data}
50
+ */
51
+ const getDefaultCustomsFormValues = () => ({
52
+ customs: {
53
+ contents: reactApi.SE.CustomsContentsType.MERCHANDISE,
54
+ nonDelivery: reactApi.SE.CustomsNonDeliveryType.RETURN_TO_SENDER
55
+ },
56
+ products: [],
57
+ advancedOptions: {
58
+ canadaDeliveredDuty: canadaDdp.CanadaDeliveredDutyOptions.RECIPIENT_PAYS
59
+ }
60
+ });
61
+
62
+ exports.extractCustomsFormData = extractCustomsFormData;
63
+ exports.getDefaultCustomsFormValues = getDefaultCustomsFormValues;
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ var customsFormElement = require('./customs-form-element.cjs');
4
+ var customsFormTypes = require('./customs-form-types.cjs');
5
+
6
+
7
+
8
+ exports.CustomsForm = customsFormElement;
9
+ exports.extractCustomsFormData = customsFormTypes.extractCustomsFormData;
10
+ exports.getDefaultCustomsFormValues = customsFormTypes.getDefaultCustomsFormValues;
@@ -16,6 +16,8 @@ var selectLabelLayoutElement = require('./select-label-layout/select-label-layou
16
16
  var paymentMethodSettingsElement = require('./payment-method-settings/payment-method-settings-element.cjs');
17
17
  var carrierServices = require('../workflows/carrier-services/carrier-services.cjs');
18
18
  var transactionHistoryElement = require('./transaction-history/transaction-history-element.cjs');
19
+ var customsFormElement = require('./customs-form/customs-form-element.cjs');
20
+ var customsFormTypes = require('./customs-form/customs-form-types.cjs');
19
21
 
20
22
 
21
23
 
@@ -36,3 +38,6 @@ exports.SelectLabelLayout = selectLabelLayoutElement;
36
38
  exports.PaymentMethodSettings = paymentMethodSettingsElement;
37
39
  exports.CarrierServices = carrierServices;
38
40
  exports.TransactionHistory = transactionHistoryElement;
41
+ exports.CustomsForm = customsFormElement;
42
+ exports.extractCustomsFormData = customsFormTypes.extractCustomsFormData;
43
+ exports.getDefaultCustomsFormValues = customsFormTypes.getDefaultCustomsFormValues;