@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,36 @@
1
- import{FunctionComponent,ReactNode}from'react';import PropTypes from'prop-types';import{BaseSelectorType}from'../../typings/index';import{VariantsObject,SetSkuCode}from'../../reducers/VariantReducer';import{VariantOption}from'../VariantSelector';export declare const propTypes:{variants:PropTypes.Validator<any>;onChange:PropTypes.Requireable<(...args:any[])=>any>;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>;};export declare type VariantHandleCallback=(variant:VariantOption)=>void;export declare type VariantTemplateProps={variants:VariantsObject|Record<string,any>;handleChange?:SetSkuCode;options:VariantOption[];type?:BaseSelectorType;loader?:ReactNode;placeholder?:string;skuCode?:string;handleCallback?:VariantHandleCallback;}&JSX.IntrinsicElements['input']&JSX.IntrinsicElements['select'];declare const VariantTemplate:FunctionComponent<VariantTemplateProps>;export default VariantTemplate;
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { BaseSelectorType } from '../../typings/index';
4
+ import { VariantsObject, SetSkuCode } from '../../reducers/VariantReducer';
5
+ import { VariantOption } from '../VariantSelector';
6
+ export declare const propTypes: {
7
+ variants: PropTypes.Validator<any>;
8
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
9
+ options: PropTypes.Validator<PropTypes.InferProps<{
10
+ label: PropTypes.Validator<string>;
11
+ code: PropTypes.Validator<string>;
12
+ lineItem: PropTypes.Requireable<PropTypes.InferProps<{
13
+ name: PropTypes.Validator<string>;
14
+ imageUrl: PropTypes.Requireable<string>;
15
+ }>>;
16
+ }>[]>;
17
+ name: PropTypes.Requireable<string>;
18
+ children: PropTypes.Requireable<(...args: any[]) => any>;
19
+ type: PropTypes.Requireable<BaseSelectorType>;
20
+ loader: PropTypes.Requireable<PropTypes.ReactElementLike>;
21
+ placeholder: PropTypes.Requireable<string>;
22
+ skuCode: PropTypes.Requireable<string>;
23
+ };
24
+ export declare type VariantHandleCallback = (variant: VariantOption) => void;
25
+ export declare type VariantTemplateProps = {
26
+ variants: VariantsObject | Record<string, any>;
27
+ handleChange?: SetSkuCode;
28
+ options: VariantOption[];
29
+ type?: BaseSelectorType;
30
+ loader?: ReactNode;
31
+ placeholder?: string;
32
+ skuCode?: string;
33
+ handleCallback?: VariantHandleCallback;
34
+ } & JSX.IntrinsicElements['input'] & JSX.IntrinsicElements['select'];
35
+ declare const VariantTemplate: FunctionComponent<VariantTemplateProps>;
36
+ export default VariantTemplate;
@@ -1 +1,17 @@
1
- import{ReactNode}from'react';import{LineItem}from'@commercelayer/sdk';import{BaseError,ResourceErrorType}from'../../typings/errors';export declare type AllErrorsParams={allErrors:BaseError[];messages:BaseError[];field?:string;props:JSX.IntrinsicElements['span'];lineItem?:LineItem;resource?:ResourceErrorType;returnHtml?:boolean;};export interface GetAllErrors{<P extends AllErrorsParams>(params:P):ReactNode;}declare const getAllErrors:GetAllErrors;export default getAllErrors;
1
+ import { ReactNode } from 'react';
2
+ import { LineItem } from '@commercelayer/sdk';
3
+ import { BaseError, ResourceErrorType } from '../../typings/errors';
4
+ export declare type AllErrorsParams = {
5
+ allErrors: BaseError[];
6
+ messages: BaseError[];
7
+ field?: string;
8
+ props: JSX.IntrinsicElements['span'];
9
+ lineItem?: LineItem;
10
+ resource?: ResourceErrorType;
11
+ returnHtml?: boolean;
12
+ };
13
+ export interface GetAllErrors {
14
+ <P extends AllErrorsParams>(params: P): ReactNode;
15
+ }
16
+ declare const getAllErrors: GetAllErrors;
17
+ export default getAllErrors;