@shipengine/elements 1.9.0 → 2.1.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.
- package/README.md +0 -4
- package/actions-menu.js +34 -0
- package/assertions.js +1 -0
- package/carrier-logo.js +1 -0
- package/components.js +1 -1
- package/constants.js +1 -1
- package/elements.js +1 -1
- package/extensions.js +1 -1
- package/formatString.js +1 -0
- package/hooks.js +1 -1
- package/index.js +1 -1
- package/money.js +1 -0
- package/package.json +20 -46
- package/pudo.js +1 -0
- package/schemas.js +1 -1
- package/src/components/actions-menu/actions-menu.d.ts +19 -0
- package/src/components/actions-menu/index.d.ts +1 -0
- package/src/components/add-funds-form/add-funds-form.d.ts +1 -1
- package/src/components/auto-funding-form/auto-funding-form.d.ts +1 -1
- package/src/components/carrier-balance/carrier-balance.d.ts +1 -1
- package/src/components/collapsible-panel/collapsible-panel.d.ts +1 -1
- package/src/components/collapsible-panel/collapsible-panel.styles.d.ts +10 -13
- package/src/components/display-term/display-term.d.ts +1 -1
- package/src/components/edit-billing-form/edit-billing-form.d.ts +1 -1
- package/src/components/field/checkbox-input/checkbox-input.d.ts +1 -0
- package/src/components/field/money-input/money-input.d.ts +1 -1
- package/src/components/field/rate-card/cost-breakdown/cost-breakdown.d.ts +1 -1
- package/src/components/field/rate-card/rate-card.d.ts +1 -1
- package/src/components/field/rate-card/rate-card.styles.d.ts +0 -1
- package/src/components/field/rate-select/rate-select.d.ts +1 -1
- package/src/components/field/select/index.d.ts +1 -0
- package/src/components/field/select/select-with-categories.d.ts +20 -0
- package/src/components/field/select/select.d.ts +5 -10
- package/src/components/fund-and-purchase/fund-and-purchase.d.ts +1 -1
- package/src/components/history/history-card/history-card.d.ts +1 -1
- package/src/components/index.d.ts +1 -0
- package/src/components/items-breakdown/items-breakdown.d.ts +1 -1
- package/src/components/pager/pager.d.ts +1 -1
- package/src/components/rate-details/rate-details.d.ts +1 -1
- package/src/components/save-status/save-status.d.ts +1 -1
- package/src/components/service-points/service-points.d.ts +1 -1
- package/src/components/templates/address-display/address-display.d.ts +1 -1
- package/src/components/templates/address-preference-display/address-preference-display.d.ts +1 -1
- package/src/components/templates/address-preference-select/address-preference-select.d.ts +1 -1
- package/src/components/templates/connect-external-carrier-form/connect-external-carrier-form.d.ts +12 -0
- package/src/components/templates/connect-external-carrier-form/index.d.ts +1 -0
- package/src/components/templates/connected-carrier-list/connected-carrier-list.d.ts +4 -1
- package/src/components/templates/connected-carrier-list/connected-carrier-list.styles.d.ts +0 -10
- package/src/components/templates/connected-carrier-list/connected-carrier-row/connected-carrier-row.d.ts +4 -1
- package/src/components/templates/connected-carrier-list/connected-carrier-row/connected-carrier-row.styles.d.ts +19 -12
- package/src/components/templates/index.d.ts +1 -1
- package/src/components/templates/label/label.d.ts +1 -1
- package/src/components/templates/product-form/product-form.d.ts +1 -1
- package/src/components/templates/products-display/products-display.d.ts +1 -1
- package/src/components/templates/products-display/products-display.styles.d.ts +12 -4
- package/src/components/templates/rate-form/rate-form.d.ts +3 -4
- package/src/components/templates/shipment/shipment.d.ts +3 -11
- package/src/components/templates/shipment-form/sections/customs-forms/components/index.d.ts +2 -0
- package/src/components/templates/shipment-form/sections/customs-forms/components/tax-ids/form/index.d.ts +3 -0
- package/src/components/templates/shipment-form/sections/customs-forms/components/tax-ids/form/schema.d.ts +38 -0
- package/src/components/templates/shipment-form/sections/customs-forms/components/tax-ids/form/values.d.ts +12 -0
- package/src/components/templates/shipment-form/sections/customs-forms/components/tax-ids/index.d.ts +2 -0
- package/src/components/templates/shipment-form/sections/customs-forms/components/tax-ids/tax-id-form.d.ts +17 -0
- package/src/components/templates/shipment-form/sections/customs-forms/components/tax-ids/tax-id-list.d.ts +12 -0
- package/src/components/templates/shipment-form/sections/customs-forms/components/tax-ids/tax-ids.d.ts +8 -0
- package/src/components/templates/shipment-form/sections/customs-forms/components/tax-ids/tax-ids.styles.d.ts +70 -0
- package/src/components/templates/shipment-form/sections/customs-forms/customs-forms.d.ts +10 -0
- package/src/components/templates/shipment-form/sections/customs-forms/index.d.ts +1 -0
- package/src/components/templates/shipment-form/sections/index.d.ts +1 -0
- package/src/components/templates/shipment-form/shipment-form.d.ts +4 -10
- package/src/components/templates/shipment-form/shipment-form.styles.d.ts +9 -0
- package/src/components/templates/shipment-form/shipment-schema.d.ts +1 -1
- package/src/components/templates/suspend-sales-order/suspend-sales-order.d.ts +1 -1
- package/src/components/templates/suspend-shipment/suspend-shipment.d.ts +1 -1
- package/src/components/templates/wallet-form/edit-wallet-address-form.d.ts +1 -1
- package/src/components/templates/wallet-form/wallet-form.d.ts +2 -4
- package/src/components/templates/wallet-form/wallet-schema.d.ts +1 -1
- package/src/components/wallet-card/wallet-card.d.ts +1 -1
- package/src/components/warehouse-form/warehouse-form.d.ts +11 -4
- package/src/components/zero-state/zero-state.d.ts +6 -0
- package/src/components/zero-state/zero-state.styles.d.ts +14 -0
- package/src/create-element/create-element.d.ts +10 -0
- package/src/create-element/element/element.d.ts +16 -0
- package/src/create-element/element/hooks/index.d.ts +1 -0
- package/src/create-element/element/hooks/use-i18n.d.ts +12 -0
- package/src/create-element/element/index.d.ts +3 -0
- package/src/create-element/element/utils/get-emotion-cache.d.ts +2 -0
- package/src/create-element/element/utils/index.d.ts +1 -0
- package/src/create-element/error-boundary/error-boundary.d.ts +21 -0
- package/src/create-element/error-boundary/index.d.ts +1 -0
- package/src/create-element/index.d.ts +1 -0
- package/src/elements/index.d.ts +5 -4
- package/src/elements/label-layout/label-layout-element.d.ts +44 -2
- package/src/elements/labels-grid/labels-grid.d.ts +45 -3
- package/src/elements/manage-carriers/index.d.ts +1 -0
- package/src/elements/{shipengine-carriers/shipengine-carriers.d.ts → manage-carriers/manage-carriers.d.ts} +99 -52
- package/src/elements/manage-external-carriers/index.d.ts +1 -0
- package/src/elements/{external-carriers/external-carriers.d.ts → manage-external-carriers/manage-external-carriers.d.ts} +74 -63
- package/src/elements/manage-funding/manage-funding-element.d.ts +47 -4
- package/src/elements/manage-warehouses/manage-warehouses.d.ts +62 -3
- package/src/elements/payment-method-settings/payment-method-settings-element.d.ts +47 -4
- package/src/elements/purchase-label/configure-shipment.d.ts +4 -27
- package/src/elements/purchase-label/hooks/use-address.d.ts +1 -1
- package/src/elements/purchase-label/hooks/use-configure-shipment.d.ts +1 -1
- package/src/elements/purchase-label/hooks/use-customs.d.ts +2 -1
- package/src/elements/purchase-label/hooks/use-import-sales-order.d.ts +2 -2
- package/src/elements/purchase-label/hooks/use-load-shipment.d.ts +3 -3
- package/src/elements/purchase-label/hooks/use-pending-shipment.d.ts +1 -1
- package/src/elements/purchase-label/hooks/use-presets.d.ts +1 -1
- package/src/elements/purchase-label/hooks/use-rates-form.d.ts +1 -1
- package/src/elements/purchase-label/hooks/use-rates-with-cache.d.ts +1 -1
- package/src/elements/purchase-label/hooks/use-request-preferred-rates.d.ts +1 -1
- package/src/elements/purchase-label/hooks/use-request-rates.d.ts +1 -1
- package/src/elements/purchase-label/hooks/use-shipment-form.d.ts +2 -1
- package/src/elements/purchase-label/purchase-label-by-sales-order.d.ts +1 -1
- package/src/elements/purchase-label/purchase-label-by-shipment.d.ts +1 -1
- package/src/elements/purchase-label/purchase-label.d.ts +85 -44
- package/src/elements/shipment-summary/index.d.ts +1 -0
- package/src/elements/{view-shipment/view-shipment.d.ts → shipment-summary/shipment-summary.d.ts} +89 -60
- package/src/elements/shipments-grid/shipments-grid.d.ts +45 -3
- package/src/elements/theme-creator/theme-creator.d.ts +44 -2
- package/src/elements/transaction-history/index.d.ts +1 -0
- package/src/elements/{wallet-history/wallet-history-element.d.ts → transaction-history/transaction-history-element.d.ts} +44 -2
- package/src/elements/unit-settings/unit-settings-element.d.ts +44 -2
- package/src/elements/vat-settings/vat-settings-element.d.ts +44 -2
- package/src/elements/void-label/components/actions/actions.d.ts +1 -1
- package/src/elements/void-label/components/message/message.d.ts +1 -1
- package/src/elements/void-label/void-label.d.ts +83 -52
- package/src/elements-provider/elements-context-provider.d.ts +44 -0
- package/src/elements-provider/elements-provider.d.ts +12 -0
- package/src/elements-provider/elements-test-provider.d.ts +3 -0
- package/src/elements-provider/hooks/index.d.ts +1 -0
- package/src/elements-provider/hooks/use-load-icons.d.ts +7 -0
- package/src/elements-provider/index.d.ts +3 -0
- package/src/factories/shipengine/address.d.ts +1 -1
- package/src/factories/shipengine/carrier.d.ts +1 -1
- package/src/factories/shipengine/index.d.ts +1 -1
- package/src/factories/shipengine/label.d.ts +1 -1
- package/src/factories/shipengine/money.d.ts +1 -1
- package/src/factories/shipengine/order-source.d.ts +1 -1
- package/src/factories/shipengine/package.d.ts +1 -1
- package/src/factories/shipengine/resource.d.ts +1 -1
- package/src/factories/shipengine/sales-order.d.ts +1 -1
- package/src/factories/shipengine/service-point.d.ts +1 -1
- package/src/factories/shipengine/service.d.ts +1 -1
- package/src/factories/shipengine/shipment.d.ts +1 -1
- package/src/factories/shipengine/{wallet-history.d.ts → transaction-history.d.ts} +1 -1
- package/src/factories/shipengine/warehouse.d.ts +1 -1
- package/src/factories/shipengine/weight.d.ts +1 -1
- package/src/features/index.d.ts +3 -3
- package/src/features/label-layout/label-layout.d.ts +1 -1
- package/src/features/label-layout/use-label-layout.d.ts +1 -1
- package/src/features/{shipengine-carriers → manage-carriers}/hooks/use-list-funding-source-carriers.d.ts +3 -3
- package/src/features/manage-carriers/index.d.ts +1 -0
- package/src/features/manage-carriers/manage-carriers-row/index.d.ts +1 -0
- package/src/features/{shipengine-carriers/shipengine-carriers-row/shipengine-carriers-row.d.ts → manage-carriers/manage-carriers-row/manage-carriers-row.d.ts} +3 -3
- package/src/features/manage-carriers/manage-carriers.d.ts +5 -0
- package/src/features/manage-external-carriers/index.d.ts +2 -0
- package/src/features/manage-external-carriers/manage-external-carriers.d.ts +14 -0
- package/src/features/manage-external-carriers/use-manage-external-carriers.d.ts +12 -0
- package/src/features/manage-funding/manage-funding.d.ts +4 -1
- package/src/features/manage-warehouses/manage-warehouses.d.ts +1 -1
- package/src/features/manage-warehouses/use-manage-warehouses.d.ts +9 -9
- package/src/features/manage-warehouses/warehouse-display/warehouse-display.d.ts +1 -1
- package/src/features/payment-method-settings/payment-method-settings.d.ts +4 -1
- package/src/features/transaction-history/index.d.ts +1 -0
- package/src/features/transaction-history/transaction-history.d.ts +6 -0
- package/src/features/unit-settings/unit-settings.d.ts +1 -1
- package/src/features/unit-settings/use-unit-settings.d.ts +1 -1
- package/src/features/vat-settings/use-vat-settings.d.ts +5 -5
- package/src/hooks/here-map/init.d.ts +1 -1
- package/src/hooks/options/use-confirmation-options.d.ts +1 -1
- package/src/hooks/options/use-customs-contents-options.d.ts +1 -1
- package/src/hooks/options/use-customs-non-delivery-options.d.ts +1 -1
- package/src/hooks/options/use-insurance-provider-options.d.ts +1 -1
- package/src/hooks/options/use-package-options.d.ts +2 -2
- package/src/hooks/options/use-rate-options.d.ts +1 -1
- package/src/hooks/options/use-service-code-options.d.ts +1 -1
- package/src/hooks/options/use-service-points.d.ts +1 -1
- package/src/hooks/options/use-shipment-metadata.d.ts +1 -1
- package/src/hooks/options/use-shipping-presets-options.d.ts +1 -1
- package/src/hooks/options/use-warehouse-options.d.ts +4 -2
- package/src/hooks/use-address-validation.d.ts +1 -1
- package/src/hooks/use-get-or-create-shipment.d.ts +3 -3
- package/src/hooks/use-scrub-errors.d.ts +1 -1
- package/src/index.d.ts +2 -0
- package/src/locales/en/index.d.ts +44 -2
- package/src/mocks/carriers/handlers.d.ts +1 -1
- package/src/mocks/warehouses/handlers.d.ts +1 -1
- package/src/schemas/shipengine/money.d.ts +1 -1
- package/src/testing/test-utils.d.ts +7 -2
- package/src/themes/fallback.d.ts +3 -0
- package/src/themes/index.d.ts +4 -0
- package/src/types/carrier-metadata.d.ts +1 -1
- package/src/types/preferred-rates.d.ts +1 -1
- package/src/types/shipping-preset/shipping-preset.d.ts +1 -1
- package/src/utilities/error.d.ts +1 -1
- package/src/utilities/feature-flags/feature-flags.d.ts +18 -0
- package/src/utilities/feature-flags/index.d.ts +2 -0
- package/src/utilities/feature-flags/types.d.ts +141 -0
- package/src/utilities/formatString.d.ts +2 -0
- package/src/utilities/index.d.ts +1 -0
- package/src/utilities/money.d.ts +1 -1
- package/src/utilities/pudo.d.ts +3 -0
- package/src/utilities/rates.d.ts +1 -3
- package/src/utilities/shipengine/address.d.ts +1 -1
- package/src/utilities/shipengine/carrier.d.ts +4 -1
- package/src/utilities/shipengine/dimensions.d.ts +1 -1
- package/src/utilities/shipengine/sales-order.d.ts +1 -1
- package/src/utilities/shipengine/shipment.d.ts +1 -1
- package/src/utilities/shipengine/warehouses.d.ts +1 -1
- package/src/utilities/shipengine/weight.d.ts +1 -1
- package/src/workflows/account-settings/account-settings.d.ts +52 -16
- package/src/workflows/account-settings/use-get-panel-props.d.ts +3 -3
- package/src/workflows/{manage-wallet-workflow/manage-wallet-workflow.d.ts → carrier-services/carrier-services.d.ts} +55 -25
- package/src/workflows/carrier-services/index.d.ts +1 -0
- package/src/workflows/{connect-carrier/connect-carrier.d.ts → connect-external-carrier/connect-external-carrier.d.ts} +52 -37
- package/src/workflows/connect-external-carrier/index.d.ts +1 -0
- package/src/workflows/index.d.ts +3 -2
- package/src/workflows/label-workflow/index.d.ts +1 -0
- package/src/workflows/{purchase-label-workflow/purchase-label-workflow.d.ts → label-workflow/label-workflow.d.ts} +16 -34
- package/src/workflows/onboarding/components/carrier-recovery-form/carrier-recovery-form.d.ts +1 -1
- package/src/workflows/onboarding/components/funding-and-carrier-connection-step/funding-and-carrier-connection-step.d.ts +2 -4
- package/src/workflows/onboarding/components/funding-and-carrier-connection-step/use-funding-and-carrier-connection-step.d.ts +1 -1
- package/src/workflows/onboarding/components/onboarding-wizard/onboarding-wizard.d.ts +2 -9
- package/src/workflows/onboarding/components/ship-from-address-step/ship-from-address-step.d.ts +1 -1
- package/src/workflows/onboarding/components/ship-from-address-step/use-ship-from-address-step.d.ts +1 -1
- package/src/workflows/onboarding/components/terms-agreement-form/terms-agreement-form.d.ts +3 -2
- package/src/workflows/onboarding/components/terms-agreement-step/terms-agreement-step.d.ts +1 -1
- package/src/workflows/onboarding/components/terms-agreement-step/use-terms-agreement-step.d.ts +1 -1
- package/src/workflows/onboarding/onboarding.d.ts +65 -71
- package/story-notes.js +1 -0
- package/suspend-text.js +1 -0
- package/transaction-history-element.js +1 -0
- package/use-page-layout.js +1 -0
- package/use-scrub-errors.js +1 -0
- package/use-toggle.js +1 -0
- package/use-unit-settings.js +1 -0
- package/utilities.js +1 -1
- package/validation.js +1 -0
- package/wallet-form.js +1 -0
- package/warehouses.js +1 -0
- package/workflows.js +1 -1
- package/carrier-2abb4760.js +0 -1
- package/carrier-logo-1b6c767e.js +0 -1
- package/feature-flags-3e03717c.js +0 -1
- package/formatString-413ec7c7.js +0 -1
- package/money-fbc4d0b3.js +0 -1
- package/payment-method-settings-element-595cc38d.js +0 -1
- package/shipment-90d35708.js +0 -1
- package/src/components/templates/connect-carrier-form/connect-carrier-form.d.ts +0 -12
- package/src/components/templates/connect-carrier-form/index.d.ts +0 -1
- package/src/elements/external-carriers/index.d.ts +0 -1
- package/src/elements/shipengine-carriers/index.d.ts +0 -1
- package/src/elements/view-shipment/index.d.ts +0 -1
- package/src/elements/wallet-history/index.d.ts +0 -1
- package/src/features/external-carriers/external-carriers.d.ts +0 -11
- package/src/features/external-carriers/index.d.ts +0 -1
- package/src/features/shipengine-carriers/index.d.ts +0 -1
- package/src/features/shipengine-carriers/shipengine-carriers-row/index.d.ts +0 -1
- package/src/features/shipengine-carriers/shipengine-carriers.d.ts +0 -10
- package/src/features/wallet-history/index.d.ts +0 -1
- package/src/features/wallet-history/wallet-history.d.ts +0 -6
- package/src/hooks/use-elements.d.ts +0 -35
- package/src/utilities/feature-flags.d.ts +0 -232
- package/src/workflows/connect-carrier/index.d.ts +0 -1
- package/src/workflows/manage-wallet-workflow/index.d.ts +0 -1
- package/src/workflows/purchase-label-workflow/index.d.ts +0 -1
- package/story-notes-ce2d8cca.js +0 -1
- package/suspend-text-c8c7b6b6.js +0 -1
- package/use-page-layout-93ffae78.js +0 -1
- package/use-scrub-errors-2c4db406.js +0 -1
- package/use-toggle-838d2ebd.js +0 -1
- package/validation-b941a548.js +0 -1
- package/wallet-form-3981400b.js +0 -1
- package/wallet-history-5b34c856.js +0 -1
- package/warehouse-form-c0b3ea78.js +0 -34
- package/warehouses-dfcdce23.js +0 -1
- /package/{address-8f8119f4.js → address.js} +0 -0
- /package/{phone-87dd7bd8.js → phone.js} +0 -0
- /package/src/components/templates/{connect-carrier-form/connect-carrier-form.styles.d.ts → connect-external-carrier-form/connect-external-carrier-form.styles.d.ts} +0 -0
- /package/src/features/{shipengine-carriers → manage-carriers}/hooks/index.d.ts +0 -0
- /package/src/features/{shipengine-carriers → manage-carriers}/hooks/use-carrier-metadata.d.ts +0 -0
- /package/src/features/{shipengine-carriers/shipengine-carriers-row/shipengine-carriers-row.styles.d.ts → manage-carriers/manage-carriers-row/manage-carriers-row.styles.d.ts} +0 -0
- /package/src/features/{shipengine-carriers/shipengine-carriers.styles.d.ts → manage-carriers/manage-carriers.styles.d.ts} +0 -0
- /package/src/features/{wallet-history/wallet-history.styles.d.ts → transaction-history/transaction-history.styles.d.ts} +0 -0
- /package/src/workflows/{manage-wallet-workflow → carrier-services}/use-get-wallet-panel-props.d.ts +0 -0
- /package/{zod-60def96c.js → zod.js} +0 -0
package/src/workflows/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from "./onboarding";
|
|
2
|
-
export * from "./
|
|
2
|
+
export * from "./label-workflow";
|
|
3
3
|
export * from "./account-settings";
|
|
4
|
-
export * from "./connect-carrier";
|
|
4
|
+
export * from "./connect-external-carrier";
|
|
5
|
+
export * from "./carrier-services";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as LabelWorkflow from "./label-workflow";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Shipment } from "@shipengine/js-api";
|
|
3
|
-
import {
|
|
3
|
+
import { PurchaseLabelFeatures, ShipmentSummaryFeatures } from "../../utilities";
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
6
6
|
*
|
|
7
7
|
* # Label Workflow Props
|
|
8
8
|
*
|
|
9
|
-
* - These are the base props that will be passed into the `<
|
|
9
|
+
* - These are the base props that will be passed into the `<LabelWorkflow />` component.
|
|
10
10
|
*
|
|
11
|
-
* @see {@link
|
|
11
|
+
* @see {@link LabelWorkflow.Element | The `<LabelWorkflow.Element />` component}
|
|
12
12
|
*/
|
|
13
|
-
export type
|
|
13
|
+
export type LabelWorkflowProps = {
|
|
14
14
|
/**
|
|
15
15
|
* `callbacks` is an optional set of callbacks that will be invoked at various points in the
|
|
16
16
|
* label purchasing workflow.
|
|
@@ -27,11 +27,7 @@ export type PurchaseLabelWorkflowProps = {
|
|
|
27
27
|
/**
|
|
28
28
|
* `features` is a set of feature flags you would like to enable or disable in this component.
|
|
29
29
|
*/
|
|
30
|
-
features:
|
|
31
|
-
/**
|
|
32
|
-
* `labelId` is the unique identifier for the label you wish to view.
|
|
33
|
-
*/
|
|
34
|
-
labelId?: string;
|
|
30
|
+
features: PurchaseLabelFeatures & ShipmentSummaryFeatures;
|
|
35
31
|
/**
|
|
36
32
|
* `multiplexedId` is the unique pattern of props that help index which Element is being displayed.
|
|
37
33
|
*/
|
|
@@ -64,7 +60,7 @@ export type PurchaseLabelWorkflowProps = {
|
|
|
64
60
|
* setLabelId,
|
|
65
61
|
* setShipmentId,
|
|
66
62
|
* setIsVoidingLabel,
|
|
67
|
-
* } =
|
|
63
|
+
* } = useLabelWorkflow({
|
|
68
64
|
* _labelId,
|
|
69
65
|
* _multiplexedId,
|
|
70
66
|
* });
|
|
@@ -72,9 +68,9 @@ export type PurchaseLabelWorkflowProps = {
|
|
|
72
68
|
*
|
|
73
69
|
* <br />
|
|
74
70
|
*
|
|
75
|
-
* @see {@link
|
|
71
|
+
* @see {@link LabelWorkflow.Element | The `<LabelWorkflow.Element />` component using this hook}
|
|
76
72
|
*/
|
|
77
|
-
export declare const
|
|
73
|
+
export declare const useLabelWorkflow: ({ _multiplexedId, }: {
|
|
78
74
|
_callbacks?: {
|
|
79
75
|
/**
|
|
80
76
|
* `onLabelCreateSuccess` is an optional callback function that will be invoked when a label
|
|
@@ -84,7 +80,6 @@ export declare const usePurchaseLabelWorkflow: ({ _multiplexedId, _labelId, }: {
|
|
|
84
80
|
labelId: string;
|
|
85
81
|
}, shipment: Shipment) => void) | undefined;
|
|
86
82
|
} | undefined;
|
|
87
|
-
_labelId?: string | undefined;
|
|
88
83
|
_multiplexedId: ({
|
|
89
84
|
orderSourceCode: string;
|
|
90
85
|
} & ({
|
|
@@ -115,20 +110,7 @@ export declare const usePurchaseLabelWorkflow: ({ _multiplexedId, _labelId, }: {
|
|
|
115
110
|
oneOff: true;
|
|
116
111
|
};
|
|
117
112
|
setIsVoidingLabel: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
118
|
-
setLabelId: (nextLabelId
|
|
119
|
-
setMultiplexedId: import("react").Dispatch<import("react").SetStateAction<({
|
|
120
|
-
orderSourceCode: string;
|
|
121
|
-
} & ({
|
|
122
|
-
externalOrderNumber: string;
|
|
123
|
-
} | {
|
|
124
|
-
externalOrderId: string;
|
|
125
|
-
})) | {
|
|
126
|
-
salesOrderId: string;
|
|
127
|
-
} | {
|
|
128
|
-
shipmentId: string;
|
|
129
|
-
} | {
|
|
130
|
-
oneOff: true;
|
|
131
|
-
}>>;
|
|
113
|
+
setLabelId: (nextLabelId?: string) => void;
|
|
132
114
|
setShipmentId: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
|
|
133
115
|
shipmentId: string | undefined;
|
|
134
116
|
};
|
|
@@ -137,17 +119,17 @@ export declare const usePurchaseLabelWorkflow: ({ _multiplexedId, _labelId, }: {
|
|
|
137
119
|
*
|
|
138
120
|
* # Label Workflow Element
|
|
139
121
|
*
|
|
140
|
-
* - The `<
|
|
122
|
+
* - The `<LabelWorkflow.Element />` component is a composition of the PurchaseLabel, ShipmentSummary,
|
|
141
123
|
* and VoidLabel elements that allows users to purchase a label, view the shipment details, and optionally void their shipping label.
|
|
142
124
|
*
|
|
143
|
-
* @param
|
|
125
|
+
* @param LabelWorkflowProps The props necessary to render the `<LabelWorkflow.Element />` for shipment
|
|
144
126
|
* based or sales order based label purchasing.
|
|
145
127
|
*
|
|
146
|
-
* @returns Element A React Element that will render the `<
|
|
128
|
+
* @returns Element A React Element that will render the `<LabelWorkflow />` component.
|
|
147
129
|
*
|
|
148
130
|
* @example
|
|
149
131
|
* ```tsx
|
|
150
|
-
* <
|
|
132
|
+
* <LabelWorkflow
|
|
151
133
|
* {...elementProps}
|
|
152
134
|
* callbacks={{ onLabelCreateSuccess }}
|
|
153
135
|
* multiplexedId={elementIdProps}
|
|
@@ -156,7 +138,7 @@ export declare const usePurchaseLabelWorkflow: ({ _multiplexedId, _labelId, }: {
|
|
|
156
138
|
*
|
|
157
139
|
* <br />
|
|
158
140
|
*
|
|
159
|
-
* @see {@link
|
|
160
|
-
* @see {@link
|
|
141
|
+
* @see {@link LabelWorkflowProps | The props that are passed into the `<LabelWorkflow />` component}
|
|
142
|
+
* @see {@link LabelWorkflow.useLabelWorkflow | The `hook` that is used to manage the state of the `<LabelWorkflow />` component}
|
|
161
143
|
*/
|
|
162
|
-
export declare const Element: ({ multiplexedId: _multiplexedId,
|
|
144
|
+
export declare const Element: ({ multiplexedId: _multiplexedId, features: propFeatures, callbacks }: LabelWorkflowProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
package/src/workflows/onboarding/components/carrier-recovery-form/carrier-recovery-form.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SE } from "@shipengine/
|
|
1
|
+
import { SE } from "@shipengine/react-api";
|
|
2
2
|
import { CarrierMetadataFromFundingSource } from "../../../../types";
|
|
3
3
|
import { CarrierRecoveryFormPayload } from "./carrier-recovery-form-schema";
|
|
4
4
|
export type CarrierRecoveryFormProps = {
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { SE } from "@shipengine/
|
|
1
|
+
import { SE } from "@shipengine/react-api";
|
|
2
2
|
import { WalletPayload } from "../../../../components/templates/wallet-form";
|
|
3
|
-
import { VatSettingsFeatures } from "../../../../features";
|
|
4
3
|
export type FundingAndCarrierConnectionStepProps = {
|
|
5
4
|
address: SE.Address;
|
|
6
5
|
createFundingSourceErrors: SE.CodedError[] | null;
|
|
7
|
-
features?: VatSettingsFeatures;
|
|
8
6
|
onSubmit: (payload: WalletPayload) => Promise<void>;
|
|
9
7
|
registerCarrierErrors: SE.CodedError[] | null;
|
|
10
8
|
};
|
|
11
|
-
export declare const FundingAndCarrierConnectionStep: ({ address, createFundingSourceErrors, onSubmit, registerCarrierErrors,
|
|
9
|
+
export declare const FundingAndCarrierConnectionStep: ({ address, createFundingSourceErrors, onSubmit, registerCarrierErrors, }: FundingAndCarrierConnectionStepProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { SE } from "@shipengine/
|
|
2
|
-
import { ShipEngineCarriersFeatures, VatSettingsFeatures } from "../../../../features";
|
|
1
|
+
import { SE } from "@shipengine/react-api";
|
|
3
2
|
import { ShipFromAddressStepProps } from "../ship-from-address-step";
|
|
4
3
|
export type ValidateWarehouse = {
|
|
5
4
|
type: "warehouse";
|
|
@@ -13,15 +12,9 @@ export type ValidateBilling = {
|
|
|
13
12
|
type: "billing";
|
|
14
13
|
};
|
|
15
14
|
export type ValidateAddress = ValidateWarehouse | ValidateBilling;
|
|
16
|
-
export type OnboardingWizardFeatures = ShipEngineCarriersFeatures & {
|
|
17
|
-
presentation: {
|
|
18
|
-
poweredByShipEngine?: boolean;
|
|
19
|
-
};
|
|
20
|
-
} & VatSettingsFeatures;
|
|
21
15
|
export type OnboardingWizardProps = {
|
|
22
16
|
defaultShipFromAddress?: ShipFromAddressStepProps["defaultShipFromAddress"];
|
|
23
|
-
features?: Partial<OnboardingWizardFeatures>;
|
|
24
17
|
onComplete: () => void;
|
|
25
18
|
partnerName?: string;
|
|
26
19
|
};
|
|
27
|
-
export declare const OnboardingWizard: ({ defaultShipFromAddress,
|
|
20
|
+
export declare const OnboardingWizard: ({ defaultShipFromAddress, onComplete: onWizardComplete, partnerName, }: OnboardingWizardProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
package/src/workflows/onboarding/components/ship-from-address-step/ship-from-address-step.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SE } from "@shipengine/
|
|
1
|
+
import { SE } from "@shipengine/react-api";
|
|
2
2
|
import { WarehousePayload } from "../../../../components";
|
|
3
3
|
export type ShipFromAddressStepProps = {
|
|
4
4
|
defaultShipFromAddress?: Pick<SE.Warehouse, "name" | "isDefault" | "originAddress" | "returnAddress">;
|
package/src/workflows/onboarding/components/ship-from-address-step/use-ship-from-address-step.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export type UseShipFromAddressStepProps = {
|
|
|
3
3
|
onStepComplete: () => void;
|
|
4
4
|
};
|
|
5
5
|
export declare const useShipFromAddressStep: ({ onStepComplete }: UseShipFromAddressStepProps) => {
|
|
6
|
-
defaultWarehouse: import("@shipengine/
|
|
6
|
+
defaultWarehouse: import("@shipengine/react-api").Warehouse | undefined;
|
|
7
7
|
handleSubmitShipFromAddress: (payload: WarehousePayload) => Promise<void>;
|
|
8
8
|
isLoadingWarehouses: boolean;
|
|
9
9
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { SE } from "@shipengine/
|
|
1
|
+
import { SE } from "@shipengine/js-api";
|
|
2
2
|
export type TermsAgreementFormProps = {
|
|
3
3
|
carrierTerms: SE.MetadataRequiredTerm[];
|
|
4
4
|
hideTerms: boolean;
|
|
5
|
+
isSubmitDisabled?: boolean;
|
|
5
6
|
onSubmit: (agreement: boolean) => void;
|
|
6
7
|
};
|
|
7
|
-
export declare const TermsAgreementForm: ({ carrierTerms, hideTerms, onSubmit, }: TermsAgreementFormProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const TermsAgreementForm: ({ carrierTerms, hideTerms, onSubmit, isSubmitDisabled, }: TermsAgreementFormProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -10,8 +10,6 @@ import { OnboardingWizardProps } from "./components/onboarding-wizard";
|
|
|
10
10
|
export type ComponentProps = {
|
|
11
11
|
/** If provided, the address form will be pre-filled */
|
|
12
12
|
defaultShipFromAddress?: OnboardingWizardProps["defaultShipFromAddress"];
|
|
13
|
-
/** Flags to selectively enable / disable features. */
|
|
14
|
-
features?: OnboardingWizardProps["features"];
|
|
15
13
|
/** Invoked when the onboarding process is completed. */
|
|
16
14
|
onComplete: () => void;
|
|
17
15
|
/** The partner responsible for the currently onboarding seller. This is typically the name of the entity that owns the host application. */
|
|
@@ -33,7 +31,7 @@ export type ComponentProps = {
|
|
|
33
31
|
* @example
|
|
34
32
|
* You can see how the `<Component />` is used in the `createElement` function call below.
|
|
35
33
|
* ```tsx
|
|
36
|
-
* export const Element =
|
|
34
|
+
* export const Element = createElement(Component, ErrorFallback, {
|
|
37
35
|
* css: {
|
|
38
36
|
* height: "100%",
|
|
39
37
|
* maxWidth: "800px",
|
|
@@ -50,7 +48,7 @@ export type ComponentProps = {
|
|
|
50
48
|
*
|
|
51
49
|
* @see {@link Onboarding.Element | The **Element** created to render `<Onboarding />`}
|
|
52
50
|
*/
|
|
53
|
-
export declare const Component: ({ defaultShipFromAddress,
|
|
51
|
+
export declare const Component: ({ defaultShipFromAddress, onComplete, partnerName }: ComponentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
54
52
|
/**
|
|
55
53
|
* # Registered Onboarding Element
|
|
56
54
|
*
|
|
@@ -135,7 +133,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
135
133
|
dimensions: string;
|
|
136
134
|
estimatedShipping: string;
|
|
137
135
|
items: string;
|
|
138
|
-
orderDate: string;
|
|
136
|
+
orderDate: string; /** If provided, the address form will be pre-filled */
|
|
139
137
|
orderValue: string;
|
|
140
138
|
requestedShipping: string;
|
|
141
139
|
shipDate: string;
|
|
@@ -158,10 +156,10 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
158
156
|
vatNumber: string;
|
|
159
157
|
vatRegistrationTooltip: string;
|
|
160
158
|
vatFormText: string;
|
|
161
|
-
vatFormRegisterLater: string;
|
|
159
|
+
vatFormRegisterLater: string; /** If provided, the address form will be pre-filled */
|
|
162
160
|
vatNumberInputHint: string;
|
|
163
161
|
vatNumberInputPlaceholder: string;
|
|
164
|
-
verifiedVat: string;
|
|
162
|
+
verifiedVat: string; /** Invoked when the onboarding process is completed. */
|
|
165
163
|
vatFormErrors: {
|
|
166
164
|
invalidFieldValue: string;
|
|
167
165
|
verificationFailure: string;
|
|
@@ -171,7 +169,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
171
169
|
genericText: string;
|
|
172
170
|
};
|
|
173
171
|
};
|
|
174
|
-
"
|
|
172
|
+
"manage-carriers": {
|
|
175
173
|
title: string;
|
|
176
174
|
headers: {
|
|
177
175
|
accountCarriers: string;
|
|
@@ -201,7 +199,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
201
199
|
info: string;
|
|
202
200
|
};
|
|
203
201
|
vatSettings: {
|
|
204
|
-
title: string;
|
|
202
|
+
title: string;
|
|
205
203
|
};
|
|
206
204
|
carriers: {
|
|
207
205
|
title: string;
|
|
@@ -249,6 +247,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
249
247
|
title: string;
|
|
250
248
|
};
|
|
251
249
|
};
|
|
250
|
+
noFundingSource: string;
|
|
252
251
|
};
|
|
253
252
|
"rate-details": {
|
|
254
253
|
total: string;
|
|
@@ -272,7 +271,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
272
271
|
location_fee: string;
|
|
273
272
|
oversize: string;
|
|
274
273
|
returns: string;
|
|
275
|
-
notifications: string;
|
|
274
|
+
notifications: string;
|
|
276
275
|
tip: string;
|
|
277
276
|
duties_and_taxes: string;
|
|
278
277
|
brokerage_fee: string;
|
|
@@ -420,7 +419,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
420
419
|
welcome: string;
|
|
421
420
|
messageLine1: string;
|
|
422
421
|
partnerMessageLine1: string;
|
|
423
|
-
messageLine2: string;
|
|
422
|
+
messageLine2: string;
|
|
424
423
|
};
|
|
425
424
|
stepLabel: {
|
|
426
425
|
accountRegistration: string;
|
|
@@ -433,6 +432,12 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
433
432
|
subtitle: string;
|
|
434
433
|
inlineMessage: string;
|
|
435
434
|
};
|
|
435
|
+
errors: {
|
|
436
|
+
noCarriers: {
|
|
437
|
+
title: string;
|
|
438
|
+
subtitle: string;
|
|
439
|
+
};
|
|
440
|
+
};
|
|
436
441
|
success: {
|
|
437
442
|
title: string;
|
|
438
443
|
subtitle: string;
|
|
@@ -478,6 +483,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
478
483
|
returnToAddressIsDifferent: string;
|
|
479
484
|
setDefault: string;
|
|
480
485
|
shipFrom: string;
|
|
486
|
+
noWarehouses: string;
|
|
481
487
|
};
|
|
482
488
|
"manage-funding": {
|
|
483
489
|
actions: {
|
|
@@ -525,6 +531,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
525
531
|
errors: {
|
|
526
532
|
balanceUnknown: string;
|
|
527
533
|
unableToFindBalance: string;
|
|
534
|
+
noFundingSource: string;
|
|
528
535
|
};
|
|
529
536
|
byoc: {
|
|
530
537
|
invoiceNotification: string;
|
|
@@ -557,11 +564,11 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
557
564
|
title: string;
|
|
558
565
|
dimensions: {
|
|
559
566
|
title: string;
|
|
560
|
-
standard: string;
|
|
567
|
+
standard: string;
|
|
561
568
|
metric: string;
|
|
562
569
|
};
|
|
563
570
|
weight: {
|
|
564
|
-
title: string;
|
|
571
|
+
title: string;
|
|
565
572
|
standard: string;
|
|
566
573
|
g: string;
|
|
567
574
|
kg: string;
|
|
@@ -576,13 +583,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
576
583
|
shipmentId: string;
|
|
577
584
|
shipDate: string;
|
|
578
585
|
shipTo: string;
|
|
579
|
-
};
|
|
580
|
-
* # Onboarding Component Props
|
|
581
|
-
*
|
|
582
|
-
* - These are the base props that will be passed into the `<Onboarding />` component.
|
|
583
|
-
*
|
|
584
|
-
* @see {@link Onboarding.Component | This prop types usage in the `<Onboarding />` component}
|
|
585
|
-
*/
|
|
586
|
+
};
|
|
586
587
|
actions: {
|
|
587
588
|
download: {
|
|
588
589
|
pdf: string;
|
|
@@ -612,9 +613,16 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
612
613
|
disconnect: string;
|
|
613
614
|
disconnectCarrier: string;
|
|
614
615
|
};
|
|
616
|
+
/**
|
|
617
|
+
* # Onboarding Component Props
|
|
618
|
+
*
|
|
619
|
+
* - These are the base props that will be passed into the `<Onboarding />` component.
|
|
620
|
+
*
|
|
621
|
+
* @see {@link Onboarding.Component | This prop types usage in the `<Onboarding />` component}
|
|
622
|
+
*/
|
|
615
623
|
noCarriersDescription: string;
|
|
616
624
|
registrationForm: {
|
|
617
|
-
error: string;
|
|
625
|
+
error: string; /** If provided, the address form will be pre-filled */
|
|
618
626
|
title: string;
|
|
619
627
|
betaWarning: string;
|
|
620
628
|
};
|
|
@@ -630,6 +638,9 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
630
638
|
toastTitle: string;
|
|
631
639
|
toastBody: string;
|
|
632
640
|
};
|
|
641
|
+
deleteCarrierErrorTitle: string;
|
|
642
|
+
deleteCarrierErrorMessage: string;
|
|
643
|
+
loadingDeletingCarrier: string;
|
|
633
644
|
};
|
|
634
645
|
common: {
|
|
635
646
|
actions: {
|
|
@@ -641,13 +652,6 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
641
652
|
continue: string;
|
|
642
653
|
delete: string;
|
|
643
654
|
edit: string;
|
|
644
|
-
/**
|
|
645
|
-
* # Onboarding Component Props
|
|
646
|
-
*
|
|
647
|
-
* - These are the base props that will be passed into the `<Onboarding />` component.
|
|
648
|
-
*
|
|
649
|
-
* @see {@link Onboarding.Component | This prop types usage in the `<Onboarding />` component}
|
|
650
|
-
*/
|
|
651
655
|
hide: string;
|
|
652
656
|
parse: string;
|
|
653
657
|
purchase: string;
|
|
@@ -665,10 +669,10 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
665
669
|
countryCode: string;
|
|
666
670
|
addressLine1: string;
|
|
667
671
|
addressLine2: string;
|
|
668
|
-
cityLocality: string;
|
|
672
|
+
cityLocality: string; /** The partner responsible for the currently onboarding seller. This is typically the name of the entity that owns the host application. */
|
|
669
673
|
stateProvince: string;
|
|
670
674
|
postalCode: string;
|
|
671
|
-
phone: string;
|
|
675
|
+
phone: string;
|
|
672
676
|
email: string;
|
|
673
677
|
addressResidentialIndicator: string;
|
|
674
678
|
};
|
|
@@ -676,39 +680,6 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
676
680
|
subFields: {
|
|
677
681
|
optional: string;
|
|
678
682
|
};
|
|
679
|
-
/**
|
|
680
|
-
* # Onboarding Component
|
|
681
|
-
*
|
|
682
|
-
* - The `<Onboarding />` component is used to onboard a new user to the ShipEngine platform. This
|
|
683
|
-
* component will allow the user to create a warehouse, register a carrier, and create a funding
|
|
684
|
-
* source for their account. This is everything a user needs to begin fulfilling their shipments
|
|
685
|
-
* using the ShipEngine Platform.
|
|
686
|
-
*
|
|
687
|
-
* @param ComponentProps The base props that will be passed into the `<Onboarding />` component.
|
|
688
|
-
*
|
|
689
|
-
* @returns Element An EmotionJSX.Element that will render the `<Onboarding />` component
|
|
690
|
-
* with all the appropriate wrappers.
|
|
691
|
-
*
|
|
692
|
-
* @example
|
|
693
|
-
* You can see how the `<Component />` is used in the `createElement` function call below.
|
|
694
|
-
* ```tsx
|
|
695
|
-
* export const Element = alchemy.createElement(Component, ErrorFallback, {
|
|
696
|
-
* css: {
|
|
697
|
-
* height: "100%",
|
|
698
|
-
* maxWidth: "800px",
|
|
699
|
-
* minWidth: "440px",
|
|
700
|
-
* overflow: "auto",
|
|
701
|
-
* scrollbarGutter: "stable both-edges",
|
|
702
|
-
* width: "100%",
|
|
703
|
-
* },
|
|
704
|
-
* resources: { en },
|
|
705
|
-
* });
|
|
706
|
-
* ```
|
|
707
|
-
*
|
|
708
|
-
* <br />
|
|
709
|
-
*
|
|
710
|
-
* @see {@link Onboarding.Element | The **Element** created to render `<Onboarding />`}
|
|
711
|
-
*/
|
|
712
683
|
parserFields: {
|
|
713
684
|
fullAddress: string;
|
|
714
685
|
};
|
|
@@ -772,6 +743,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
772
743
|
};
|
|
773
744
|
customs: {
|
|
774
745
|
addDeclaration: string;
|
|
746
|
+
noResults: string;
|
|
775
747
|
contents: {
|
|
776
748
|
documents: string;
|
|
777
749
|
gift: string;
|
|
@@ -779,6 +751,14 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
779
751
|
returnedGoods: string;
|
|
780
752
|
sample: string;
|
|
781
753
|
};
|
|
754
|
+
taxIds: {
|
|
755
|
+
sectionTitle: string;
|
|
756
|
+
addTaxId: string;
|
|
757
|
+
sectionTitleTooltip: string;
|
|
758
|
+
entityTypeTooltipText: string;
|
|
759
|
+
entityTypeTooltipPointOne: string;
|
|
760
|
+
entityTypeTooltipPointTwo: string;
|
|
761
|
+
};
|
|
782
762
|
currencyChange: string;
|
|
783
763
|
declarations: string;
|
|
784
764
|
descriptionTooltip: {
|
|
@@ -796,6 +776,11 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
796
776
|
sku: string;
|
|
797
777
|
value: string;
|
|
798
778
|
valueQuantity: string;
|
|
779
|
+
taxId: string;
|
|
780
|
+
taxIdType: string;
|
|
781
|
+
taxIdTypeValue: string;
|
|
782
|
+
taxIssuingAuthority: string;
|
|
783
|
+
entityType: string;
|
|
799
784
|
};
|
|
800
785
|
nonDelivery: {
|
|
801
786
|
returnToSender: string;
|
|
@@ -868,6 +853,8 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
868
853
|
shipment: string;
|
|
869
854
|
shipments: string;
|
|
870
855
|
warehouses: string;
|
|
856
|
+
funding: string;
|
|
857
|
+
paymentMethod: string;
|
|
871
858
|
};
|
|
872
859
|
months: {
|
|
873
860
|
january: string;
|
|
@@ -946,6 +933,16 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
946
933
|
gram: string;
|
|
947
934
|
kilogram: string;
|
|
948
935
|
};
|
|
936
|
+
actionsMenu: {
|
|
937
|
+
menuTitle: string;
|
|
938
|
+
actions: {
|
|
939
|
+
printLabel: string;
|
|
940
|
+
voidLabel: string;
|
|
941
|
+
printForms: string;
|
|
942
|
+
edit: string;
|
|
943
|
+
remove: string;
|
|
944
|
+
};
|
|
945
|
+
};
|
|
949
946
|
ZnVuZGluZ19zb3VyY2VfaWQgbXVzdCBiZSBhbiBpbnRlZ2Vy: string;
|
|
950
947
|
T25seSByZXNpZGVudGlhbCBkZWxpdmVyeSBhZGRyZXNzZXMgYXJlIGFsbG93ZWQgZm9yIFVQUyBHcm91bmQgU2F2ZXIu: string;
|
|
951
948
|
"VGhlIHNlbGVjdGVkIHNlcnZpY2UgaW5jbHVkZXMgaW5zdXJhbmNlIGZvciBhbiBpbnN1cmVkIGFtb3VudCB1cCB0byAkMTAwLgo=": string;
|
|
@@ -961,17 +958,14 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
961
958
|
};
|
|
962
959
|
"account-settings": {
|
|
963
960
|
messages: {
|
|
964
|
-
|
|
961
|
+
transactionHistory: {
|
|
962
|
+
noTransactions: string;
|
|
963
|
+
};
|
|
964
|
+
noFundingSourceDescription: string;
|
|
965
|
+
noFundingSourceAction: string;
|
|
965
966
|
};
|
|
966
967
|
title: string;
|
|
967
968
|
sections: {
|
|
968
|
-
/**
|
|
969
|
-
* # Onboarding Component Props
|
|
970
|
-
*
|
|
971
|
-
* - These are the base props that will be passed into the `<Onboarding />` component.
|
|
972
|
-
*
|
|
973
|
-
* @see {@link Onboarding.Component | This prop types usage in the `<Onboarding />` component}
|
|
974
|
-
*/
|
|
975
969
|
accountBalance: string;
|
|
976
970
|
paymentMethod: string;
|
|
977
971
|
transactionHistory: string;
|
package/story-notes.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{J as t,K as e,M as a,N as r,O as n,Q as s,U as i,X as o,Y as p,Z as c,_ as l,$ as d,a0 as g,a1 as m,a2 as u,a3 as h}from"./actions-menu.js";import{jsxs as b,Fragment as x,jsx as S}from"@emotion/react/jsx-runtime";import{Typography as f}from"@shipengine/giger";var C=Object.freeze({__proto__:null,CheckboxInput:t,CreditCardInput:e,DatePicker:a,ExpirationInput:r,InputGroup:n,transform:s,MoneyInput:i,NumberInput:o,RateSelect:p,SelectAutoComplete:c,Select:l,SelectWithCategories:d,SubmitButton:g,Switch:m,TextArea:u,TextInput:h});const I=({children:t,notes:e})=>b(x,{children:[b("div",Object.assign({css:()=>({backgroundColor:"lightsteelblue",marginBottom:"16px",padding:"16px",paddingLeft:"32px"})},{children:[S(f,Object.assign({variant:"heading5"},{children:"Story notes:"})),S("ul",Object.assign({css:t=>({"> li":{marginTop:t.spacing(1)}})},{children:e.map((t=>S("li",{children:t},t)))}))]})),S("hr",{css:()=>({backgroundColor:"transparent",borderTop:"1px dotted lightgrey",marginBottom:"16px"})}),t]});export{I as S,C as f};
|
package/suspend-text.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as e,jsx as n}from"@emotion/react/jsx-runtime";import{useRef as t,useLayoutEffect as r,useState as i,useMemo as o,useCallback as a}from"react";import{Icon as s,Table as c,TableFooter as l,TableHeader as d,TableHeaderRow as g,TableHeaderCell as h,Checkbox as p,TableBody as m,TableRow as u,TableBodyCell as f,Button as b,ButtonVariant as w,IconSize as C,DropdownOptionList as v,Option as O,Pagination as y,Skeleton as S,SkeletonAnimation as j,SkeletonVariant as x}from"@shipengine/giger";import{IconNames as k}from"@shipengine/giger-theme";import{c as E}from"./validation.js";import{G as P}from"./actions-menu.js";import{c as D,f as I}from"./formatString.js";import{useTranslation as T,Trans as z}from"react-i18next";const A=E({container:{backgroundColor:"#11003A"},getChildrenStyles:e=>n=>({height:e?"90%":"0",overflow:"scroll"}),getDrawerStyles:e=>n=>({backgroundColor:"#11003A",bottom:0,height:e?"50%":`${n.spacing(6)}px`,minWidth:"440px",position:"fixed",transformOrigin:"bottom",transition:"height 0.5s;"}),header:e=>({alignItems:"center",color:"#fff",display:"flex",height:e.spacing(6),justifyContent:"space-between",padding:e.spacing(1)})}),R=({children:i,headerContent:o,isOpen:a,toggleDrawer:c})=>{const l=t(null);return r((()=>{const e=()=>{const e=l.current;e&&e.parentElement&&(e.style.width=`${e.parentElement.clientWidth}px`)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),e("div",Object.assign({"aria-label":"Drawer",css:A.getDrawerStyles(a),ref:l},{children:[e("header",Object.assign({"aria-expanded":a,css:A.header},{children:[n("div",Object.assign({onClick:c,onKeyDown:e=>{"Enter"===e.key&&c()},role:"button",tabIndex:0},{children:n(s,{css:{transform:`rotate(${a?"-90":"90"}deg)`},name:k.PAGINATION_LEFT})})),o]})),n("div",Object.assign({"aria-labelledby":"drawer",css:A.getChildrenStyles(a),role:"region"},{children:i}))]}))},W=({date:e,short:t})=>{const{locale:r}=P();return n("div",{children:n("div",{children:t?D(e,r):I(e,r)})})},M=E({checkboxHeader:e=>({width:e.spacing(6)}),table:{"*":{overflow:"hidden",textOverflow:"clip !important"}}}),_=({columns:t,data:r,footerContent:s,onRowClick:b,useCheckboxes:w=!1})=>{var C,v,O;const[y,S]=i(null!==(C=null==r?void 0:r.map((()=>!1)))&&void 0!==C?C:[]),j=o((()=>y.length>0&&y.every((e=>e))),[y]),x=o((()=>y.some((e=>e))),[y]),k=a((e=>{S((n=>{const t=[...n];return t[e]=!t[e],t}))}),[]),E=a((e=>{S((n=>{const t=[...n];for(const n of t.entries())t[n[0]]=e;return t}))}),[]);return n(c,Object.assign({css:M.table,"data-testid":"grid",footer:s&&n(l,{children:s}),header:n(d,{children:e(g,{children:[w?n(h,Object.assign({css:M.checkboxHeader},{children:n(p,{checked:null!==(v=j||x)&&void 0!==v&&v,indeterminate:null!==(O=!j&&x)&&void 0!==O&&O,onChange:e=>E(e.target.checked)})})):null,t.map((e=>e.headerContent)).map(((e,t)=>n(h,{children:e},t)))]})})},{children:n(m,{children:r.map(((r,i)=>{var o;return e(u,Object.assign({onClick:b?()=>b(r):void 0},{children:[w?n(f,{children:n(p,{checked:null!==(o=y[i])&&void 0!==o&&o,onChange:()=>k(i)})}):null,t.map(((e,t)=>e.renderCellContent?n(f,{children:e.renderCellContent(r)},t):null))]}),i)}))})}))},H=E({footer:{"> *":{borderTop:"0 !important"},alignItems:"center",display:"flex",justifyContent:"space-between",width:"100%"},leftFooter:e=>({display:"flex",margin:e.spacing(2),span:{fontWeight:e.typography.fontWeight.bold}}),rowCount:e=>({alignItems:"center",display:"flex",marginRight:e.spacing(4),whiteSpace:"pre"}),rowCountDropDown:{"> * > *":{justifyContent:"center !important"}},rowsActions:e=>({"#selected-row":{":hover":{backgroundColor:"transparent"},borderRadius:e.borderRadius.XS,color:e.palette.black,padding:e.spacing(1),paddingRight:e.spacing(.5)},alignItems:"baseline",display:"flex",span:{alignSelf:"center"}})}),N=[5,10,25,50],F=({currentPageSize:r,pagingData:o,rowCountSelection:c=N,onPageSelect:l,onPageSizeSelect:d})=>{const[g,h]=i(!1),p=t(null),{t:m}=T(),u=a((()=>h((e=>!e))),[]);return e("div",Object.assign({css:H.footer},{children:[e("div",Object.assign({css:H.leftFooter},{children:[n("div",Object.assign({css:H.rowCount},{children:n(z,{components:[n("b",{style:{fontWeight:"bold"}},"1")],count:o.total,i18nKey:"common:grid.row-count",values:{firstIndex:0!==o.total?1+(o.page-1)*r:0,lastIndex:Math.min(o.total,o.page*r)}})})),e("div",Object.assign({css:H.rowsActions},{children:[m("common:grid.rows"),n(b,Object.assign({id:"selected-row",onClick:()=>u(),ref:p,variant:w.TEXT},{children:r})),n(s,g?{name:k.CHEVRON_TOP,onClick:()=>u(),size:C.SIZE_MEDIUM}:{name:k.CHEVRON_BOTTOM,onClick:()=>u(),size:C.SIZE_MEDIUM}),n(v,Object.assign({css:H.rowCountDropDown,dropdownWidth:"max-content",isOpen:g,onChange:()=>u(),onClickAway:e=>{var n;(null===(n=p.current)||void 0===n?void 0:n.contains(e.target))||u()},placement:"bottom",reference:p.current},{children:c.map((e=>n(O,Object.assign({onClick:()=>d(e),value:String(e)},{children:e}),e)))}))]}))]})),n("div",{children:n(y,{boundaryPagesToShow:5,currentPage:o.page,onPageChange:l,totalPages:o.pages})})]}))},G=(e=10)=>{const[n,t]=i(1),[r,o]=i(e);return{page:n,pagerProps:{currentPage:n,currentPageSize:r,onPageSelect:e=>{t(e)},onPageSizeSelect:e=>{o(e)}},pageSize:r}},L=({children:e,loading:t})=>t?n(S,{animation:j.WAVE,variant:x.TEXT}):n("span",{children:e});export{W as C,R as D,_ as G,F as P,L as S,G as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as n}from"@emotion/react/jsx-runtime";import{S as r,c as i,e as a,u as s,M as o,d as l,E as c,f as d,U as p,g,h,i as u,P as m,T as b}from"./use-unit-settings.js";import{T as f,h as C,m as v,r as O,a8 as j,e as x}from"./actions-menu.js";import{O as w,S as y,Q as _,T}from"./formatString.js";import{useTranslation as S}from"react-i18next";import{Icon as k,IconSize as D,Select as E,Option as W,Input as z,Popover as R,Typography as $,ButtonIcon as I,Tag as P,TagColor as F}from"@shipengine/giger";import{IconNames as L}from"@shipengine/giger-theme";import{useListCarriers as A,useListLabels as B,useListSalesOrderShipments as M,useListShipments as N}from"@shipengine/react-api";import{D as U,u as K,C as G,S as H,G as V,P as Z}from"./suspend-text.js";import{useState as q,useCallback as Q,useRef as J,useContext as X,createContext as Y}from"react";import{c as ee}from"./validation.js";import{d as te}from"./use-toggle.js";const ne=ee({category:{alignItems:"center",cursor:"pointer",display:"flex",flexDirection:"row",justifyContent:"space-between"},colorPicker:e=>({"&::-webkit-color-swatch":{border:`1px solid ${e.palette.gray.light}`,borderRadius:"4px",padding:0},"&::-webkit-color-swatch-wrapper":{padding:0},alignSelf:"center",appearance:"none",background:"none",border:0,cursor:"pointer",height:e.spacing(4.25),outline:"none",width:e.spacing(4.25)}),container:e=>({marginBottom:e.spacing(2)}),input:e=>({border:`1px solid ${e.palette.gray.light}`,borderRadius:"4px",color:e.palette.gray.main,fontSize:"14px",padding:e.spacing(1)}),inputContainer:e=>({alignItems:"center",display:"flex",flexDirection:"row",justifyContent:"space-between",padding:`${e.spacing(2)}px 0`}),wrapper:e=>({display:"flex",gap:e.spacing(1)})}),re=({paletteConfig:n,onUpdatePaletteConfig:r,formatKey:i})=>{const[a,s]=q(new Set),o=e=>{s((t=>{const n=new Set(t);return n.has(e)?new Set([...n].filter((t=>t!==e))):new Set([...n,e])}))},l=Q(((e,t,i)=>{const a=(e=>{if(e)return e.match(/^#[0-9A-Fa-f]{0,6}$/)?e:e.match(/^[0-9A-Fa-f]{6}$/)?`#${e}`:void 0})(i),s=Object.assign(Object.assign({},n||{}),{[e]:Object.assign(Object.assign({},(null==n?void 0:n[e])||{}),{[t]:a})});r(s)}),[r,n]);return e("div",Object.assign({"data-test-id":"color-palette-editor"},{children:n&&Object.keys(n).map((r=>t("div",Object.assign({css:ne.container,id:r},{children:[t("div",Object.assign({"aria-expanded":a.has(r),css:ne.category,onClick:e=>{e.preventDefault(),o(r)},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),o(r))},role:"button",tabIndex:0},{children:[e("p",{children:w(r)}),e(k,{name:a.has(r)?L.CHEVRON_TOP:L.CHEVRON_BOTTOM,size:D.SIZE_REGULAR})]})),a.has(r)&&Object.keys(n[r]).map((a=>t("div",Object.assign({css:ne.inputContainer,id:"input-container"},{children:[e("label",Object.assign({css:{fontWeight:"bold"},htmlFor:`${r}.${a}`},{children:i(a)})),t("form",Object.assign({css:ne.wrapper},{children:[e("input",{css:ne.input,onChange:e=>{e.preventDefault(),l(r,a,e.target.value)},onKeyDown:e=>{"Enter"===e.key&&e.preventDefault()},type:"text",value:n[r][a]}),e("input",{css:ne.colorPicker,onChange:e=>l(r,a,e.target.value),type:"color",value:n[r][a]})]}))]}),a)))]}),r)))}))},ie=ee({input:e=>({border:`1px solid ${e.palette.gray.light}`,borderRadius:"4px",color:e.palette.gray.main,fontSize:"14px",maxWidth:e.spacing(16),padding:0}),keys:{fontSize:"16px",fontWeight:"bold",marginTop:"8px"},section:e=>({"& > div:first-child":{flexGrow:3},"& > div:last-child":{flexShrink:1},display:"flex",gap:e.spacing(1),justifyContent:"space-between"}),sectionContainer:e=>({marginBottom:e.spacing(4)}),select:e=>({border:`1px solid ${e.palette.gray.light}`,borderRadius:"4px",color:e.palette.gray.main,fontSize:"14px"})}),ae=({onUpdateTypographyConfig:r,typographyConfig:i,formatKey:a})=>{const s=Q(((e,t,n)=>{const a=Object.assign(Object.assign({},i||{}),{[e]:Object.assign(Object.assign({},(null==i?void 0:i[e])||{}),{[t]:n})});r(a)}),[r,i]),o=Q(((e,t)=>{if(e)return e[t]}),[]),l=(t,n)=>{var r;const a=[{label:"Normal",value:"400"},{label:"Semi Bold",value:"600"},{label:"Bold",value:"700"}],l=null===(r=o(i,t))||void 0===r?void 0:r.fontWeight.toString(),c=void 0!==l?a.find((e=>e.value===l)):void 0;return e(E,Object.assign({css:ie.select,label:"Font Weight",name:"font-weight",onChange:(e,r)=>s(t,n,null==r?void 0:r.value),value:c},{children:a.map((t=>e(W,Object.assign({value:t.value},{children:t.label}),t.value)))}))},c=(t,n)=>{var r;const a=null===(r=o(i,t))||void 0===r?void 0:r.fontSize.replace("px","");return e(z,{"aria-labelledby":`${t}.${n}`,css:ie.input,label:"Font Size(px)",onChange:e=>{e.target.value.match(/^\d{0,2}$/)&&s(t,n,`${e.target.value}px`)},value:a})},d=(t,r)=>{switch(r){case"fontWeight":return e(n,{children:l(t,r)});case"fontSize":return e(n,{children:c(t,r)});default:return null}};return e("div",{children:i&&Object.keys(i).map((n=>t("div",Object.assign({css:ie.sectionContainer},{children:[e("p",Object.assign({css:ie.keys,id:n},{children:a(n)})),e("section",Object.assign({css:ie.section},{children:Object.keys(i[n]).map((t=>e("div",Object.assign({id:`${n}.${t}`},{children:d(n,t)}),t)))}))]}),n)))})},se=ee({container:e=>({color:e.palette.gray.dark,display:"flex",flexDirection:"column",flexGrow:1,overflow:"hidden",position:"relative"}),content:e=>({display:"flex",flexDirection:"column",gap:e.spacing(3),padding:e.spacing(3)}),copy:e=>({backgroundColor:e.palette.white,borderRadius:"4px",padding:e.spacing(.5)}),drawerHeader:e=>({alignItems:"center",display:"flex",gap:e.spacing(2),justifyContent:"end",width:"50%"}),drawerWrapper:{display:"flex",justifyContent:"space-between",position:"relative"},header:{alignItems:"center",display:"flex",justifyContent:"space-between"},popoverWrapper:e=>({display:"flex",flexDirection:"column",gap:e.spacing(1)}),pre:e=>({backgroundColor:"#FFFFFF66",borderRadius:"8px",fontSize:"14px",padding:e.spacing(.3)}),presetOption:e=>({"&:hover":{backgroundColor:"theme.palette.gray.ultraLight"},backgroundColor:"transparent",borderRadius:"4px",fontSize:"14px",padding:e.spacing(1)}),presetsButton:e=>({"&:hover":{backgroundColor:"#d1d4d7"},backgroundColor:"#E4E5E7",borderRadius:"4px",cursor:"pointer",display:"flex",fontSize:"14px",gap:e.spacing(.5),padding:`${e.spacing(.5)}px ${e.spacing(1)}px`})}),oe=({themeConfig:n,onUpdateThemeConfig:r,presets:i,showDrawer:a})=>{const s=J(n),[o,l]=q(!1),c=Object.keys(n).flatMap((e=>{if("components"===e&&n[e]&&"object"==typeof n[e]){return Object.keys(n[e])}return[e]})).map((e=>"palette"===e?{label:"Color Palette",value:"Color Palette"}:{label:w(e),value:w(e)})),[d,p]=q(c.sort()[0].value),g=e=>y(_(e)),h=J(null),[u,m]=te(!1),b=e=>{r(e)};return t("div",Object.assign({"aria-label":"Theme Creator",css:se.container,"data-testid":"theme-creator",role:"region"},{children:[t("div",Object.assign({css:se.content},{children:[t("div",Object.assign({css:se.header},{children:[e(f,{onSelectTab:e=>{p(e)},selectedTab:d,tabs:c}),i?t("div",{children:[t("button",Object.assign({"aria-controls":"presets-popover","aria-expanded":u,css:se.presetsButton,onClick:e=>{e.preventDefault(),m()},ref:h},{children:["Presets",e(k,{name:L.CARET_BOTTOM,size:D.SIZE_SMALL})]})),e(R,Object.assign({container:document.querySelector("#theme-creator"),isOpen:u,onClickAway:()=>m(),placement:"bottom-end",reference:h.current},{children:t("div",Object.assign({css:se.popoverWrapper},{children:[e("button",Object.assign({"aria-label":"Set Default Theme",css:se.presetOption,onClick:e=>{e.preventDefault(),m(),b(s.current)},role:"menuitem"},{children:"Default"})),i.map((t=>e("button",Object.assign({"aria-label":`Set ${t.presetName} Theme`,css:se.presetOption,onClick:e=>{e.preventDefault(),m(),b(t.themeConfig)},role:"menuitem"},{children:t.presetName}),t.presetName)))]}))}))]}):e("button",Object.assign({"aria-label":"Set Default Theme",css:se.presetsButton,onClick:()=>{b(s.current)},role:"menuitem"},{children:"Reset to Default"}))]})),e($,Object.assign({role:"heading",variant:"heading4"},{children:`${d} Editor`})),((t,n)=>{var i;switch(n){case"Color Palette":return e(re,{formatKey:g,onUpdatePaletteConfig:e=>{r(Object.assign(Object.assign({},t),{palette:e}))},paletteConfig:t.palette});case"Typography":return e(ae,{formatKey:g,onUpdateTypographyConfig:e=>{r(Object.assign(Object.assign({},t),{components:Object.assign(Object.assign({},t.components),{Typography:e})}))},typographyConfig:null===(i=t.components)||void 0===i?void 0:i.Typography});default:return null}})(n,d)]})),a&&e(U,Object.assign({"aria-label":"Show themeConfig.js Code Drawer",headerContent:t("div",Object.assign({css:se.drawerHeader},{children:[e("pre",Object.assign({css:se.pre},{children:"themeConfig.js"})),a.copyToClipboardText&&e("div",Object.assign({css:se.copy},{children:e(C,{content:a.copyToClipboardText})}))]})),isOpen:o,toggleDrawer:()=>l(!o)},{children:a.content}))]}))},le=({onRedirectToOnboarding:t})=>e(r,{onRedirectToOnboarding:t}),ce=i(le,v,{css:{height:"100%",maxWidth:"800px",minWidth:"440px",width:"100%"},resources:{en:a}});var de=Object.freeze({__proto__:null,Component:le,Element:ce});const pe=()=>{const t=T(s(),[]);return e(o,Object.assign({},t))},ge=i(pe,v,{css:{height:"100%",maxWidth:"800px",minWidth:"440px",width:"100%"},resources:{en:a}});var he=Object.freeze({__proto__:null,Component:pe,Element:ge});const ue=({isModalFullScreen:t})=>{const n=T(l(),[]);return e(c,Object.assign({isModalFullScreen:t},n))},me=i(ue,v,{css:{height:"100%",maxWidth:"800px",minWidth:"440px",width:"100%"},resources:{en:a}});var be=Object.freeze({__proto__:null,Component:ue,Element:me});const fe=i((({onRowClick:n})=>{const{t:r}=S(["common","list-labels"]),{page:i,pageSize:a,pagerProps:s}=K(),{data:o,isLoading:l}=A(),{data:c,isLoading:d,isError:p,error:g}=B({page:i,pageSize:a}),h=(null==c?void 0:c.labels)?c.labels.filter((e=>e.shipmentId)).map((e=>e.shipmentId)):[],{data:u,isLoading:m}=M({shipmentIds:h});if(d)return e(O,{message:r("loading.labels")});if(p)throw new Error(g.map((e=>e.message)).join(", "));if(!c)throw new Error(r("errorMessages.unableToLoad.labels"));const b=[{headerContent:r("list-labels:headers.labelId"),renderCellContent:t=>e("div",{children:t.labelId})},{headerContent:r("list-labels:headers.created"),renderCellContent:t=>(null==t?void 0:t.shipDate)&&e(G,{date:t.shipDate})},{headerContent:r("list-labels:headers.shipTo"),renderCellContent:t=>{const n=null==u?void 0:u.find((e=>e.shipmentId===t.shipmentId)),r=n&&n.shipTo.addressLine1?e(j,{address:n.shipTo}):"--";return e(H,Object.assign({loading:m},{children:r}))}},{headerContent:r("list-labels:headers.service"),renderCellContent:n=>{if(!l&&o){const r=o.find((e=>e.carrierCode===n.carrierCode));if(r){const i=r.services.find((e=>e.serviceCode===n.serviceCode));if(i)return t("div",{children:[e(x,{carrierCode:n.carrierCode},n.carrierCode)," ",i.name]})}}return t(H,Object.assign({loading:l},{children:["`$",n.carrierCode," - $",n.serviceCode,"`"]}))}},{headerContent:e("div",{"aria-label":r("list-labels:headers.download")}),renderCellContent:t=>"completed"===t.status?e("div",Object.assign({css:{textAlign:"right"}},{children:e(I,{ariaDescribedby:"",children:r("list-labels:actions.download.pdf"),icon:L.DOWNLOAD,onClick:e=>{e.stopPropagation(),window.open(t.labelDownload.pdf)}})})):e("div",Object.assign({css:{textAlign:"right"}},{children:e(P,Object.assign({color:F.INFO},{children:t.status.toLocaleUpperCase()}))}))}];return e(V,{columns:b,data:c.labels,footerContent:e(Z,Object.assign({},s,{pagingData:c})),onRowClick:n})}),v,{css:{height:"100%",minWidth:"440px",width:"100%"},resources:{en:a}});var Ce=Object.freeze({__proto__:null,Element:fe});const ve=i((({onRowClick:t,shipmentStatus:n="pending"})=>{const{t:r}=S(["common","list-shipments"]),{page:i,pageSize:a,pagerProps:s}=K(),{data:o,isLoading:l,isError:c,error:d}=N({page:i,pageSize:a,shipmentStatus:n});if(l)return e(O,{message:r("loading.shipments")});if(c)throw new Error(d.map((e=>e.message)).join(", "));if(!o)throw new Error(r("errorMessages.unableToLoad.shipments"));const p=[{headerContent:r("list-shipments:headers.shipmentId"),renderCellContent:t=>e("div",{children:t.shipmentId})},{headerContent:r("list-shipments:headers.shipTo"),renderCellContent:t=>t.shipTo.addressLine1?e(j,{address:t.shipTo}):"--"},{headerContent:r("list-shipments:headers.shipDate"),renderCellContent:t=>t.shipDate?e(G,{date:t.shipDate}):"--"}];return e(V,{columns:p,data:o.shipments,footerContent:e(Z,Object.assign({},s,{pagingData:o})),onRowClick:t})}),v,{css:{height:"100%",minWidth:"440px",width:"100%"},resources:{en:a}});var Oe=Object.freeze({__proto__:null,Element:ve});const je=Y(void 0),xe=({children:t,editableTheme:n})=>{const[r,i]=q(n);return e(je.Provider,Object.assign({value:{setThemeConfig:i,themeConfig:r}},{children:t}))},we=()=>{const e=X(je);if(!e)throw new Error("useThemeConfigurator must be used within a ThemeConfiguratorProvider");return e},ye=t=>{var n=T(t,[]);return e(oe,Object.assign({},n))},_e=i(ye,v,{css:{height:"100%",maxWidth:"800px",minWidth:"440px",width:"100%"},resources:{en:a}});var Te=Object.freeze({__proto__:null,Component:ye,Element:_e});const Se=()=>{const t=T(d(),[]);return e(p,Object.assign({},t))},ke=i(Se,v,{css:{height:"100%",maxWidth:"800px",minWidth:"440px",width:"100%"},resources:{en:a}});var De=Object.freeze({__proto__:null,Component:Se,Element:ke});const Ee=({onRedirectToOnboarding:t})=>e(g,{onRedirectToOnboarding:t}),We=i(Ee,v,{css:{height:"100%",maxWidth:"800px",minWidth:"440px",width:"100%"},resources:{en:a}});var ze=Object.freeze({__proto__:null,Component:Ee,Element:We});const Re=()=>{const t=T(h(),[]);return e(u,Object.assign({},t))},$e=i(Re,v,{css:{height:"100%",maxWidth:"800px",minWidth:"440px",width:"100%"},resources:{en:a}});var Ie=Object.freeze({__proto__:null,Component:Re,Element:$e});const Pe=({onRedirectToOnboarding:t})=>e(m,{onRedirectToOnboarding:t}),Fe=i(Pe,v,{css:{height:"100%",maxWidth:"800px",minWidth:"440px",width:"100%"},resources:{en:a}});var Le=Object.freeze({__proto__:null,Component:Pe,Element:Fe});const Ae=()=>e(b,{}),Be=i(Ae,v,{css:{height:"100%",maxWidth:"800px",minWidth:"440px",width:"100%"},resources:{en:a}});var Me=Object.freeze({__proto__:null,Component:Ae,Element:Be});export{xe as T,he as a,be as b,De as c,ze as d,Ie as e,Me as f,Ce as l,de as m,Le as p,Oe as s,Te as t,we as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useTranslation as e}from"react-i18next";import{jsx as l,jsxs as a}from"@emotion/react/jsx-runtime";import{useRef as t,useState as o,useContext as r,createContext as n}from"react";import{P as s}from"./use-toggle.js";const i=()=>{const{t:l}=e("common");return[{label:l("months.january"),value:"01"},{label:l("months.february"),value:"02"},{label:l("months.march"),value:"03"},{label:l("months.april"),value:"04"},{label:l("months.may"),value:"05"},{label:l("months.june"),value:"06"},{label:l("months.july"),value:"07"},{label:l("months.august"),value:"08"},{label:l("months.september"),value:"09"},{label:l("months.october"),value:"10"},{label:l("months.november"),value:"11"},{label:l("months.december"),value:"12"}]},u=n(void 0);u.displayName="PageLayoutContext";const c=({children:e})=>{const r=t(null),n=t(null),[i]=o({FooterPortal:e=>l(s,Object.assign({target:n},{children:e.children})),HeaderPortal:e=>l(s,Object.assign({target:r},{children:e.children}))});return l(u.Provider,Object.assign({value:i},{children:a("div",Object.assign({css:{display:"flex",flexDirection:"column",height:"100%"}},{children:[l("div",{css:{flexShrink:0},id:"page-layout-header",ref:r}),l("div",Object.assign({css:{overflow:"scroll"},id:"page-layout-content"},{children:e})),l("div",{css:{flexShrink:0},id:"page-layout-footer",ref:n})]}))}))},m=()=>{const e=r(u);if(!e)throw new Error("usePageLayout must be called from within the scope of PageLayoutProvider");return e};export{c as P,m as a,i as u};
|