@commercelayer/react-components 3.13.0-beta.1 → 3.13.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/lib/components/AddToCartButton.d.ts +27 -1
  2. package/lib/components/Address.d.ts +13 -1
  3. package/lib/components/AddressCountrySelector.d.ts +9 -1
  4. package/lib/components/AddressField.d.ts +15 -1
  5. package/lib/components/AddressInput.d.ts +7 -1
  6. package/lib/components/AddressStateSelector.d.ts +11 -1
  7. package/lib/components/AddressesContainer.d.ts +8 -1
  8. package/lib/components/AdjustmentAmount.d.ts +4 -1
  9. package/lib/components/AdyenPayment.d.ts +25 -1
  10. package/lib/components/AvailabilityContainer.d.ts +7 -1
  11. package/lib/components/AvailabilityTemplate.d.ts +15 -1
  12. package/lib/components/BillingAddressContainer.d.ts +6 -1
  13. package/lib/components/BillingAddressForm.d.ts +8 -1
  14. package/lib/components/BraintreePayment.d.ts +30 -1
  15. package/lib/components/CheckoutComPayment.d.ts +23 -1
  16. package/lib/components/CheckoutLink.d.ts +13 -1
  17. package/lib/components/CommerceLayer.d.ts +8 -1
  18. package/lib/components/CustomerContainer.d.ts +7 -1
  19. package/lib/components/CustomerInput.d.ts +11 -1
  20. package/lib/components/DeliveryLeadTime.d.ts +10 -1
  21. package/lib/components/DiscountAmount.d.ts +4 -1
  22. package/lib/components/Errors.d.ts +5 -1
  23. package/lib/components/ExternalFunction.d.ts +7 -1
  24. package/lib/components/GiftCard.d.ts +8 -1
  25. package/lib/components/GiftCardAmount.d.ts +4 -1
  26. package/lib/components/GiftCardContainer.d.ts +6 -1
  27. package/lib/components/GiftCardCurrencySelector.d.ts +7 -1
  28. package/lib/components/GiftCardInput.d.ts +7 -1
  29. package/lib/components/GiftCardOrCouponCode.d.ts +17 -1
  30. package/lib/components/GiftCardOrCouponCode.js +1 -1
  31. package/lib/components/GiftCardOrCouponForm.d.ts +10 -1
  32. package/lib/components/GiftCardOrCouponInput.d.ts +10 -1
  33. package/lib/components/GiftCardOrCouponRemoveButton.d.ts +18 -1
  34. package/lib/components/GiftCardOrCouponSubmit.d.ts +9 -1
  35. package/lib/components/ItemContainer.d.ts +11 -1
  36. package/lib/components/KlarnaPayment.d.ts +9 -1
  37. package/lib/components/LineItem.d.ts +8 -1
  38. package/lib/components/LineItem.js +1 -1
  39. package/lib/components/LineItemAmount.d.ts +7 -1
  40. package/lib/components/LineItemCode.d.ts +12 -1
  41. package/lib/components/LineItemImage.d.ts +16 -1
  42. package/lib/components/LineItemImage.js +1 -1
  43. package/lib/components/LineItemName.d.ts +11 -1
  44. package/lib/components/LineItemOption.d.ts +19 -1
  45. package/lib/components/LineItemOptions.d.ts +16 -1
  46. package/lib/components/LineItemQuantity.d.ts +14 -1
  47. package/lib/components/LineItemRemoveLink.d.ts +12 -1
  48. package/lib/components/LineItemsContainer.d.ts +8 -1
  49. package/lib/components/LineItemsCount.d.ts +12 -1
  50. package/lib/components/LineItemsEmpty.d.ts +12 -1
  51. package/lib/components/MetadataInput.d.ts +5 -1
  52. package/lib/components/OrderContainer.d.ts +12 -1
  53. package/lib/components/OrderNumber.d.ts +5 -1
  54. package/lib/components/OrderStorage.d.ts +8 -1
  55. package/lib/components/PaymentGateway.d.ts +16 -1
  56. package/lib/components/PaymentMethod.d.ts +16 -1
  57. package/lib/components/PaymentMethodAmount.d.ts +4 -1
  58. package/lib/components/PaymentMethodName.d.ts +9 -1
  59. package/lib/components/PaymentMethodPrice.d.ts +9 -1
  60. package/lib/components/PaymentMethodRadioButton.d.ts +12 -1
  61. package/lib/components/PaymentMethodsContainer.d.ts +8 -1
  62. package/lib/components/PaymentSource.d.ts +19 -1
  63. package/lib/components/PaymentSourceBrandIcon.d.ts +15 -1
  64. package/lib/components/PaymentSourceBrandName.d.ts +12 -1
  65. package/lib/components/PaymentSourceDetail.d.ts +12 -1
  66. package/lib/components/PaymentSourceEditButton.d.ts +9 -1
  67. package/lib/components/PaypalPayment.d.ts +12 -1
  68. package/lib/components/PlaceOrderButton.d.ts +14 -1
  69. package/lib/components/PlaceOrderContainer.d.ts +8 -1
  70. package/lib/components/Price.d.ts +16 -1
  71. package/lib/components/PricesContainer.d.ts +11 -1
  72. package/lib/components/PrivacyAndTermsCheckbox.d.ts +4 -1
  73. package/lib/components/QuantitySelector.d.ts +17 -1
  74. package/lib/components/SaveAddressesButton.d.ts +10 -1
  75. package/lib/components/SaveCustomerButton.d.ts +13 -1
  76. package/lib/components/Shipment.d.ts +15 -1
  77. package/lib/components/Shipment.js +1 -1
  78. package/lib/components/ShipmentField.d.ts +12 -1
  79. package/lib/components/ShipmentsContainer.d.ts +6 -1
  80. package/lib/components/ShipmentsContainer.js +1 -1
  81. package/lib/components/ShippingAddressContainer.d.ts +6 -1
  82. package/lib/components/ShippingAddressForm.d.ts +8 -1
  83. package/lib/components/ShippingAmount.d.ts +4 -1
  84. package/lib/components/ShippingMethod.d.ts +8 -1
  85. package/lib/components/ShippingMethodName.d.ts +11 -1
  86. package/lib/components/ShippingMethodPrice.d.ts +13 -1
  87. package/lib/components/ShippingMethodRadioButton.d.ts +13 -1
  88. package/lib/components/ShippingMethodRadioButton.js +1 -1
  89. package/lib/components/SkuField.d.ts +9 -1
  90. package/lib/components/SkuList.d.ts +7 -1
  91. package/lib/components/SkuListsContainer.d.ts +6 -1
  92. package/lib/components/SkuOption.d.ts +7 -1
  93. package/lib/components/SkuOptionInput.d.ts +5 -1
  94. package/lib/components/SkuOptionsContainer.d.ts +7 -1
  95. package/lib/components/Skus.d.ts +11 -1
  96. package/lib/components/SkusContainer.d.ts +14 -1
  97. package/lib/components/StockTransfer.d.ts +6 -1
  98. package/lib/components/StockTransfer.js +1 -1
  99. package/lib/components/StockTransferField.d.ts +9 -1
  100. package/lib/components/StripePayment.d.ts +18 -1
  101. package/lib/components/SubTotalAmount.d.ts +4 -1
  102. package/lib/components/SubmitButton.d.ts +9 -1
  103. package/lib/components/TaxesAmount.d.ts +4 -1
  104. package/lib/components/TotalAmount.d.ts +4 -1
  105. package/lib/components/VariantSelector.d.ts +29 -1
  106. package/lib/components/VariantsContainer.d.ts +8 -1
  107. package/lib/components/WireTransferPayment.d.ts +10 -1
  108. package/lib/components/gateways/AdyenGateway.d.ts +4 -1
  109. package/lib/components/gateways/BraintreeGateway.d.ts +4 -1
  110. package/lib/components/gateways/CheckoutComGateway.d.ts +4 -1
  111. package/lib/components/gateways/KlarnaGateway.d.ts +4 -1
  112. package/lib/components/gateways/PaypalGateway.d.ts +4 -1
  113. package/lib/components/gateways/StripeGateway.d.ts +4 -1
  114. package/lib/components/gateways/WireTransferGateway.d.ts +4 -1
  115. package/lib/components/utils/AddressCardsTemplate.d.ts +26 -1
  116. package/lib/components/utils/BaseField.d.ts +8 -1
  117. package/lib/components/utils/BaseInput.d.ts +5 -1
  118. package/lib/components/utils/BaseInput.js +1 -1
  119. package/lib/components/utils/BaseOrderPrice.d.ts +6 -1
  120. package/lib/components/utils/BaseSelect.d.ts +5 -1
  121. package/lib/components/utils/GenericFieldComponent.d.ts +37 -1
  122. package/lib/components/utils/GenericFieldComponent.js +1 -1
  123. package/lib/components/utils/Parent.d.ts +6 -1
  124. package/lib/components/utils/Parent.js +1 -1
  125. package/lib/components/utils/PaymentCardsTemplate.d.ts +22 -1
  126. package/lib/components/utils/PriceTemplate.d.ts +8 -1
  127. package/lib/components/utils/VariantTemplate.d.ts +36 -1
  128. package/lib/components/utils/getAllErrors.d.ts +17 -1
  129. package/lib/config/components.d.ts +913 -1
  130. package/lib/config/currency.d.ts +5 -1
  131. package/lib/context/AddressChildrenContext.d.ts +6 -1
  132. package/lib/context/AddressContext.d.ts +16 -1
  133. package/lib/context/AvailabilityContext.d.ts +2 -1
  134. package/lib/context/BillingAddressContext.d.ts +11 -1
  135. package/lib/context/BillingAddressFormContext.d.ts +19 -1
  136. package/lib/context/CommerceLayerContext.d.ts +6 -1
  137. package/lib/context/CouponAndGiftCardFormContext.d.ts +9 -1
  138. package/lib/context/CustomerContext.d.ts +15 -1
  139. package/lib/context/ExternalFunctionContext.d.ts +11 -1
  140. package/lib/context/GiftCardContext.d.ts +10 -1
  141. package/lib/context/ItemContext.d.ts +12 -1
  142. package/lib/context/LineItemChildrenContext.d.ts +8 -1
  143. package/lib/context/LineItemContext.d.ts +7 -1
  144. package/lib/context/LineItemOptionChildrenContext.d.ts +7 -1
  145. package/lib/context/OrderContext.d.ts +29 -1
  146. package/lib/context/OrderStorageContext.d.ts +10 -1
  147. package/lib/context/PaymentMethodChildrenContext.d.ts +9 -1
  148. package/lib/context/PaymentMethodContext.d.ts +22 -1
  149. package/lib/context/PaymentSourceContext.d.ts +13 -1
  150. package/lib/context/PlaceOrderContext.d.ts +17 -1
  151. package/lib/context/PricesContext.d.ts +6 -1
  152. package/lib/context/ShipmentChildrenContext.d.ts +12 -1
  153. package/lib/context/ShipmentContext.d.ts +11 -1
  154. package/lib/context/ShippingAddressContext.d.ts +9 -1
  155. package/lib/context/ShippingAddressFormContext.d.ts +3 -1
  156. package/lib/context/ShippingMethodChildrenContext.d.ts +9 -1
  157. package/lib/context/SkuChildrenContext.d.ts +8 -1
  158. package/lib/context/SkuContext.d.ts +8 -1
  159. package/lib/context/SkuListsContext.d.ts +5 -1
  160. package/lib/context/SkuOptionChildrenContext.d.ts +7 -1
  161. package/lib/context/SkuOptionsContext.d.ts +2 -1
  162. package/lib/context/StockTransferChildrenContext.d.ts +6 -1
  163. package/lib/context/VariantsContext.d.ts +2 -1
  164. package/lib/index.d.ts +102 -1
  165. package/lib/reducers/AddressReducer.d.ts +59 -1
  166. package/lib/reducers/AvailabilityReducer.d.ts +61 -1
  167. package/lib/reducers/BillingAddressReducer.d.ts +31 -1
  168. package/lib/reducers/CustomerReducer.d.ts +50 -1
  169. package/lib/reducers/GiftCardReducer.d.ts +76 -1
  170. package/lib/reducers/ItemReducer.d.ts +69 -1
  171. package/lib/reducers/LineItemReducer.d.ts +52 -1
  172. package/lib/reducers/OrderReducer.d.ts +132 -2
  173. package/lib/reducers/PaymentMethodReducer.d.ts +151 -1
  174. package/lib/reducers/PlaceOrderReducer.d.ts +59 -1
  175. package/lib/reducers/PriceReducer.d.ts +44 -1
  176. package/lib/reducers/ShipmentReducer.d.ts +40 -1
  177. package/lib/reducers/ShippingAddressReducer.d.ts +32 -1
  178. package/lib/reducers/SkuListsReducer.d.ts +21 -1
  179. package/lib/reducers/SkuOptionsReducer.d.ts +26 -1
  180. package/lib/reducers/SkuReducer.d.ts +21 -1
  181. package/lib/reducers/VariantReducer.d.ts +71 -1
  182. package/lib/typings/errors.d.ts +42 -1
  183. package/lib/typings/index.d.ts +137 -1
  184. package/lib/utils/PropsType.d.ts +33 -1
  185. package/lib/utils/addressesManager.d.ts +28 -1
  186. package/lib/utils/baseReducer.d.ts +3 -1
  187. package/lib/utils/browserInfo.d.ts +9 -1
  188. package/lib/utils/checkIncludeResource.d.ts +8 -1
  189. package/lib/utils/childrenTypes.d.ts +9 -1
  190. package/lib/utils/compareObjAttribute.d.ts +7 -1
  191. package/lib/utils/countryStateCity.d.ts +9 -1
  192. package/lib/utils/customMessages.d.ts +8 -1
  193. package/lib/utils/customerOrderOptions.d.ts +3 -1
  194. package/lib/utils/getAmount.d.ts +9 -1
  195. package/lib/utils/getCardDetails.d.ts +15 -1
  196. package/lib/utils/getCurrentItemKey.d.ts +6 -1
  197. package/lib/utils/getErrors.d.ts +11 -1
  198. package/lib/utils/getLineItemsCount.d.ts +12 -1
  199. package/lib/utils/getLoaderComponent.d.ts +2 -1
  200. package/lib/utils/getPrices.d.ts +17 -1
  201. package/lib/utils/getSdk.d.ts +3 -1
  202. package/lib/utils/getSkus.d.ts +3 -1
  203. package/lib/utils/hooks/useExternalScript.d.ts +1 -1
  204. package/lib/utils/isEmptyStates.d.ts +1 -1
  205. package/lib/utils/isJSON.d.ts +1 -1
  206. package/lib/utils/jwt.d.ts +27 -1
  207. package/lib/utils/localStorage.d.ts +17 -1
  208. package/lib/utils/organization.d.ts +6 -1
  209. package/lib/utils/paypalPayment.d.ts +3 -1
  210. package/lib/utils/placeholderImages.d.ts +2 -0
  211. package/lib/utils/placeholderImages.js +1 -0
  212. package/lib/utils/promisify.d.ts +1 -1
  213. package/lib/utils/shipments.d.ts +3 -1
  214. package/lib/utils/validateFormFields.d.ts +22 -1
  215. package/package.json +2 -2
@@ -1 +1,11 @@
1
- import{FunctionComponent,ReactNode}from'react';import type{LineItem}from'@commercelayer/sdk';export declare type LineItemNameType=Omit<LineItemNameProps,'children'>&{label:string;lineItem:LineItem;};declare type LineItemNameProps={children?:(props:LineItemNameType)=>ReactNode;}&JSX.IntrinsicElements['p'];declare const LineItemName:FunctionComponent<LineItemNameProps>;export default LineItemName;
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ import type { LineItem } from '@commercelayer/sdk';
3
+ export declare type LineItemNameType = Omit<LineItemNameProps, 'children'> & {
4
+ label: string;
5
+ lineItem: LineItem;
6
+ };
7
+ declare type LineItemNameProps = {
8
+ children?: (props: LineItemNameType) => ReactNode;
9
+ } & JSX.IntrinsicElements['p'];
10
+ declare const LineItemName: FunctionComponent<LineItemNameProps>;
11
+ export default LineItemName;
@@ -1 +1,19 @@
1
- import{FunctionComponent,CSSProperties}from'react';import{LineItemOption as LineItemOptionType}from'@commercelayer/sdk';import{FunctionChildren}from'../typings/index';declare type LineItemOptionChildrenProps=FunctionChildren<Omit<LineItemOptionProps,'children'>&{lineItemOption:LineItemOptionType;}>;declare type LineItemOptionProps={id?:string;className?:string;key?:string;style?:CSSProperties;children?:LineItemOptionChildrenProps;name?:string;valueClassName?:string;tagElement?:keyof JSX.IntrinsicElements;tagContainer?:keyof JSX.IntrinsicElements;};declare const LineItemOption:FunctionComponent<LineItemOptionProps>;export default LineItemOption;
1
+ import { FunctionComponent, CSSProperties } from 'react';
2
+ import { LineItemOption as LineItemOptionType } from '@commercelayer/sdk';
3
+ import { FunctionChildren } from '../typings/index';
4
+ declare type LineItemOptionChildrenProps = FunctionChildren<Omit<LineItemOptionProps, 'children'> & {
5
+ lineItemOption: LineItemOptionType;
6
+ }>;
7
+ declare type LineItemOptionProps = {
8
+ id?: string;
9
+ className?: string;
10
+ key?: string;
11
+ style?: CSSProperties;
12
+ children?: LineItemOptionChildrenProps;
13
+ name?: string;
14
+ valueClassName?: string;
15
+ tagElement?: keyof JSX.IntrinsicElements;
16
+ tagContainer?: keyof JSX.IntrinsicElements;
17
+ };
18
+ declare const LineItemOption: FunctionComponent<LineItemOptionProps>;
19
+ export default LineItemOption;
@@ -1 +1,16 @@
1
- import React,{ReactNode}from'react';export declare type LineItemOptionsProps=JSX.IntrinsicElements['div']&{children:ReactNode;title?:string;showName?:boolean;titleTagElement?:keyof JSX.IntrinsicElements;titleClassName?:string;}&({skuOptionId:string;showAll?:never;}|{skuOptionId?:never;showAll:true;});declare const LineItemOptions:React.FunctionComponent<LineItemOptionsProps>;export default LineItemOptions;
1
+ import React, { ReactNode } from 'react';
2
+ export declare type LineItemOptionsProps = JSX.IntrinsicElements['div'] & {
3
+ children: ReactNode;
4
+ title?: string;
5
+ showName?: boolean;
6
+ titleTagElement?: keyof JSX.IntrinsicElements;
7
+ titleClassName?: string;
8
+ } & ({
9
+ skuOptionId: string;
10
+ showAll?: never;
11
+ } | {
12
+ skuOptionId?: never;
13
+ showAll: true;
14
+ });
15
+ declare const LineItemOptions: React.FunctionComponent<LineItemOptionsProps>;
16
+ export default LineItemOptions;
@@ -1 +1,14 @@
1
- import React,{FunctionComponent}from'react';import{FunctionChildren}from'../typings/index';declare type LineItemQuantityChildrenProps=FunctionChildren<Omit<LineItemQuantityProps,'children'>&{quantity:number;handleChange:(event:React.MouseEvent<HTMLSelectElement>)=>void;}>;declare type LineItemQuantityProps={children?:LineItemQuantityChildrenProps;max?:number;disabled?:boolean;readonly?:boolean;}&(JSX.IntrinsicElements['select']&JSX.IntrinsicElements['span']);declare const LineItemQuantity:FunctionComponent<LineItemQuantityProps>;export default LineItemQuantity;
1
+ import React, { FunctionComponent } from 'react';
2
+ import { FunctionChildren } from '../typings/index';
3
+ declare type LineItemQuantityChildrenProps = FunctionChildren<Omit<LineItemQuantityProps, 'children'> & {
4
+ quantity: number;
5
+ handleChange: (event: React.MouseEvent<HTMLSelectElement>) => void;
6
+ }>;
7
+ declare type LineItemQuantityProps = {
8
+ children?: LineItemQuantityChildrenProps;
9
+ max?: number;
10
+ disabled?: boolean;
11
+ readonly?: boolean;
12
+ } & (JSX.IntrinsicElements['select'] & JSX.IntrinsicElements['span']);
13
+ declare const LineItemQuantity: FunctionComponent<LineItemQuantityProps>;
14
+ export default LineItemQuantity;
@@ -1 +1,12 @@
1
- import React,{FunctionComponent,PropsWithoutRef}from'react';import{FunctionChildren}from'../typings/index';declare type ChildrenLineItemRemoveLinkProps=FunctionChildren<{handleRemove:(event:React.MouseEvent<HTMLAnchorElement>)=>void;label?:string;}>;declare type LineItemRemoveLinkProps={children?:ChildrenLineItemRemoveLinkProps;label?:string;}&PropsWithoutRef<JSX.IntrinsicElements['a']>;declare const LineItemRemoveLink:FunctionComponent<LineItemRemoveLinkProps>;export default LineItemRemoveLink;
1
+ import React, { FunctionComponent, PropsWithoutRef } from 'react';
2
+ import { FunctionChildren } from '../typings/index';
3
+ declare type ChildrenLineItemRemoveLinkProps = FunctionChildren<{
4
+ handleRemove: (event: React.MouseEvent<HTMLAnchorElement>) => void;
5
+ label?: string;
6
+ }>;
7
+ declare type LineItemRemoveLinkProps = {
8
+ children?: ChildrenLineItemRemoveLinkProps;
9
+ label?: string;
10
+ } & PropsWithoutRef<JSX.IntrinsicElements['a']>;
11
+ declare const LineItemRemoveLink: FunctionComponent<LineItemRemoveLinkProps>;
12
+ export default LineItemRemoveLink;
@@ -1 +1,8 @@
1
- import{FunctionComponent,ReactNode}from'react';declare type LineItemsContainer={children:ReactNode;filters?:Record<string,any>;loader?:ReactNode;};declare const LineItemsContainer:FunctionComponent<LineItemsContainer>;export default LineItemsContainer;
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ declare type LineItemsContainer = {
3
+ children: ReactNode;
4
+ filters?: Record<string, any>;
5
+ loader?: ReactNode;
6
+ };
7
+ declare const LineItemsContainer: FunctionComponent<LineItemsContainer>;
8
+ export default LineItemsContainer;
@@ -1 +1,12 @@
1
- import{FunctionComponent}from'react';import{TypeAccepted}from'../utils/getLineItemsCount';import{FunctionChildren}from'../typings/index';declare type LineItemsCountChildrenProps=FunctionChildren<Omit<LineItemsCountProps,'children'>&{quantity:number;}>;declare type LineItemsCountProps={children?:LineItemsCountChildrenProps;typeAccepted?:TypeAccepted[];}&JSX.IntrinsicElements['span'];declare const LineItemsCount:FunctionComponent<LineItemsCountProps>;export default LineItemsCount;
1
+ import { FunctionComponent } from 'react';
2
+ import { TypeAccepted } from '../utils/getLineItemsCount';
3
+ import { FunctionChildren } from '../typings/index';
4
+ declare type LineItemsCountChildrenProps = FunctionChildren<Omit<LineItemsCountProps, 'children'> & {
5
+ quantity: number;
6
+ }>;
7
+ declare type LineItemsCountProps = {
8
+ children?: LineItemsCountChildrenProps;
9
+ typeAccepted?: TypeAccepted[];
10
+ } & JSX.IntrinsicElements['span'];
11
+ declare const LineItemsCount: FunctionComponent<LineItemsCountProps>;
12
+ export default LineItemsCount;
@@ -1 +1,12 @@
1
- import{FunctionComponent}from'react';import{FunctionChildren}from'../typings/index';export declare type LineItemsCountType=FunctionChildren<Omit<LineItemsCountProps,'children'>&{quantity:number;text:string;}>;declare type LineItemsCountProps={children?:LineItemsCountType;text?:string;}&JSX.IntrinsicElements['span'];declare const LineItemsEmpty:FunctionComponent<LineItemsCountProps>;export default LineItemsEmpty;
1
+ import { FunctionComponent } from 'react';
2
+ import { FunctionChildren } from '../typings/index';
3
+ export declare type LineItemsCountType = FunctionChildren<Omit<LineItemsCountProps, 'children'> & {
4
+ quantity: number;
5
+ text: string;
6
+ }>;
7
+ declare type LineItemsCountProps = {
8
+ children?: LineItemsCountType;
9
+ text?: string;
10
+ } & JSX.IntrinsicElements['span'];
11
+ declare const LineItemsEmpty: FunctionComponent<LineItemsCountProps>;
12
+ export default LineItemsEmpty;
@@ -1 +1,5 @@
1
- import{FunctionComponent}from'react';import{BaseInputComponentProps}from'../typings/index';export declare type MetadataInputProps=BaseInputComponentProps&JSX.IntrinsicElements['input']&JSX.IntrinsicElements['textarea'];declare const MetadataInput:FunctionComponent<MetadataInputProps>;export default MetadataInput;
1
+ import { FunctionComponent } from 'react';
2
+ import { BaseInputComponentProps } from '../typings/index';
3
+ export declare type MetadataInputProps = BaseInputComponentProps & JSX.IntrinsicElements['input'] & JSX.IntrinsicElements['textarea'];
4
+ declare const MetadataInput: FunctionComponent<MetadataInputProps>;
5
+ export default MetadataInput;
@@ -1 +1,12 @@
1
- import React,{ReactNode}from'react';import{BaseMetadataObject}from'../typings/index';import{OrderCreate,Order}from'@commercelayer/sdk';declare type OrderContainerProps={children:ReactNode;metadata?:BaseMetadataObject;attributes?:OrderCreate;orderId?:string;fetchOrder?:(order:Order)=>void;};declare const OrderContainer:React.FunctionComponent<OrderContainerProps>;export default OrderContainer;
1
+ import React, { ReactNode } from 'react';
2
+ import { BaseMetadataObject } from '../typings/index';
3
+ import { OrderCreate, Order } from '@commercelayer/sdk';
4
+ declare type OrderContainerProps = {
5
+ children: ReactNode;
6
+ metadata?: BaseMetadataObject;
7
+ attributes?: OrderCreate;
8
+ orderId?: string;
9
+ fetchOrder?: (order: Order) => void;
10
+ };
11
+ declare const OrderContainer: React.FunctionComponent<OrderContainerProps>;
12
+ export default OrderContainer;
@@ -1 +1,5 @@
1
- import{FunctionComponent}from'react';import{BaseFieldProps}from'./utils/BaseField';export declare type OrderNumberProps=Omit<BaseFieldProps,'attribute'>;declare const OrderNumber:FunctionComponent<OrderNumberProps>;export default OrderNumber;
1
+ import { FunctionComponent } from 'react';
2
+ import { BaseFieldProps } from './utils/BaseField';
3
+ export declare type OrderNumberProps = Omit<BaseFieldProps, 'attribute'>;
4
+ declare const OrderNumber: FunctionComponent<OrderNumberProps>;
5
+ export default OrderNumber;
@@ -1 +1,8 @@
1
- import{FunctionComponent,ReactNode}from'react';declare type OrderStorageProps={children:ReactNode;persistKey:string;clearWhenPlaced?:boolean;};declare const OrderStorage:FunctionComponent<OrderStorageProps>;export default OrderStorage;
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ declare type OrderStorageProps = {
3
+ children: ReactNode;
4
+ persistKey: string;
5
+ clearWhenPlaced?: boolean;
6
+ };
7
+ declare const OrderStorage: FunctionComponent<OrderStorageProps>;
8
+ export default OrderStorage;
@@ -1 +1,16 @@
1
- import{LoaderType}from'../typings/index';import{FunctionComponent}from'react';import{PaymentSourceProps}from'./PaymentSource';export declare type GatewayBaseType=PaymentGatewayProps&{show:boolean;loading:boolean;loaderComponent:JSX.Element;};export declare type PaymentGatewayProps=PaymentSourceProps&{showCard:boolean;handleEditClick:(e:MouseEvent)=>void;show:boolean;loader?:LoaderType;};declare const PaymentGateway:FunctionComponent<PaymentGatewayProps>;export default PaymentGateway;
1
+ import { LoaderType } from '../typings/index';
2
+ import { FunctionComponent } from 'react';
3
+ import { PaymentSourceProps } from './PaymentSource';
4
+ export declare type GatewayBaseType = PaymentGatewayProps & {
5
+ show: boolean;
6
+ loading: boolean;
7
+ loaderComponent: JSX.Element;
8
+ };
9
+ export declare type PaymentGatewayProps = PaymentSourceProps & {
10
+ showCard: boolean;
11
+ handleEditClick: (e: MouseEvent) => void;
12
+ show: boolean;
13
+ loader?: LoaderType;
14
+ };
15
+ declare const PaymentGateway: FunctionComponent<PaymentGatewayProps>;
16
+ export default PaymentGateway;
@@ -1 +1,16 @@
1
- import{FunctionComponent,ReactNode}from'react';import{LoaderType}from'../typings/index';import{PaymentMethod as PaymentMethodType}from'@commercelayer/sdk';declare type PaymentMethodProps={children:ReactNode;activeClass?:string;loader?:LoaderType;}&Omit<JSX.IntrinsicElements['div'],'onClick'>&({clickableContainer:true;onClick?:(payment?:PaymentMethodType|Record<string,any>)=>void;}|{clickableContainer?:never;onClick?:never;});declare const PaymentMethod:FunctionComponent<PaymentMethodProps>;export default PaymentMethod;
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ import { LoaderType } from '../typings/index';
3
+ import { PaymentMethod as PaymentMethodType } from '@commercelayer/sdk';
4
+ declare type PaymentMethodProps = {
5
+ children: ReactNode;
6
+ activeClass?: string;
7
+ loader?: LoaderType;
8
+ } & Omit<JSX.IntrinsicElements['div'], 'onClick'> & ({
9
+ clickableContainer: true;
10
+ onClick?: (payment?: PaymentMethodType | Record<string, any>) => void;
11
+ } | {
12
+ clickableContainer?: never;
13
+ onClick?: never;
14
+ });
15
+ declare const PaymentMethod: FunctionComponent<PaymentMethodProps>;
16
+ export default PaymentMethod;
@@ -1 +1,4 @@
1
- import{FunctionComponent}from'react';import{BaseAmountComponent}from'../typings/index';declare const PaymentMethodAmount:FunctionComponent<BaseAmountComponent>;export default PaymentMethodAmount;
1
+ import { FunctionComponent } from 'react';
2
+ import { BaseAmountComponent } from '../typings/index';
3
+ declare const PaymentMethodAmount: FunctionComponent<BaseAmountComponent>;
4
+ export default PaymentMethodAmount;
@@ -1 +1,9 @@
1
- import{FunctionComponent,ReactNode}from'react';declare type PaymentMethodNameChildrenProps=Omit<PaymentMethodNameProps,'children'>&{labelName:string;};declare type PaymentMethodNameProps={children?:(props:PaymentMethodNameChildrenProps)=>ReactNode;}&JSX.IntrinsicElements['label'];declare const PaymentMethodName:FunctionComponent<PaymentMethodNameProps>;export default PaymentMethodName;
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ declare type PaymentMethodNameChildrenProps = Omit<PaymentMethodNameProps, 'children'> & {
3
+ labelName: string;
4
+ };
5
+ declare type PaymentMethodNameProps = {
6
+ children?: (props: PaymentMethodNameChildrenProps) => ReactNode;
7
+ } & JSX.IntrinsicElements['label'];
8
+ declare const PaymentMethodName: FunctionComponent<PaymentMethodNameProps>;
9
+ export default PaymentMethodName;
@@ -1 +1,9 @@
1
- import{FunctionComponent}from'react';import{BaseAmountComponent}from'../typings/index';declare type Props={type?:'amount';labelFree?:string;};export declare type PaymentMethodPriceProps=BaseAmountComponent&Props;declare const PaymentMethodPrice:FunctionComponent<PaymentMethodPriceProps>;export default PaymentMethodPrice;
1
+ import { FunctionComponent } from 'react';
2
+ import { BaseAmountComponent } from '../typings/index';
3
+ declare type Props = {
4
+ type?: 'amount';
5
+ labelFree?: string;
6
+ };
7
+ export declare type PaymentMethodPriceProps = BaseAmountComponent & Props;
8
+ declare const PaymentMethodPrice: FunctionComponent<PaymentMethodPriceProps>;
9
+ export default PaymentMethodPrice;
@@ -1 +1,12 @@
1
- import{FunctionComponent,ReactNode,ChangeEvent}from'react';import{PaymentMethod}from'@commercelayer/sdk';declare type ShippingMethodRadioButtonChildrenProps=Omit<ShippingMethodRadioButtonProps,'children'>&{checked:boolean;handleOnChange:(event:ChangeEvent<HTMLInputElement>)=>Promise<void>;};declare type ShippingMethodRadioButtonProps={children?:(props:ShippingMethodRadioButtonChildrenProps)=>ReactNode;onChange?:(payment?:PaymentMethod|Record<string,any>)=>void;}&JSX.IntrinsicElements['input'];declare const PaymentMethodRadioButton:FunctionComponent<ShippingMethodRadioButtonProps>;export default PaymentMethodRadioButton;
1
+ import { FunctionComponent, ReactNode, ChangeEvent } from 'react';
2
+ import { PaymentMethod } from '@commercelayer/sdk';
3
+ declare type ShippingMethodRadioButtonChildrenProps = Omit<ShippingMethodRadioButtonProps, 'children'> & {
4
+ checked: boolean;
5
+ handleOnChange: (event: ChangeEvent<HTMLInputElement>) => Promise<void>;
6
+ };
7
+ declare type ShippingMethodRadioButtonProps = {
8
+ children?: (props: ShippingMethodRadioButtonChildrenProps) => ReactNode;
9
+ onChange?: (payment?: PaymentMethod | Record<string, any>) => void;
10
+ } & JSX.IntrinsicElements['input'];
11
+ declare const PaymentMethodRadioButton: FunctionComponent<ShippingMethodRadioButtonProps>;
12
+ export default PaymentMethodRadioButton;
@@ -1 +1,8 @@
1
- import React,{ReactNode}from'react';import{PaymentMethodConfig}from'../reducers/PaymentMethodReducer';declare type PaymentMethodsContainerProps={children:ReactNode;config?:PaymentMethodConfig;};declare const PaymentMethodsContainer:React.FunctionComponent<PaymentMethodsContainerProps>;export default PaymentMethodsContainer;
1
+ import React, { ReactNode } from 'react';
2
+ import { PaymentMethodConfig } from '../reducers/PaymentMethodReducer';
3
+ declare type PaymentMethodsContainerProps = {
4
+ children: ReactNode;
5
+ config?: PaymentMethodConfig;
6
+ };
7
+ declare const PaymentMethodsContainer: React.FunctionComponent<PaymentMethodsContainerProps>;
8
+ export default PaymentMethodsContainer;
@@ -1 +1,19 @@
1
- import{FunctionComponent,ReactNode}from'react';import{LoaderType}from'../typings/index';import{CustomerCardsTemplateChildren}from'./utils/PaymentCardsTemplate';export declare type CustomerCardsProps={handleClick:()=>void;};export declare type CustomerSaveToWalletProps={name:'save_payment_source_to_customer_wallet';};export declare type PaymentSourceProps={children?:ReactNode;readonly?:boolean;templateCustomerCards?:CustomerCardsTemplateChildren;onClickCustomerCards?:()=>void;templateCustomerSaveToWallet?:(props:CustomerSaveToWalletProps)=>ReactNode;loader?:LoaderType;}&JSX.IntrinsicElements['div'];declare const PaymentSource:FunctionComponent<PaymentSourceProps>;export default PaymentSource;
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ import { LoaderType } from '../typings/index';
3
+ import { CustomerCardsTemplateChildren } from './utils/PaymentCardsTemplate';
4
+ export declare type CustomerCardsProps = {
5
+ handleClick: () => void;
6
+ };
7
+ export declare type CustomerSaveToWalletProps = {
8
+ name: 'save_payment_source_to_customer_wallet';
9
+ };
10
+ export declare type PaymentSourceProps = {
11
+ children?: ReactNode;
12
+ readonly?: boolean;
13
+ templateCustomerCards?: CustomerCardsTemplateChildren;
14
+ onClickCustomerCards?: () => void;
15
+ templateCustomerSaveToWallet?: (props: CustomerSaveToWalletProps) => ReactNode;
16
+ loader?: LoaderType;
17
+ } & JSX.IntrinsicElements['div'];
18
+ declare const PaymentSource: FunctionComponent<PaymentSourceProps>;
19
+ export default PaymentSource;
@@ -1 +1,15 @@
1
- import{IconBrand}from'../context/PaymentSourceContext';import{FunctionComponent}from'react';import{FunctionChildren}from'../typings/index';declare type CustomComponent=FunctionChildren<Omit<Props&{brand:IconBrand;defaultSrc:string;url:string;},'children'>>;declare type Props={children?:CustomComponent;width?:number;height?:number;}&JSX.IntrinsicElements['img'];declare const PaymentSourceBrandIcon:FunctionComponent<Props>;export default PaymentSourceBrandIcon;
1
+ import { IconBrand } from '../context/PaymentSourceContext';
2
+ import { FunctionComponent } from 'react';
3
+ import { FunctionChildren } from '../typings/index';
4
+ declare type CustomComponent = FunctionChildren<Omit<Props & {
5
+ brand: IconBrand;
6
+ defaultSrc: string;
7
+ url: string;
8
+ }, 'children'>>;
9
+ declare type Props = {
10
+ children?: CustomComponent;
11
+ width?: number;
12
+ height?: number;
13
+ } & JSX.IntrinsicElements['img'];
14
+ declare const PaymentSourceBrandIcon: FunctionComponent<Props>;
15
+ export default PaymentSourceBrandIcon;
@@ -1 +1,12 @@
1
- import{IconBrand}from'../context/PaymentSourceContext';import{FunctionComponent}from'react';import{FunctionChildren}from'../typings/index';declare type CustomComponent=FunctionChildren<Omit<Props&{brand:IconBrand;},'children'>>;declare type Props={children?:CustomComponent;label?:string;}&JSX.IntrinsicElements['span'];declare const PaymentSourceBrandName:FunctionComponent<Props>;export default PaymentSourceBrandName;
1
+ import { IconBrand } from '../context/PaymentSourceContext';
2
+ import { FunctionComponent } from 'react';
3
+ import { FunctionChildren } from '../typings/index';
4
+ declare type CustomComponent = FunctionChildren<Omit<Props & {
5
+ brand: IconBrand;
6
+ }, 'children'>>;
7
+ declare type Props = {
8
+ children?: CustomComponent;
9
+ label?: string;
10
+ } & JSX.IntrinsicElements['span'];
11
+ declare const PaymentSourceBrandName: FunctionComponent<Props>;
12
+ export default PaymentSourceBrandName;
@@ -1 +1,12 @@
1
- import{FunctionComponent}from'react';import{FunctionChildren}from'../typings/index';export declare type PaymentSourceDetailType='last4'|'exp_year'|'exp_month';declare type CustomComponent=FunctionChildren<Omit<Props&{text:string;},'children'>>;declare type Props={children?:CustomComponent;type:PaymentSourceDetailType;}&JSX.IntrinsicElements['span'];declare const PaymentSourceDetail:FunctionComponent<Props>;export default PaymentSourceDetail;
1
+ import { FunctionComponent } from 'react';
2
+ import { FunctionChildren } from '../typings/index';
3
+ export declare type PaymentSourceDetailType = 'last4' | 'exp_year' | 'exp_month';
4
+ declare type CustomComponent = FunctionChildren<Omit<Props & {
5
+ text: string;
6
+ }, 'children'>>;
7
+ declare type Props = {
8
+ children?: CustomComponent;
9
+ type: PaymentSourceDetailType;
10
+ } & JSX.IntrinsicElements['span'];
11
+ declare const PaymentSourceDetail: FunctionComponent<Props>;
12
+ export default PaymentSourceDetail;
@@ -1 +1,9 @@
1
- import{FunctionComponent,ReactNode}from'react';import{FunctionChildren}from'../typings/index';declare type CustomComponent=FunctionChildren<Omit<Props,'children'>>;declare type Props={children?:CustomComponent;label?:string|ReactNode;}&Omit<JSX.IntrinsicElements['button'],'onClick'>;declare const PaymentSourceEditButton:FunctionComponent<Props>;export default PaymentSourceEditButton;
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ import { FunctionChildren } from '../typings/index';
3
+ declare type CustomComponent = FunctionChildren<Omit<Props, 'children'>>;
4
+ declare type Props = {
5
+ children?: CustomComponent;
6
+ label?: string | ReactNode;
7
+ } & Omit<JSX.IntrinsicElements['button'], 'onClick'>;
8
+ declare const PaymentSourceEditButton: FunctionComponent<Props>;
9
+ export default PaymentSourceEditButton;
@@ -1 +1,12 @@
1
- import{FunctionComponent,ReactNode}from'react';export declare type PaypalConfig={return_url:string;cancel_url:string;infoMessage?:{text?:string|ReactNode;className?:string;};};declare type Props=Omit<PaypalConfig,'return_url'|'cancel_url'>&JSX.IntrinsicElements['div'];declare const PaypalPayment:FunctionComponent<Props>;export default PaypalPayment;
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ export declare type PaypalConfig = {
3
+ return_url: string;
4
+ cancel_url: string;
5
+ infoMessage?: {
6
+ text?: string | ReactNode;
7
+ className?: string;
8
+ };
9
+ };
10
+ declare type Props = Omit<PaypalConfig, 'return_url' | 'cancel_url'> & JSX.IntrinsicElements['div'];
11
+ declare const PaypalPayment: FunctionComponent<Props>;
12
+ export default PaypalPayment;
@@ -1 +1,14 @@
1
- import{FunctionComponent,ReactNode}from'react';import{FunctionChildren}from'../typings/index';declare type PlaceOrderButtonChildrenProps=FunctionChildren<Omit<PlaceOrderButtonProps,'children'>&{handleClick:()=>Promise<void>;}>;declare type PlaceOrderButtonProps={children?:PlaceOrderButtonChildrenProps;label?:string|ReactNode;onClick?:(response:{placed:boolean;})=>void;}&JSX.IntrinsicElements['button'];declare const PlaceOrderButton:FunctionComponent<PlaceOrderButtonProps>;export default PlaceOrderButton;
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ import { FunctionChildren } from '../typings/index';
3
+ declare type PlaceOrderButtonChildrenProps = FunctionChildren<Omit<PlaceOrderButtonProps, 'children'> & {
4
+ handleClick: () => Promise<void>;
5
+ }>;
6
+ declare type PlaceOrderButtonProps = {
7
+ children?: PlaceOrderButtonChildrenProps;
8
+ label?: string | ReactNode;
9
+ onClick?: (response: {
10
+ placed: boolean;
11
+ }) => void;
12
+ } & JSX.IntrinsicElements['button'];
13
+ declare const PlaceOrderButton: FunctionComponent<PlaceOrderButtonProps>;
14
+ export default PlaceOrderButton;
@@ -1 +1,8 @@
1
- import{FunctionComponent,ReactNode}from'react';import{PlaceOrderOptions}from'../reducers/PlaceOrderReducer';declare type PlaceOrderContainerProps={children:ReactNode;options?:PlaceOrderOptions;};declare const PlaceOrderContainer:FunctionComponent<PlaceOrderContainerProps>;export default PlaceOrderContainer;
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ import { PlaceOrderOptions } from '../reducers/PlaceOrderReducer';
3
+ declare type PlaceOrderContainerProps = {
4
+ children: ReactNode;
5
+ options?: PlaceOrderOptions;
6
+ };
7
+ declare const PlaceOrderContainer: FunctionComponent<PlaceOrderContainerProps>;
8
+ export default PlaceOrderContainer;
@@ -1 +1,16 @@
1
- import{FunctionComponent}from'react';import{Price as PriceType}from'@commercelayer/sdk';import{FunctionChildren,LoaderType}from'../typings/index';declare type PriceChildrenProps=FunctionChildren<{loading:boolean;loader:LoaderType;prices:PriceType[];}&Omit<PriceProps,'children'>>;export interface PriceProps extends Partial<JSX.IntrinsicElements['span']>{children?:PriceChildrenProps;compareClassName?:string;showCompare?:boolean;skuCode?:string;}declare const Price:FunctionComponent<PriceProps>;export default Price;
1
+ import { FunctionComponent } from 'react';
2
+ import { Price as PriceType } from '@commercelayer/sdk';
3
+ import { FunctionChildren, LoaderType } from '../typings/index';
4
+ declare type PriceChildrenProps = FunctionChildren<{
5
+ loading: boolean;
6
+ loader: LoaderType;
7
+ prices: PriceType[];
8
+ } & Omit<PriceProps, 'children'>>;
9
+ export interface PriceProps extends Partial<JSX.IntrinsicElements['span']> {
10
+ children?: PriceChildrenProps;
11
+ compareClassName?: string;
12
+ showCompare?: boolean;
13
+ skuCode?: string;
14
+ }
15
+ declare const Price: FunctionComponent<PriceProps>;
16
+ export default Price;
@@ -1 +1,11 @@
1
- import{FunctionComponent,ReactNode}from'react';import{LoaderType}from'../typings/index';declare type PricesContainerProps={children:ReactNode;filters?:object;loader?:LoaderType;perPage?:number;skuCode?:string;};declare const PricesContainer:FunctionComponent<PricesContainerProps>;export default PricesContainer;
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ import { LoaderType } from '../typings/index';
3
+ declare type PricesContainerProps = {
4
+ children: ReactNode;
5
+ filters?: object;
6
+ loader?: LoaderType;
7
+ perPage?: number;
8
+ skuCode?: string;
9
+ };
10
+ declare const PricesContainer: FunctionComponent<PricesContainerProps>;
11
+ export default PricesContainer;
@@ -1 +1,4 @@
1
- import{FunctionComponent}from'react';import{BaseInputProps}from'./utils/BaseInput';declare const PrivacyAndTermsCheckbox:FunctionComponent<Partial<BaseInputProps>>;export default PrivacyAndTermsCheckbox;
1
+ import { FunctionComponent } from 'react';
2
+ import { BaseInputProps } from './utils/BaseInput';
3
+ declare const PrivacyAndTermsCheckbox: FunctionComponent<Partial<BaseInputProps>>;
4
+ export default PrivacyAndTermsCheckbox;
@@ -1 +1,17 @@
1
- import React,{FunctionComponent}from'react';import{FunctionChildren}from'../typings/index';declare type QuantitySelectorChildrenProps=FunctionChildren<Omit<QuantitySelectorProps,'children'>&{handleChange:(event:React.MouseEvent<HTMLInputElement>)=>void;handleBlur:(event:React.MouseEvent<HTMLInputElement>)=>void;}>;declare type QuantitySelectorProps={children?:QuantitySelectorChildrenProps;disabled?:boolean;min?:number;max?:number;value?:string;skuCode?:string;skuListId?:string;}&JSX.IntrinsicElements['input'];declare const QuantitySelector:FunctionComponent<QuantitySelectorProps>;export default QuantitySelector;
1
+ import React, { FunctionComponent } from 'react';
2
+ import { FunctionChildren } from '../typings/index';
3
+ declare type QuantitySelectorChildrenProps = FunctionChildren<Omit<QuantitySelectorProps, 'children'> & {
4
+ handleChange: (event: React.MouseEvent<HTMLInputElement>) => void;
5
+ handleBlur: (event: React.MouseEvent<HTMLInputElement>) => void;
6
+ }>;
7
+ declare type QuantitySelectorProps = {
8
+ children?: QuantitySelectorChildrenProps;
9
+ disabled?: boolean;
10
+ min?: number;
11
+ max?: number;
12
+ value?: string;
13
+ skuCode?: string;
14
+ skuListId?: string;
15
+ } & JSX.IntrinsicElements['input'];
16
+ declare const QuantitySelector: FunctionComponent<QuantitySelectorProps>;
17
+ export default QuantitySelector;
@@ -1 +1,10 @@
1
- import{FunctionComponent,ReactNode}from'react';import{FunctionChildren}from'../typings/index';declare type SaveAddressesButtonChildrenProps=FunctionChildren<Omit<SaveAddressesButtonProps,'children'>>;declare type SaveAddressesButtonProps={children?:SaveAddressesButtonChildrenProps;label?:string|ReactNode;onClick?:()=>void;}&JSX.IntrinsicElements['button'];declare const SaveAddressesButton:FunctionComponent<SaveAddressesButtonProps>;export default SaveAddressesButton;
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ import { FunctionChildren } from '../typings/index';
3
+ declare type SaveAddressesButtonChildrenProps = FunctionChildren<Omit<SaveAddressesButtonProps, 'children'>>;
4
+ declare type SaveAddressesButtonProps = {
5
+ children?: SaveAddressesButtonChildrenProps;
6
+ label?: string | ReactNode;
7
+ onClick?: () => void;
8
+ } & JSX.IntrinsicElements['button'];
9
+ declare const SaveAddressesButton: FunctionComponent<SaveAddressesButtonProps>;
10
+ export default SaveAddressesButton;
@@ -1 +1,13 @@
1
- import{FunctionComponent,ReactNode}from'react';import{FunctionChildren}from'../typings/index';declare type ParentProps={handleClick:()=>any;};declare type SaveAddressesButtonChildrenProps=FunctionChildren<Omit<SaveCustomerButtonProps&ParentProps,'children'>>;declare type SaveCustomerButtonProps={children?:SaveAddressesButtonChildrenProps;label?:string|ReactNode;onClick?:()=>void;}&JSX.IntrinsicElements['button'];declare const SaveCustomerButton:FunctionComponent<SaveCustomerButtonProps>;export default SaveCustomerButton;
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ import { FunctionChildren } from '../typings/index';
3
+ declare type ParentProps = {
4
+ handleClick: () => any;
5
+ };
6
+ declare type SaveAddressesButtonChildrenProps = FunctionChildren<Omit<SaveCustomerButtonProps & ParentProps, 'children'>>;
7
+ declare type SaveCustomerButtonProps = {
8
+ children?: SaveAddressesButtonChildrenProps;
9
+ label?: string | ReactNode;
10
+ onClick?: () => void;
11
+ } & JSX.IntrinsicElements['button'];
12
+ declare const SaveCustomerButton: FunctionComponent<SaveCustomerButtonProps>;
13
+ export default SaveCustomerButton;
@@ -1 +1,15 @@
1
- import React,{ReactNode}from'react';import{LoaderType}from'../typings/index';declare type ShipmentProps={children:ReactNode;loader?:LoaderType;};declare const Shipment:React.FunctionComponent<ShipmentProps>;export default Shipment;
1
+ import { ReactNode } from 'react';
2
+ import { LoaderType } from '../typings/index';
3
+ declare type ShipmentProps = {
4
+ children: ReactNode;
5
+ loader?: LoaderType;
6
+ autoSelectSingleShippingMethod?: boolean | (() => void);
7
+ };
8
+ declare function Shipment({ children, loader, autoSelectSingleShippingMethod, }: ShipmentProps): JSX.Element;
9
+ declare namespace Shipment {
10
+ var propTypes: {
11
+ children: import("prop-types").Validator<boolean | import("react").ReactChild | import("react").ReactFragment | import("react").ReactPortal | (() => ReactNode)>;
12
+ };
13
+ var displayName: string;
14
+ }
15
+ export default Shipment;
@@ -1 +1 @@
1
- import{jsx as _jsx}from"react/jsx-runtime";import{Fragment,useContext,useState,useEffect}from"react";import ShipmentContext from"../context/ShipmentContext";import ShipmentChildrenContext from"../context/ShipmentChildrenContext";import components from"../config/components";import getLoaderComponent from"../utils/getLoaderComponent";const propTypes=components.Shipment.propTypes,displayName=components.Shipment.displayName,Shipment=({children,loader="Loading..."})=>{const[loading,setLoading]=useState(!0),{shipments,deliveryLeadTimes}=useContext(ShipmentContext);useEffect(()=>(shipments&&setLoading(!1),()=>{setLoading(!0)}),[shipments]);const components2=shipments&&shipments.map((shipment,k)=>{var _a;const shipmentLineItems=shipment.shipment_line_items,lineItems=shipmentLineItems==null?void 0:shipmentLineItems.map(shipmentLineItem=>{const l=shipmentLineItem.line_item;return l&&(l.quantity=shipmentLineItem.quantity),l}),shippingMethods=shipment.available_shipping_methods,currentShippingMethodId=(_a=shipment.shipping_method)===null||_a===void 0?void 0:_a.id,stockTransfers=shipment.stock_transfers,times=deliveryLeadTimes==null?void 0:deliveryLeadTimes.filter(time=>{var _a2,_b;return((_a2=time.stock_location)===null||_a2===void 0?void 0:_a2.id)===((_b=shipment.stock_location)===null||_b===void 0?void 0:_b.id)}),shipmentProps={lineItems,shippingMethods,currentShippingMethodId,stockTransfers,deliveryLeadTimes:times,shipment,keyNumber:k+1};return _jsx(ShipmentChildrenContext.Provider,Object.assign({value:shipmentProps},{children}),k)});return loading?getLoaderComponent(loader):_jsx(Fragment,{children:components2})};Shipment.propTypes=propTypes,Shipment.displayName=displayName;export default Shipment;
1
+ import{jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";import{useContext,useState,useEffect}from"react";import ShipmentContext from"../context/ShipmentContext";import ShipmentChildrenContext from"../context/ShipmentChildrenContext";import components from"../config/components";import getLoaderComponent from"../utils/getLoaderComponent";const propTypes=components.Shipment.propTypes,displayName=components.Shipment.displayName;export default function Shipment({children,loader="Loading...",autoSelectSingleShippingMethod=!1}){const[loading,setLoading]=useState(!0),{shipments,deliveryLeadTimes,setShippingMethod}=useContext(ShipmentContext);useEffect(()=>(shipments&&setLoading(!1),autoSelectSingleShippingMethod&&shipments&&shipments.forEach(shipment=>{var _a;const isSingle=((_a=shipment==null?void 0:shipment.available_shipping_methods)===null||_a===void 0?void 0:_a.length)===1;if(!(shipment==null?void 0:shipment.shipping_method)&&isSingle){const[shippingMethod]=(shipment==null?void 0:shipment.available_shipping_methods)||[];setShippingMethod(shipment==null?void 0:shipment.id,shippingMethod==null?void 0:shippingMethod.id),typeof autoSelectSingleShippingMethod=="function"&&autoSelectSingleShippingMethod()}}),()=>{setLoading(!0)}),[shipments]);const components2=shipments&&shipments.map((shipment,k)=>{var _a;const shipmentLineItems=shipment.shipment_line_items,lineItems=shipmentLineItems==null?void 0:shipmentLineItems.map(shipmentLineItem=>{const l=shipmentLineItem.line_item;return l&&(l.quantity=shipmentLineItem.quantity),l}),shippingMethods=shipment.available_shipping_methods,currentShippingMethodId=autoSelectSingleShippingMethod&&shippingMethods&&shippingMethods.length===1?shippingMethods[0].id:(_a=shipment.shipping_method)===null||_a===void 0?void 0:_a.id,stockTransfers=shipment.stock_transfers,times=deliveryLeadTimes==null?void 0:deliveryLeadTimes.filter(time=>{var _a2,_b;return((_a2=time.stock_location)===null||_a2===void 0?void 0:_a2.id)===((_b=shipment.stock_location)===null||_b===void 0?void 0:_b.id)}),shipmentProps={lineItems,shippingMethods,currentShippingMethodId,stockTransfers,deliveryLeadTimes:times,shipment,keyNumber:k+1};return _jsx(ShipmentChildrenContext.Provider,Object.assign({value:shipmentProps},{children}),k)});return loading?getLoaderComponent(loader):_jsx(_Fragment,{children:components2})}Shipment.propTypes=propTypes,Shipment.displayName=displayName;
@@ -1 +1,12 @@
1
- import{FunctionComponent,ReactNode}from'react';import{Shipment}from'@commercelayer/sdk';declare type ShipmentFieldChildrenProps=Omit<ShipmentFieldProps,'children'>&{shipment:Shipment;};export declare type ShipmentAttribute='number'|'currency_code'|'status'|'cost_amount_cents'|'cost_amount_float'|'formatted_cost_amount'|'key_number';declare type ShipmentFieldProps={children?:(props:ShipmentFieldChildrenProps)=>ReactNode;name:ShipmentAttribute;}&JSX.IntrinsicElements['span'];declare const ShipmentField:FunctionComponent<ShipmentFieldProps>;export default ShipmentField;
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ import { Shipment } from '@commercelayer/sdk';
3
+ declare type ShipmentFieldChildrenProps = Omit<ShipmentFieldProps, 'children'> & {
4
+ shipment: Shipment;
5
+ };
6
+ export declare type ShipmentAttribute = 'number' | 'currency_code' | 'status' | 'cost_amount_cents' | 'cost_amount_float' | 'formatted_cost_amount' | 'key_number';
7
+ declare type ShipmentFieldProps = {
8
+ children?: (props: ShipmentFieldChildrenProps) => ReactNode;
9
+ name: ShipmentAttribute;
10
+ } & JSX.IntrinsicElements['span'];
11
+ declare const ShipmentField: FunctionComponent<ShipmentFieldProps>;
12
+ export default ShipmentField;
@@ -1 +1,6 @@
1
- import React,{ReactNode}from'react';declare type ShipmentsContainerProps={children:ReactNode;};declare const ShipmentsContainer:React.FunctionComponent<ShipmentsContainerProps>;export default ShipmentsContainer;
1
+ import React, { ReactNode } from 'react';
2
+ declare type ShipmentsContainerProps = {
3
+ children: ReactNode;
4
+ };
5
+ declare const ShipmentsContainer: React.FunctionComponent<ShipmentsContainerProps>;
6
+ export default ShipmentsContainer;
@@ -1 +1 @@
1
- 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,[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.line_item":!0,"shipments.stock_location":!0}}):addResourceToInclude({newResource:["shipments.available_shipping_methods","shipments.shipment_line_items.line_item","shipments.shipping_method","shipments.stock_transfers.line_item","shipments.stock_location"]}),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;return!!(((_a=lineItem.item)===null||_a===void 0?void 0:_a.do_not_ship)||((_b=lineItem.item)===null||_b===void 0?void 0:_b.do_not_track)||((_d=(_c=lineItem.item)===null||_c===void 0?void 0:_c.inventory)===null||_d===void 0?void 0:_d.quantity)>=(lineItem==null?void 0:lineItem.quantity))}).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{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,[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.line_item":!0,"shipments.stock_location":!0}}):addResourceToInclude({newResource:["shipments.available_shipping_methods","shipments.shipment_line_items.line_item","shipments.shipping_method","shipments.stock_transfers.line_item","shipments.stock_location"]}),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;return!!(((_a=lineItem.item)===null||_a===void 0?void 0:_a.do_not_ship)||((_b=lineItem.item)===null||_b===void 0?void 0:_b.do_not_track)||((_d=(_c=lineItem.item)===null||_c===void 0?void 0:_c.inventory)===null||_d===void 0?void 0:_d.quantity)>=(lineItem==null?void 0:lineItem.quantity))}).includes(!1)&&setShipmentErrors([...state.errors||[],{code:"OUT_OF_STOCK",message:"No stock available",resource:"line_items"}],dispatch)),()=>{setShipmentErrors([],dispatch)}),[order==null?void 0:order.shipments]);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 +1,6 @@
1
- import{FunctionComponent,ReactNode}from'react';declare type Props={children:ReactNode;};declare const ShippingAddressContainer:FunctionComponent<Props>;export default ShippingAddressContainer;
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ declare type Props = {
3
+ children: ReactNode;
4
+ };
5
+ declare const ShippingAddressContainer: FunctionComponent<Props>;
6
+ export default ShippingAddressContainer;
@@ -1 +1,8 @@
1
- import{FunctionComponent,ReactNode}from'react';declare type ShippingAddressFormProps={children:ReactNode;reset?:boolean;errorClassName?:string;}&Omit<JSX.IntrinsicElements['form'],'onSubmit'>;declare const ShippingAddressForm:FunctionComponent<ShippingAddressFormProps>;export default ShippingAddressForm;
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ declare type ShippingAddressFormProps = {
3
+ children: ReactNode;
4
+ reset?: boolean;
5
+ errorClassName?: string;
6
+ } & Omit<JSX.IntrinsicElements['form'], 'onSubmit'>;
7
+ declare const ShippingAddressForm: FunctionComponent<ShippingAddressFormProps>;
8
+ export default ShippingAddressForm;
@@ -1 +1,4 @@
1
- import{FunctionComponent}from'react';import{BaseAmountComponent}from'../typings/index';declare const ShippingAmount:FunctionComponent<BaseAmountComponent>;export default ShippingAmount;
1
+ import { FunctionComponent } from 'react';
2
+ import { BaseAmountComponent } from '../typings/index';
3
+ declare const ShippingAmount: FunctionComponent<BaseAmountComponent>;
4
+ export default ShippingAmount;