@commercelayer/react-components 3.0.0-beta.1 → 3.0.0-beta.10
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 +1 -1
- package/dist/components/AddressStateSelector.d.ts +11 -0
- package/dist/components/AdyenPayment.d.ts +18 -0
- package/dist/components/BraintreePayment.d.ts +12 -1
- package/dist/components/LineItemOption.d.ts +8 -5
- package/dist/components/LineItemOptions.d.ts +8 -3
- package/dist/components/PaymentGateway.d.ts +8 -1
- package/dist/components/PaymentMethod.d.ts +10 -1
- package/dist/components/PaymentSource.d.ts +2 -0
- package/dist/components/PaypalPayment.d.ts +0 -7
- package/dist/components/Shipment.d.ts +2 -0
- package/dist/components/StripePayment.d.ts +2 -6
- package/dist/components/WireTransferPayment.d.ts +0 -7
- package/dist/components/gateways/AdyenGateway.d.ts +5 -0
- package/dist/components/gateways/BraintreeGateway.d.ts +5 -0
- package/dist/components/gateways/PaypalGateway.d.ts +5 -0
- package/dist/components/gateways/StripeGateway.d.ts +5 -0
- package/dist/components/gateways/WireTransferGateway.d.ts +5 -0
- package/dist/components/utils/BaseInput.d.ts +1 -1
- package/dist/config/components.d.ts +22 -16
- package/dist/context/AddressContext.d.ts +4 -3
- package/dist/context/BillingAddressFormContext.d.ts +3 -0
- package/dist/context/CustomerContext.d.ts +2 -0
- package/dist/context/LineItemOptionChildrenContext.d.ts +1 -0
- package/dist/context/PaymentMethodChildrenContext.d.ts +3 -0
- package/dist/context/PaymentMethodContext.d.ts +8 -1
- package/dist/context/PlaceOrderContext.d.ts +3 -1
- package/dist/index.d.ts +1 -2
- package/dist/react-components.cjs.development.js +4672 -4097
- package/dist/react-components.cjs.development.js.map +1 -1
- package/dist/react-components.cjs.production.min.js +1 -1
- package/dist/react-components.cjs.production.min.js.map +1 -1
- package/dist/react-components.esm.js +4485 -3909
- package/dist/react-components.esm.js.map +1 -1
- package/dist/reducers/AddressReducer.d.ts +7 -2
- package/dist/reducers/CustomerReducer.d.ts +2 -8
- package/dist/reducers/PaymentMethodReducer.d.ts +25 -2
- package/dist/reducers/PlaceOrderReducer.d.ts +1 -0
- package/dist/typings/index.d.ts +4 -28
- package/dist/utils/addressesManager.d.ts +1 -0
- package/dist/utils/browserInfo.d.ts +9 -0
- package/dist/utils/countryStateCity.d.ts +9 -0
- package/dist/utils/customerOrderOptions.d.ts +4 -0
- package/dist/utils/getLoaderComponent.d.ts +3 -0
- package/dist/utils/isEmptyStates.d.ts +1 -0
- package/dist/utils/isJSON.d.ts +1 -0
- package/dist/utils/localStorage.d.ts +6 -0
- package/dist/utils/promisify.d.ts +1 -0
- package/dist/utils/validateFormFields.d.ts +1 -1
- package/package.json +48 -43
- package/dist/components/OrderList.d.ts +0 -26
- package/dist/components/OrderListRow.d.ts +0 -14
- package/dist/context/OrderListChildrenContext.d.ts +0 -14
- package/dist/typings/order.d.ts +0 -120
- package/dist/utils/icons.d.ts +0 -3
- package/dist/utils/isDate.d.ts +0 -1
- package/dist/utils/scrollbarWidth.d.ts +0 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ A collection of reusable React components that makes it super fast and simple to
|
|
|
4
4
|
|
|
5
5
|
### What is Commerce Layer?
|
|
6
6
|
|
|
7
|
-
[Commerce Layer](https://commercelayer.io
|
|
7
|
+
[Commerce Layer](https://commercelayer.io) is a multi-market commerce API and order management system that lets you add global shopping capabilities to any website, mobile app, chatbot, wearable, voice, or IoT device, with ease. Compose your stack with the best-of-breed tools you already mastered and love. Make any experience shoppable, anywhere, through a blazing-fast, enterprise-grade, and secure API.
|
|
8
8
|
|
|
9
9
|
# Getting started
|
|
10
10
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { AddressStateSelectName, BaseSelectComponentProps } from "../typings/index";
|
|
3
|
+
declare type AddressStateSelectorProps = Omit<BaseSelectComponentProps, 'options' | 'name'> & {
|
|
4
|
+
name: AddressStateSelectName;
|
|
5
|
+
required?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
inputClassName?: string;
|
|
8
|
+
selectClassName?: string;
|
|
9
|
+
} & Pick<JSX.IntrinsicElements['select'], 'className' | 'id' | 'style'>;
|
|
10
|
+
declare const AddressStateSelector: FunctionComponent<AddressStateSelectorProps>;
|
|
11
|
+
export default AddressStateSelector;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { PaymentSourceProps } from './PaymentSource';
|
|
3
|
+
export declare type AdyenPaymentConfig = {
|
|
4
|
+
cardContainerClassName?: string;
|
|
5
|
+
threeDSecureContainerClassName?: string;
|
|
6
|
+
placeOrderCallback?: (response: {
|
|
7
|
+
placed: boolean;
|
|
8
|
+
}) => void;
|
|
9
|
+
};
|
|
10
|
+
declare type AdyenPaymentProps = {
|
|
11
|
+
clientKey?: string;
|
|
12
|
+
config?: AdyenPaymentConfig;
|
|
13
|
+
templateCustomerSaveToWallet?: PaymentSourceProps['templateCustomerSaveToWallet'];
|
|
14
|
+
locale?: string;
|
|
15
|
+
environment?: string;
|
|
16
|
+
};
|
|
17
|
+
declare const AdyenPayment: FunctionComponent<AdyenPaymentProps>;
|
|
18
|
+
export default AdyenPayment;
|
|
@@ -1,19 +1,30 @@
|
|
|
1
1
|
import { FunctionComponent } from 'react';
|
|
2
2
|
import { HostedFieldFieldOptions } from 'braintree-web/modules/hosted-fields';
|
|
3
|
+
import { PaymentSourceProps } from './PaymentSource';
|
|
3
4
|
declare type BraintreeHostedFields<Type> = {
|
|
4
5
|
[Property in keyof Type]: {
|
|
5
6
|
label?: string;
|
|
6
7
|
} & Type[Property];
|
|
7
8
|
};
|
|
8
9
|
export declare type BraintreeConfig = {
|
|
10
|
+
containerClassName?: string;
|
|
11
|
+
cardContainerClassName?: string;
|
|
12
|
+
expDateContainerClassName?: string;
|
|
13
|
+
fieldsContainerClassName?: string;
|
|
14
|
+
cvvContainerClassName?: string;
|
|
15
|
+
cardDetailsContainerClassName?: string;
|
|
16
|
+
fieldLabelClassName?: string;
|
|
17
|
+
inputWrapperClassName?: string;
|
|
18
|
+
fields?: BraintreeHostedFields<HostedFieldFieldOptions>;
|
|
9
19
|
styles?: {
|
|
10
20
|
[key: string]: Record<string, string>;
|
|
11
21
|
};
|
|
12
|
-
fields?: BraintreeHostedFields<HostedFieldFieldOptions>;
|
|
13
22
|
};
|
|
14
23
|
declare type BraintreePaymentProps = {
|
|
15
24
|
authorization: string;
|
|
16
25
|
config?: BraintreeConfig;
|
|
26
|
+
templateCustomerSaveToWallet?: PaymentSourceProps['templateCustomerSaveToWallet'];
|
|
27
|
+
locale?: string;
|
|
17
28
|
};
|
|
18
29
|
declare const BraintreePayment: FunctionComponent<BraintreePaymentProps>;
|
|
19
30
|
export default BraintreePayment;
|
|
@@ -5,12 +5,15 @@ declare type LineItemOptionChildrenProps = FunctionChildren<Omit<LineItemOptionP
|
|
|
5
5
|
lineItemOption: LineItemOptionCollection;
|
|
6
6
|
}>;
|
|
7
7
|
declare type LineItemOptionProps = {
|
|
8
|
+
id?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
key?: string;
|
|
11
|
+
style?: CSSProperties;
|
|
8
12
|
children?: LineItemOptionChildrenProps;
|
|
9
|
-
name
|
|
13
|
+
name?: string;
|
|
10
14
|
valueClassName?: string;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} & JSX.IntrinsicElements['span'];
|
|
15
|
+
tagElement?: keyof JSX.IntrinsicElements;
|
|
16
|
+
tagContainer?: keyof JSX.IntrinsicElements;
|
|
17
|
+
};
|
|
15
18
|
declare const LineItemOption: FunctionComponent<LineItemOptionProps>;
|
|
16
19
|
export default LineItemOption;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { FunctionComponent, ReactNode } from 'react';
|
|
2
|
-
export declare type LineItemOptionsProps = {
|
|
2
|
+
export declare type LineItemOptionsProps = JSX.IntrinsicElements['span'] & {
|
|
3
3
|
children: ReactNode;
|
|
4
|
-
skuOptionId: string;
|
|
5
4
|
title?: string;
|
|
6
5
|
showName?: boolean;
|
|
7
|
-
} &
|
|
6
|
+
} & ({
|
|
7
|
+
skuOptionId: string;
|
|
8
|
+
showAll?: never;
|
|
9
|
+
} | {
|
|
10
|
+
skuOptionId?: never;
|
|
11
|
+
showAll: true;
|
|
12
|
+
});
|
|
8
13
|
declare const LineItemOptions: FunctionComponent<LineItemOptionsProps>;
|
|
9
14
|
export default LineItemOptions;
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
+
import { LoaderType } from "../typings/index";
|
|
1
2
|
import { FunctionComponent } from 'react';
|
|
2
3
|
import { PaymentSourceProps } from './PaymentSource';
|
|
3
|
-
declare type
|
|
4
|
+
export declare type GatewayBaseType = PaymentGatewayProps & {
|
|
5
|
+
show: boolean;
|
|
6
|
+
loading: boolean;
|
|
7
|
+
loaderComponent: JSX.Element;
|
|
8
|
+
};
|
|
9
|
+
export declare type PaymentGatewayProps = PaymentSourceProps & {
|
|
4
10
|
showCard: boolean;
|
|
5
11
|
handleEditClick: () => void;
|
|
6
12
|
show: boolean;
|
|
13
|
+
loader?: LoaderType;
|
|
7
14
|
};
|
|
8
15
|
declare const PaymentGateway: FunctionComponent<PaymentGatewayProps>;
|
|
9
16
|
export default PaymentGateway;
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
import { LoaderType } from "../typings/index";
|
|
3
|
+
import { PaymentMethodCollection } from '@commercelayer/js-sdk';
|
|
2
4
|
declare type PaymentMethodProps = {
|
|
3
5
|
children: ReactNode;
|
|
4
6
|
activeClass?: string;
|
|
5
|
-
|
|
7
|
+
loader?: LoaderType;
|
|
8
|
+
} & Omit<JSX.IntrinsicElements['div'], 'onClick'> & ({
|
|
9
|
+
clickableContainer: true;
|
|
10
|
+
onClick?: (payment?: PaymentMethodCollection | Record<string, any>) => void;
|
|
11
|
+
} | {
|
|
12
|
+
clickableContainer?: never;
|
|
13
|
+
onClick?: never;
|
|
14
|
+
});
|
|
6
15
|
declare const PaymentMethod: FunctionComponent<PaymentMethodProps>;
|
|
7
16
|
export default PaymentMethod;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
import { LoaderType } from "../typings/index";
|
|
2
3
|
export declare type CustomerCardsProps = {
|
|
3
4
|
handleClick: () => void;
|
|
4
5
|
};
|
|
@@ -11,6 +12,7 @@ export declare type PaymentSourceProps = {
|
|
|
11
12
|
templateCustomerCards?: (props: CustomerCardsProps) => ReactNode;
|
|
12
13
|
onClickCustomerCards?: () => void;
|
|
13
14
|
templateCustomerSaveToWallet?: (props: CustomerSaveToWalletProps) => ReactNode;
|
|
15
|
+
loader?: LoaderType;
|
|
14
16
|
} & JSX.IntrinsicElements['div'];
|
|
15
17
|
declare const PaymentSource: FunctionComponent<PaymentSourceProps>;
|
|
16
18
|
export default PaymentSource;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { SetPaymentSourceResponse } from "../reducers/PaymentMethodReducer";
|
|
2
1
|
import { FunctionComponent, ReactNode } from 'react';
|
|
3
2
|
export declare type PaypalConfig = {
|
|
4
3
|
returnUrl: string;
|
|
@@ -7,12 +6,6 @@ export declare type PaypalConfig = {
|
|
|
7
6
|
text?: string | ReactNode;
|
|
8
7
|
className?: string;
|
|
9
8
|
};
|
|
10
|
-
submitButton?: {
|
|
11
|
-
label?: string | ReactNode;
|
|
12
|
-
onClick?: (response?: SetPaymentSourceResponse) => void;
|
|
13
|
-
className?: string;
|
|
14
|
-
containerClassName?: string;
|
|
15
|
-
};
|
|
16
9
|
};
|
|
17
10
|
declare type Props = Omit<PaypalConfig, 'returnUrl' | 'cancelUrl'> & JSX.IntrinsicElements['div'];
|
|
18
11
|
declare const PaypalPayment: FunctionComponent<Props>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
import { LoaderType } from "../typings/index";
|
|
2
3
|
declare type ShipmentProps = {
|
|
3
4
|
children: ReactNode;
|
|
5
|
+
loader?: LoaderType;
|
|
4
6
|
};
|
|
5
7
|
declare const Shipment: FunctionComponent<ShipmentProps>;
|
|
6
8
|
export default Shipment;
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import { FunctionComponent
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
2
|
import { StripeCardElementOptions, StripeElementLocale } from '@stripe/stripe-js';
|
|
3
|
-
import { PaymentMethodConfig
|
|
3
|
+
import { PaymentMethodConfig } from "../reducers/PaymentMethodReducer";
|
|
4
4
|
import { PaymentSourceProps } from './PaymentSource';
|
|
5
5
|
export declare type StripeConfig = {
|
|
6
6
|
containerClassName?: string;
|
|
7
7
|
hintLabel?: string;
|
|
8
8
|
name?: string;
|
|
9
9
|
options?: StripeCardElementOptions;
|
|
10
|
-
submitClassName?: string;
|
|
11
|
-
submitContainerClassName?: string;
|
|
12
|
-
submitLabel?: string | ReactNode;
|
|
13
|
-
handleSubmit?: (response?: SetPaymentSourceResponse) => void;
|
|
14
10
|
[key: string]: any;
|
|
15
11
|
};
|
|
16
12
|
declare type StripePaymentProps = PaymentMethodConfig['stripePayment'] & JSX.IntrinsicElements['div'] & Partial<PaymentSourceProps['templateCustomerSaveToWallet']> & {
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
import { SetPaymentSourceResponse } from "../reducers/PaymentMethodReducer";
|
|
2
1
|
import { FunctionComponent, ReactNode } from 'react';
|
|
3
2
|
export declare type WireTransferConfig = {
|
|
4
3
|
infoMessage?: {
|
|
5
4
|
text?: string | ReactNode;
|
|
6
5
|
className?: string;
|
|
7
6
|
};
|
|
8
|
-
submitButton?: {
|
|
9
|
-
label?: string | ReactNode;
|
|
10
|
-
onClick?: (response?: SetPaymentSourceResponse) => void;
|
|
11
|
-
className?: string;
|
|
12
|
-
containerClassName?: string;
|
|
13
|
-
};
|
|
14
7
|
};
|
|
15
8
|
declare type Props = WireTransferConfig & JSX.IntrinsicElements['div'];
|
|
16
9
|
declare const WireTransferPayment: FunctionComponent<Props>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BaseInputComponentProps } from "../../typings/index";
|
|
3
3
|
export declare type BaseInputProps = BaseInputComponentProps & JSX.IntrinsicElements['input'] & JSX.IntrinsicElements['textarea'];
|
|
4
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<BaseInputProps, "children" | "form" | "list" | "name" | "onChange" | "placeholder" | "key" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "crossOrigin" | "disabled" | "enterKeyHint" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "height" | "max" | "maxLength" | "min" | "minLength" | "multiple" | "pattern" | "readOnly" | "required" | "size" | "src" | "step" | "type" | "value" | "width" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "
|
|
4
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<BaseInputProps, "children" | "form" | "list" | "color" | "hidden" | "name" | "onChange" | "placeholder" | "key" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "crossOrigin" | "disabled" | "enterKeyHint" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "height" | "max" | "maxLength" | "min" | "minLength" | "multiple" | "pattern" | "readOnly" | "required" | "size" | "src" | "step" | "type" | "value" | "width" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "cols" | "dirName" | "rows" | "wrap"> & React.RefAttributes<any>>;
|
|
5
5
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { TimeFormat, BaseInputType, GiftCardInputName, LineItemType, BasePriceType, BaseFormatPrice, BaseSelectorType, AddressInputName, AddressCountrySelectName } from "../typings/index";
|
|
3
|
+
import { TimeFormat, BaseInputType, GiftCardInputName, LineItemType, BasePriceType, BaseFormatPrice, BaseSelectorType, AddressInputName, AddressCountrySelectName, AddressStateSelectName } from "../typings/index";
|
|
4
4
|
import { DeliveryLeadTimeField } from '../components/DeliveryLeadTime';
|
|
5
5
|
import { StockTransferFieldType } from "../components/StockTransferField";
|
|
6
6
|
import { PaymentSourceDetailType } from "../components/PaymentSourceDetail";
|
|
@@ -30,6 +30,22 @@ declare const components: {
|
|
|
30
30
|
required: boolean;
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
|
+
AddressStateSelector: {
|
|
34
|
+
displayName: string;
|
|
35
|
+
propTypes: {
|
|
36
|
+
children: PropTypes.Requireable<(...args: any[]) => any>;
|
|
37
|
+
placeholder: PropTypes.Requireable<PropTypes.InferProps<{
|
|
38
|
+
label: PropTypes.Validator<string>;
|
|
39
|
+
value: PropTypes.Validator<string | number>;
|
|
40
|
+
}>>;
|
|
41
|
+
value: PropTypes.Requireable<string>;
|
|
42
|
+
name: PropTypes.Validator<AddressStateSelectName>;
|
|
43
|
+
required: PropTypes.Requireable<boolean>;
|
|
44
|
+
};
|
|
45
|
+
defaultProps: {
|
|
46
|
+
required: boolean;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
33
49
|
AddressField: {
|
|
34
50
|
displayName: string;
|
|
35
51
|
propTypes: {
|
|
@@ -339,12 +355,12 @@ declare const components: {
|
|
|
339
355
|
LineItemOption: {
|
|
340
356
|
displayName: string;
|
|
341
357
|
propTypes: {
|
|
342
|
-
name: PropTypes.
|
|
358
|
+
name: PropTypes.Requireable<string>;
|
|
343
359
|
children: PropTypes.Requireable<(...args: any[]) => any>;
|
|
344
360
|
valueClassName: PropTypes.Requireable<string>;
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
361
|
+
className: PropTypes.Requireable<string>;
|
|
362
|
+
id: PropTypes.Requireable<string>;
|
|
363
|
+
style: PropTypes.Requireable<object>;
|
|
348
364
|
};
|
|
349
365
|
};
|
|
350
366
|
LineItemOptions: {
|
|
@@ -354,10 +370,7 @@ declare const components: {
|
|
|
354
370
|
children: PropTypes.Validator<boolean | import("react").ReactChild | import("react").ReactFragment | import("react").ReactPortal>;
|
|
355
371
|
title: PropTypes.Requireable<string>;
|
|
356
372
|
showName: PropTypes.Requireable<boolean>;
|
|
357
|
-
skuOptionId: PropTypes.
|
|
358
|
-
};
|
|
359
|
-
defaultProps: {
|
|
360
|
-
showName: boolean;
|
|
373
|
+
skuOptionId: PropTypes.Requireable<string>;
|
|
361
374
|
};
|
|
362
375
|
};
|
|
363
376
|
LineItemQuantity: {
|
|
@@ -430,13 +443,6 @@ declare const components: {
|
|
|
430
443
|
metadata: {};
|
|
431
444
|
};
|
|
432
445
|
};
|
|
433
|
-
OrderList: {
|
|
434
|
-
permittedChildren: string[];
|
|
435
|
-
displayName: string;
|
|
436
|
-
propTypes: {
|
|
437
|
-
children: PropTypes.Validator<boolean | import("react").ReactChild | import("react").ReactFragment | import("react").ReactPortal>;
|
|
438
|
-
};
|
|
439
|
-
};
|
|
440
446
|
OrderNumber: {
|
|
441
447
|
displayName: string;
|
|
442
448
|
propTypes: {
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { AddressState, SetAddress
|
|
2
|
+
import { AddressState, SetAddress } from "../reducers/AddressReducer";
|
|
3
|
+
import { BaseError } from "../typings/errors";
|
|
3
4
|
declare type DefaultContext = {
|
|
4
5
|
saveAddresses: () => void;
|
|
5
6
|
setCloneAddress: (id: string, resource: 'billingAddress' | 'shippingAddress') => void;
|
|
6
7
|
setAddress: SetAddress;
|
|
7
|
-
setAddressErrors:
|
|
8
|
+
setAddressErrors: (errors: BaseError[], resource: 'billingAddress' | 'shippingAddress') => void;
|
|
8
9
|
} & AddressState;
|
|
9
10
|
export declare const defaultAddressContext: {
|
|
10
11
|
saveAddresses: () => void;
|
|
11
12
|
setCloneAddress: () => void;
|
|
12
13
|
setAddress: SetAddress;
|
|
13
|
-
setAddressErrors:
|
|
14
|
+
setAddressErrors: () => void;
|
|
14
15
|
};
|
|
15
16
|
declare const AddressesContext: import("react").Context<DefaultContext>;
|
|
16
17
|
export default AddressesContext;
|
|
@@ -10,6 +10,9 @@ export declare type DefaultContextAddress = {
|
|
|
10
10
|
error: boolean;
|
|
11
11
|
}>[];
|
|
12
12
|
errorClassName?: string;
|
|
13
|
+
requiresBillingInfo?: boolean;
|
|
14
|
+
resetField?: (name: string) => void;
|
|
15
|
+
values?: Record<string, any>;
|
|
13
16
|
};
|
|
14
17
|
declare const BillingAddressFormContext: import("react").Context<DefaultContextAddress>;
|
|
15
18
|
export default BillingAddressFormContext;
|
|
@@ -4,9 +4,11 @@ declare type DefaultContext = {
|
|
|
4
4
|
saveCustomerUser: (customerEmail: string) => Promise<void>;
|
|
5
5
|
setCustomerErrors: SetCustomerErrors;
|
|
6
6
|
setCustomerEmail: SetCustomerEmail;
|
|
7
|
+
getCustomerPaymentSources: () => Promise<void>;
|
|
7
8
|
} & Partial<CustomerState>;
|
|
8
9
|
export declare const defaultCustomerContext: {
|
|
9
10
|
saveCustomerUser: () => Promise<void>;
|
|
11
|
+
getCustomerPaymentSources: () => Promise<void>;
|
|
10
12
|
setCustomerErrors: SetCustomerErrors;
|
|
11
13
|
setCustomerEmail: SetCustomerEmail;
|
|
12
14
|
};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { LineItemOptionCollection } from '@commercelayer/js-sdk';
|
|
3
3
|
export interface InitialLineItemContext {
|
|
4
4
|
lineItemOption: Partial<LineItemOptionCollection>;
|
|
5
|
+
showAll?: boolean;
|
|
5
6
|
}
|
|
6
7
|
declare const LineItemOptionChildrenContext: import("react").Context<InitialLineItemContext>;
|
|
7
8
|
export default LineItemOptionChildrenContext;
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
import { PaymentMethodCollection } from '@commercelayer/js-sdk';
|
|
3
3
|
export interface InitialPaymentMethodChildrenContext {
|
|
4
4
|
payment?: PaymentMethodCollection;
|
|
5
|
+
clickableContainer?: boolean;
|
|
6
|
+
paymentSelected?: string;
|
|
7
|
+
setPaymentSelected?: (paymentId: string) => void;
|
|
5
8
|
}
|
|
6
9
|
declare const PaymentMethodChildrenContext: import("react").Context<InitialPaymentMethodChildrenContext>;
|
|
7
10
|
export default PaymentMethodChildrenContext;
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { UpdatePaymentSource } from '../reducers/PaymentMethodReducer';
|
|
3
|
+
import { PaymentMethodState, SetPaymentMethodErrors, SetPaymentSource, SetPaymentMethod, DestroyPaymentSource, SetPaymentRef, setLoading } from "../reducers/PaymentMethodReducer";
|
|
3
4
|
declare type DefaultContext = {
|
|
4
5
|
setPaymentMethodErrors: SetPaymentMethodErrors;
|
|
5
6
|
setPaymentMethod: SetPaymentMethod;
|
|
6
7
|
setPaymentSource: SetPaymentSource;
|
|
8
|
+
setPaymentRef: SetPaymentRef;
|
|
7
9
|
destroyPaymentSource: DestroyPaymentSource;
|
|
10
|
+
updatePaymentSource: UpdatePaymentSource;
|
|
11
|
+
setLoading: typeof setLoading;
|
|
8
12
|
} & PaymentMethodState;
|
|
9
13
|
export declare const defaultPaymentMethodContext: {
|
|
10
14
|
setPaymentMethodErrors: SetPaymentMethodErrors;
|
|
11
15
|
setPaymentMethod: SetPaymentMethod;
|
|
12
16
|
setPaymentSource: SetPaymentSource;
|
|
17
|
+
setPaymentRef: SetPaymentRef;
|
|
13
18
|
destroyPaymentSource: DestroyPaymentSource;
|
|
19
|
+
updatePaymentSource: UpdatePaymentSource;
|
|
20
|
+
setLoading: typeof setLoading;
|
|
14
21
|
};
|
|
15
22
|
declare const PaymentMethodContext: import("react").Context<DefaultContext>;
|
|
16
23
|
export default PaymentMethodContext;
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
import { PlaceOrderState, SetPlaceOrderErrors } from "../reducers/PlaceOrderReducer";
|
|
3
3
|
declare type DefaultContext = {
|
|
4
4
|
setPlaceOrderErrors?: SetPlaceOrderErrors;
|
|
5
|
-
setPlaceOrder?: (
|
|
5
|
+
setPlaceOrder?: ({ paymentSource, }: {
|
|
6
|
+
paymentSource: Record<string, string>;
|
|
7
|
+
}) => Promise<{
|
|
6
8
|
placed: boolean;
|
|
7
9
|
}>;
|
|
8
10
|
placeOrderPermitted?: () => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { default as Address } from "./components/Address";
|
|
|
3
3
|
export { default as AddressCountrySelector } from "./components/AddressCountrySelector";
|
|
4
4
|
export { default as AddressField } from "./components/AddressField";
|
|
5
5
|
export { default as AddressInput } from "./components/AddressInput";
|
|
6
|
+
export { default as AddressStateSelector } from "./components/AddressStateSelector";
|
|
6
7
|
export { default as AddressesContainer } from "./components/AddressesContainer";
|
|
7
8
|
export { default as AvailabilityContainer } from "./components/AvailabilityContainer";
|
|
8
9
|
export { default as AvailabilityTemplate } from "./components/AvailabilityTemplate";
|
|
@@ -40,8 +41,6 @@ export { default as LineItemsContainer } from "./components/LineItemsContainer";
|
|
|
40
41
|
export { default as LineItemsCount } from "./components/LineItemsCount";
|
|
41
42
|
export { default as MetadataInput } from "./components/MetadataInput";
|
|
42
43
|
export { default as OrderContainer } from "./components/OrderContainer";
|
|
43
|
-
export { default as OrderList } from "./components/OrderList";
|
|
44
|
-
export { default as OrderListRow } from "./components/OrderListRow";
|
|
45
44
|
export { default as OrderNumber } from "./components/OrderNumber";
|
|
46
45
|
export { default as OrderStorage } from "./components/OrderStorage";
|
|
47
46
|
export { default as PaymentMethod } from "./components/PaymentMethod";
|