@commercelayer/react-components 3.8.1 → 3.9.1

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.
@@ -1 +1 @@
1
- import{FunctionComponent,ReactNode}from'react';import{LineItemType}from'../typings/index';declare type LineItemProps={children:ReactNode;type?:LineItemType;};declare const LineItem:FunctionComponent<LineItemProps>;export default LineItem;
1
+ import React,{ReactNode}from'react';import{LineItemType}from'../typings/index';declare type LineItemProps={children:ReactNode;type?:LineItemType;};declare const LineItem:React.FunctionComponent<LineItemProps>;export default LineItem;
@@ -1 +1 @@
1
- import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import ShipmentContext,{defaultShipmentContext}from"../context/ShipmentContext";import{useContext,useEffect,useReducer}from"react";import shipmentReducer,{shipmentInitialState,setShipmentErrors,getShipments,setShippingMethod}from"../reducers/ShipmentReducer";import OrderContext from"../context/OrderContext";import CommerceLayerContext from"../context/CommerceLayerContext";import components from"../config/components";import{isEmpty}from"lodash";const propTypes=components.ShipmentsContainer.propTypes,displayName=components.ShipmentsContainer.displayName,ShipmentsContainer=props=>{const{children}=props,p=__rest(props,["children"]),[state,dispatch]=useReducer(shipmentReducer,shipmentInitialState),{order,getOrder,include,addResourceToInclude,includeLoaded}=useContext(OrderContext),config=useContext(CommerceLayerContext);useEffect(()=>{(include==null?void 0:include.includes("shipments.available_shipping_methods"))?(includeLoaded==null?void 0:includeLoaded["shipments.available_shipping_methods"])||addResourceToInclude({newResourceLoaded:{"shipments.available_shipping_methods":!0,"shipments.shipment_line_items.line_item":!0,"shipments.shipping_method":!0,"shipments.stock_transfers":!0,"shipments.stock_location":!0}}):addResourceToInclude({newResource:["shipments.available_shipping_methods","shipments.shipment_line_items.line_item","shipments.shipping_method","shipments.stock_transfers","shipments.stock_location"]}),(include==null?void 0:include.includes("line_items.item"))?(includeLoaded==null?void 0:includeLoaded["line_items.item"])||addResourceToInclude({newResourceLoaded:{"line_items.item":!0}}):addResourceToInclude({newResource:["line_items.item"]}),order&&!isEmpty(config)&&order.shipments&&getShipments({order,dispatch,config})},[order,include,includeLoaded]),useEffect(()=>(order&&(order.shipments&&order.shipments.length>0&&order.shipments.map(shipment=>shipment.available_shipping_methods&&shipment.available_shipping_methods.length>0).includes(!1)&&setShipmentErrors([...state.errors||[],{code:"NO_SHIPPING_METHODS",message:"No shipping methods",resource:"shipments"}],dispatch),order.line_items&&order.line_items.length>0&&order.line_items.map(line_item=>{var _a,_b,_c,_d,_e;return((_b=(_a=line_item.item)===null||_a===void 0?void 0:_a.inventory)===null||_b===void 0?void 0:_b.quantity)>=(line_item==null?void 0:line_item.quantity)?((_c=line_item.item)===null||_c===void 0?void 0:_c.do_not_ship)||((_e=(_d=line_item.item)===null||_d===void 0?void 0:_d.inventory)===null||_e===void 0?void 0:_e.available):!1}).includes(!1)&&setShipmentErrors([...state.errors||[],{code:"OUT_OF_STOCK",message:"No stock available",resource:"line_items"}],dispatch)),()=>{setShipmentErrors([],dispatch)}),[order]);const contextValue=Object.assign(Object.assign({},state),{setShipmentErrors:errors=>defaultShipmentContext.setShipmentErrors(errors,dispatch),setShippingMethod:async(shipmentId,shippingMethodId)=>await setShippingMethod({shippingMethodId,shipmentId,config,getOrder,order})});return _jsx(ShipmentContext.Provider,Object.assign({value:contextValue},{children}))};ShipmentsContainer.propTypes=propTypes,ShipmentsContainer.displayName=displayName;export default ShipmentsContainer;
1
+ import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import ShipmentContext,{defaultShipmentContext}from"../context/ShipmentContext";import{useContext,useEffect,useReducer}from"react";import shipmentReducer,{shipmentInitialState,setShipmentErrors,getShipments,setShippingMethod}from"../reducers/ShipmentReducer";import OrderContext from"../context/OrderContext";import CommerceLayerContext from"../context/CommerceLayerContext";import components from"../config/components";import{isEmpty}from"lodash";const propTypes=components.ShipmentsContainer.propTypes,displayName=components.ShipmentsContainer.displayName,ShipmentsContainer=props=>{const{children}=props,p=__rest(props,["children"]),[state,dispatch]=useReducer(shipmentReducer,shipmentInitialState),{order,getOrder,include,addResourceToInclude,includeLoaded}=useContext(OrderContext),config=useContext(CommerceLayerContext);useEffect(()=>{(include==null?void 0:include.includes("shipments.available_shipping_methods"))?(includeLoaded==null?void 0:includeLoaded["shipments.available_shipping_methods"])||addResourceToInclude({newResourceLoaded:{"shipments.available_shipping_methods":!0,"shipments.shipment_line_items.line_item":!0,"shipments.shipping_method":!0,"shipments.stock_transfers":!0,"shipments.stock_location":!0}}):addResourceToInclude({newResource:["shipments.available_shipping_methods","shipments.shipment_line_items.line_item","shipments.shipping_method","shipments.stock_transfers","shipments.stock_location"]}),(include==null?void 0:include.includes("line_items.item"))?(includeLoaded==null?void 0:includeLoaded["line_items.item"])||addResourceToInclude({newResourceLoaded:{"line_items.item":!0}}):addResourceToInclude({newResource:["line_items.item"]}),order&&!isEmpty(config)&&order.shipments&&getShipments({order,dispatch,config})},[order,include,includeLoaded]),useEffect(()=>(order&&(order.shipments&&order.shipments.length>0&&order.shipments.map(shipment=>shipment.available_shipping_methods&&shipment.available_shipping_methods.length>0).includes(!1)&&setShipmentErrors([...state.errors||[],{code:"NO_SHIPPING_METHODS",message:"No shipping methods",resource:"shipments"}],dispatch),order.line_items&&order.line_items.length>0&&order.line_items.filter(({item_type})=>item_type==="skus").map(lineItem=>{var _a,_b,_c,_d,_e;return((_b=(_a=lineItem.item)===null||_a===void 0?void 0:_a.inventory)===null||_b===void 0?void 0:_b.quantity)>=(lineItem==null?void 0:lineItem.quantity)?((_c=lineItem.item)===null||_c===void 0?void 0:_c.do_not_ship)||((_e=(_d=lineItem.item)===null||_d===void 0?void 0:_d.inventory)===null||_e===void 0?void 0:_e.available):!1}).includes(!1)&&setShipmentErrors([...state.errors||[],{code:"OUT_OF_STOCK",message:"No stock available",resource:"line_items"}],dispatch)),()=>{setShipmentErrors([],dispatch)}),[order]);const contextValue=Object.assign(Object.assign({},state),{setShipmentErrors:errors=>defaultShipmentContext.setShipmentErrors(errors,dispatch),setShippingMethod:async(shipmentId,shippingMethodId)=>await setShippingMethod({shippingMethodId,shipmentId,config,getOrder,order})});return _jsx(ShipmentContext.Provider,Object.assign({value:contextValue},{children}))};ShipmentsContainer.propTypes=propTypes,ShipmentsContainer.displayName=displayName;export default ShipmentsContainer;
@@ -0,0 +1 @@
1
+ import{QueryParamsList}from'@commercelayer/sdk';import{ReactNode}from'react';declare type Props={skus:string[];children:ReactNode;queryParams?:QueryParamsList;};declare function SkuContainer<P extends Props>(props:P):JSX.Element;declare namespace SkuContainer{var propTypes:{children:import("prop-types").Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>ReactNode)>;};}export default SkuContainer;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import components from"../config/components";import CommerceLayerContext from"../context/CommerceLayerContext";import SkuContext from"../context/SkuContext";import skuReducer,{getSku,skuInitialState}from"../reducers/SkuReducer";import{useContext,useEffect,useMemo,useReducer}from"react";export default function SkuContainer(props){const{skus,children,queryParams}=props,[state,dispatch]=useReducer(skuReducer,skuInitialState),config=useContext(CommerceLayerContext),loadSkus=async()=>await getSku({config,dispatch,skus,queryParams});useEffect(()=>(config.accessToken&&(state==null?void 0:state.skus)&&(state==null?void 0:state.skus.length)===0&&loadSkus(),()=>{dispatch({type:"setLoading",payload:{loading:!0}})}),[config,skus]);const contextValue=useMemo(()=>state,[state]);return _jsx(SkuContext.Provider,Object.assign({value:contextValue},{children}))}SkuContainer.propTypes=components.SkuContainer.propTypes;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ import{Sku}from'@commercelayer/sdk';declare type ExcludeTag<T extends keyof JSX.IntrinsicElements>=Exclude<keyof JSX.IntrinsicElements,T>;declare type Conditional=({attribute:'image_url';tagElement:'img';}&JSX.IntrinsicElements['img'])|({attribute:Exclude<keyof Sku,'image_url'>;tagElement:ExcludeTag<'img'>;}&JSX.IntrinsicElements[ExcludeTag<'img'>]);declare type ChildrenProps=Omit<Props,'children'|'attribute'>&{element:Sku[keyof Sku];};declare type Props={children?:(props:ChildrenProps)=>JSX.Element;}&Conditional;declare function SkuField<P extends Props>({attribute,tagElement,children,...p}:P):JSX.Element;declare namespace SkuField{var propTypes:{children:import("prop-types").Requireable<(...args:any[])=>any>;attribute:import("prop-types").Requireable<string>;tagElement:import("prop-types").Requireable<string>;};}export default SkuField;
@@ -0,0 +1 @@
1
+ import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import SkuChildrenContext from"../context/SkuChildrenContext";import{useContext}from"react";import Parent from"./utils/Parent";import components from"../config/components";export default function SkuField(_a){var{attribute,tagElement,children}=_a,p=__rest(_a,["attribute","tagElement","children"]);const{sku}=useContext(SkuChildrenContext),element=sku&&sku[attribute]||"",Tag=tagElement;if(Tag==="img"){const src=element,name=sku==null?void 0:sku.name;return _jsx("img",Object.assign({alt:name,src},p))}const parentProps=Object.assign({element,tagElement},p);return children?_jsx(Parent,Object.assign({},parentProps,{children})):_jsx(Tag,{children:element})}SkuField.propTypes=components.SkuField.propTypes;
@@ -0,0 +1 @@
1
+ import{ReactNode}from'react';declare type Props={children:ReactNode;};declare function Skus<P extends Props>({children}:P):JSX.Element;declare namespace Skus{var propTypes:{children:import("prop-types").Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>ReactNode)>;};}export default Skus;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";import components from"../config/components";import SkuChildrenContext from"../context/SkuChildrenContext";import SkuContext from"../context/SkuContext";import{useContext}from"react";export default function Skus({children}){const{skus}=useContext(SkuContext),components2=skus&&skus.map((sku,key)=>{const value={sku};return _jsx(SkuChildrenContext.Provider,Object.assign({value},{children}),key)});return _jsx(_Fragment,{children:components2})}Skus.propTypes=components.Skus.propTypes;
@@ -1 +1 @@
1
- import{FunctionComponent,ReactNode}from'react';declare type VariantsContainerProps={children:ReactNode;filters?:Record<string,any>;skuCode?:string;};declare const VariantsContainer:FunctionComponent<VariantsContainerProps>;export default VariantsContainer;
1
+ import React,{ReactNode}from'react';declare type VariantsContainerProps={children:ReactNode;filters?:Record<string,any>;skuCode?:string;};declare const VariantsContainer:React.FunctionComponent<VariantsContainerProps>;export default VariantsContainer;
@@ -1 +1 @@
1
- import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import CommerceLayerContext from"../../context/CommerceLayerContext";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import{Fragment,useContext}from"react";import AdyenPayment from"../AdyenPayment";import PaymentCardsTemplate from"../utils/PaymentCardsTemplate";import jwt from"../../utils/jwt";export default function AdyenGateway(props){var _a;const{readonly,showCard,handleEditClick,children,templateCustomerCards,show,loading,onClickCustomerCards,loaderComponent,templateCustomerSaveToWallet}=props,p=__rest(props,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]),{order}=useContext(OrderContext),{accessToken}=useContext(CommerceLayerContext),{payment}=useContext(PaymentMethodChildrenContext),{payments,isGuest}=useContext(CustomerContext),{currentPaymentMethodId,config,paymentSource}=useContext(PaymentMethodContext),paymentResource="adyen_payments",locale=order==null?void 0:order.language_code;if(!readonly&&(payment==null?void 0:payment.id)!==currentPaymentMethodId)return null;const clientKey=paymentSource==null?void 0:paymentSource.public_key,environment=jwt(accessToken).test?"test":"live",adyenConfig=config?getPaymentConfig(paymentResource,config):{},customerPayments=!isEmpty(payments)&&payments?payments.filter(customerPayment=>{var _a2;return((_a2=customerPayment.payment_source)===null||_a2===void 0?void 0:_a2.type)==="adyen_payments"}):[];if(readonly||showCard){const card=(_a=paymentSource==null?void 0:paymentSource.payment_request_data)===null||_a===void 0?void 0:_a.payment_method,value=Object.assign(Object.assign({},card),{showCard,handleEditClick,readonly});return isEmpty(card)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value},{children}))}return!isGuest&&templateCustomerCards?clientKey&&!loading&&(paymentSource==null?void 0:paymentSource.payment_methods)?_jsxs(Fragment,{children:[isEmpty(customerPayments)?null:_jsx("div",Object.assign({className:p.className},{children:_jsx(PaymentCardsTemplate,Object.assign({},{paymentResource,customerPayments},{children:templateCustomerCards}))})),_jsx(AdyenPayment,{templateCustomerSaveToWallet,clientKey,locale,environment,config:adyenConfig})]}):loaderComponent:clientKey&&!loading&&(paymentSource==null?void 0:paymentSource.payment_methods)?_jsx(AdyenPayment,{clientKey,locale,config:adyenConfig}):loaderComponent}
1
+ import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import CommerceLayerContext from"../../context/CommerceLayerContext";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import{Fragment,useContext}from"react";import AdyenPayment from"../AdyenPayment";import PaymentCardsTemplate from"../utils/PaymentCardsTemplate";import jwt from"../../utils/jwt";import getCardDetails from"../../utils/getCardDetails";export default function AdyenGateway(props){var _a,_b;const{readonly,showCard,handleEditClick,children,templateCustomerCards,loading,loaderComponent,templateCustomerSaveToWallet}=props,p=__rest(props,["readonly","showCard","handleEditClick","children","templateCustomerCards","loading","loaderComponent","templateCustomerSaveToWallet"]),{order}=useContext(OrderContext),{accessToken}=useContext(CommerceLayerContext),{payment}=useContext(PaymentMethodChildrenContext),{payments,isGuest}=useContext(CustomerContext),{currentPaymentMethodId,config,paymentSource}=useContext(PaymentMethodContext),paymentResource="adyen_payments",locale=order==null?void 0:order.language_code,paymentMethods=((_a=order==null?void 0:order.payment_source)===null||_a===void 0?void 0:_a.payment_methods)||(paymentSource==null?void 0:paymentSource.payment_methods);if(!readonly&&(payment==null?void 0:payment.id)!==currentPaymentMethodId)return null;const clientKey=((_b=order==null?void 0:order.payment_source)===null||_b===void 0?void 0:_b.public_key)||(paymentSource==null?void 0:paymentSource.public_key),environment=jwt(accessToken).test?"test":"live",adyenConfig=config?getPaymentConfig(paymentResource,config):{},customerPayments=!isEmpty(payments)&&payments?payments.filter(customerPayment=>{var _a2;return((_a2=customerPayment.payment_source)===null||_a2===void 0?void 0:_a2.type)==="adyen_payments"}):[];if(readonly||showCard){const card=getCardDetails({customerPayment:{payment_source:(order==null?void 0:order.payment_source)||paymentSource},paymentType:paymentResource}),value=Object.assign(Object.assign({},card),{showCard,handleEditClick,readonly});return isEmpty(card)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value},{children}))}return!isGuest&&templateCustomerCards?clientKey&&!loading&&paymentMethods?_jsxs(Fragment,{children:[isEmpty(customerPayments)?null:_jsx("div",Object.assign({className:p.className},{children:_jsx(PaymentCardsTemplate,Object.assign({},{paymentResource,customerPayments},{children:templateCustomerCards}))})),_jsx(AdyenPayment,{templateCustomerSaveToWallet,clientKey,locale,environment,config:adyenConfig})]}):loaderComponent:clientKey&&!loading&&paymentMethods?_jsx(AdyenPayment,{clientKey,locale,config:adyenConfig}):loaderComponent}
@@ -1 +1 @@
1
- import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import BraintreePayment from"../BraintreePayment";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import{Fragment,useContext}from"react";import PaymentCardsTemplate from"../utils/PaymentCardsTemplate";export default function BraintreeGateway(props){var _a;const{readonly,showCard,handleEditClick,children,templateCustomerCards,show,loading,onClickCustomerCards,loaderComponent,templateCustomerSaveToWallet}=props,p=__rest(props,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]),{order}=useContext(OrderContext),{payment}=useContext(PaymentMethodChildrenContext),{payments,isGuest}=useContext(CustomerContext),{currentPaymentMethodId,config,paymentSource}=useContext(PaymentMethodContext),paymentResource="braintree_payments",locale=order==null?void 0:order.language_code;if(!readonly&&(payment==null?void 0:payment.id)!==currentPaymentMethodId)return null;const authorization=paymentSource==null?void 0:paymentSource.client_token,braintreeConfig=config?getPaymentConfig(paymentResource,config):{},customerPayments=!isEmpty(payments)&&payments?payments.filter(customerPayment=>{var _a2;return((_a2=customerPayment.payment_source)===null||_a2===void 0?void 0:_a2.type)==="braintree_payments"}):[];if(readonly||showCard){const card=(_a=paymentSource==null?void 0:paymentSource.options)===null||_a===void 0?void 0:_a.card,value=Object.assign(Object.assign({},card),{showCard,handleEditClick,readonly});return isEmpty(card)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value},{children}))}return!isGuest&&templateCustomerCards?authorization&&!loading?_jsxs(Fragment,{children:[isEmpty(customerPayments)?null:_jsx("div",Object.assign({className:p.className},{children:_jsx(PaymentCardsTemplate,Object.assign({},{paymentResource,customerPayments},{children:templateCustomerCards}))})),_jsx(BraintreePayment,{templateCustomerSaveToWallet,authorization,locale,config:braintreeConfig})]}):loaderComponent:authorization&&!loading?_jsx(BraintreePayment,{locale,authorization,config:braintreeConfig}):loaderComponent}
1
+ import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import BraintreePayment from"../BraintreePayment";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import getCardDetails from"../../utils/getCardDetails";import isEmpty from"lodash/isEmpty";import{Fragment,useContext}from"react";import PaymentCardsTemplate from"../utils/PaymentCardsTemplate";export default function BraintreeGateway(props){var _a;const{readonly,showCard,handleEditClick,children,templateCustomerCards,loading,loaderComponent,templateCustomerSaveToWallet}=props,p=__rest(props,["readonly","showCard","handleEditClick","children","templateCustomerCards","loading","loaderComponent","templateCustomerSaveToWallet"]),{order}=useContext(OrderContext),{payment}=useContext(PaymentMethodChildrenContext),{payments,isGuest}=useContext(CustomerContext),{currentPaymentMethodId,config,paymentSource}=useContext(PaymentMethodContext),paymentResource="braintree_payments",locale=order==null?void 0:order.language_code;if(!readonly&&(payment==null?void 0:payment.id)!==currentPaymentMethodId)return null;const authorization=((_a=order==null?void 0:order.payment_source)===null||_a===void 0?void 0:_a.client_token)||(paymentSource==null?void 0:paymentSource.client_token),braintreeConfig=config?getPaymentConfig(paymentResource,config):{},customerPayments=!isEmpty(payments)&&payments?payments.filter(customerPayment=>{var _a2;return((_a2=customerPayment.payment_source)===null||_a2===void 0?void 0:_a2.type)==="braintree_payments"}):[];if(readonly||showCard){const card=getCardDetails({customerPayment:{payment_source:(order==null?void 0:order.payment_source)||paymentSource},paymentType:paymentResource}),value=Object.assign(Object.assign({},card),{showCard,handleEditClick,readonly});return isEmpty(card)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value},{children}))}return!isGuest&&templateCustomerCards?authorization&&!loading?_jsxs(Fragment,{children:[isEmpty(customerPayments)?null:_jsx("div",Object.assign({className:p.className},{children:_jsx(PaymentCardsTemplate,Object.assign({},{paymentResource,customerPayments},{children:templateCustomerCards}))})),_jsx(BraintreePayment,{templateCustomerSaveToWallet,authorization,locale,config:braintreeConfig})]}):loaderComponent:authorization&&!loading?_jsx(BraintreePayment,{locale,authorization,config:braintreeConfig}):loaderComponent}
@@ -1 +1 @@
1
- import{__rest}from"tslib";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";import CheckoutComPayment from"../CheckoutComPayment";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import React from"react";import PaymentCardsTemplate from"../utils/PaymentCardsTemplate";import getCardDetails from"../../utils/getCardDetails";export default function CheckoutComGateway(props){const{readonly,showCard,handleEditClick,children,templateCustomerCards,show,loading,loaderComponent,templateCustomerSaveToWallet}=props,p=__rest(props,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","loaderComponent","templateCustomerSaveToWallet"]),{order}=React.useContext(OrderContext),{payment}=React.useContext(PaymentMethodChildrenContext),{payments,isGuest}=React.useContext(CustomerContext),{currentPaymentMethodId,config,paymentSource}=React.useContext(PaymentMethodContext),paymentResource="checkout_com_payments",locale=order==null?void 0:order.language_code;if(!readonly&&(payment==null?void 0:payment.id)!==currentPaymentMethodId)return null;const publicKey=paymentSource==null?void 0:paymentSource.public_key,paymentConfig=config?getPaymentConfig(paymentResource,config):{},customerPayments=!isEmpty(payments)&&payments?payments.filter(customerPayment=>{var _a;return((_a=customerPayment.payment_source)===null||_a===void 0?void 0:_a.type)===paymentResource}):[];if(readonly||showCard){const card=getCardDetails({customerPayment:{payment_source:(order==null?void 0:order.payment_source)||paymentSource},paymentType:paymentResource}),value=Object.assign(Object.assign({},card),{showCard,handleEditClick,readonly});return card.brand?_jsx(PaymentSourceContext.Provider,Object.assign({value},{children})):null}return!isGuest&&templateCustomerCards?publicKey&&!loading?_jsxs(_Fragment,{children:[isEmpty(customerPayments)?null:_jsx("div",Object.assign({className:p.className},{children:_jsx(PaymentCardsTemplate,Object.assign({},{paymentResource,customerPayments},{children:templateCustomerCards}))})),_jsx(CheckoutComPayment,Object.assign({show,templateCustomerSaveToWallet,publicKey,locale},paymentConfig))]}):loaderComponent:publicKey&&!loading?_jsx(CheckoutComPayment,Object.assign({show,publicKey,locale},paymentConfig)):loaderComponent}
1
+ import{__rest}from"tslib";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";import CheckoutComPayment from"../CheckoutComPayment";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import React from"react";import PaymentCardsTemplate from"../utils/PaymentCardsTemplate";import getCardDetails from"../../utils/getCardDetails";export default function CheckoutComGateway(props){var _a;const{readonly,showCard,handleEditClick,children,templateCustomerCards,show,loading,loaderComponent,templateCustomerSaveToWallet}=props,p=__rest(props,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","loaderComponent","templateCustomerSaveToWallet"]),{order}=React.useContext(OrderContext),{payment}=React.useContext(PaymentMethodChildrenContext),{payments,isGuest}=React.useContext(CustomerContext),{currentPaymentMethodId,config,paymentSource}=React.useContext(PaymentMethodContext),paymentResource="checkout_com_payments",locale=order==null?void 0:order.language_code;if(!readonly&&(payment==null?void 0:payment.id)!==currentPaymentMethodId)return null;const publicKey=((_a=order==null?void 0:order.payment_source)===null||_a===void 0?void 0:_a.public_key)||(paymentSource==null?void 0:paymentSource.public_key),paymentConfig=config?getPaymentConfig(paymentResource,config):{},customerPayments=!isEmpty(payments)&&payments?payments.filter(customerPayment=>{var _a2;return((_a2=customerPayment.payment_source)===null||_a2===void 0?void 0:_a2.type)===paymentResource}):[];if(readonly||showCard){const card=getCardDetails({customerPayment:{payment_source:(order==null?void 0:order.payment_source)||paymentSource},paymentType:paymentResource}),value=Object.assign(Object.assign({},card),{showCard,handleEditClick,readonly});return card.brand?_jsx(PaymentSourceContext.Provider,Object.assign({value},{children})):null}return!isGuest&&templateCustomerCards?publicKey&&!loading?_jsxs(_Fragment,{children:[isEmpty(customerPayments)?null:_jsx("div",Object.assign({className:p.className},{children:_jsx(PaymentCardsTemplate,Object.assign({},{paymentResource,customerPayments},{children:templateCustomerCards}))})),_jsx(CheckoutComPayment,Object.assign({show,templateCustomerSaveToWallet,publicKey,locale},paymentConfig))]}):loaderComponent:publicKey&&!loading?_jsx(CheckoutComPayment,Object.assign({show,publicKey,locale},paymentConfig)):loaderComponent}
@@ -1,2 +1,2 @@
1
1
  /// <reference types="react" />
2
- import{GatewayBaseType}from'../PaymentGateway';declare type PaypalGateway=GatewayBaseType;export default function PaypalGateway(props:PaypalGateway):JSX.Element|null;export{};
2
+ import{GatewayBaseType}from'../PaymentGateway';declare type PaypalGateway=Partial<GatewayBaseType>;export default function PaypalGateway(props:PaypalGateway):JSX.Element|null;export{};
@@ -1 +1 @@
1
- import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import PaypalPayment from"../PaypalPayment";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import{useContext}from"react";export default function PaypalGateway(props){var _a,_b;const{readonly,showCard,handleEditClick,children,templateCustomerCards,show,loading,onClickCustomerCards,loaderComponent,templateCustomerSaveToWallet}=props,p=__rest(props,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]),{payment}=useContext(PaymentMethodChildrenContext),{currentPaymentMethodId,config,paymentSource}=useContext(PaymentMethodContext),paymentResource="paypal_payments";if(!readonly&&(payment==null?void 0:payment.id)!==currentPaymentMethodId)return null;if(readonly||showCard){const card=((_a=paymentSource==null?void 0:paymentSource.options)===null||_a===void 0?void 0:_a.card)||((_b=paymentSource==null?void 0:paymentSource.metadata)===null||_b===void 0?void 0:_b.card),value=Object.assign(Object.assign({},card),{showCard,handleEditClick,readonly});return isEmpty(card)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value},{children}))}const paypalConfig=config&&getPaymentConfig(paymentResource,config);return _jsx(PaypalPayment,Object.assign({},p,{infoMessage:paypalConfig==null?void 0:paypalConfig.infoMessage}))}
1
+ import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import PaypalPayment from"../PaypalPayment";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import getCardDetails from"../../utils/getCardDetails";import isEmpty from"lodash/isEmpty";import{useContext}from"react";export default function PaypalGateway(props){const{readonly,showCard,handleEditClick,children}=props,p=__rest(props,["readonly","showCard","handleEditClick","children"]),{order}=useContext(OrderContext),{payment}=useContext(PaymentMethodChildrenContext),{currentPaymentMethodId,config,paymentSource}=useContext(PaymentMethodContext),paymentResource="paypal_payments";if(!readonly&&(payment==null?void 0:payment.id)!==currentPaymentMethodId)return null;if(readonly||showCard){const card=getCardDetails({customerPayment:{payment_source:(order==null?void 0:order.payment_source)||paymentSource},paymentType:paymentResource}),value=Object.assign(Object.assign({},card),{showCard,handleEditClick,readonly});return isEmpty(card)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value},{children}))}const paypalConfig=config&&getPaymentConfig(paymentResource,config);return delete p.show,delete p.templateCustomerCards,delete p.templateCustomerSaveToWallet,delete p.loading,delete p.loaderComponent,delete p.onClickCustomerCards,_jsx(PaypalPayment,Object.assign({},p,{infoMessage:paypalConfig==null?void 0:paypalConfig.infoMessage}))}
@@ -1 +1 @@
1
- import{__rest}from"tslib";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";import StripePayment from"../StripePayment";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import React from"react";import PaymentCardsTemplate from"../utils/PaymentCardsTemplate";export default function StripeGateway(props){var _a,_b;const{readonly,showCard,handleEditClick,children,templateCustomerCards,show,loading,loaderComponent,templateCustomerSaveToWallet}=props,p=__rest(props,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","loaderComponent","templateCustomerSaveToWallet"]),{order}=React.useContext(OrderContext),{payment}=React.useContext(PaymentMethodChildrenContext),{payments,isGuest}=React.useContext(CustomerContext),{currentPaymentMethodId,config,paymentSource}=React.useContext(PaymentMethodContext),paymentResource="stripe_payments",locale=order==null?void 0:order.language_code;if(!readonly&&(payment==null?void 0:payment.id)!==currentPaymentMethodId)return null;const publishableKey=paymentSource==null?void 0:paymentSource.publishable_key,stripeConfig=config?getPaymentConfig(paymentResource,config):{},customerPayments=!isEmpty(payments)&&payments?payments.filter(customerPayment=>{var _a2;return((_a2=customerPayment.payment_source)===null||_a2===void 0?void 0:_a2.type)==="stripe_payments"}):[];if(readonly||showCard){const card=(_a=paymentSource==null?void 0:paymentSource.options)===null||_a===void 0?void 0:_a.card,value=Object.assign(Object.assign({},card),{showCard,handleEditClick,readonly});return isEmpty(card)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value},{children}))}return!isGuest&&templateCustomerCards?_jsxs(_Fragment,{children:[isEmpty(customerPayments)?null:_jsx("div",Object.assign({className:p.className},{children:_jsx(PaymentCardsTemplate,Object.assign({},{paymentResource,customerPayments},{children:templateCustomerCards}))})),_jsx(StripePayment,Object.assign({show,templateCustomerSaveToWallet,publishableKey,locale},stripeConfig))]}):publishableKey&&!loading&&((_b=order==null?void 0:order.payment_source)===null||_b===void 0?void 0:_b.id)?_jsx(StripePayment,Object.assign({show,publishableKey,locale},stripeConfig)):loaderComponent}
1
+ import{__rest}from"tslib";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";import StripePayment from"../StripePayment";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import getCardDetails from"../../utils/getCardDetails";import isEmpty from"lodash/isEmpty";import React from"react";import PaymentCardsTemplate from"../utils/PaymentCardsTemplate";export default function StripeGateway(props){var _a,_b;const{readonly,showCard,handleEditClick,children,templateCustomerCards,show,loading,loaderComponent,templateCustomerSaveToWallet}=props,p=__rest(props,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","loaderComponent","templateCustomerSaveToWallet"]),{order}=React.useContext(OrderContext),{payment}=React.useContext(PaymentMethodChildrenContext),{payments,isGuest}=React.useContext(CustomerContext),{currentPaymentMethodId,config,paymentSource}=React.useContext(PaymentMethodContext),paymentResource="stripe_payments",locale=order==null?void 0:order.language_code;if(!readonly&&(payment==null?void 0:payment.id)!==currentPaymentMethodId)return null;const publishableKey=((_a=order==null?void 0:order.payment_source)===null||_a===void 0?void 0:_a.publishable_key)||(paymentSource==null?void 0:paymentSource.publishable_key),paymentSourceId=((_b=order==null?void 0:order.payment_source)===null||_b===void 0?void 0:_b.id)||(paymentSource==null?void 0:paymentSource.id),stripeConfig=config?getPaymentConfig(paymentResource,config):{},customerPayments=!isEmpty(payments)&&payments?payments.filter(customerPayment=>{var _a2;return((_a2=customerPayment.payment_source)===null||_a2===void 0?void 0:_a2.type)==="stripe_payments"}):[];if(readonly||showCard){const card=getCardDetails({customerPayment:{payment_source:(order==null?void 0:order.payment_source)||paymentSource},paymentType:paymentResource}),value=Object.assign(Object.assign({},card),{showCard,handleEditClick,readonly});return isEmpty(card)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value},{children}))}return!isGuest&&templateCustomerCards?_jsxs(_Fragment,{children:[isEmpty(customerPayments)?null:_jsx("div",Object.assign({className:p.className},{children:_jsx(PaymentCardsTemplate,Object.assign({},{paymentResource,customerPayments},{children:templateCustomerCards}))})),_jsx(StripePayment,Object.assign({show,templateCustomerSaveToWallet,publishableKey,locale},stripeConfig))]}):publishableKey&&!loading&&paymentSourceId?_jsx(StripePayment,Object.assign({show,publishableKey,locale},stripeConfig)):loaderComponent}
@@ -1,2 +1,2 @@
1
1
  /// <reference types="react" />
2
- import PropTypes from'prop-types';import{TimeFormat,BaseInputType,GiftCardInputName,LineItemType,BasePriceType,BaseFormatPrice,BaseSelectorType,AddressInputName,AddressCountrySelectName,AddressStateSelectName}from'../typings/index';import{DeliveryLeadTimeField}from'../components/DeliveryLeadTime';import{StockTransferFieldType}from'../components/StockTransferField';import{PaymentSourceDetailType}from'../components/PaymentSourceDetail';import{CodeType}from'../reducers/OrderReducer';import{ShipmentAttribute}from'../components/ShipmentField';declare const components:{Address:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};AddressCountrySelector:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<PropTypes.InferProps<{label:PropTypes.Validator<string>;value:PropTypes.Validator<string|number>;}>>;value:PropTypes.Requireable<string>;name:PropTypes.Validator<AddressCountrySelectName>;required:PropTypes.Requireable<boolean>;};defaultProps:{required:boolean;};};AddressStateSelector:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<PropTypes.InferProps<{label:PropTypes.Validator<string>;value:PropTypes.Validator<string|number>;}>>;value:PropTypes.Requireable<string>;name:PropTypes.Validator<AddressStateSelectName>;required:PropTypes.Requireable<boolean>;};defaultProps:{required:boolean;};};AddressField:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};AddressInput:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;name:PropTypes.Validator<AddressInputName>;type:PropTypes.Validator<BaseInputType>;placeholder:PropTypes.Requireable<string>;disabled:PropTypes.Requireable<boolean>;required:PropTypes.Requireable<boolean>;};defaultProps:{required:boolean;};};AdjustmentAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:BaseFormatPrice;};};AddToCartButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string|PropTypes.ReactElementLike>;skuCode:PropTypes.Requireable<string>;disabled:PropTypes.Requireable<boolean>;lineItem:PropTypes.Requireable<PropTypes.InferProps<{name:PropTypes.Validator<string>;imageUrl:PropTypes.Requireable<string>;}>>;};defaultProps:{label:string;};};AddressesContainer:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;shipToDifferentAddress:PropTypes.Requireable<boolean>;};};AvailabilityContainer:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;skuCode:PropTypes.Requireable<string>;};};AvailabilityTemplate:{displayName:string;propTypes:{timeFormat:PropTypes.Requireable<TimeFormat>;showShippingMethodName:PropTypes.Requireable<boolean>;children:PropTypes.Requireable<(...args:any[])=>any>;};defaultProps:{timeFormat:string;showShippingMethodName:boolean;};};BillingAddressContainer:{permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};BillingAddressForm:{permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};CheckoutLink:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string>;};defaultProps:{label:string;};};CommerceLayer:{permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;accessToken:PropTypes.Validator<string>;endpoint:PropTypes.Validator<string>;};};CustomerContainer:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;isGuest:PropTypes.Requireable<boolean>;};};CustomerInput:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;name:PropTypes.Requireable<string>;type:PropTypes.Requireable<string>;placeholder:PropTypes.Requireable<string>;disabled:PropTypes.Requireable<boolean>;required:PropTypes.Requireable<boolean>;saveOnBlur:PropTypes.Requireable<boolean>;};defaultProps:{required:boolean;};};DeliveryLeadTime:{displayName:string;propTypes:{type:PropTypes.Validator<DeliveryLeadTimeField>;children:PropTypes.Requireable<(...args:any[])=>any>;};};DiscountAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:BaseFormatPrice;};};Errors:{displayName:string;propTypes:{resource:PropTypes.Validator<import("../typings/errors").ResourceErrorType>;children:PropTypes.Requireable<(...args:any[])=>any>;field:PropTypes.Requireable<string>;};defaultProps:{messages:never[];field:string;};};ExternalFunction:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;url:PropTypes.Validator<string>;};};GiftCard:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;onSubmit:PropTypes.Requireable<(...args:any[])=>any>;};defaultProps:{onSubmit:undefined;};};GiftCardAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};};GiftCardContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};GiftCardCurrencySelector:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<PropTypes.InferProps<{value:PropTypes.Validator<string|number>;label:PropTypes.Validator<string>;}>>;value:PropTypes.Requireable<string>;required:PropTypes.Requireable<boolean>;};defaultProps:{required:boolean;};};GiftCardInput:{displayName:string;propTypes:{type:PropTypes.Validator<BaseInputType>;name:PropTypes.Validator<GiftCardInputName>;children:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<string>;};};GiftCardOrCouponForm:{permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};GiftCardOrCouponInput:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<string>;disabled:PropTypes.Requireable<boolean>;required:PropTypes.Requireable<boolean>;};};GiftCardOrCouponSubmit:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string|object>;};};GiftCardOrCouponCode:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;type:PropTypes.Requireable<CodeType>;};};GiftCardOrCouponRemoveButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;type:PropTypes.Requireable<CodeType>;label:PropTypes.Requireable<string|object>;};};ItemContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;skuCode:PropTypes.Requireable<string>;lineItem:PropTypes.Requireable<PropTypes.InferProps<{name:PropTypes.Validator<string>;imageUrl:PropTypes.Requireable<string>;}>>;};};LineItem:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;type:PropTypes.Requireable<LineItemType>;};defaultProps:{type:string;};};LineItemAmount:{displayName:string;propTypes:{type:PropTypes.Requireable<BasePriceType>;id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:string;type:string;};};LineItemImage:{displayName:string;propTypes:{width:PropTypes.Requireable<number>;children:PropTypes.Requireable<(...args:any[])=>any>;};};LineItemName:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};LineItemCode:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};LineItemOption:{displayName:string;propTypes:{name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;valueClassName:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;id:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;};};LineItemOptions:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;title:PropTypes.Requireable<string>;showName:PropTypes.Requireable<boolean>;skuOptionId:PropTypes.Requireable<string>;};};LineItemQuantity:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;max:PropTypes.Requireable<number>;disabled:PropTypes.Requireable<boolean>;readonly:PropTypes.Requireable<boolean>;};defaultProps:{max:number;};};LineItemRemoveLink:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string>;};defaultProps:{label:string;};};LineItemsContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;filters:PropTypes.Requireable<object>;loader:PropTypes.Requireable<string|PropTypes.ReactElementLike>;};defaultProps:{filters:{};loader:string;};};LineItemsCount:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;name:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;};};LineItemsEmpty:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;name:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;text:PropTypes.Requireable<string>;};};MetadataInput:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;name:PropTypes.Validator<string>;type:PropTypes.Validator<BaseInputType>;onChange:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<string>;};};OrderContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;orderId:PropTypes.Requireable<string>;metadata:PropTypes.Requireable<{[x:string]:string|null|undefined;}>;attributes:PropTypes.Requireable<object>;};defaultProps:{metadata:{};};};OrderNumber:{displayName:string;propTypes:{className:PropTypes.Requireable<string>;};defaultProps:{format:BaseFormatPrice;};};OrderStorage:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;clearWhenPlaced:PropTypes.Requireable<boolean>;persistKey:PropTypes.Validator<string>;};};PaymentMethod:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};PaymentMethodAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:BaseFormatPrice;};};PaymentMethodName:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};PaymentMethodPrice:{displayName:string;propTypes:{type:PropTypes.Requireable<"amount">;id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};};PaymentMethodRadioButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};PaymentMethodsContainer:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};PaymentSource:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Requireable<import("react").ReactNode|(()=>import("react").ReactNode)>;readonly:PropTypes.Requireable<boolean>;};};PaymentSourceBrandIcon:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;width:PropTypes.Requireable<number>;height:PropTypes.Requireable<number>;src:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;};};PaymentSourceBrandName:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string>;};};PaymentSourceEditButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string|PropTypes.ReactElementLike>;};};PaymentSourceDetail:{displayName:string;propTypes:{type:PropTypes.Validator<PaymentSourceDetailType>;};};PlaceOrderButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string|PropTypes.ReactElementLike>;};defaultProps:{label:string;};};PlaceOrderContainer:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};Price:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;compareClassName:PropTypes.Requireable<string>;skuCode:PropTypes.Requireable<string>;showCompare:PropTypes.Requireable<boolean>;};defaultProps:{skuCode:string;};};PricesContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;skuCode:PropTypes.Requireable<string>;loader:PropTypes.Requireable<string|PropTypes.ReactElementLike>;perPage:PropTypes.Requireable<number>;filters:PropTypes.Requireable<object>;};defaultProps:{perPage:number;filters:{};loader:string;skuCode:string;};};PrivacyAndTermsCheckbox:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};QuantitySelector:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;min:PropTypes.Requireable<number>;max:PropTypes.Requireable<number>;value:PropTypes.Requireable<string>;skuCode:PropTypes.Requireable<string>;disabled:PropTypes.Requireable<boolean>;};defaultProps:{min:number;};};SaveAddressesButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string|PropTypes.ReactElementLike>;onClick:PropTypes.Requireable<(...args:any[])=>any>;disabled:PropTypes.Requireable<boolean>;};defaultProps:{label:string;};};Shipment:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};ShipmentField:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;name:PropTypes.Validator<ShipmentAttribute>;};};ShipmentsContainer:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};ShippingAddressContainer:{permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};SaveCustomerButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string|PropTypes.ReactElementLike>;onClick:PropTypes.Requireable<(...args:any[])=>any>;};defaultProps:{label:string;};};ShippingAddressForm:{permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};ShippingAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};};ShippingMethod:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;readonly:PropTypes.Requireable<boolean>;};};ShippingMethodName:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};ShippingMethodRadioButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};ShippingMethodPrice:{displayName:string;propTypes:{type:PropTypes.Requireable<"amount">;id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:string;type:string;};};SkuList:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;id:PropTypes.Validator<string>;};};SkuListsContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};SkuOption:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;id:PropTypes.Validator<string>;};};SkuOptionInput:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;name:PropTypes.Validator<string>;type:PropTypes.Validator<BaseInputType>;onChange:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<string>;};};SkuOptionsContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;skuCode:PropTypes.Requireable<string>;};};StockTransfer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};StockTransferField:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;type:PropTypes.Validator<StockTransferFieldType>;};};SubmitButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string|PropTypes.ReactElementLike>;};defaultProps:{label:string;};};SubTotalAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:BaseFormatPrice;};};TaxesAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:BaseFormatPrice;};};TotalAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:BaseFormatPrice;};};VariantsContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;skuCode:PropTypes.Requireable<string>;filters:PropTypes.Requireable<object>;};defaultProps:{skuCode:string;filters:{};};};VariantSelector:{displayName:string;propTypes:{options:PropTypes.Validator<PropTypes.InferProps<{label:PropTypes.Validator<string>;code:PropTypes.Validator<string>;lineItem:PropTypes.Requireable<PropTypes.InferProps<{name:PropTypes.Validator<string>;imageUrl:PropTypes.Requireable<string>;}>>;}>[]>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;type:PropTypes.Requireable<BaseSelectorType>;loader:PropTypes.Requireable<PropTypes.ReactElementLike>;placeholder:PropTypes.Requireable<string>;skuCode:PropTypes.Requireable<string>;};defaultProps:{placeholder:string;type:BaseSelectorType;};};};export default components;
2
+ import PropTypes from'prop-types';import{TimeFormat,BaseInputType,GiftCardInputName,LineItemType,BasePriceType,BaseFormatPrice,BaseSelectorType,AddressInputName,AddressCountrySelectName,AddressStateSelectName}from'../typings/index';import{DeliveryLeadTimeField}from'../components/DeliveryLeadTime';import{StockTransferFieldType}from'../components/StockTransferField';import{PaymentSourceDetailType}from'../components/PaymentSourceDetail';import{CodeType}from'../reducers/OrderReducer';import{ShipmentAttribute}from'../components/ShipmentField';declare const components:{Address:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};AddressCountrySelector:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<PropTypes.InferProps<{label:PropTypes.Validator<string>;value:PropTypes.Validator<string|number>;}>>;value:PropTypes.Requireable<string>;name:PropTypes.Validator<AddressCountrySelectName>;required:PropTypes.Requireable<boolean>;};defaultProps:{required:boolean;};};AddressStateSelector:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<PropTypes.InferProps<{label:PropTypes.Validator<string>;value:PropTypes.Validator<string|number>;}>>;value:PropTypes.Requireable<string>;name:PropTypes.Validator<AddressStateSelectName>;required:PropTypes.Requireable<boolean>;};defaultProps:{required:boolean;};};AddressField:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};AddressInput:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;name:PropTypes.Validator<AddressInputName>;type:PropTypes.Validator<BaseInputType>;placeholder:PropTypes.Requireable<string>;disabled:PropTypes.Requireable<boolean>;required:PropTypes.Requireable<boolean>;};defaultProps:{required:boolean;};};AdjustmentAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:BaseFormatPrice;};};AddToCartButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string|PropTypes.ReactElementLike>;skuCode:PropTypes.Requireable<string>;disabled:PropTypes.Requireable<boolean>;lineItem:PropTypes.Requireable<PropTypes.InferProps<{name:PropTypes.Validator<string>;imageUrl:PropTypes.Requireable<string>;}>>;};defaultProps:{label:string;};};AddressesContainer:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;shipToDifferentAddress:PropTypes.Requireable<boolean>;};};AvailabilityContainer:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;skuCode:PropTypes.Requireable<string>;};};AvailabilityTemplate:{displayName:string;propTypes:{timeFormat:PropTypes.Requireable<TimeFormat>;showShippingMethodName:PropTypes.Requireable<boolean>;children:PropTypes.Requireable<(...args:any[])=>any>;};defaultProps:{timeFormat:string;showShippingMethodName:boolean;};};BillingAddressContainer:{permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};BillingAddressForm:{permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};CheckoutLink:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string>;};defaultProps:{label:string;};};CommerceLayer:{permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;accessToken:PropTypes.Validator<string>;endpoint:PropTypes.Validator<string>;};};CustomerContainer:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;isGuest:PropTypes.Requireable<boolean>;};};CustomerInput:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;name:PropTypes.Requireable<string>;type:PropTypes.Requireable<string>;placeholder:PropTypes.Requireable<string>;disabled:PropTypes.Requireable<boolean>;required:PropTypes.Requireable<boolean>;saveOnBlur:PropTypes.Requireable<boolean>;};defaultProps:{required:boolean;};};DeliveryLeadTime:{displayName:string;propTypes:{type:PropTypes.Validator<DeliveryLeadTimeField>;children:PropTypes.Requireable<(...args:any[])=>any>;};};DiscountAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:BaseFormatPrice;};};Errors:{displayName:string;propTypes:{resource:PropTypes.Validator<import("../typings/errors").ResourceErrorType>;children:PropTypes.Requireable<(...args:any[])=>any>;field:PropTypes.Requireable<string>;};defaultProps:{messages:never[];field:string;};};ExternalFunction:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;url:PropTypes.Validator<string>;};};GiftCard:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;onSubmit:PropTypes.Requireable<(...args:any[])=>any>;};defaultProps:{onSubmit:undefined;};};GiftCardAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};};GiftCardContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};GiftCardCurrencySelector:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<PropTypes.InferProps<{value:PropTypes.Validator<string|number>;label:PropTypes.Validator<string>;}>>;value:PropTypes.Requireable<string>;required:PropTypes.Requireable<boolean>;};defaultProps:{required:boolean;};};GiftCardInput:{displayName:string;propTypes:{type:PropTypes.Validator<BaseInputType>;name:PropTypes.Validator<GiftCardInputName>;children:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<string>;};};GiftCardOrCouponForm:{permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};GiftCardOrCouponInput:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<string>;disabled:PropTypes.Requireable<boolean>;required:PropTypes.Requireable<boolean>;};};GiftCardOrCouponSubmit:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string|object>;};};GiftCardOrCouponCode:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;type:PropTypes.Requireable<CodeType>;};};GiftCardOrCouponRemoveButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;type:PropTypes.Requireable<CodeType>;label:PropTypes.Requireable<string|object>;};};ItemContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;skuCode:PropTypes.Requireable<string>;lineItem:PropTypes.Requireable<PropTypes.InferProps<{name:PropTypes.Validator<string>;imageUrl:PropTypes.Requireable<string>;}>>;};};LineItem:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;type:PropTypes.Requireable<LineItemType>;};defaultProps:{type:string;};};LineItemAmount:{displayName:string;propTypes:{type:PropTypes.Requireable<BasePriceType>;id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:string;type:string;};};LineItemImage:{displayName:string;propTypes:{width:PropTypes.Requireable<number>;children:PropTypes.Requireable<(...args:any[])=>any>;};};LineItemName:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};LineItemCode:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};LineItemOption:{displayName:string;propTypes:{name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;valueClassName:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;id:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;};};LineItemOptions:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;title:PropTypes.Requireable<string>;showName:PropTypes.Requireable<boolean>;skuOptionId:PropTypes.Requireable<string>;};};LineItemQuantity:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;max:PropTypes.Requireable<number>;disabled:PropTypes.Requireable<boolean>;readonly:PropTypes.Requireable<boolean>;};defaultProps:{max:number;};};LineItemRemoveLink:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string>;};defaultProps:{label:string;};};LineItemsContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;filters:PropTypes.Requireable<object>;loader:PropTypes.Requireable<string|PropTypes.ReactElementLike>;};defaultProps:{filters:{};loader:string;};};LineItemsCount:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;name:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;};};LineItemsEmpty:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;name:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;text:PropTypes.Requireable<string>;};};MetadataInput:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;name:PropTypes.Validator<string>;type:PropTypes.Validator<BaseInputType>;onChange:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<string>;};};OrderContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;orderId:PropTypes.Requireable<string>;metadata:PropTypes.Requireable<{[x:string]:string|null|undefined;}>;attributes:PropTypes.Requireable<object>;};defaultProps:{metadata:{};};};OrderNumber:{displayName:string;propTypes:{className:PropTypes.Requireable<string>;};defaultProps:{format:BaseFormatPrice;};};OrderStorage:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;clearWhenPlaced:PropTypes.Requireable<boolean>;persistKey:PropTypes.Validator<string>;};};PaymentMethod:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};PaymentMethodAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:BaseFormatPrice;};};PaymentMethodName:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};PaymentMethodPrice:{displayName:string;propTypes:{type:PropTypes.Requireable<"amount">;id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};};PaymentMethodRadioButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};PaymentMethodsContainer:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};PaymentSource:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Requireable<import("react").ReactNode|(()=>import("react").ReactNode)>;readonly:PropTypes.Requireable<boolean>;};};PaymentSourceBrandIcon:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;width:PropTypes.Requireable<number>;height:PropTypes.Requireable<number>;src:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;};};PaymentSourceBrandName:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string>;};};PaymentSourceEditButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string|PropTypes.ReactElementLike>;};};PaymentSourceDetail:{displayName:string;propTypes:{type:PropTypes.Validator<PaymentSourceDetailType>;};};PlaceOrderButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string|PropTypes.ReactElementLike>;};defaultProps:{label:string;};};PlaceOrderContainer:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};Price:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;compareClassName:PropTypes.Requireable<string>;skuCode:PropTypes.Requireable<string>;showCompare:PropTypes.Requireable<boolean>;};defaultProps:{skuCode:string;};};PricesContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;skuCode:PropTypes.Requireable<string>;loader:PropTypes.Requireable<string|PropTypes.ReactElementLike>;perPage:PropTypes.Requireable<number>;filters:PropTypes.Requireable<object>;};defaultProps:{perPage:number;filters:{};loader:string;skuCode:string;};};PrivacyAndTermsCheckbox:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};QuantitySelector:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;min:PropTypes.Requireable<number>;max:PropTypes.Requireable<number>;value:PropTypes.Requireable<string>;skuCode:PropTypes.Requireable<string>;disabled:PropTypes.Requireable<boolean>;};defaultProps:{min:number;};};SaveAddressesButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string|PropTypes.ReactElementLike>;onClick:PropTypes.Requireable<(...args:any[])=>any>;disabled:PropTypes.Requireable<boolean>;};defaultProps:{label:string;};};Shipment:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};ShipmentField:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;name:PropTypes.Validator<ShipmentAttribute>;};};ShipmentsContainer:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};ShippingAddressContainer:{permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};SaveCustomerButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string|PropTypes.ReactElementLike>;onClick:PropTypes.Requireable<(...args:any[])=>any>;};defaultProps:{label:string;};};ShippingAddressForm:{permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};ShippingAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};};ShippingMethod:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;readonly:PropTypes.Requireable<boolean>;};};ShippingMethodName:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};ShippingMethodRadioButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};ShippingMethodPrice:{displayName:string;propTypes:{type:PropTypes.Requireable<"amount">;id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:string;type:string;};};SkuContainer:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};Skus:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};SkuField:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;attribute:PropTypes.Requireable<string>;tagElement:PropTypes.Requireable<string>;};};SkuList:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;id:PropTypes.Validator<string>;};};SkuListsContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};SkuOption:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;id:PropTypes.Validator<string>;};};SkuOptionInput:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;name:PropTypes.Validator<string>;type:PropTypes.Validator<BaseInputType>;onChange:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<string>;};};SkuOptionsContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;skuCode:PropTypes.Requireable<string>;};};StockTransfer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};StockTransferField:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;type:PropTypes.Validator<StockTransferFieldType>;};};SubmitButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string|PropTypes.ReactElementLike>;};defaultProps:{label:string;};};SubTotalAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:BaseFormatPrice;};};TaxesAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:BaseFormatPrice;};};TotalAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:BaseFormatPrice;};};VariantsContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;skuCode:PropTypes.Requireable<string>;filters:PropTypes.Requireable<object>;};defaultProps:{skuCode:string;filters:{};};};VariantSelector:{displayName:string;propTypes:{options:PropTypes.Validator<PropTypes.InferProps<{label:PropTypes.Validator<string>;code:PropTypes.Validator<string>;lineItem:PropTypes.Requireable<PropTypes.InferProps<{name:PropTypes.Validator<string>;imageUrl:PropTypes.Requireable<string>;}>>;}>[]>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;type:PropTypes.Requireable<BaseSelectorType>;loader:PropTypes.Requireable<PropTypes.ReactElementLike>;placeholder:PropTypes.Requireable<string>;skuCode:PropTypes.Requireable<string>;};defaultProps:{placeholder:string;type:BaseSelectorType;};};};export default components;
@@ -1 +1 @@
1
- import PropTypes from"prop-types";import childrenTypes from"../utils/childrenTypes";import{baseOrderComponentPricePropTypes,PTLoader,BMObject}from"../typings/index";import{ErrorPropTypes}from"../typings/errors";import{BaseInputComponentPropTypes}from"../typings/index";const components={Address:{permittedChildren:["AddressField","ReactNode"],displayName:"Address",propTypes:{children:childrenTypes.isRequired}},AddressCountrySelector:{displayName:"AddressCountrySelector",propTypes:{children:PropTypes.func,placeholder:PropTypes.shape({label:PropTypes.string.isRequired,value:PropTypes.oneOfType([PropTypes.string,PropTypes.number]).isRequired}),value:PropTypes.string,name:PropTypes.oneOf(["billing_address_country_code","shipping_address_country_code"]).isRequired,required:PropTypes.bool},defaultProps:{required:!0}},AddressStateSelector:{displayName:"AddressStateSelector",propTypes:{children:PropTypes.func,placeholder:PropTypes.shape({label:PropTypes.string.isRequired,value:PropTypes.oneOfType([PropTypes.string,PropTypes.number]).isRequired}),value:PropTypes.string,name:PropTypes.oneOf(["billing_address_state_code","shipping_address_state_code"]).isRequired,required:PropTypes.bool},defaultProps:{required:!0}},AddressField:{displayName:"AddressField",propTypes:{children:PropTypes.func}},AddressInput:{displayName:"AddressInput",propTypes:{children:PropTypes.func,name:PropTypes.oneOf(["billing_address_city","billing_address_company","billing_address_email","billing_address_first_name","billing_address_last_name","billing_address_line_1","billing_address_line_2","billing_address_phone","billing_address_state_code","billing_address_zip_code","billing_address_billing_info","billing_address_save_to_customer_book","shipping_address_city","shipping_address_company","shipping_address_email","shipping_address_first_name","shipping_address_last_name","shipping_address_line_1","shipping_address_line_2","shipping_address_phone","shipping_address_state_code","shipping_address_zip_code","shipping_address_save_to_customer_book"]).isRequired,type:PropTypes.oneOf(["checkbox","date","email","number","tel","text","textarea"]).isRequired,placeholder:PropTypes.string,disabled:PropTypes.bool,required:PropTypes.bool},defaultProps:{required:!0}},AdjustmentAmount:{displayName:"AdjustmentAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},AddToCartButton:{displayName:"AddToCartButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element]),skuCode:PropTypes.string,disabled:PropTypes.bool,lineItem:PropTypes.shape({name:PropTypes.string.isRequired,imageUrl:PropTypes.string})},defaultProps:{label:"Add to cart"}},AddressesContainer:{displayName:"AddressesContainer",permittedChildren:["BillingAddressForm","BillingAddressContainer","ShippingAddressForm","ShippingAddressContainer","SaveAddressesButton","ReactNode"],propTypes:{children:childrenTypes.isRequired,shipToDifferentAddress:PropTypes.bool}},AvailabilityContainer:{displayName:"AvailabilityContainer",permittedChildren:["AvailabilityTemplate","ReactNode"],propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string}},AvailabilityTemplate:{displayName:"AvailabilityTemplate",propTypes:{timeFormat:PropTypes.oneOf(["days","hours"]),showShippingMethodName:PropTypes.bool,children:PropTypes.func},defaultProps:{timeFormat:"days",showShippingMethodName:!1}},BillingAddressContainer:{permittedChildren:["Address","ReactNode"],propTypes:{children:childrenTypes.isRequired}},BillingAddressForm:{permittedChildren:["AddressInput","ReactNode","Errors"],propTypes:{children:childrenTypes.isRequired}},CheckoutLink:{displayName:"CheckoutLink",propTypes:{children:PropTypes.func,label:PropTypes.string},defaultProps:{label:"Checkout"}},CommerceLayer:{permittedChildren:["OrderContainer","OrderStorage","PricesContainer","GiftCardContainer","ReactNode"],propTypes:{children:childrenTypes.isRequired,accessToken:PropTypes.string.isRequired,endpoint:PropTypes.string.isRequired}},CustomerContainer:{displayName:"CustomerContainer",permittedChildren:["CustomerInput","SaveCustomerButton","AddressesContainer","PaymentMethodsContainer","ShipmentsContainer","ReactNode"],propTypes:{children:childrenTypes.isRequired,isGuest:PropTypes.bool}},CustomerInput:{displayName:"CustomerInput",propTypes:{children:PropTypes.func,name:PropTypes.oneOf(["customerEmail"]),type:PropTypes.oneOf(["email"]),placeholder:PropTypes.string,disabled:PropTypes.bool,required:PropTypes.bool,saveOnBlur:PropTypes.bool},defaultProps:{required:!0}},DeliveryLeadTime:{displayName:"DeliveryLeadTime",propTypes:{type:PropTypes.oneOf(["max_days","max_hours","min_days","min_hours"]).isRequired,children:PropTypes.func}},DiscountAmount:{displayName:"DiscountAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},Errors:{displayName:"Errors",propTypes:ErrorPropTypes,defaultProps:{messages:[],field:"base"}},ExternalFunction:{displayName:"ExternalFunction",permittedChildren:["AddToCartButton","ReactNode"],propTypes:{children:childrenTypes.isRequired,url:PropTypes.string.isRequired}},GiftCard:{permittedChildren:["GiftCardCurrencySelector","GiftCardInput","Errors","MetadataInput","SubmitButton","ReactNode"],displayName:"GiftCard",propTypes:{children:childrenTypes.isRequired,onSubmit:PropTypes.func},defaultProps:{onSubmit:void 0}},GiftCardAmount:{displayName:"GiftCardAmount",propTypes:baseOrderComponentPricePropTypes},GiftCardContainer:{permittedChildren:["GiftCard","Errors","ReactNode"],displayName:"GiftCardContainer",propTypes:{children:childrenTypes.isRequired}},GiftCardCurrencySelector:{displayName:"GiftCardCurrencySelector",propTypes:{children:PropTypes.func,placeholder:PropTypes.shape({value:PropTypes.oneOfType([PropTypes.string,PropTypes.number]).isRequired,label:PropTypes.string.isRequired}),value:PropTypes.string,required:PropTypes.bool},defaultProps:{required:!0}},GiftCardInput:{displayName:"GiftCardInput",propTypes:{type:PropTypes.oneOf(["text","email","number","date","checkbox"]).isRequired,name:PropTypes.oneOf(["balanceCents","balanceMaxCents","singleUse","rechargeable","imageUrl","expiresAt","referenceOrigin","email","firstName","lastName","reference"]).isRequired,children:PropTypes.func,placeholder:PropTypes.string}},GiftCardOrCouponForm:{permittedChildren:["GiftCardOrCouponInput","GiftCardOrCouponSubmit","ReactNode"],propTypes:{children:childrenTypes.isRequired}},GiftCardOrCouponInput:{displayName:"GiftCardOrCouponInput",propTypes:{children:PropTypes.func,placeholder:PropTypes.string,disabled:PropTypes.bool,required:PropTypes.bool}},GiftCardOrCouponSubmit:{displayName:"GiftCardOrCouponSubmit",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.object])}},GiftCardOrCouponCode:{displayName:"GiftCardOrCouponCode",propTypes:{children:PropTypes.func,type:PropTypes.oneOf(["coupon","gift_card"])}},GiftCardOrCouponRemoveButton:{displayName:"GiftCardOrCouponRemoveButton",propTypes:{children:PropTypes.func,type:PropTypes.oneOf(["coupon","gift_card"]),label:PropTypes.oneOfType([PropTypes.string,PropTypes.object])}},ItemContainer:{permittedChildren:["PricesContainer","VariantsContainer","SkuOptionContainer","QuantitySelector","AddToCartButton","AvailabilityContainer","SkuListsContainer","ReactNode"],displayName:"ItemContainer",propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string,lineItem:PropTypes.shape({name:PropTypes.string.isRequired,imageUrl:PropTypes.string})}},LineItem:{permittedChildren:["AvailabilityContainer","LineItemImage","LineItemName","LineItemOptions","LineItemQuantity","LineItemAmount","LineItemRemoveLink","StockTransfer","Errors","ReactNode"],displayName:"LineItem",propTypes:{children:childrenTypes.isRequired,type:PropTypes.oneOf(["skus","gift_cards","shipments","payment_methods","promotions","adjustments","bundles"])},defaultProps:{type:"skus"}},LineItemAmount:{displayName:"LineItemAmount",propTypes:Object.assign(Object.assign({},baseOrderComponentPricePropTypes),{type:PropTypes.oneOf(["total","unit","option"])}),defaultProps:{format:"formatted",type:"total"}},LineItemImage:{displayName:"LineItemImage",propTypes:{width:PropTypes.number,children:PropTypes.func}},LineItemName:{displayName:"LineItemName",propTypes:{children:PropTypes.func}},LineItemCode:{displayName:"LineItemCode",propTypes:{children:PropTypes.func}},LineItemOption:{displayName:"LineItemOption",propTypes:{name:PropTypes.string,children:PropTypes.func,valueClassName:PropTypes.string,className:PropTypes.string,id:PropTypes.string,style:PropTypes.object}},LineItemOptions:{permittedChildren:["LineItemOption","ReactNode"],displayName:"LineItemOptions",propTypes:{children:childrenTypes.isRequired,title:PropTypes.string,showName:PropTypes.bool,skuOptionId:PropTypes.string}},LineItemQuantity:{displayName:"LineItemQuantity",propTypes:{children:PropTypes.func,max:PropTypes.number,disabled:PropTypes.bool,readonly:PropTypes.bool},defaultProps:{max:50}},LineItemRemoveLink:{displayName:"LineItemRemoveLink",propTypes:{children:PropTypes.func,label:PropTypes.string},defaultProps:{label:"Remove"}},LineItemsContainer:{permittedChildren:["LineItemsCount","LineItemsEmpty","LineItem","ReactNode"],displayName:"LineItemsContainer",propTypes:{children:childrenTypes.isRequired,filters:PropTypes.object,loader:PTLoader},defaultProps:{filters:{},loader:"Loading..."}},LineItemsCount:{displayName:"LineItemsCount",propTypes:{children:PropTypes.func,id:PropTypes.string,className:PropTypes.string,name:PropTypes.string,style:PropTypes.object}},LineItemsEmpty:{displayName:"LineItemsEmpty",propTypes:{children:PropTypes.func,id:PropTypes.string,className:PropTypes.string,name:PropTypes.string,style:PropTypes.object,text:PropTypes.string}},MetadataInput:{displayName:"MetadataInput",propTypes:BaseInputComponentPropTypes},OrderContainer:{permittedChildren:["AddressesContainer","CustomerContainer","ItemContainer","LineItemsContainer","SubTotalAmount","DiscountAmount","AdjustmentAmount","ShippingAmount","TaxesAmount","GiftCardAmount","TotalAmount","CheckoutLink","GiftCardContainer","ShipmentsContainer","PaymentMethodsContainer","PaymentMethodAmount","GiftCardOrCouponForm","GiftCardOrCouponCode","GiftCardOrCouponRemoveButton","Errors","OrderNumber","ReactNode"],displayName:"OrderContainer",propTypes:{children:childrenTypes.isRequired,orderId:PropTypes.string,metadata:BMObject,attributes:PropTypes.object},defaultProps:{metadata:{}}},OrderNumber:{displayName:"OrderNumber",propTypes:{className:PropTypes.string},defaultProps:{format:"formatted"}},OrderStorage:{permittedChildren:["OrderContainer","ReactNode"],displayName:"OrderStorage",propTypes:{children:childrenTypes.isRequired,clearWhenPlaced:PropTypes.bool,persistKey:PropTypes.string.isRequired}},PaymentMethod:{permittedChildren:["PaymentMethodName","PaymentMethodRadioButton","PaymentMethodPrice","PaymentSource","ReactNode","Errors"],displayName:"PaymentMethod",propTypes:{children:childrenTypes.isRequired}},PaymentMethodAmount:{displayName:"PaymentMethodAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},PaymentMethodName:{displayName:"PaymentMethodName",propTypes:{children:PropTypes.func}},PaymentMethodPrice:{displayName:"PaymentMethodPrice",propTypes:Object.assign(Object.assign({},baseOrderComponentPricePropTypes),{type:PropTypes.oneOf(["amount"])})},PaymentMethodRadioButton:{displayName:"PaymentMethodRadioButton",propTypes:{children:PropTypes.func}},PaymentMethodsContainer:{displayName:"PaymentMethodsContainer",permittedChildren:["PaymentSource","ReactNode","PlaceOrderContainer"],propTypes:{children:childrenTypes.isRequired}},PaymentSource:{displayName:"PaymentSource",permittedChildren:["PaymentSourceBrandIcon","PaymentSourceBrandName","PaymentSourceEditButton","PaymentSourceDetail","ReactNode"],propTypes:{children:childrenTypes,readonly:PropTypes.bool}},PaymentSourceBrandIcon:{displayName:"PaymentSourceBrandIcon",propTypes:{children:PropTypes.func,width:PropTypes.number,height:PropTypes.number,src:PropTypes.string,className:PropTypes.string}},PaymentSourceBrandName:{displayName:"PaymentSourceBrandName",propTypes:{children:PropTypes.func,label:PropTypes.string}},PaymentSourceEditButton:{displayName:"PaymentSourceEditButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element])}},PaymentSourceDetail:{displayName:"PaymentSourceDetail",propTypes:{type:PropTypes.oneOf(["last4","exp_year","exp_month"]).isRequired}},PlaceOrderButton:{displayName:"PlaceOrderButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element])},defaultProps:{label:"Place order"}},PlaceOrderContainer:{displayName:"PlaceOrderContainer",permittedChildren:["PaymentMethod","PlaceOrderButton","PrivacyAndTermsCheckbox","ReactNode"],propTypes:{children:childrenTypes.isRequired}},Price:{displayName:"Price",propTypes:{children:PropTypes.func,compareClassName:PropTypes.string,skuCode:PropTypes.string,showCompare:PropTypes.bool},defaultProps:{skuCode:""}},PricesContainer:{permittedChildren:["Price","ReactNode"],displayName:"PricesContainer",propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string,loader:PTLoader,perPage:PropTypes.number,filters:PropTypes.object},defaultProps:{perPage:10,filters:{},loader:"Loading...",skuCode:""}},PrivacyAndTermsCheckbox:{displayName:"PrivacyAndTermsCheckbox",propTypes:{children:PropTypes.func}},QuantitySelector:{displayName:"QuantitySelector",propTypes:{children:PropTypes.func,min:PropTypes.number,max:PropTypes.number,value:PropTypes.string,skuCode:PropTypes.string,disabled:PropTypes.bool},defaultProps:{min:1}},SaveAddressesButton:{displayName:"SaveAddressesButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element]),onClick:PropTypes.func,disabled:PropTypes.bool},defaultProps:{label:"Continue to delivery"}},Shipment:{permittedChildren:["LineItemsContainer","LineItem","ShippingMethod","ReactNode"],displayName:"Shipment",propTypes:{children:childrenTypes.isRequired}},ShipmentField:{displayName:"ShipmentField",propTypes:{children:PropTypes.func,name:PropTypes.oneOf(["cost_amount_cents","cost_amount_float","currency_code","formatted_cost_amount","number","status","key_number"]).isRequired}},ShipmentsContainer:{displayName:"ShipmentsContainer",permittedChildren:["Shipment","ReactNode","Errors"],propTypes:{children:childrenTypes.isRequired}},ShippingAddressContainer:{permittedChildren:["Address","ReactNode"],propTypes:{children:childrenTypes.isRequired}},SaveCustomerButton:{displayName:"SaveCustomerButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element]),onClick:PropTypes.func},defaultProps:{label:"Save"}},ShippingAddressForm:{permittedChildren:["AddressInput","ReactNode"],propTypes:{children:childrenTypes.isRequired}},ShippingAmount:{displayName:"ShippingAmount",propTypes:baseOrderComponentPricePropTypes},ShippingMethod:{permittedChildren:["ShippingMethodName","ShippingMethodPrice","ShippingMethodRadioButton","DeliveryLeadTime","ReactNode"],displayName:"ShippingMethod",propTypes:{children:childrenTypes.isRequired,readonly:PropTypes.bool}},ShippingMethodName:{displayName:"ShippingMethodName",propTypes:{children:PropTypes.func}},ShippingMethodRadioButton:{displayName:"ShippingMethodRadioButton",propTypes:{children:PropTypes.func}},ShippingMethodPrice:{displayName:"ShippingMethodPrice",propTypes:Object.assign(Object.assign({},baseOrderComponentPricePropTypes),{type:PropTypes.oneOf(["amount"])}),defaultProps:{format:"formatted",type:"amount"}},SkuList:{permittedChildren:["AddToCartButton","QuantitySelector","ReactNode"],displayName:"SkuList",propTypes:{children:childrenTypes.isRequired,id:PropTypes.string.isRequired}},SkuListsContainer:{permittedChildren:["SkuList","ReactNode"],displayName:"SkuListsContainer",propTypes:{children:childrenTypes.isRequired}},SkuOption:{permittedChildren:["SkuOptionInput","ReactNode"],displayName:"SkuOption",propTypes:{children:childrenTypes.isRequired,id:PropTypes.string.isRequired}},SkuOptionInput:{displayName:"SkuOptionInput",propTypes:BaseInputComponentPropTypes},SkuOptionsContainer:{permittedChildren:["SkuOption","ReactNode"],displayName:"SkuOptionsContainer",propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string}},StockTransfer:{permittedChildren:["StockTransferField","ReactNode"],displayName:"StockTransfer",propTypes:{children:childrenTypes.isRequired}},StockTransferField:{displayName:"StockTransferField",propTypes:{children:PropTypes.func,type:PropTypes.oneOf(["quantity","sku_code"]).isRequired}},SubmitButton:{displayName:"SubmitButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element])},defaultProps:{label:"Submit"}},SubTotalAmount:{displayName:"SubTotalAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},TaxesAmount:{displayName:"TaxesAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},TotalAmount:{displayName:"TotalAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},VariantsContainer:{permittedChildren:["VariantSelector","ReactNode"],displayName:"VariantsContainer",propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string,filters:PropTypes.object},defaultProps:{skuCode:"",filters:{}}},VariantSelector:{displayName:"VariantSelector",propTypes:{options:PropTypes.arrayOf(PropTypes.shape({label:PropTypes.string.isRequired,code:PropTypes.string.isRequired,lineItem:PropTypes.shape({name:PropTypes.string.isRequired,imageUrl:PropTypes.string})}).isRequired).isRequired,name:PropTypes.string,children:PropTypes.func,type:PropTypes.oneOf(["select","radio"]),loader:PropTypes.element,placeholder:PropTypes.string,skuCode:PropTypes.string},defaultProps:{placeholder:"Select a variant",type:"select"}}};export default components;
1
+ import PropTypes from"prop-types";import childrenTypes from"../utils/childrenTypes";import{baseOrderComponentPricePropTypes,PTLoader,BMObject}from"../typings/index";import{ErrorPropTypes}from"../typings/errors";import{BaseInputComponentPropTypes}from"../typings/index";const components={Address:{permittedChildren:["AddressField","ReactNode"],displayName:"Address",propTypes:{children:childrenTypes.isRequired}},AddressCountrySelector:{displayName:"AddressCountrySelector",propTypes:{children:PropTypes.func,placeholder:PropTypes.shape({label:PropTypes.string.isRequired,value:PropTypes.oneOfType([PropTypes.string,PropTypes.number]).isRequired}),value:PropTypes.string,name:PropTypes.oneOf(["billing_address_country_code","shipping_address_country_code"]).isRequired,required:PropTypes.bool},defaultProps:{required:!0}},AddressStateSelector:{displayName:"AddressStateSelector",propTypes:{children:PropTypes.func,placeholder:PropTypes.shape({label:PropTypes.string.isRequired,value:PropTypes.oneOfType([PropTypes.string,PropTypes.number]).isRequired}),value:PropTypes.string,name:PropTypes.oneOf(["billing_address_state_code","shipping_address_state_code"]).isRequired,required:PropTypes.bool},defaultProps:{required:!0}},AddressField:{displayName:"AddressField",propTypes:{children:PropTypes.func}},AddressInput:{displayName:"AddressInput",propTypes:{children:PropTypes.func,name:PropTypes.oneOf(["billing_address_city","billing_address_company","billing_address_email","billing_address_first_name","billing_address_last_name","billing_address_line_1","billing_address_line_2","billing_address_phone","billing_address_state_code","billing_address_zip_code","billing_address_billing_info","billing_address_save_to_customer_book","shipping_address_city","shipping_address_company","shipping_address_email","shipping_address_first_name","shipping_address_last_name","shipping_address_line_1","shipping_address_line_2","shipping_address_phone","shipping_address_state_code","shipping_address_zip_code","shipping_address_save_to_customer_book"]).isRequired,type:PropTypes.oneOf(["checkbox","date","email","number","tel","text","textarea"]).isRequired,placeholder:PropTypes.string,disabled:PropTypes.bool,required:PropTypes.bool},defaultProps:{required:!0}},AdjustmentAmount:{displayName:"AdjustmentAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},AddToCartButton:{displayName:"AddToCartButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element]),skuCode:PropTypes.string,disabled:PropTypes.bool,lineItem:PropTypes.shape({name:PropTypes.string.isRequired,imageUrl:PropTypes.string})},defaultProps:{label:"Add to cart"}},AddressesContainer:{displayName:"AddressesContainer",permittedChildren:["BillingAddressForm","BillingAddressContainer","ShippingAddressForm","ShippingAddressContainer","SaveAddressesButton","ReactNode"],propTypes:{children:childrenTypes.isRequired,shipToDifferentAddress:PropTypes.bool}},AvailabilityContainer:{displayName:"AvailabilityContainer",permittedChildren:["AvailabilityTemplate","ReactNode"],propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string}},AvailabilityTemplate:{displayName:"AvailabilityTemplate",propTypes:{timeFormat:PropTypes.oneOf(["days","hours"]),showShippingMethodName:PropTypes.bool,children:PropTypes.func},defaultProps:{timeFormat:"days",showShippingMethodName:!1}},BillingAddressContainer:{permittedChildren:["Address","ReactNode"],propTypes:{children:childrenTypes.isRequired}},BillingAddressForm:{permittedChildren:["AddressInput","ReactNode","Errors"],propTypes:{children:childrenTypes.isRequired}},CheckoutLink:{displayName:"CheckoutLink",propTypes:{children:PropTypes.func,label:PropTypes.string},defaultProps:{label:"Checkout"}},CommerceLayer:{permittedChildren:["OrderContainer","OrderStorage","PricesContainer","GiftCardContainer","ReactNode"],propTypes:{children:childrenTypes.isRequired,accessToken:PropTypes.string.isRequired,endpoint:PropTypes.string.isRequired}},CustomerContainer:{displayName:"CustomerContainer",permittedChildren:["CustomerInput","SaveCustomerButton","AddressesContainer","PaymentMethodsContainer","ShipmentsContainer","ReactNode"],propTypes:{children:childrenTypes.isRequired,isGuest:PropTypes.bool}},CustomerInput:{displayName:"CustomerInput",propTypes:{children:PropTypes.func,name:PropTypes.oneOf(["customerEmail"]),type:PropTypes.oneOf(["email"]),placeholder:PropTypes.string,disabled:PropTypes.bool,required:PropTypes.bool,saveOnBlur:PropTypes.bool},defaultProps:{required:!0}},DeliveryLeadTime:{displayName:"DeliveryLeadTime",propTypes:{type:PropTypes.oneOf(["max_days","max_hours","min_days","min_hours"]).isRequired,children:PropTypes.func}},DiscountAmount:{displayName:"DiscountAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},Errors:{displayName:"Errors",propTypes:ErrorPropTypes,defaultProps:{messages:[],field:"base"}},ExternalFunction:{displayName:"ExternalFunction",permittedChildren:["AddToCartButton","ReactNode"],propTypes:{children:childrenTypes.isRequired,url:PropTypes.string.isRequired}},GiftCard:{permittedChildren:["GiftCardCurrencySelector","GiftCardInput","Errors","MetadataInput","SubmitButton","ReactNode"],displayName:"GiftCard",propTypes:{children:childrenTypes.isRequired,onSubmit:PropTypes.func},defaultProps:{onSubmit:void 0}},GiftCardAmount:{displayName:"GiftCardAmount",propTypes:baseOrderComponentPricePropTypes},GiftCardContainer:{permittedChildren:["GiftCard","Errors","ReactNode"],displayName:"GiftCardContainer",propTypes:{children:childrenTypes.isRequired}},GiftCardCurrencySelector:{displayName:"GiftCardCurrencySelector",propTypes:{children:PropTypes.func,placeholder:PropTypes.shape({value:PropTypes.oneOfType([PropTypes.string,PropTypes.number]).isRequired,label:PropTypes.string.isRequired}),value:PropTypes.string,required:PropTypes.bool},defaultProps:{required:!0}},GiftCardInput:{displayName:"GiftCardInput",propTypes:{type:PropTypes.oneOf(["text","email","number","date","checkbox"]).isRequired,name:PropTypes.oneOf(["balanceCents","balanceMaxCents","singleUse","rechargeable","imageUrl","expiresAt","referenceOrigin","email","firstName","lastName","reference"]).isRequired,children:PropTypes.func,placeholder:PropTypes.string}},GiftCardOrCouponForm:{permittedChildren:["GiftCardOrCouponInput","GiftCardOrCouponSubmit","ReactNode"],propTypes:{children:childrenTypes.isRequired}},GiftCardOrCouponInput:{displayName:"GiftCardOrCouponInput",propTypes:{children:PropTypes.func,placeholder:PropTypes.string,disabled:PropTypes.bool,required:PropTypes.bool}},GiftCardOrCouponSubmit:{displayName:"GiftCardOrCouponSubmit",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.object])}},GiftCardOrCouponCode:{displayName:"GiftCardOrCouponCode",propTypes:{children:PropTypes.func,type:PropTypes.oneOf(["coupon","gift_card"])}},GiftCardOrCouponRemoveButton:{displayName:"GiftCardOrCouponRemoveButton",propTypes:{children:PropTypes.func,type:PropTypes.oneOf(["coupon","gift_card"]),label:PropTypes.oneOfType([PropTypes.string,PropTypes.object])}},ItemContainer:{permittedChildren:["PricesContainer","VariantsContainer","SkuOptionContainer","QuantitySelector","AddToCartButton","AvailabilityContainer","SkuListsContainer","ReactNode"],displayName:"ItemContainer",propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string,lineItem:PropTypes.shape({name:PropTypes.string.isRequired,imageUrl:PropTypes.string})}},LineItem:{permittedChildren:["AvailabilityContainer","LineItemImage","LineItemName","LineItemOptions","LineItemQuantity","LineItemAmount","LineItemRemoveLink","StockTransfer","Errors","ReactNode"],displayName:"LineItem",propTypes:{children:childrenTypes.isRequired,type:PropTypes.oneOf(["skus","gift_cards","shipments","payment_methods","promotions","adjustments","bundles"])},defaultProps:{type:"skus"}},LineItemAmount:{displayName:"LineItemAmount",propTypes:Object.assign(Object.assign({},baseOrderComponentPricePropTypes),{type:PropTypes.oneOf(["total","unit","option"])}),defaultProps:{format:"formatted",type:"total"}},LineItemImage:{displayName:"LineItemImage",propTypes:{width:PropTypes.number,children:PropTypes.func}},LineItemName:{displayName:"LineItemName",propTypes:{children:PropTypes.func}},LineItemCode:{displayName:"LineItemCode",propTypes:{children:PropTypes.func}},LineItemOption:{displayName:"LineItemOption",propTypes:{name:PropTypes.string,children:PropTypes.func,valueClassName:PropTypes.string,className:PropTypes.string,id:PropTypes.string,style:PropTypes.object}},LineItemOptions:{permittedChildren:["LineItemOption","ReactNode"],displayName:"LineItemOptions",propTypes:{children:childrenTypes.isRequired,title:PropTypes.string,showName:PropTypes.bool,skuOptionId:PropTypes.string}},LineItemQuantity:{displayName:"LineItemQuantity",propTypes:{children:PropTypes.func,max:PropTypes.number,disabled:PropTypes.bool,readonly:PropTypes.bool},defaultProps:{max:50}},LineItemRemoveLink:{displayName:"LineItemRemoveLink",propTypes:{children:PropTypes.func,label:PropTypes.string},defaultProps:{label:"Remove"}},LineItemsContainer:{permittedChildren:["LineItemsCount","LineItemsEmpty","LineItem","ReactNode"],displayName:"LineItemsContainer",propTypes:{children:childrenTypes.isRequired,filters:PropTypes.object,loader:PTLoader},defaultProps:{filters:{},loader:"Loading..."}},LineItemsCount:{displayName:"LineItemsCount",propTypes:{children:PropTypes.func,id:PropTypes.string,className:PropTypes.string,name:PropTypes.string,style:PropTypes.object}},LineItemsEmpty:{displayName:"LineItemsEmpty",propTypes:{children:PropTypes.func,id:PropTypes.string,className:PropTypes.string,name:PropTypes.string,style:PropTypes.object,text:PropTypes.string}},MetadataInput:{displayName:"MetadataInput",propTypes:BaseInputComponentPropTypes},OrderContainer:{permittedChildren:["AddressesContainer","CustomerContainer","ItemContainer","LineItemsContainer","SubTotalAmount","DiscountAmount","AdjustmentAmount","ShippingAmount","TaxesAmount","GiftCardAmount","TotalAmount","CheckoutLink","GiftCardContainer","ShipmentsContainer","PaymentMethodsContainer","PaymentMethodAmount","GiftCardOrCouponForm","GiftCardOrCouponCode","GiftCardOrCouponRemoveButton","Errors","OrderNumber","ReactNode"],displayName:"OrderContainer",propTypes:{children:childrenTypes.isRequired,orderId:PropTypes.string,metadata:BMObject,attributes:PropTypes.object},defaultProps:{metadata:{}}},OrderNumber:{displayName:"OrderNumber",propTypes:{className:PropTypes.string},defaultProps:{format:"formatted"}},OrderStorage:{permittedChildren:["OrderContainer","ReactNode"],displayName:"OrderStorage",propTypes:{children:childrenTypes.isRequired,clearWhenPlaced:PropTypes.bool,persistKey:PropTypes.string.isRequired}},PaymentMethod:{permittedChildren:["PaymentMethodName","PaymentMethodRadioButton","PaymentMethodPrice","PaymentSource","ReactNode","Errors"],displayName:"PaymentMethod",propTypes:{children:childrenTypes.isRequired}},PaymentMethodAmount:{displayName:"PaymentMethodAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},PaymentMethodName:{displayName:"PaymentMethodName",propTypes:{children:PropTypes.func}},PaymentMethodPrice:{displayName:"PaymentMethodPrice",propTypes:Object.assign(Object.assign({},baseOrderComponentPricePropTypes),{type:PropTypes.oneOf(["amount"])})},PaymentMethodRadioButton:{displayName:"PaymentMethodRadioButton",propTypes:{children:PropTypes.func}},PaymentMethodsContainer:{displayName:"PaymentMethodsContainer",permittedChildren:["PaymentSource","ReactNode","PlaceOrderContainer"],propTypes:{children:childrenTypes.isRequired}},PaymentSource:{displayName:"PaymentSource",permittedChildren:["PaymentSourceBrandIcon","PaymentSourceBrandName","PaymentSourceEditButton","PaymentSourceDetail","ReactNode"],propTypes:{children:childrenTypes,readonly:PropTypes.bool}},PaymentSourceBrandIcon:{displayName:"PaymentSourceBrandIcon",propTypes:{children:PropTypes.func,width:PropTypes.number,height:PropTypes.number,src:PropTypes.string,className:PropTypes.string}},PaymentSourceBrandName:{displayName:"PaymentSourceBrandName",propTypes:{children:PropTypes.func,label:PropTypes.string}},PaymentSourceEditButton:{displayName:"PaymentSourceEditButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element])}},PaymentSourceDetail:{displayName:"PaymentSourceDetail",propTypes:{type:PropTypes.oneOf(["last4","exp_year","exp_month"]).isRequired}},PlaceOrderButton:{displayName:"PlaceOrderButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element])},defaultProps:{label:"Place order"}},PlaceOrderContainer:{displayName:"PlaceOrderContainer",permittedChildren:["PaymentMethod","PlaceOrderButton","PrivacyAndTermsCheckbox","ReactNode"],propTypes:{children:childrenTypes.isRequired}},Price:{displayName:"Price",propTypes:{children:PropTypes.func,compareClassName:PropTypes.string,skuCode:PropTypes.string,showCompare:PropTypes.bool},defaultProps:{skuCode:""}},PricesContainer:{permittedChildren:["Price","ReactNode"],displayName:"PricesContainer",propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string,loader:PTLoader,perPage:PropTypes.number,filters:PropTypes.object},defaultProps:{perPage:10,filters:{},loader:"Loading...",skuCode:""}},PrivacyAndTermsCheckbox:{displayName:"PrivacyAndTermsCheckbox",propTypes:{children:PropTypes.func}},QuantitySelector:{displayName:"QuantitySelector",propTypes:{children:PropTypes.func,min:PropTypes.number,max:PropTypes.number,value:PropTypes.string,skuCode:PropTypes.string,disabled:PropTypes.bool},defaultProps:{min:1}},SaveAddressesButton:{displayName:"SaveAddressesButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element]),onClick:PropTypes.func,disabled:PropTypes.bool},defaultProps:{label:"Continue to delivery"}},Shipment:{permittedChildren:["LineItemsContainer","LineItem","ShippingMethod","ReactNode"],displayName:"Shipment",propTypes:{children:childrenTypes.isRequired}},ShipmentField:{displayName:"ShipmentField",propTypes:{children:PropTypes.func,name:PropTypes.oneOf(["cost_amount_cents","cost_amount_float","currency_code","formatted_cost_amount","number","status","key_number"]).isRequired}},ShipmentsContainer:{displayName:"ShipmentsContainer",permittedChildren:["Shipment","ReactNode","Errors"],propTypes:{children:childrenTypes.isRequired}},ShippingAddressContainer:{permittedChildren:["Address","ReactNode"],propTypes:{children:childrenTypes.isRequired}},SaveCustomerButton:{displayName:"SaveCustomerButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element]),onClick:PropTypes.func},defaultProps:{label:"Save"}},ShippingAddressForm:{permittedChildren:["AddressInput","ReactNode"],propTypes:{children:childrenTypes.isRequired}},ShippingAmount:{displayName:"ShippingAmount",propTypes:baseOrderComponentPricePropTypes},ShippingMethod:{permittedChildren:["ShippingMethodName","ShippingMethodPrice","ShippingMethodRadioButton","DeliveryLeadTime","ReactNode"],displayName:"ShippingMethod",propTypes:{children:childrenTypes.isRequired,readonly:PropTypes.bool}},ShippingMethodName:{displayName:"ShippingMethodName",propTypes:{children:PropTypes.func}},ShippingMethodRadioButton:{displayName:"ShippingMethodRadioButton",propTypes:{children:PropTypes.func}},ShippingMethodPrice:{displayName:"ShippingMethodPrice",propTypes:Object.assign(Object.assign({},baseOrderComponentPricePropTypes),{type:PropTypes.oneOf(["amount"])}),defaultProps:{format:"formatted",type:"amount"}},SkuContainer:{displayName:"SkuContainer",permittedChildren:["Skus","ReactNode"],propTypes:{children:childrenTypes.isRequired}},Skus:{displayName:"Skus",permittedChildren:["SkuField","ReactNode"],propTypes:{children:childrenTypes.isRequired}},SkuField:{displayName:"SkuField",propTypes:{children:PropTypes.func,attribute:PropTypes.string,tagElement:PropTypes.string}},SkuList:{permittedChildren:["AddToCartButton","QuantitySelector","ReactNode"],displayName:"SkuList",propTypes:{children:childrenTypes.isRequired,id:PropTypes.string.isRequired}},SkuListsContainer:{permittedChildren:["SkuList","ReactNode"],displayName:"SkuListsContainer",propTypes:{children:childrenTypes.isRequired}},SkuOption:{permittedChildren:["SkuOptionInput","ReactNode"],displayName:"SkuOption",propTypes:{children:childrenTypes.isRequired,id:PropTypes.string.isRequired}},SkuOptionInput:{displayName:"SkuOptionInput",propTypes:BaseInputComponentPropTypes},SkuOptionsContainer:{permittedChildren:["SkuOption","ReactNode"],displayName:"SkuOptionsContainer",propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string}},StockTransfer:{permittedChildren:["StockTransferField","ReactNode"],displayName:"StockTransfer",propTypes:{children:childrenTypes.isRequired}},StockTransferField:{displayName:"StockTransferField",propTypes:{children:PropTypes.func,type:PropTypes.oneOf(["quantity","sku_code"]).isRequired}},SubmitButton:{displayName:"SubmitButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element])},defaultProps:{label:"Submit"}},SubTotalAmount:{displayName:"SubTotalAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},TaxesAmount:{displayName:"TaxesAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},TotalAmount:{displayName:"TotalAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},VariantsContainer:{permittedChildren:["VariantSelector","ReactNode"],displayName:"VariantsContainer",propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string,filters:PropTypes.object},defaultProps:{skuCode:"",filters:{}}},VariantSelector:{displayName:"VariantSelector",propTypes:{options:PropTypes.arrayOf(PropTypes.shape({label:PropTypes.string.isRequired,code:PropTypes.string.isRequired,lineItem:PropTypes.shape({name:PropTypes.string.isRequired,imageUrl:PropTypes.string})}).isRequired).isRequired,name:PropTypes.string,children:PropTypes.func,type:PropTypes.oneOf(["select","radio"]),loader:PropTypes.element,placeholder:PropTypes.string,skuCode:PropTypes.string},defaultProps:{placeholder:"Select a variant",type:"select"}}};export default components;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ import{Sku}from'@commercelayer/sdk';export declare type InitialSkuContext=Partial<{sku:Sku;}>;declare const SkuChildrenContext:import("react").Context<Partial<{sku:Sku;}>>;export default SkuChildrenContext;
@@ -0,0 +1 @@
1
+ import{createContext}from"react";const initial={},SkuChildrenContext=createContext(initial);export default SkuChildrenContext;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ import{SkuState}from'../reducers/SkuReducer';export declare type SkuContextValue=SkuState;declare const SkuContext:import("react").Context<Partial<{skus:import("@commercelayer/sdk/lib/cjs/resources/skus").Sku[];loading:boolean;}>>;export default SkuContext;
@@ -0,0 +1 @@
1
+ import{createContext}from"react";const SkuContext=createContext({});export default SkuContext;
package/lib/index.d.ts CHANGED
@@ -1 +1 @@
1
- export{default as AddToCartButton}from'./components/AddToCartButton';export{default as Address}from'./components/Address';export{default as AddressCountrySelector}from'./components/AddressCountrySelector';export{default as AddressField}from'./components/AddressField';export{default as AddressInput}from'./components/AddressInput';export{default as AddressStateSelector}from'./components/AddressStateSelector';export{default as AddressesContainer}from'./components/AddressesContainer';export{default as AdjustmentAmount}from'./components/AdjustmentAmount';export{default as AvailabilityContainer}from'./components/AvailabilityContainer';export{default as AvailabilityTemplate}from'./components/AvailabilityTemplate';export{default as BillingAddressContainer}from'./components/BillingAddressContainer';export{default as BillingAddressForm}from'./components/BillingAddressForm';export{default as CheckoutLink}from'./components/CheckoutLink';export{default as CommerceLayer}from'./components/CommerceLayer';export{default as CustomerContainer}from'./components/CustomerContainer';export{default as CustomerInput}from'./components/CustomerInput';export{default as DeliveryLeadTime}from'./components/DeliveryLeadTime';export{default as DiscountAmount}from'./components/DiscountAmount';export{default as Errors}from'./components/Errors';export{default as ExternalFunction}from'./components/ExternalFunction';export{default as GiftCard}from'./components/GiftCard';export{default as GiftCardAmount}from'./components/GiftCardAmount';export{default as GiftCardContainer}from'./components/GiftCardContainer';export{default as GiftCardCurrencySelector}from'./components/GiftCardCurrencySelector';export{default as GiftCardInput}from'./components/GiftCardInput';export{default as GiftCardOrCouponCode}from'./components/GiftCardOrCouponCode';export{default as GiftCardOrCouponForm}from'./components/GiftCardOrCouponForm';export{default as GiftCardOrCouponInput}from'./components/GiftCardOrCouponInput';export{default as GiftCardOrCouponRemoveButton}from'./components/GiftCardOrCouponRemoveButton';export{default as GiftCardOrCouponSubmit}from'./components/GiftCardOrCouponSubmit';export{default as ItemContainer}from'./components/ItemContainer';export{default as LineItem}from'./components/LineItem';export{default as LineItemAmount}from'./components/LineItemAmount';export{default as LineItemCode}from'./components/LineItemCode';export{default as LineItemImage}from'./components/LineItemImage';export{default as LineItemName}from'./components/LineItemName';export{default as LineItemOption}from'./components/LineItemOption';export{default as LineItemOptions}from'./components/LineItemOptions';export{default as LineItemQuantity}from'./components/LineItemQuantity';export{default as LineItemRemoveLink}from'./components/LineItemRemoveLink';export{default as LineItemsContainer}from'./components/LineItemsContainer';export{default as LineItemsCount}from'./components/LineItemsCount';export{default as LineItemsEmpty}from'./components/LineItemsEmpty';export{default as MetadataInput}from'./components/MetadataInput';export{default as OrderContainer}from'./components/OrderContainer';export{default as OrderNumber}from'./components/OrderNumber';export{default as OrderStorage}from'./components/OrderStorage';export{default as PaymentMethod}from'./components/PaymentMethod';export{default as PaymentMethodAmount}from'./components/PaymentMethodAmount';export{default as PaymentMethodName}from'./components/PaymentMethodName';export{default as PaymentMethodPrice}from'./components/PaymentMethodPrice';export{default as PaymentMethodRadioButton}from'./components/PaymentMethodRadioButton';export{default as PaymentMethodsContainer}from'./components/PaymentMethodsContainer';export{default as PaymentSource}from'./components/PaymentSource';export{default as PaymentSourceBrandIcon}from'./components/PaymentSourceBrandIcon';export{default as PaymentSourceBrandName}from'./components/PaymentSourceBrandName';export{default as PaymentSourceDetail}from'./components/PaymentSourceDetail';export{default as PaymentSourceEditButton}from'./components/PaymentSourceEditButton';export{default as PlaceOrderButton}from'./components/PlaceOrderButton';export{default as PlaceOrderContainer}from'./components/PlaceOrderContainer';export{default as Price}from'./components/Price';export{default as PricesContainer}from'./components/PricesContainer';export{default as PrivacyAndTermsCheckbox}from'./components/PrivacyAndTermsCheckbox';export{default as QuantitySelector}from'./components/QuantitySelector';export{default as SaveAddressesButton}from'./components/SaveAddressesButton';export{default as SaveCustomerButton}from'./components/SaveCustomerButton';export{default as Shipment}from'./components/Shipment';export{default as ShipmentField}from'./components/ShipmentField';export{default as ShipmentsContainer}from'./components/ShipmentsContainer';export{default as ShippingAddressContainer}from'./components/ShippingAddressContainer';export{default as ShippingAddressForm}from'./components/ShippingAddressForm';export{default as ShippingAmount}from'./components/ShippingAmount';export{default as ShippingMethod}from'./components/ShippingMethod';export{default as ShippingMethodName}from'./components/ShippingMethodName';export{default as ShippingMethodPrice}from'./components/ShippingMethodPrice';export{default as ShippingMethodRadioButton}from'./components/ShippingMethodRadioButton';export{default as SkuList}from'./components/SkuList';export{default as SkuListsContainer}from'./components/SkuListsContainer';export{default as SkuOption}from'./components/SkuOption';export{default as SkuOptionInput}from'./components/SkuOptionInput';export{default as SkuOptionsContainer}from'./components/SkuOptionsContainer';export{default as StockTransfer}from'./components/StockTransfer';export{default as StockTransferField}from'./components/StockTransferField';export{default as SubTotalAmount}from'./components/SubTotalAmount';export{default as SubmitButton}from'./components/SubmitButton';export{default as TaxesAmount}from'./components/TaxesAmount';export{default as TotalAmount}from'./components/TotalAmount';export{default as VariantSelector}from'./components/VariantSelector';export{default as VariantsContainer}from'./components/VariantsContainer';export type{CustomerCardsType}from'./components/utils/PaymentCardsTemplate';export type{AddressCardsType}from'./components/utils/AddressCardsTemplate';export type{AddToCartButtonType}from'./components/AddToCartButton';export type{ShippingMethodRadioButtonType,ShippingMethodRadioButtonOnChangeType,}from'./components/ShippingMethodRadioButton';export type{LineItemCodeType}from'./components/LineItemCode';export type{LineItemNameType}from'./components/LineItemName';export type{LineItemImageType}from'./components/LineItemImage';export type{LineItemType}from'./typings/index';export type{ErrorComponentProps,ResourceErrorType}from'./typings/errors';export type{AddressCountrySelectName,AddressInputName,AddressStateSelectName,BaseInputType,}from'./typings/index';
1
+ export{default as AddToCartButton}from'./components/AddToCartButton';export{default as Address}from'./components/Address';export{default as AddressCountrySelector}from'./components/AddressCountrySelector';export{default as AddressField}from'./components/AddressField';export{default as AddressInput}from'./components/AddressInput';export{default as AddressStateSelector}from'./components/AddressStateSelector';export{default as AddressesContainer}from'./components/AddressesContainer';export{default as AdjustmentAmount}from'./components/AdjustmentAmount';export{default as AvailabilityContainer}from'./components/AvailabilityContainer';export{default as AvailabilityTemplate}from'./components/AvailabilityTemplate';export{default as BillingAddressContainer}from'./components/BillingAddressContainer';export{default as BillingAddressForm}from'./components/BillingAddressForm';export{default as CheckoutLink}from'./components/CheckoutLink';export{default as CommerceLayer}from'./components/CommerceLayer';export{default as CustomerContainer}from'./components/CustomerContainer';export{default as CustomerInput}from'./components/CustomerInput';export{default as DeliveryLeadTime}from'./components/DeliveryLeadTime';export{default as DiscountAmount}from'./components/DiscountAmount';export{default as Errors}from'./components/Errors';export{default as ExternalFunction}from'./components/ExternalFunction';export{default as GiftCard}from'./components/GiftCard';export{default as GiftCardAmount}from'./components/GiftCardAmount';export{default as GiftCardContainer}from'./components/GiftCardContainer';export{default as GiftCardCurrencySelector}from'./components/GiftCardCurrencySelector';export{default as GiftCardInput}from'./components/GiftCardInput';export{default as GiftCardOrCouponCode}from'./components/GiftCardOrCouponCode';export{default as GiftCardOrCouponForm}from'./components/GiftCardOrCouponForm';export{default as GiftCardOrCouponInput}from'./components/GiftCardOrCouponInput';export{default as GiftCardOrCouponRemoveButton}from'./components/GiftCardOrCouponRemoveButton';export{default as GiftCardOrCouponSubmit}from'./components/GiftCardOrCouponSubmit';export{default as ItemContainer}from'./components/ItemContainer';export{default as LineItem}from'./components/LineItem';export{default as LineItemAmount}from'./components/LineItemAmount';export{default as LineItemCode}from'./components/LineItemCode';export{default as LineItemImage}from'./components/LineItemImage';export{default as LineItemName}from'./components/LineItemName';export{default as LineItemOption}from'./components/LineItemOption';export{default as LineItemOptions}from'./components/LineItemOptions';export{default as LineItemQuantity}from'./components/LineItemQuantity';export{default as LineItemRemoveLink}from'./components/LineItemRemoveLink';export{default as LineItemsContainer}from'./components/LineItemsContainer';export{default as LineItemsCount}from'./components/LineItemsCount';export{default as LineItemsEmpty}from'./components/LineItemsEmpty';export{default as MetadataInput}from'./components/MetadataInput';export{default as OrderContainer}from'./components/OrderContainer';export{default as OrderNumber}from'./components/OrderNumber';export{default as OrderStorage}from'./components/OrderStorage';export{default as PaymentMethod}from'./components/PaymentMethod';export{default as PaymentMethodAmount}from'./components/PaymentMethodAmount';export{default as PaymentMethodName}from'./components/PaymentMethodName';export{default as PaymentMethodPrice}from'./components/PaymentMethodPrice';export{default as PaymentMethodRadioButton}from'./components/PaymentMethodRadioButton';export{default as PaymentMethodsContainer}from'./components/PaymentMethodsContainer';export{default as PaymentSource}from'./components/PaymentSource';export{default as PaymentSourceBrandIcon}from'./components/PaymentSourceBrandIcon';export{default as PaymentSourceBrandName}from'./components/PaymentSourceBrandName';export{default as PaymentSourceDetail}from'./components/PaymentSourceDetail';export{default as PaymentSourceEditButton}from'./components/PaymentSourceEditButton';export{default as PlaceOrderButton}from'./components/PlaceOrderButton';export{default as PlaceOrderContainer}from'./components/PlaceOrderContainer';export{default as Price}from'./components/Price';export{default as PricesContainer}from'./components/PricesContainer';export{default as PrivacyAndTermsCheckbox}from'./components/PrivacyAndTermsCheckbox';export{default as QuantitySelector}from'./components/QuantitySelector';export{default as SaveAddressesButton}from'./components/SaveAddressesButton';export{default as SaveCustomerButton}from'./components/SaveCustomerButton';export{default as Shipment}from'./components/Shipment';export{default as ShipmentField}from'./components/ShipmentField';export{default as ShipmentsContainer}from'./components/ShipmentsContainer';export{default as ShippingAddressContainer}from'./components/ShippingAddressContainer';export{default as ShippingAddressForm}from'./components/ShippingAddressForm';export{default as ShippingAmount}from'./components/ShippingAmount';export{default as ShippingMethod}from'./components/ShippingMethod';export{default as ShippingMethodName}from'./components/ShippingMethodName';export{default as ShippingMethodPrice}from'./components/ShippingMethodPrice';export{default as ShippingMethodRadioButton}from'./components/ShippingMethodRadioButton';export{default as Skus}from'./components/Skus';export{default as SkuContainer}from'./components/SkuContainer';export{default as SkuField}from'./components/SkuField';export{default as SkuList}from'./components/SkuList';export{default as SkuListsContainer}from'./components/SkuListsContainer';export{default as SkuOption}from'./components/SkuOption';export{default as SkuOptionInput}from'./components/SkuOptionInput';export{default as SkuOptionsContainer}from'./components/SkuOptionsContainer';export{default as StockTransfer}from'./components/StockTransfer';export{default as StockTransferField}from'./components/StockTransferField';export{default as SubTotalAmount}from'./components/SubTotalAmount';export{default as SubmitButton}from'./components/SubmitButton';export{default as TaxesAmount}from'./components/TaxesAmount';export{default as TotalAmount}from'./components/TotalAmount';export{default as VariantSelector}from'./components/VariantSelector';export{default as VariantsContainer}from'./components/VariantsContainer';export type{CustomerCardsType}from'./components/utils/PaymentCardsTemplate';export type{AddressCardsType}from'./components/utils/AddressCardsTemplate';export type{AddToCartButtonType}from'./components/AddToCartButton';export type{ShippingMethodRadioButtonType,ShippingMethodRadioButtonOnChangeType,}from'./components/ShippingMethodRadioButton';export type{LineItemCodeType}from'./components/LineItemCode';export type{LineItemNameType}from'./components/LineItemName';export type{LineItemImageType}from'./components/LineItemImage';export type{LineItemType}from'./typings/index';export type{ErrorComponentProps,ResourceErrorType}from'./typings/errors';export type{AddressCountrySelectName,AddressInputName,AddressStateSelectName,BaseInputType,}from'./typings/index';
package/lib/index.js CHANGED
@@ -1 +1 @@
1
- export{default as AddToCartButton}from"./components/AddToCartButton";export{default as Address}from"./components/Address";export{default as AddressCountrySelector}from"./components/AddressCountrySelector";export{default as AddressField}from"./components/AddressField";export{default as AddressInput}from"./components/AddressInput";export{default as AddressStateSelector}from"./components/AddressStateSelector";export{default as AddressesContainer}from"./components/AddressesContainer";export{default as AdjustmentAmount}from"./components/AdjustmentAmount";export{default as AvailabilityContainer}from"./components/AvailabilityContainer";export{default as AvailabilityTemplate}from"./components/AvailabilityTemplate";export{default as BillingAddressContainer}from"./components/BillingAddressContainer";export{default as BillingAddressForm}from"./components/BillingAddressForm";export{default as CheckoutLink}from"./components/CheckoutLink";export{default as CommerceLayer}from"./components/CommerceLayer";export{default as CustomerContainer}from"./components/CustomerContainer";export{default as CustomerInput}from"./components/CustomerInput";export{default as DeliveryLeadTime}from"./components/DeliveryLeadTime";export{default as DiscountAmount}from"./components/DiscountAmount";export{default as Errors}from"./components/Errors";export{default as ExternalFunction}from"./components/ExternalFunction";export{default as GiftCard}from"./components/GiftCard";export{default as GiftCardAmount}from"./components/GiftCardAmount";export{default as GiftCardContainer}from"./components/GiftCardContainer";export{default as GiftCardCurrencySelector}from"./components/GiftCardCurrencySelector";export{default as GiftCardInput}from"./components/GiftCardInput";export{default as GiftCardOrCouponCode}from"./components/GiftCardOrCouponCode";export{default as GiftCardOrCouponForm}from"./components/GiftCardOrCouponForm";export{default as GiftCardOrCouponInput}from"./components/GiftCardOrCouponInput";export{default as GiftCardOrCouponRemoveButton}from"./components/GiftCardOrCouponRemoveButton";export{default as GiftCardOrCouponSubmit}from"./components/GiftCardOrCouponSubmit";export{default as ItemContainer}from"./components/ItemContainer";export{default as LineItem}from"./components/LineItem";export{default as LineItemAmount}from"./components/LineItemAmount";export{default as LineItemCode}from"./components/LineItemCode";export{default as LineItemImage}from"./components/LineItemImage";export{default as LineItemName}from"./components/LineItemName";export{default as LineItemOption}from"./components/LineItemOption";export{default as LineItemOptions}from"./components/LineItemOptions";export{default as LineItemQuantity}from"./components/LineItemQuantity";export{default as LineItemRemoveLink}from"./components/LineItemRemoveLink";export{default as LineItemsContainer}from"./components/LineItemsContainer";export{default as LineItemsCount}from"./components/LineItemsCount";export{default as LineItemsEmpty}from"./components/LineItemsEmpty";export{default as MetadataInput}from"./components/MetadataInput";export{default as OrderContainer}from"./components/OrderContainer";export{default as OrderNumber}from"./components/OrderNumber";export{default as OrderStorage}from"./components/OrderStorage";export{default as PaymentMethod}from"./components/PaymentMethod";export{default as PaymentMethodAmount}from"./components/PaymentMethodAmount";export{default as PaymentMethodName}from"./components/PaymentMethodName";export{default as PaymentMethodPrice}from"./components/PaymentMethodPrice";export{default as PaymentMethodRadioButton}from"./components/PaymentMethodRadioButton";export{default as PaymentMethodsContainer}from"./components/PaymentMethodsContainer";export{default as PaymentSource}from"./components/PaymentSource";export{default as PaymentSourceBrandIcon}from"./components/PaymentSourceBrandIcon";export{default as PaymentSourceBrandName}from"./components/PaymentSourceBrandName";export{default as PaymentSourceDetail}from"./components/PaymentSourceDetail";export{default as PaymentSourceEditButton}from"./components/PaymentSourceEditButton";export{default as PlaceOrderButton}from"./components/PlaceOrderButton";export{default as PlaceOrderContainer}from"./components/PlaceOrderContainer";export{default as Price}from"./components/Price";export{default as PricesContainer}from"./components/PricesContainer";export{default as PrivacyAndTermsCheckbox}from"./components/PrivacyAndTermsCheckbox";export{default as QuantitySelector}from"./components/QuantitySelector";export{default as SaveAddressesButton}from"./components/SaveAddressesButton";export{default as SaveCustomerButton}from"./components/SaveCustomerButton";export{default as Shipment}from"./components/Shipment";export{default as ShipmentField}from"./components/ShipmentField";export{default as ShipmentsContainer}from"./components/ShipmentsContainer";export{default as ShippingAddressContainer}from"./components/ShippingAddressContainer";export{default as ShippingAddressForm}from"./components/ShippingAddressForm";export{default as ShippingAmount}from"./components/ShippingAmount";export{default as ShippingMethod}from"./components/ShippingMethod";export{default as ShippingMethodName}from"./components/ShippingMethodName";export{default as ShippingMethodPrice}from"./components/ShippingMethodPrice";export{default as ShippingMethodRadioButton}from"./components/ShippingMethodRadioButton";export{default as SkuList}from"./components/SkuList";export{default as SkuListsContainer}from"./components/SkuListsContainer";export{default as SkuOption}from"./components/SkuOption";export{default as SkuOptionInput}from"./components/SkuOptionInput";export{default as SkuOptionsContainer}from"./components/SkuOptionsContainer";export{default as StockTransfer}from"./components/StockTransfer";export{default as StockTransferField}from"./components/StockTransferField";export{default as SubTotalAmount}from"./components/SubTotalAmount";export{default as SubmitButton}from"./components/SubmitButton";export{default as TaxesAmount}from"./components/TaxesAmount";export{default as TotalAmount}from"./components/TotalAmount";export{default as VariantSelector}from"./components/VariantSelector";export{default as VariantsContainer}from"./components/VariantsContainer";
1
+ export{default as AddToCartButton}from"./components/AddToCartButton";export{default as Address}from"./components/Address";export{default as AddressCountrySelector}from"./components/AddressCountrySelector";export{default as AddressField}from"./components/AddressField";export{default as AddressInput}from"./components/AddressInput";export{default as AddressStateSelector}from"./components/AddressStateSelector";export{default as AddressesContainer}from"./components/AddressesContainer";export{default as AdjustmentAmount}from"./components/AdjustmentAmount";export{default as AvailabilityContainer}from"./components/AvailabilityContainer";export{default as AvailabilityTemplate}from"./components/AvailabilityTemplate";export{default as BillingAddressContainer}from"./components/BillingAddressContainer";export{default as BillingAddressForm}from"./components/BillingAddressForm";export{default as CheckoutLink}from"./components/CheckoutLink";export{default as CommerceLayer}from"./components/CommerceLayer";export{default as CustomerContainer}from"./components/CustomerContainer";export{default as CustomerInput}from"./components/CustomerInput";export{default as DeliveryLeadTime}from"./components/DeliveryLeadTime";export{default as DiscountAmount}from"./components/DiscountAmount";export{default as Errors}from"./components/Errors";export{default as ExternalFunction}from"./components/ExternalFunction";export{default as GiftCard}from"./components/GiftCard";export{default as GiftCardAmount}from"./components/GiftCardAmount";export{default as GiftCardContainer}from"./components/GiftCardContainer";export{default as GiftCardCurrencySelector}from"./components/GiftCardCurrencySelector";export{default as GiftCardInput}from"./components/GiftCardInput";export{default as GiftCardOrCouponCode}from"./components/GiftCardOrCouponCode";export{default as GiftCardOrCouponForm}from"./components/GiftCardOrCouponForm";export{default as GiftCardOrCouponInput}from"./components/GiftCardOrCouponInput";export{default as GiftCardOrCouponRemoveButton}from"./components/GiftCardOrCouponRemoveButton";export{default as GiftCardOrCouponSubmit}from"./components/GiftCardOrCouponSubmit";export{default as ItemContainer}from"./components/ItemContainer";export{default as LineItem}from"./components/LineItem";export{default as LineItemAmount}from"./components/LineItemAmount";export{default as LineItemCode}from"./components/LineItemCode";export{default as LineItemImage}from"./components/LineItemImage";export{default as LineItemName}from"./components/LineItemName";export{default as LineItemOption}from"./components/LineItemOption";export{default as LineItemOptions}from"./components/LineItemOptions";export{default as LineItemQuantity}from"./components/LineItemQuantity";export{default as LineItemRemoveLink}from"./components/LineItemRemoveLink";export{default as LineItemsContainer}from"./components/LineItemsContainer";export{default as LineItemsCount}from"./components/LineItemsCount";export{default as LineItemsEmpty}from"./components/LineItemsEmpty";export{default as MetadataInput}from"./components/MetadataInput";export{default as OrderContainer}from"./components/OrderContainer";export{default as OrderNumber}from"./components/OrderNumber";export{default as OrderStorage}from"./components/OrderStorage";export{default as PaymentMethod}from"./components/PaymentMethod";export{default as PaymentMethodAmount}from"./components/PaymentMethodAmount";export{default as PaymentMethodName}from"./components/PaymentMethodName";export{default as PaymentMethodPrice}from"./components/PaymentMethodPrice";export{default as PaymentMethodRadioButton}from"./components/PaymentMethodRadioButton";export{default as PaymentMethodsContainer}from"./components/PaymentMethodsContainer";export{default as PaymentSource}from"./components/PaymentSource";export{default as PaymentSourceBrandIcon}from"./components/PaymentSourceBrandIcon";export{default as PaymentSourceBrandName}from"./components/PaymentSourceBrandName";export{default as PaymentSourceDetail}from"./components/PaymentSourceDetail";export{default as PaymentSourceEditButton}from"./components/PaymentSourceEditButton";export{default as PlaceOrderButton}from"./components/PlaceOrderButton";export{default as PlaceOrderContainer}from"./components/PlaceOrderContainer";export{default as Price}from"./components/Price";export{default as PricesContainer}from"./components/PricesContainer";export{default as PrivacyAndTermsCheckbox}from"./components/PrivacyAndTermsCheckbox";export{default as QuantitySelector}from"./components/QuantitySelector";export{default as SaveAddressesButton}from"./components/SaveAddressesButton";export{default as SaveCustomerButton}from"./components/SaveCustomerButton";export{default as Shipment}from"./components/Shipment";export{default as ShipmentField}from"./components/ShipmentField";export{default as ShipmentsContainer}from"./components/ShipmentsContainer";export{default as ShippingAddressContainer}from"./components/ShippingAddressContainer";export{default as ShippingAddressForm}from"./components/ShippingAddressForm";export{default as ShippingAmount}from"./components/ShippingAmount";export{default as ShippingMethod}from"./components/ShippingMethod";export{default as ShippingMethodName}from"./components/ShippingMethodName";export{default as ShippingMethodPrice}from"./components/ShippingMethodPrice";export{default as ShippingMethodRadioButton}from"./components/ShippingMethodRadioButton";export{default as Skus}from"./components/Skus";export{default as SkuContainer}from"./components/SkuContainer";export{default as SkuField}from"./components/SkuField";export{default as SkuList}from"./components/SkuList";export{default as SkuListsContainer}from"./components/SkuListsContainer";export{default as SkuOption}from"./components/SkuOption";export{default as SkuOptionInput}from"./components/SkuOptionInput";export{default as SkuOptionsContainer}from"./components/SkuOptionsContainer";export{default as StockTransfer}from"./components/StockTransfer";export{default as StockTransferField}from"./components/StockTransferField";export{default as SubTotalAmount}from"./components/SubTotalAmount";export{default as SubmitButton}from"./components/SubmitButton";export{default as TaxesAmount}from"./components/TaxesAmount";export{default as TotalAmount}from"./components/TotalAmount";export{default as VariantSelector}from"./components/VariantSelector";export{default as VariantsContainer}from"./components/VariantsContainer";
@@ -0,0 +1 @@
1
+ import{CommerceLayerConfig}from'../context/CommerceLayerContext';import{BaseAction}from'../typings/index';import{QueryParamsList,Sku}from'@commercelayer/sdk';import{Dispatch}from'react';declare type SkuActionType='getSkus'|'setLoading';declare type SkuAction=BaseAction<SkuActionType,SkuState>;export declare type SkuState=Partial<{skus:Sku[];loading:boolean;}>;export declare const skuInitialState:SkuState;declare type GetSku={config:CommerceLayerConfig;skus:string[];dispatch:Dispatch<SkuAction>;queryParams?:QueryParamsList;};export declare function getSku<T extends GetSku>({config,skus,dispatch,queryParams,}:T):Promise<void>;export default function skuReducer(state:SkuState,reducer:SkuAction):SkuState;export{};
@@ -0,0 +1 @@
1
+ import baseReducer from"../utils/baseReducer";import getSdk from"../utils/getSdk";const actionType=["getSkus"];export const skuInitialState={skus:[],loading:!0};export async function getSku({config,skus,dispatch,queryParams}){if(!config.accessToken||skus.length===0)return;const sdk=getSdk(config);let allSkus=[];const get=await sdk.skus.list(Object.assign(Object.assign({},queryParams),{filters:Object.assign(Object.assign({},queryParams==null?void 0:queryParams.filters),{code_in:skus.join(",")})}));allSkus=[...get];const meta=get.meta;if(meta.pageCount>1)for(let pageNumber=meta.currentPage+1;pageNumber<=meta.pageCount;pageNumber++){const getPage=await sdk.skus.list(Object.assign(Object.assign({},queryParams),{filters:Object.assign(Object.assign({},queryParams==null?void 0:queryParams.filters),{code_in:skus.join(",")}),pageNumber}));allSkus=[...allSkus,...getPage]}dispatch({type:"getSkus",payload:{skus:allSkus,loading:!1}})}export default function skuReducer(state,reducer){return baseReducer(state,reducer,actionType)}
@@ -1 +1 @@
1
- import PropTypes from"prop-types";const CEType=["EMPTY_ERROR","FILTER_NOT_ALLOWED","FORBIDDEN","INTERNAL_SERVER_ERROR","INVALID_DATA_FORMAT","INVALID_FIELD","INVALID_FIELD_FORMAT","INVALID_FIELD_VALUE","INVALID_FILTERS_SYNTAX","INVALID_FILTER_VALUE","INVALID_INCLUDE","INVALID_LINKS_OBJECT","INVALID_PAGE_OBJECT","INVALID_PAGE_VALUE","INVALID_RESOURCE","INVALID_RESOURCE_ID","INVALID_SORT_CRITERIA","INVALID_TOKEN","KEY_NOT_INCLUDED_IN_URL","KEY_ORDER_MISMATCH","LOCKED","NOT_ACCEPTABLE","PARAM_MISSING","PARAM_NOT_ALLOWED","RECORD_NOT_FOUND","RECORD_NOT_FOUND","RELATION_EXISTS","SAVE_FAILED","TYPE_MISMATCH","UNAUTHORIZED","UNSUPPORTED_MEDIA_TYPE","VALIDATION_ERROR"];export const REType=["gift_cards","line_items","orders","prices","sku_options","variant"],BaseErrorObject=PropTypes.shape({code:PropTypes.oneOf(CEType).isRequired,message:PropTypes.string.isRequired,resource:PropTypes.oneOf(REType),field:PropTypes.string,id:PropTypes.string}),ErrorPropTypes={resource:PropTypes.oneOf(["billing_address","gift_cards","line_items","orders","payment_methods","prices","shipping_address","sku_options","variant"]).isRequired,children:PropTypes.func,field:PropTypes.string};
1
+ import PropTypes from"prop-types";const CEType=["EMPTY_ERROR","FILTER_NOT_ALLOWED","FORBIDDEN","INTERNAL_SERVER_ERROR","INVALID_DATA_FORMAT","INVALID_FIELD","INVALID_FIELD_FORMAT","INVALID_FIELD_VALUE","INVALID_FILTERS_SYNTAX","INVALID_FILTER_VALUE","INVALID_INCLUDE","INVALID_LINKS_OBJECT","INVALID_PAGE_OBJECT","INVALID_PAGE_VALUE","INVALID_RESOURCE","INVALID_RESOURCE_ID","INVALID_SORT_CRITERIA","INVALID_TOKEN","KEY_NOT_INCLUDED_IN_URL","KEY_ORDER_MISMATCH","LOCKED","NOT_ACCEPTABLE","PARAM_MISSING","PARAM_NOT_ALLOWED","RECORD_NOT_FOUND","RECORD_NOT_FOUND","RELATION_EXISTS","SAVE_FAILED","TYPE_MISMATCH","UNAUTHORIZED","UNSUPPORTED_MEDIA_TYPE","VALIDATION_ERROR"];export const REType=["gift_cards","line_items","orders","prices","sku_options","variant"],BaseErrorObject=PropTypes.shape({code:PropTypes.oneOf(CEType).isRequired,message:PropTypes.string.isRequired,resource:PropTypes.oneOf(REType),field:PropTypes.string,id:PropTypes.string}),ErrorPropTypes={resource:PropTypes.oneOf(["billing_address","gift_cards","line_items","orders","payment_methods","prices","shipping_address","sku_options","variant","shipments"]).isRequired,children:PropTypes.func,field:PropTypes.string};
@@ -1 +1 @@
1
- import{Dispatch,ReactNode,RefObject}from'react';import PropTypes,{InferProps}from'prop-types';import{BaseError}from'./errors';export declare const BC:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;};export declare const PTLoader:PropTypes.Requireable<string|PropTypes.ReactElementLike>;export declare const BaseSelectComponentPropTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;options:PropTypes.Validator<PropTypes.InferProps<{label:PropTypes.Validator<string>;value:PropTypes.Validator<string|number>;selected:PropTypes.Requireable<boolean>;}>[]>;placeholder:PropTypes.Requireable<PropTypes.InferProps<{label:PropTypes.Validator<string>;value:PropTypes.Validator<string|number>;}>>;value:PropTypes.Requireable<string>;name:PropTypes.Validator<string>;};export declare type SelectPlaceholder=Option;declare type BaseSelectChildrenComponentProps=Omit<BaseSelectComponentProps,'children'>;declare type Option={label:string;value:string|number;disabled?:boolean;};export interface BaseSelectComponentProps{children?:(props:BaseSelectChildrenComponentProps)=>ReactNode;options:Option[];placeholder?:Option;value?:string;className?:string;required?:boolean;name:string;onChange?:(event:React.ChangeEvent<HTMLSelectElement>)=>void;}export declare const BaseInputComponentPropTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;name:PropTypes.Validator<string>;type:PropTypes.Validator<BaseInputType>;onChange:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<string>;};declare type BaseInputChildrenComponentProps=Omit<BaseInputComponentProps,'children'>&{handleChange:(event:React.ChangeEvent<HTMLInputElement|HTMLTextAreaElement>)=>void;};export interface BaseInputComponentProps{ref?:()=>RefObject<any>;children?:(props:BaseInputChildrenComponentProps)=>ReactNode;name:string;onChange?:(event:React.ChangeEvent<HTMLInputElement|HTMLTextAreaElement>)=>void;placeholder?:string;}export declare type LineItemType='gift_cards'|'payment_methods'|'promotions'|'shipments'|'skus'|'bundles'|'adjustments';export declare type GiftCardInputName='balanceCents'|'balanceMaxCents'|'singleUse'|'rechargeable'|'imageUrl'|'expiresAt'|'referenceOrigin'|'email'|'firstName'|'lastName'|'reference';export declare type AddressInputName='billing_address_city'|'billing_address_company'|'billing_address_first_name'|'billing_address_email'|'billing_address_last_name'|'billing_address_line_1'|'billing_address_line_2'|'billing_address_phone'|'billing_address_state_code'|'billing_address_zip_code'|'billing_address_billing_info'|'billing_address_save_to_customer_book'|'shipping_address_city'|'shipping_address_company'|'shipping_address_email'|'shipping_address_first_name'|'shipping_address_last_name'|'shipping_address_line_1'|'shipping_address_line_2'|'shipping_address_phone'|'shipping_address_state_code'|'shipping_address_zip_code'|'shipping_address_save_to_customer_book';export declare type AddressCountrySelectName='billing_address_country_code'|'shipping_address_country_code';export declare type AddressStateSelectName='billing_address_state_code'|'shipping_address_state_code';export declare type BaseInputType='checkbox'|'date'|'email'|'number'|'tel'|'text'|'textarea';export declare type LoaderType=string|ReactNode;export declare const BMObject:PropTypes.Requireable<{[x:string]:string|null|undefined;}>;export declare type BaseMetadataObject={[key:string]:string|undefined|null;};export declare type TimeFormat='days'|'hours';export declare type BaseComponent=InferProps<typeof BC>;export interface BaseAction<A=string>{type:A;payload:Record<string,any>;}export interface BaseState{[key:string]:any;errors?:BaseError[];}export declare type BaseActionType<T=string>=T[];export interface BFSetStateContainer<T>{<P extends T>(param:P):void;}export interface BaseReducer{<S extends BaseState,A extends BaseAction,T extends BaseActionType>(state:S,action:A,type:T):S;}export interface BaseUnsetState<A>{(dispatch:Dispatch<A>):void;}export interface BaseMetadata{[key:string]:string|undefined|null;}export declare type BaseFormatPrice='formatted'|'cents'|'float';export declare const baseOrderPricePropTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;base:PropTypes.Validator<string>;type:PropTypes.Validator<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};export declare const baseOrderComponentPricePropTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};export declare type BasePriceType='total'|'option'|'unit';export declare type BaseSelectorType='select'|'radio';export declare type BaseAmountComponentChildren=Omit<BaseAmountComponent,'children'>;export declare type BaseAmountComponent={children?:(props:BaseAmountComponentChildren)=>ReactNode;format?:BaseFormatPrice;price?:string;priceCents?:number;labelFree?:string;}&JSX.IntrinsicElements['span'];export interface FunctionChildren<P=Record<string,any>>{(props:P):ReactNode;}export{};
1
+ import{Dispatch,ReactNode,RefObject}from'react';import PropTypes,{InferProps}from'prop-types';import{BaseError}from'./errors';export declare const BC:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;};export declare const PTLoader:PropTypes.Requireable<string|PropTypes.ReactElementLike>;export declare const BaseSelectComponentPropTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;options:PropTypes.Validator<PropTypes.InferProps<{label:PropTypes.Validator<string>;value:PropTypes.Validator<string|number>;selected:PropTypes.Requireable<boolean>;}>[]>;placeholder:PropTypes.Requireable<PropTypes.InferProps<{label:PropTypes.Validator<string>;value:PropTypes.Validator<string|number>;}>>;value:PropTypes.Requireable<string>;name:PropTypes.Validator<string>;};export declare type SelectPlaceholder=Option;declare type BaseSelectChildrenComponentProps=Omit<BaseSelectComponentProps,'children'>;declare type Option={label:string;value:string|number;disabled?:boolean;};export interface BaseSelectComponentProps{children?:(props:BaseSelectChildrenComponentProps)=>ReactNode;options:Option[];placeholder?:Option;value?:string;className?:string;required?:boolean;name:string;onChange?:(event:React.ChangeEvent<HTMLSelectElement>)=>void;}export declare const BaseInputComponentPropTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;name:PropTypes.Validator<string>;type:PropTypes.Validator<BaseInputType>;onChange:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<string>;};declare type BaseInputChildrenComponentProps=Omit<BaseInputComponentProps,'children'>&{handleChange:(event:React.ChangeEvent<HTMLInputElement|HTMLTextAreaElement>)=>void;};export interface BaseInputComponentProps{ref?:()=>RefObject<any>;children?:(props:BaseInputChildrenComponentProps)=>ReactNode;name:string;onChange?:(event:React.ChangeEvent<HTMLInputElement|HTMLTextAreaElement>)=>void;placeholder?:string;}export declare type LineItemType='gift_cards'|'payment_methods'|'promotions'|'shipments'|'skus'|'bundles'|'adjustments';export declare type GiftCardInputName='balanceCents'|'balanceMaxCents'|'singleUse'|'rechargeable'|'imageUrl'|'expiresAt'|'referenceOrigin'|'email'|'firstName'|'lastName'|'reference';export declare type AddressInputName='billing_address_city'|'billing_address_company'|'billing_address_first_name'|'billing_address_email'|'billing_address_last_name'|'billing_address_line_1'|'billing_address_line_2'|'billing_address_phone'|'billing_address_state_code'|'billing_address_zip_code'|'billing_address_billing_info'|'billing_address_save_to_customer_book'|'shipping_address_city'|'shipping_address_company'|'shipping_address_email'|'shipping_address_first_name'|'shipping_address_last_name'|'shipping_address_line_1'|'shipping_address_line_2'|'shipping_address_phone'|'shipping_address_state_code'|'shipping_address_zip_code'|'shipping_address_save_to_customer_book';export declare type AddressCountrySelectName='billing_address_country_code'|'shipping_address_country_code';export declare type AddressStateSelectName='billing_address_state_code'|'shipping_address_state_code';export declare type BaseInputType='checkbox'|'date'|'email'|'number'|'tel'|'text'|'textarea';export declare type LoaderType=string|ReactNode;export declare const BMObject:PropTypes.Requireable<{[x:string]:string|null|undefined;}>;export declare type BaseMetadataObject={[key:string]:string|undefined|null;};export declare type TimeFormat='days'|'hours';export declare type BaseComponent=InferProps<typeof BC>;export interface BaseAction<A=string,P=Record<string,any>>{type:A;payload:P;}export interface BaseState{[key:string]:any;errors?:BaseError[];}export declare type BaseActionType<T=string>=T[];export interface BFSetStateContainer<T>{<P extends T>(param:P):void;}export interface BaseReducer{<S extends BaseState,A extends BaseAction,T extends BaseActionType>(state:S,action:A,type:T):S;}export interface BaseUnsetState<A>{(dispatch:Dispatch<A>):void;}export interface BaseMetadata{[key:string]:string|undefined|null;}export declare type BaseFormatPrice='formatted'|'cents'|'float';export declare const baseOrderPricePropTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;base:PropTypes.Validator<string>;type:PropTypes.Validator<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};export declare const baseOrderComponentPricePropTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};export declare type BasePriceType='total'|'option'|'unit';export declare type BaseSelectorType='select'|'radio';export declare type BaseAmountComponentChildren=Omit<BaseAmountComponent,'children'>;export declare type BaseAmountComponent={children?:(props:BaseAmountComponentChildren)=>ReactNode;format?:BaseFormatPrice;price?:string;priceCents?:number;labelFree?:string;}&JSX.IntrinsicElements['span'];export interface FunctionChildren<P=Record<string,any>>{(props:P):ReactNode;}export{};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercelayer/react-components",
3
- "version": "3.8.1",
3
+ "version": "3.9.1",
4
4
  "description": "The Official Commerce Layer React Components",
5
5
  "module": "lib/index.js",
6
6
  "types": "lib/index.d.ts",