@shipengine/elements 0.13.0 → 0.14.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 (48) hide show
  1. package/components/accordion/accordion.d.ts +2 -2
  2. package/components/error-boundary/error-boundary.d.ts +2 -2
  3. package/components/field/create-field-controller.d.ts +3 -3
  4. package/components/field/input-group/input-group.d.ts +1 -1
  5. package/components/field/money-input/money-input.d.ts +4 -4
  6. package/components/field/rate-card/cost-breakdown/cost-breakdown.d.ts +4 -4
  7. package/components/field/rate-select/rate-select.d.ts +1 -1
  8. package/components/field/select/select.d.ts +1 -1
  9. package/components/field/switch/switch.d.ts +2 -2
  10. package/components/items-breakdown/items-breakdown.d.ts +3 -3
  11. package/components/organisms/manual-funding-form/index.d.ts +1 -0
  12. package/components/organisms/manual-funding-form/manual-funding-form.d.ts +4 -1
  13. package/components/settings-card/settings-card.d.ts +2 -2
  14. package/components/templates/address-form/address-schema.d.ts +98 -98
  15. package/components/templates/address-preference-display/address-preference-display.d.ts +1 -1
  16. package/components/templates/billing-form/billing-schema.d.ts +26 -26
  17. package/components/templates/customs-item-form/customs-item-form-schema.d.ts +2 -2
  18. package/components/templates/funding-methods/funding-methods.d.ts +8 -1
  19. package/components/templates/label/label.d.ts +3 -3
  20. package/components/templates/rate-form/rate-form.d.ts +2 -2
  21. package/components/templates/sales-order/sales-order.d.ts +1 -1
  22. package/components/templates/shipment-form/shipment-form.d.ts +4 -4
  23. package/components/templates/shipment-form/shipment-schema.d.ts +140 -140
  24. package/elements/components/configure-shipment/configure-shipment.d.ts +1 -1
  25. package/elements/components/configure-shipment/hooks/use-address.d.ts +1 -1
  26. package/elements/components/configure-shipment/hooks/use-customs.d.ts +1 -1
  27. package/elements/components/configure-shipment/hooks/use-presets.d.ts +1 -1
  28. package/elements/components/configure-shipment/hooks/use-rates-form.d.ts +1 -1
  29. package/elements/components/configure-shipment/hooks/use-shipment-form.d.ts +2 -2
  30. package/factories/shipengine/address.d.ts +1 -1
  31. package/factories/shipengine/sales-order.d.ts +1 -1
  32. package/factories/shipengine/shipment.d.ts +2 -2
  33. package/hooks/options/use-insurance-provider-options.d.ts +1 -1
  34. package/hooks/options/use-shipping-presets-options.d.ts +1 -1
  35. package/hooks/use-elements.d.ts +3 -3
  36. package/hooks/use-page-layout.d.ts +1 -1
  37. package/index.cjs +8378 -8195
  38. package/index.js +4969 -4786
  39. package/locales/en/index.d.ts +5 -0
  40. package/package.json +5 -5
  41. package/schemas/shipengine/phone.d.ts +1 -1
  42. package/testing/swr.d.ts +5 -5
  43. package/types/carrier-metadata.d.ts +11 -0
  44. package/utilities/form-logger.d.ts +1 -1
  45. package/utilities/rates.d.ts +3 -3
  46. package/utilities/shipengine/weight.d.ts +1 -1
  47. package/utilities/validation.d.ts +1 -1
  48. package/components/field/input-group/input-group.styles.d.ts +0 -2
@@ -3,10 +3,10 @@ import { WithChildrenCommonProps } from "@packlink/giger";
3
3
  type AccordionProps = WithChildrenCommonProps<{
4
4
  /** Flag to indicate if the Accordion must appear expanded */
5
5
  initialExpanded?: boolean;
6
- /** Title to show */
7
- title?: string;
8
6
  /** Element to render at the right part of the summary */
9
7
  rightContent?: JSX.Element;
8
+ /** Title to show */
9
+ title?: string;
10
10
  }>;
11
11
  export declare const Accordion: ({ initialExpanded, title, children, rightContent, ...rest }: AccordionProps) => import("@emotion/react/jsx-runtime").JSX.Element;
12
12
  export {};
@@ -4,12 +4,12 @@ export type FallbackRender = (props: {
4
4
  }) => React.ReactElement;
5
5
  export type ErrorBoundaryProps = {
6
6
  children?: React.ReactNode | (() => React.ReactNode);
7
+ element?: string;
7
8
  fallback?: React.ReactElement | FallbackRender;
8
9
  onError?: (err: Error, context: {
9
- element?: string;
10
10
  componentStack: string;
11
+ element?: string;
11
12
  }) => void;
12
- element?: string;
13
13
  };
14
14
  type ErrorBoundaryState = {
15
15
  error: Error | null;
@@ -7,12 +7,12 @@ export type FieldControllerProps<NP, TFieldValues extends FieldValues = FieldVal
7
7
  control: NonNullable<UseControllerProps<TFieldValues, TName>["control"]>;
8
8
  defaultValue?: Partial<UseControllerProps<TFieldValues, TName>["defaultValue"]>;
9
9
  disabled?: boolean;
10
+ displayErrors?: boolean;
11
+ displayLabel?: boolean;
10
12
  errors?: string[];
13
+ inputOnly?: boolean;
11
14
  label: string;
12
15
  labelWeight?: FieldLabelProps["weight"];
13
- displayLabel?: boolean;
14
- displayErrors?: boolean;
15
- inputOnly?: boolean;
16
16
  } & Omit<FieldLabelProps, "children" | "weight"> & Omit<UseControllerProps<TFieldValues, TName>, "defaultValue"> & ControlledFormInputProps<NP>;
17
17
  type FieldControllerOptions = {
18
18
  inputOnly?: boolean;
@@ -6,8 +6,8 @@ export type InputGroupItem = React.ReactElement<ControlledFieldProps>;
6
6
  type InputGroupProps = {
7
7
  children: InputGroupItem[];
8
8
  disabled?: boolean;
9
- trigger: UseFormTrigger<any>;
10
9
  divider?: string[];
10
+ trigger: UseFormTrigger<any>;
11
11
  };
12
12
  export declare const InputGroup: ControlledField<FieldLabelProps, InputGroupProps, "errors" | "shouldDisplayErrors" | "withBottomMargin">;
13
13
  export {};
@@ -1,5 +1,5 @@
1
- import * as SE from "@shipengine/types";
2
1
  import { InputProps } from "@packlink/giger";
2
+ import * as SE from "@shipengine/types";
3
3
  import { ControlledField } from "../create-field-controller";
4
4
  export declare const transform: {
5
5
  in: ({ amount, currency }?: Partial<{
@@ -18,13 +18,13 @@ type MoneyInputOptions = {
18
18
  signed?: boolean;
19
19
  };
20
20
  type MoneyInputProps = {
21
+ onChange?: (value: SE.Money) => void;
22
+ /** Flag to render currency symbol at the left */
23
+ showCurrencySymbol?: boolean;
21
24
  value?: Partial<{
22
25
  amount: number | string;
23
26
  currency: SE.Currency;
24
27
  }>;
25
- /** Flag to render currency symbol at the left */
26
- showCurrencySymbol?: boolean;
27
- onChange?: (value: SE.Money) => void;
28
28
  } & Omit<InputProps, "onChange" | "value">;
29
29
  export declare const MoneyInput: ControlledField<MoneyInputProps, MoneyInputOptions>;
30
30
  export {};
@@ -1,11 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  import * as SE from "@shipengine/types";
3
3
  export interface CostBreakdownProps {
4
- showExtendedData: boolean;
5
- shippingAmount?: SE.Money;
6
- insuranceAmount?: SE.Money;
7
4
  confirmationAmount?: SE.Money;
8
- taxAmount?: SE.Money;
5
+ insuranceAmount?: SE.Money;
9
6
  otherAmount?: SE.Money;
7
+ shippingAmount?: SE.Money;
8
+ showExtendedData: boolean;
9
+ taxAmount?: SE.Money;
10
10
  }
11
11
  export declare const CostBreakdown: ({ showExtendedData, shippingAmount, insuranceAmount, confirmationAmount, taxAmount, otherAmount, }: CostBreakdownProps) => JSX.Element;
@@ -1,8 +1,8 @@
1
1
  import { RateOption } from "../../../hooks";
2
2
  import { ControlledField } from "../create-field-controller";
3
3
  type RateSelectProps = {
4
- options: RateOption[];
5
4
  nicknameFeature?: boolean;
5
+ options: RateOption[];
6
6
  };
7
7
  type RateSelectOptions = {
8
8
  onClick?: (rateId: string) => void;
@@ -7,8 +7,8 @@ export type SelectOption = {
7
7
  };
8
8
  export type SelectCategory = {
9
9
  label: string;
10
- value?: string;
11
10
  options: SelectOption[];
11
+ value?: string;
12
12
  };
13
13
  export type SelectOptionOrCategory = SelectOption | SelectCategory;
14
14
  type SelectProps = {
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import { ISwitchProps } from "@packlink/giger";
3
3
  export type SwitchProps = {
4
- defaultChecked?: boolean;
5
4
  children?: React.ReactNode;
6
- shouldUnmount?: boolean;
5
+ defaultChecked?: boolean;
7
6
  label: string;
7
+ shouldUnmount?: boolean;
8
8
  } & Omit<ISwitchProps, "children">;
9
9
  export declare const Switch: ({ defaultChecked, children, shouldUnmount, label, onChange, ...props }: SwitchProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,12 +1,12 @@
1
1
  import * as SE from "@shipengine/types";
2
2
  export type Item = {
3
- name: string;
4
3
  detail: string;
4
+ name: string;
5
5
  quantity: number;
6
- value: SE.Money;
7
- totalValue?: SE.Money;
8
6
  subDetail?: string;
9
7
  subDetailValue?: SE.Money;
8
+ totalValue?: SE.Money;
9
+ value: SE.Money;
10
10
  };
11
11
  export type ItemsBreakdownProps = {
12
12
  items: Item[];
@@ -1 +1,2 @@
1
1
  export * from "./manual-funding-form";
2
+ export * from "./manual-funding-schema";
@@ -2,6 +2,9 @@
2
2
  import { ManualFundingFormPayload } from "./manual-funding-schema";
3
3
  export type ManualFundingFormProps<T = undefined> = {
4
4
  currentBalance: number;
5
+ errorMessage?: string;
6
+ hasError: boolean;
7
+ isLoading: boolean;
5
8
  onSubmit: (payload: ManualFundingFormPayload) => Promise<void> | void;
6
9
  requiredAmount?: number;
7
10
  } & ({
@@ -11,4 +14,4 @@ export type ManualFundingFormProps<T = undefined> = {
11
14
  formId?: string;
12
15
  portalRef?: never;
13
16
  });
14
- export declare const ManualFundingForm: <T extends Element>({ currentBalance, formId, onSubmit, portalRef, requiredAmount, }: ManualFundingFormProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
17
+ export declare const ManualFundingForm: <T extends Element>({ currentBalance, errorMessage, formId, hasError, isLoading, onSubmit, portalRef, requiredAmount, }: ManualFundingFormProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,11 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  export type SettingsCardProps = {
3
3
  cardAction: {
4
- name: string;
5
4
  action: () => void;
5
+ name: string;
6
6
  };
7
7
  children?: React.ReactNode;
8
- title: string | JSX.Element;
9
8
  subtitle?: string;
9
+ title: string | JSX.Element;
10
10
  };
11
11
  export declare const SettingsCard: ({ cardAction, children, subtitle, title }: SettingsCardProps) => import("@emotion/react/jsx-runtime").JSX.Element;