@commercelayer/react-components 4.5.2-beta.2 → 4.6.0-beta.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.
Files changed (225) hide show
  1. package/lib/cjs/components/MetadataInput.d.ts +0 -1
  2. package/lib/cjs/components/addresses/Address.d.ts +0 -1
  3. package/lib/cjs/components/addresses/AddressCountrySelector.d.ts +0 -1
  4. package/lib/cjs/components/addresses/AddressInput.d.ts +0 -1
  5. package/lib/cjs/components/addresses/AddressStateSelector.d.ts +0 -1
  6. package/lib/cjs/components/addresses/AddressesEmpty.d.ts +0 -1
  7. package/lib/cjs/components/addresses/ShippingAddressContainer.d.ts +0 -1
  8. package/lib/cjs/components/auth/CommerceLayer.d.ts +17 -2
  9. package/lib/cjs/components/auth/CommerceLayer.js +1 -1
  10. package/lib/cjs/components/customers/CustomerContainer.d.ts +3 -1
  11. package/lib/cjs/components/customers/CustomerContainer.js +1 -1
  12. package/lib/cjs/components/customers/CustomerField.d.ts +0 -1
  13. package/lib/cjs/components/customers/CustomerInput.d.ts +0 -1
  14. package/lib/cjs/components/customers/CustomerPaymentSource.d.ts +0 -1
  15. package/lib/cjs/components/customers/CustomerPaymentSourceEmpty.d.ts +0 -1
  16. package/lib/cjs/components/customers/MyAccountLink.d.ts +0 -1
  17. package/lib/cjs/components/customers/MyIdentityLink.d.ts +0 -1
  18. package/lib/cjs/components/errors/Errors.d.ts +0 -1
  19. package/lib/cjs/components/gift_cards/GiftCard.d.ts +0 -1
  20. package/lib/cjs/components/gift_cards/GiftCardCurrencySelector.d.ts +0 -1
  21. package/lib/cjs/components/gift_cards/GiftCardInput.d.ts +0 -1
  22. package/lib/cjs/components/gift_cards/GiftCardOrCouponCode.d.ts +0 -1
  23. package/lib/cjs/components/gift_cards/GiftCardOrCouponForm.d.ts +0 -1
  24. package/lib/cjs/components/gift_cards/GiftCardOrCouponInput.d.ts +0 -1
  25. package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionButton.d.ts +0 -1
  26. package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionsContainer.d.ts +0 -1
  27. package/lib/cjs/components/line_items/LineItem.d.ts +0 -1
  28. package/lib/cjs/components/line_items/LineItemAmount.d.ts +0 -1
  29. package/lib/cjs/components/line_items/LineItemCode.d.ts +0 -1
  30. package/lib/cjs/components/line_items/LineItemField.d.ts +0 -1
  31. package/lib/cjs/components/line_items/LineItemImage.d.ts +0 -1
  32. package/lib/cjs/components/line_items/LineItemName.d.ts +0 -1
  33. package/lib/cjs/components/line_items/LineItemsContainer.d.ts +0 -1
  34. package/lib/cjs/components/line_items/LineItemsCount.d.ts +0 -1
  35. package/lib/cjs/components/line_items/LineItemsEmpty.d.ts +0 -1
  36. package/lib/cjs/components/orders/AdjustmentAmount.d.ts +0 -1
  37. package/lib/cjs/components/orders/CheckoutLink.d.ts +0 -1
  38. package/lib/cjs/components/orders/DiscountAmount.d.ts +0 -1
  39. package/lib/cjs/components/orders/GiftCardAmount.d.ts +0 -1
  40. package/lib/cjs/components/orders/OrderContainer.d.ts +0 -1
  41. package/lib/cjs/components/orders/OrderList.d.ts +0 -1
  42. package/lib/cjs/components/orders/OrderListEmpty.d.ts +0 -1
  43. package/lib/cjs/components/orders/OrderListPaginationButtons.d.ts +0 -1
  44. package/lib/cjs/components/orders/OrderListPaginationInfo.d.ts +0 -1
  45. package/lib/cjs/components/orders/OrderListRow.d.ts +0 -1
  46. package/lib/cjs/components/orders/OrderNumber.d.ts +0 -1
  47. package/lib/cjs/components/orders/PaymentMethodAmount.d.ts +0 -1
  48. package/lib/cjs/components/orders/PrivacyAndTermsCheckbox.d.ts +0 -1
  49. package/lib/cjs/components/orders/ShippingAmount.d.ts +0 -1
  50. package/lib/cjs/components/orders/SubTotalAmount.d.ts +0 -1
  51. package/lib/cjs/components/orders/TaxesAmount.d.ts +0 -1
  52. package/lib/cjs/components/orders/TotalAmount.d.ts +0 -1
  53. package/lib/cjs/components/parcels/ParcelField.d.ts +0 -1
  54. package/lib/cjs/components/parcels/ParcelLineItem.d.ts +0 -1
  55. package/lib/cjs/components/parcels/ParcelLineItemField.d.ts +0 -1
  56. package/lib/cjs/components/parcels/ParcelLineItemsCount.d.ts +0 -1
  57. package/lib/cjs/components/parcels/Parcels.d.ts +0 -1
  58. package/lib/cjs/components/parcels/ParcelsCount.d.ts +0 -1
  59. package/lib/cjs/components/payment_gateways/AdyenGateway.d.ts +0 -1
  60. package/lib/cjs/components/payment_gateways/BraintreeGateway.d.ts +0 -1
  61. package/lib/cjs/components/payment_gateways/CheckoutComGateway.d.ts +0 -1
  62. package/lib/cjs/components/payment_gateways/ExternalGateway.d.ts +0 -1
  63. package/lib/cjs/components/payment_gateways/KlarnaGateway.d.ts +0 -1
  64. package/lib/cjs/components/payment_gateways/PaymentGateway.d.ts +0 -1
  65. package/lib/cjs/components/payment_gateways/PaypalGateway.d.ts +0 -1
  66. package/lib/cjs/components/payment_gateways/StripeGateway.d.ts +0 -1
  67. package/lib/cjs/components/payment_gateways/WireTransferGateway.d.ts +0 -1
  68. package/lib/cjs/components/payment_methods/PaymentMethod.d.ts +0 -1
  69. package/lib/cjs/components/payment_methods/PaymentMethodName.d.ts +0 -1
  70. package/lib/cjs/components/payment_methods/PaymentMethodPrice.d.ts +0 -1
  71. package/lib/cjs/components/payment_source/BraintreePayment.d.ts +0 -1
  72. package/lib/cjs/components/payment_source/CheckoutComPayment.d.ts +0 -1
  73. package/lib/cjs/components/payment_source/ExternalPayment.d.ts +0 -1
  74. package/lib/cjs/components/payment_source/KlarnaPayment.d.ts +0 -1
  75. package/lib/cjs/components/payment_source/PaymentSource.d.ts +0 -1
  76. package/lib/cjs/components/payment_source/PaymentSourceBrandIcon.d.ts +0 -1
  77. package/lib/cjs/components/payment_source/PaymentSourceBrandName.d.ts +0 -1
  78. package/lib/cjs/components/payment_source/PaymentSourceDetail.d.ts +0 -1
  79. package/lib/cjs/components/payment_source/StripeExpressPayment.d.ts +0 -1
  80. package/lib/cjs/components/payment_source/StripePayment.d.ts +0 -1
  81. package/lib/cjs/components/payment_source/WireTransferPayment.d.ts +0 -1
  82. package/lib/cjs/components/prices/Price.d.ts +19 -1
  83. package/lib/cjs/components/prices/PricesContainer.d.ts +0 -1
  84. package/lib/cjs/components/shipments/ShipmentField.d.ts +0 -1
  85. package/lib/cjs/components/shipments/ShipmentsCount.d.ts +0 -1
  86. package/lib/cjs/components/shipping_methods/ShippingMethodName.d.ts +0 -1
  87. package/lib/cjs/components/shipping_methods/ShippingMethodPrice.d.ts +0 -1
  88. package/lib/cjs/components/shipping_methods/ShippingMethodRadioButton.d.ts +0 -1
  89. package/lib/cjs/components/skus/AvailabilityTemplate.d.ts +0 -1
  90. package/lib/cjs/components/skus/DeliveryLeadTime.d.ts +0 -1
  91. package/lib/cjs/components/skus/SkuField.d.ts +0 -1
  92. package/lib/cjs/components/stock_transfers/StockTransfer.d.ts +0 -1
  93. package/lib/cjs/components/stock_transfers/StockTransferField.d.ts +0 -1
  94. package/lib/cjs/components/utils/AddressCardsTemplate.d.ts +0 -1
  95. package/lib/cjs/components/utils/BaseOrderPrice.d.ts +0 -1
  96. package/lib/cjs/components/utils/PaymentCardsTemplate.d.ts +0 -1
  97. package/lib/cjs/components/utils/PriceTemplate.d.ts +0 -1
  98. package/lib/cjs/components/utils/getAllErrors.d.ts +0 -1
  99. package/lib/cjs/context/BillingAddressFormContext.d.ts +1 -1
  100. package/lib/cjs/reducers/AddressReducer.d.ts +1 -1
  101. package/lib/cjs/reducers/AddressReducer.js +1 -1
  102. package/lib/cjs/reducers/CustomerReducer.d.ts +3 -2
  103. package/lib/cjs/reducers/CustomerReducer.js +1 -1
  104. package/lib/cjs/typings/globals.d.ts +0 -1
  105. package/lib/cjs/typings/index.d.ts +1 -1
  106. package/lib/cjs/utils/filterChildren.d.ts +0 -1
  107. package/lib/cjs/utils/getCustomerIdByToken.d.ts +6 -0
  108. package/lib/cjs/utils/getCustomerIdByToken.js +2 -0
  109. package/lib/cjs/utils/getLoaderComponent.d.ts +0 -1
  110. package/lib/cjs/utils/getPrices.d.ts +0 -1
  111. package/lib/cjs/utils/isGuestToken.d.ts +6 -0
  112. package/lib/cjs/utils/isGuestToken.js +2 -0
  113. package/lib/esm/components/MetadataInput.d.ts +0 -1
  114. package/lib/esm/components/addresses/Address.d.ts +0 -1
  115. package/lib/esm/components/addresses/AddressCountrySelector.d.ts +0 -1
  116. package/lib/esm/components/addresses/AddressInput.d.ts +0 -1
  117. package/lib/esm/components/addresses/AddressStateSelector.d.ts +0 -1
  118. package/lib/esm/components/addresses/AddressesEmpty.d.ts +0 -1
  119. package/lib/esm/components/addresses/ShippingAddressContainer.d.ts +0 -1
  120. package/lib/esm/components/auth/CommerceLayer.d.ts +17 -2
  121. package/lib/esm/components/auth/CommerceLayer.js +1 -1
  122. package/lib/esm/components/customers/CustomerContainer.d.ts +3 -1
  123. package/lib/esm/components/customers/CustomerContainer.js +1 -1
  124. package/lib/esm/components/customers/CustomerField.d.ts +0 -1
  125. package/lib/esm/components/customers/CustomerInput.d.ts +0 -1
  126. package/lib/esm/components/customers/CustomerPaymentSource.d.ts +0 -1
  127. package/lib/esm/components/customers/CustomerPaymentSourceEmpty.d.ts +0 -1
  128. package/lib/esm/components/customers/MyAccountLink.d.ts +0 -1
  129. package/lib/esm/components/customers/MyIdentityLink.d.ts +0 -1
  130. package/lib/esm/components/errors/Errors.d.ts +0 -1
  131. package/lib/esm/components/gift_cards/GiftCard.d.ts +0 -1
  132. package/lib/esm/components/gift_cards/GiftCardCurrencySelector.d.ts +0 -1
  133. package/lib/esm/components/gift_cards/GiftCardInput.d.ts +0 -1
  134. package/lib/esm/components/gift_cards/GiftCardOrCouponCode.d.ts +0 -1
  135. package/lib/esm/components/gift_cards/GiftCardOrCouponForm.d.ts +0 -1
  136. package/lib/esm/components/gift_cards/GiftCardOrCouponInput.d.ts +0 -1
  137. package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionButton.d.ts +0 -1
  138. package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionsContainer.d.ts +0 -1
  139. package/lib/esm/components/line_items/LineItem.d.ts +0 -1
  140. package/lib/esm/components/line_items/LineItemAmount.d.ts +0 -1
  141. package/lib/esm/components/line_items/LineItemCode.d.ts +0 -1
  142. package/lib/esm/components/line_items/LineItemField.d.ts +0 -1
  143. package/lib/esm/components/line_items/LineItemImage.d.ts +0 -1
  144. package/lib/esm/components/line_items/LineItemName.d.ts +0 -1
  145. package/lib/esm/components/line_items/LineItemsContainer.d.ts +0 -1
  146. package/lib/esm/components/line_items/LineItemsCount.d.ts +0 -1
  147. package/lib/esm/components/line_items/LineItemsEmpty.d.ts +0 -1
  148. package/lib/esm/components/orders/AdjustmentAmount.d.ts +0 -1
  149. package/lib/esm/components/orders/CheckoutLink.d.ts +0 -1
  150. package/lib/esm/components/orders/DiscountAmount.d.ts +0 -1
  151. package/lib/esm/components/orders/GiftCardAmount.d.ts +0 -1
  152. package/lib/esm/components/orders/OrderContainer.d.ts +0 -1
  153. package/lib/esm/components/orders/OrderList.d.ts +0 -1
  154. package/lib/esm/components/orders/OrderListEmpty.d.ts +0 -1
  155. package/lib/esm/components/orders/OrderListPaginationButtons.d.ts +0 -1
  156. package/lib/esm/components/orders/OrderListPaginationInfo.d.ts +0 -1
  157. package/lib/esm/components/orders/OrderListRow.d.ts +0 -1
  158. package/lib/esm/components/orders/OrderNumber.d.ts +0 -1
  159. package/lib/esm/components/orders/PaymentMethodAmount.d.ts +0 -1
  160. package/lib/esm/components/orders/PrivacyAndTermsCheckbox.d.ts +0 -1
  161. package/lib/esm/components/orders/ShippingAmount.d.ts +0 -1
  162. package/lib/esm/components/orders/SubTotalAmount.d.ts +0 -1
  163. package/lib/esm/components/orders/TaxesAmount.d.ts +0 -1
  164. package/lib/esm/components/orders/TotalAmount.d.ts +0 -1
  165. package/lib/esm/components/parcels/ParcelField.d.ts +0 -1
  166. package/lib/esm/components/parcels/ParcelLineItem.d.ts +0 -1
  167. package/lib/esm/components/parcels/ParcelLineItemField.d.ts +0 -1
  168. package/lib/esm/components/parcels/ParcelLineItemsCount.d.ts +0 -1
  169. package/lib/esm/components/parcels/Parcels.d.ts +0 -1
  170. package/lib/esm/components/parcels/ParcelsCount.d.ts +0 -1
  171. package/lib/esm/components/payment_gateways/AdyenGateway.d.ts +0 -1
  172. package/lib/esm/components/payment_gateways/BraintreeGateway.d.ts +0 -1
  173. package/lib/esm/components/payment_gateways/CheckoutComGateway.d.ts +0 -1
  174. package/lib/esm/components/payment_gateways/ExternalGateway.d.ts +0 -1
  175. package/lib/esm/components/payment_gateways/KlarnaGateway.d.ts +0 -1
  176. package/lib/esm/components/payment_gateways/PaymentGateway.d.ts +0 -1
  177. package/lib/esm/components/payment_gateways/PaypalGateway.d.ts +0 -1
  178. package/lib/esm/components/payment_gateways/StripeGateway.d.ts +0 -1
  179. package/lib/esm/components/payment_gateways/WireTransferGateway.d.ts +0 -1
  180. package/lib/esm/components/payment_methods/PaymentMethod.d.ts +0 -1
  181. package/lib/esm/components/payment_methods/PaymentMethodName.d.ts +0 -1
  182. package/lib/esm/components/payment_methods/PaymentMethodPrice.d.ts +0 -1
  183. package/lib/esm/components/payment_source/BraintreePayment.d.ts +0 -1
  184. package/lib/esm/components/payment_source/CheckoutComPayment.d.ts +0 -1
  185. package/lib/esm/components/payment_source/ExternalPayment.d.ts +0 -1
  186. package/lib/esm/components/payment_source/KlarnaPayment.d.ts +0 -1
  187. package/lib/esm/components/payment_source/PaymentSource.d.ts +0 -1
  188. package/lib/esm/components/payment_source/PaymentSourceBrandIcon.d.ts +0 -1
  189. package/lib/esm/components/payment_source/PaymentSourceBrandName.d.ts +0 -1
  190. package/lib/esm/components/payment_source/PaymentSourceDetail.d.ts +0 -1
  191. package/lib/esm/components/payment_source/StripeExpressPayment.d.ts +0 -1
  192. package/lib/esm/components/payment_source/StripePayment.d.ts +0 -1
  193. package/lib/esm/components/payment_source/WireTransferPayment.d.ts +0 -1
  194. package/lib/esm/components/prices/Price.d.ts +19 -1
  195. package/lib/esm/components/prices/PricesContainer.d.ts +0 -1
  196. package/lib/esm/components/shipments/ShipmentField.d.ts +0 -1
  197. package/lib/esm/components/shipments/ShipmentsCount.d.ts +0 -1
  198. package/lib/esm/components/shipping_methods/ShippingMethodName.d.ts +0 -1
  199. package/lib/esm/components/shipping_methods/ShippingMethodPrice.d.ts +0 -1
  200. package/lib/esm/components/shipping_methods/ShippingMethodRadioButton.d.ts +0 -1
  201. package/lib/esm/components/skus/AvailabilityTemplate.d.ts +0 -1
  202. package/lib/esm/components/skus/DeliveryLeadTime.d.ts +0 -1
  203. package/lib/esm/components/skus/SkuField.d.ts +0 -1
  204. package/lib/esm/components/stock_transfers/StockTransfer.d.ts +0 -1
  205. package/lib/esm/components/stock_transfers/StockTransferField.d.ts +0 -1
  206. package/lib/esm/components/utils/AddressCardsTemplate.d.ts +0 -1
  207. package/lib/esm/components/utils/BaseOrderPrice.d.ts +0 -1
  208. package/lib/esm/components/utils/PaymentCardsTemplate.d.ts +0 -1
  209. package/lib/esm/components/utils/PriceTemplate.d.ts +0 -1
  210. package/lib/esm/components/utils/getAllErrors.d.ts +0 -1
  211. package/lib/esm/context/BillingAddressFormContext.d.ts +1 -1
  212. package/lib/esm/reducers/AddressReducer.d.ts +1 -1
  213. package/lib/esm/reducers/AddressReducer.js +1 -1
  214. package/lib/esm/reducers/CustomerReducer.d.ts +3 -2
  215. package/lib/esm/reducers/CustomerReducer.js +1 -1
  216. package/lib/esm/typings/globals.d.ts +0 -1
  217. package/lib/esm/typings/index.d.ts +1 -1
  218. package/lib/esm/utils/filterChildren.d.ts +0 -1
  219. package/lib/esm/utils/getCustomerIdByToken.d.ts +6 -0
  220. package/lib/esm/utils/getCustomerIdByToken.js +2 -0
  221. package/lib/esm/utils/getLoaderComponent.d.ts +0 -1
  222. package/lib/esm/utils/getPrices.d.ts +0 -1
  223. package/lib/esm/utils/isGuestToken.d.ts +6 -0
  224. package/lib/esm/utils/isGuestToken.js +2 -0
  225. package/package.json +21 -21
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseInputComponentProps } from '../typings/index';
3
2
  type Props = BaseInputComponentProps & JSX.IntrinsicElements['input'] & JSX.IntrinsicElements['textarea'];
4
3
  export declare function MetadataInput(props: Props): JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type Address as AddressType } from '@commercelayer/sdk';
3
2
  import { type AddressCardsTemplateChildren } from '../utils/AddressCardsTemplate';
4
3
  import type { DefaultChildrenType } from '../../typings/globals';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseSelectComponentProps } from '../../typings/index';
3
2
  import { type AddressValuesKeys } from '../../context/BillingAddressFormContext';
4
3
  type TCountryFieldName = 'billing_address_country_code' | 'shipping_address_country_code' | 'customer_address_country_code';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseInputComponentProps, type AddressInputName } from '../../typings/index';
3
2
  import { type AddressValuesKeys } from '../../context/BillingAddressFormContext';
4
3
  type Props = {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type AddressStateSelectName, type BaseSelectComponentProps } from '../../typings/index';
3
2
  type Props = Omit<BaseSelectComponentProps, 'options' | 'name'> & {
4
3
  name: AddressStateSelectName;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ChildrenFunction } from '../../typings/index';
3
2
  interface Props extends Omit<JSX.IntrinsicElements['span'], 'children'> {
4
3
  /**
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { DefaultChildrenType } from '../../typings/globals';
3
2
  interface Props {
4
3
  children: DefaultChildrenType;
@@ -1,9 +1,24 @@
1
- /// <reference types="react" />
2
1
  import type { DefaultChildrenType } from '../../typings/globals';
3
2
  interface Props {
3
+ /**
4
+ * Accept a React node as children.
5
+ */
4
6
  children: DefaultChildrenType;
7
+ /**
8
+ * The access token to authenticate the API calls.
9
+ */
5
10
  accessToken: string;
6
- endpoint: string;
11
+ /**
12
+ * The endpoint to make the API calls. e.g. https://yourdomain.commercelayer.io
13
+ */
14
+ endpoint?: string;
15
+ /**
16
+ * The domain to make the API calls. e.g. commercelayer.io
17
+ */
18
+ domain?: string;
7
19
  }
20
+ /**
21
+ * CommerceLayer component
22
+ */
8
23
  export declare function CommerceLayer(props: Props): JSX.Element;
9
24
  export default CommerceLayer;
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CommerceLayer=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext")),ErrorBoundary_1=tslib_1.__importDefault(require("../utils/ErrorBoundary"));function CommerceLayer(props){const{children}=props,p=tslib_1.__rest(props,["children"]);return(0,jsx_runtime_1.jsx)(ErrorBoundary_1.default,{children:(0,jsx_runtime_1.jsx)(CommerceLayerContext_1.default.Provider,{value:Object.assign({},p),children})})}exports.CommerceLayer=CommerceLayer,exports.default=CommerceLayer;
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CommerceLayer=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext")),ErrorBoundary_1=tslib_1.__importDefault(require("../utils/ErrorBoundary")),jwt_1=tslib_1.__importDefault(require("../../utils/jwt"));function CommerceLayer(props){var _a;const{children}=props,p=tslib_1.__rest(props,["children"]);if(!p.endpoint){const{organization}=(0,jwt_1.default)(p.accessToken);p.endpoint=`https://${organization.slug}.${(_a=p.domain)!==null&&_a!==void 0?_a:"commercelayer.io"}`}return(0,jsx_runtime_1.jsx)(ErrorBoundary_1.default,{children:(0,jsx_runtime_1.jsx)(CommerceLayerContext_1.default.Provider,{value:Object.assign({},p),children})})}exports.CommerceLayer=CommerceLayer,exports.default=CommerceLayer;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { DefaultChildrenType } from '../../typings/globals';
3
2
  interface Props {
4
3
  children: DefaultChildrenType;
@@ -7,5 +6,8 @@ interface Props {
7
6
  */
8
7
  isGuest?: boolean;
9
8
  }
9
+ /**
10
+ * The CustomerContainer component manages the customer state.
11
+ */
10
12
  export declare function CustomerContainer(props: Props): JSX.Element;
11
13
  export default CustomerContainer;
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CustomerContainer=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),CustomerReducer_1=tslib_1.__importStar(require("../../reducers/CustomerReducer")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext")),CustomerContext_1=tslib_1.__importDefault(require("../../context/CustomerContext"));function CustomerContainer(props){const{children,isGuest=!1}=props,[state,dispatch]=(0,react_1.useReducer)(CustomerReducer_1.default,CustomerReducer_1.customerInitialState),{order,addResourceToInclude,include,updateOrder,includeLoaded,withoutIncludes}=(0,react_1.useContext)(OrderContext_1.default),config=(0,react_1.useContext)(CommerceLayerContext_1.default);(0,react_1.useEffect)(()=>{!include?.includes("available_customer_payment_sources.payment_source")&&!isGuest?addResourceToInclude({newResource:"available_customer_payment_sources.payment_source"}):!includeLoaded?.["available_customer_payment_sources.payment_source"]&&!isGuest&&addResourceToInclude({newResourceLoaded:{"available_customer_payment_sources.payment_source":!0}})},[include?.length,Object.keys(includeLoaded??{}).length]),(0,react_1.useEffect)(()=>{config.accessToken&&state.addresses==null&&!isGuest&&(0,CustomerReducer_1.getCustomerAddresses)({config,dispatch,isOrderAvailable:withoutIncludes!=null}),order?.available_customer_payment_sources&&!isGuest&&(0,CustomerReducer_1.getCustomerPaymentSources)({dispatch,order}),config.accessToken&&order==null&&include==null&&includeLoaded==null&&withoutIncludes===void 0&&!isGuest&&function(){return tslib_1.__awaiter(this,void 0,void 0,function*(){yield(0,CustomerReducer_1.getCustomerOrders)({config,dispatch}),yield(0,CustomerReducer_1.getCustomerSubscriptions)({config,dispatch}),yield(0,CustomerReducer_1.getCustomerPayments)({config,dispatch})})}()},[config.accessToken,order?.payment_source!=null,isGuest]);const contextValue=(0,react_1.useMemo)(()=>Object.assign(Object.assign({isGuest},state),{saveCustomerUser:customerEmail=>tslib_1.__awaiter(this,void 0,void 0,function*(){yield(0,CustomerReducer_1.saveCustomerUser)({config,customerEmail,dispatch,updateOrder,order})}),setCustomerErrors:errors=>{(0,CustomerReducer_1.setCustomerErrors)(errors,dispatch)},setCustomerEmail:customerEmail=>{(0,CustomerReducer_1.setCustomerEmail)(customerEmail,dispatch)},getCustomerPaymentSources:()=>{(0,CustomerReducer_1.getCustomerPaymentSources)({dispatch,order})},deleteCustomerAddress:({customerAddressId})=>tslib_1.__awaiter(this,void 0,void 0,function*(){yield(0,CustomerReducer_1.deleteCustomerAddress)({customerAddressId,dispatch,config,addresses:state.addresses})}),createCustomerAddress:address=>tslib_1.__awaiter(this,void 0,void 0,function*(){yield(0,CustomerReducer_1.createCustomerAddress)({address,config,dispatch,state})}),getCustomerOrders:({pageNumber,pageSize})=>tslib_1.__awaiter(this,void 0,void 0,function*(){yield(0,CustomerReducer_1.getCustomerOrders)({config,dispatch,pageNumber,pageSize})})}),[state,isGuest]);return(0,jsx_runtime_1.jsx)(CustomerContext_1.default.Provider,{value:contextValue,children})}exports.CustomerContainer=CustomerContainer,exports.default=CustomerContainer;
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CustomerContainer=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),CustomerReducer_1=tslib_1.__importStar(require("../../reducers/CustomerReducer")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext")),CustomerContext_1=tslib_1.__importDefault(require("../../context/CustomerContext")),isGuestToken_1=require("../../utils/isGuestToken");function CustomerContainer(props){const{children,isGuest}=props,[state,dispatch]=(0,react_1.useReducer)(CustomerReducer_1.default,CustomerReducer_1.customerInitialState),{order,addResourceToInclude,include,updateOrder,includeLoaded,withoutIncludes}=(0,react_1.useContext)(OrderContext_1.default),config=(0,react_1.useContext)(CommerceLayerContext_1.default);(0,react_1.useEffect)(()=>{if(config.accessToken){if(isGuest??(0,isGuestToken_1.isGuestToken)(config.accessToken))return;include?.includes("available_customer_payment_sources.payment_source")?includeLoaded?.["available_customer_payment_sources.payment_source"]||addResourceToInclude({newResourceLoaded:{"available_customer_payment_sources.payment_source":!0}}):addResourceToInclude({newResource:"available_customer_payment_sources.payment_source"})}},[config.accessToken,include?.length,Object.keys(includeLoaded??{}).length]),(0,react_1.useEffect)(()=>{if(config.accessToken){if(isGuest??(0,isGuestToken_1.isGuestToken)(config.accessToken))return;state.customers==null&&(0,CustomerReducer_1.getCustomerInfo)({config,dispatch}),state.addresses==null&&(0,CustomerReducer_1.getCustomerAddresses)({config,dispatch,isOrderAvailable:withoutIncludes!=null}),order?.available_customer_payment_sources&&(0,CustomerReducer_1.getCustomerPaymentSources)({dispatch,order}),config.accessToken&&order==null&&include==null&&includeLoaded==null&&withoutIncludes===void 0&&function(){return tslib_1.__awaiter(this,void 0,void 0,function*(){yield(0,CustomerReducer_1.getCustomerOrders)({config,dispatch}),yield(0,CustomerReducer_1.getCustomerSubscriptions)({config,dispatch}),yield(0,CustomerReducer_1.getCustomerPayments)({config,dispatch})})}()}},[config.accessToken,order?.payment_source!=null,isGuest]);const contextValue=(0,react_1.useMemo)(()=>Object.assign(Object.assign({isGuest},state),{saveCustomerUser:customerEmail=>tslib_1.__awaiter(this,void 0,void 0,function*(){yield(0,CustomerReducer_1.saveCustomerUser)({config,customerEmail,dispatch,updateOrder,order})}),setCustomerErrors:errors=>{(0,CustomerReducer_1.setCustomerErrors)(errors,dispatch)},setCustomerEmail:customerEmail=>{(0,CustomerReducer_1.setCustomerEmail)(customerEmail,dispatch)},getCustomerPaymentSources:()=>{(0,CustomerReducer_1.getCustomerPaymentSources)({dispatch,order})},deleteCustomerAddress:({customerAddressId})=>tslib_1.__awaiter(this,void 0,void 0,function*(){yield(0,CustomerReducer_1.deleteCustomerAddress)({customerAddressId,dispatch,config,addresses:state.addresses})}),createCustomerAddress:address=>tslib_1.__awaiter(this,void 0,void 0,function*(){yield(0,CustomerReducer_1.createCustomerAddress)({address,config,dispatch,state})}),getCustomerOrders:({pageNumber,pageSize})=>tslib_1.__awaiter(this,void 0,void 0,function*(){yield(0,CustomerReducer_1.getCustomerOrders)({config,dispatch,pageNumber,pageSize})})}),[state,isGuest]);return(0,jsx_runtime_1.jsx)(CustomerContext_1.default.Provider,{value:contextValue,children})}exports.CustomerContainer=CustomerContainer,exports.default=CustomerContainer;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ConditionalElement } from '../../typings/index';
3
2
  import { type TGenericChildrenProps, type TResources } from '../utils/GenericFieldComponent';
4
3
  type StockTransferFieldChildrenProps = TGenericChildrenProps<TResources['Customer']>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseInputComponentProps } from '../../typings/index';
3
2
  type Props = {
4
3
  name?: 'customer_email' | string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type DefaultChildrenType } from '../../typings/globals';
3
2
  interface Props {
4
3
  children?: DefaultChildrenType;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ChildrenFunction } from '../../typings/index';
3
2
  interface Props extends Omit<JSX.IntrinsicElements['span'], 'children'> {
4
3
  /**
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ChildrenFunction } from '../../typings/index';
3
2
  interface ChildrenProps extends Omit<Props, 'children'> {
4
3
  /**
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ChildrenFunction } from '../../typings/index';
3
2
  interface ChildrenProps extends Omit<Props, 'children'> {
4
3
  /**
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { CodeErrorType } from '../../typings/errors';
3
2
  import { type ChildrenFunction } from '../../typings/index';
4
3
  export type TResourceError = 'addresses' | 'billing_address' | 'gift_cards' | 'gift_card_or_coupon_code' | 'line_items' | 'orders' | 'payment_methods' | 'prices' | 'shipments' | 'shipping_address' | 'customer_address' | 'sku_options' | 'variant' | 'in_stock_subscriptions';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseState } from '../../typings/index';
3
2
  import type { DefaultChildrenType } from '../../typings/globals';
4
3
  interface Props extends Omit<JSX.IntrinsicElements['form'], 'children'> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseSelectComponentProps } from '../../typings/index';
3
2
  type Props = Omit<BaseSelectComponentProps, 'options' | 'name'> & {
4
3
  required?: boolean;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseInputComponentProps, type GiftCardInputName } from '../../typings/index';
3
2
  type Props = {
4
3
  name: GiftCardInputName;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ChildrenFunction } from '../../typings/index';
3
2
  import type { CodeType } from '../../reducers/OrderReducer';
4
3
  interface ChildrenProps extends Omit<Props, 'children'> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { Order } from '@commercelayer/sdk';
3
2
  import type { DefaultChildrenType } from '../../typings/globals';
4
3
  interface Props extends Omit<JSX.IntrinsicElements['form'], 'onSubmit'> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseInputComponentProps } from '../../typings/index';
3
2
  import { type OrderCodeType } from '../../reducers/OrderReducer';
4
3
  type Props = {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ChildrenFunction } from '../../typings/index';
3
2
  interface Props extends Omit<JSX.IntrinsicElements['button'], 'children' | 'onClick'> {
4
3
  /**
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type DefaultChildrenType } from '../../typings/globals';
3
2
  interface Props {
4
3
  /**
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type TLineItem = 'gift_cards' | 'payment_methods' | 'promotions' | 'shipments' | 'skus' | 'bundles' | 'adjustments';
3
2
  interface Props {
4
3
  children: JSX.Element | JSX.Element[];
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseAmountComponent, type BasePriceType } from '../../typings/index';
3
2
  type Props = BaseAmountComponent & {
4
3
  type?: BasePriceType;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type LineItem } from '@commercelayer/sdk';
3
2
  import { type ChildrenFunction } from '../../typings/index';
4
3
  export interface TLineItemCode extends Omit<Props, 'children'> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ConditionalElement } from '../../typings/index';
3
2
  import { type TGenericChildrenProps, type TResources } from '../utils/GenericFieldComponent';
4
3
  type LineItemFieldChildrenProps = TGenericChildrenProps<TResources['LineItem']>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type LineItem } from '@commercelayer/sdk';
3
2
  import type { ChildrenFunction } from '../../typings/index';
4
3
  import { type TLineItem } from './LineItem';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { LineItem } from '@commercelayer/sdk';
3
2
  import { type ChildrenFunction } from '../../typings/index';
4
3
  export interface TLineItemName extends Omit<Props, 'children'> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { DefaultChildrenType } from '../../typings/globals';
3
2
  interface Props {
4
3
  children: DefaultChildrenType;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type TypeAccepted } from '../../utils/getLineItemsCount';
3
2
  import { type ChildrenFunction } from '../../typings/index';
4
3
  interface ChildrenProps extends Omit<Props, 'children'> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ChildrenFunction } from '../../typings/index';
3
2
  interface ChildrenProps extends Omit<Props, 'children'> {
4
3
  quantity: number;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseAmountComponent } from '../../typings/index';
3
2
  export declare function AdjustmentAmount(props: BaseAmountComponent): JSX.Element;
4
3
  export default AdjustmentAmount;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ChildrenFunction } from '../../typings/index';
3
2
  interface ChildrenProps extends Omit<Props, 'children'> {
4
3
  checkoutUrl: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseAmountComponent } from '../../typings/index';
3
2
  export declare function DiscountAmount(props: BaseAmountComponent): JSX.Element;
4
3
  export default DiscountAmount;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseAmountComponent } from '../../typings/index';
3
2
  export declare function GiftCardAmount(props: BaseAmountComponent): JSX.Element;
4
3
  export default GiftCardAmount;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseMetadataObject } from '../../typings/index';
3
2
  import type { OrderCreate, Order } from '@commercelayer/sdk';
4
3
  import type { DefaultChildrenType } from '../../typings/globals';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type TOrderList, type InitialOrderListContext, type OrderListContent } from '../../context/OrderListChildrenContext';
3
2
  import { type ColumnDef, type SortingState } from '@tanstack/react-table';
4
3
  import type { DefaultChildrenType, TRange } from '../../typings/globals';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ChildrenFunction } from '../../typings/index';
3
2
  interface Props extends Omit<JSX.IntrinsicElements['span'], 'children'> {
4
3
  /**
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type OrderListPaginationContext as TOrderListPaginationContext } from '../../context/OrderListPaginationContext';
3
2
  import { type ChildrenFunction } from '../../typings/index';
4
3
  interface PaginationButton extends Omit<JSX.IntrinsicElements['button'], 'children' | 'disabled'> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ChildrenFunction } from '../../typings/index';
3
2
  type TAsComponent = keyof Pick<JSX.IntrinsicElements, 'p' | 'span' | 'div'>;
4
3
  type ChildrenProps<A extends TAsComponent> = Omit<Props<A>, 'children'> & {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type TOrderList, type OrderListContent, type TableAccessor } from '../../context/OrderListChildrenContext';
3
2
  import { type Row } from '@tanstack/react-table';
4
3
  interface ChildrenProps extends Omit<Props, 'children'> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseFieldProps } from '../utils/BaseField';
3
2
  type Props = Omit<BaseFieldProps, 'attribute'>;
4
3
  export declare function OrderNumber(props: Props): JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseAmountComponent } from '../../typings/index';
3
2
  export declare function PaymentMethodAmount(props: BaseAmountComponent): JSX.Element;
4
3
  export default PaymentMethodAmount;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseInputProps } from '../utils/BaseInput';
3
2
  export declare function PrivacyAndTermsCheckbox(props: Partial<BaseInputProps>): JSX.Element;
4
3
  export default PrivacyAndTermsCheckbox;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseAmountComponent } from '../../typings/index';
3
2
  export declare function ShippingAmount(props: BaseAmountComponent): JSX.Element;
4
3
  export default ShippingAmount;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseAmountComponent } from '../../typings/index';
3
2
  export declare function SubTotalAmount(props: BaseAmountComponent): JSX.Element;
4
3
  export default SubTotalAmount;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseAmountComponent } from '../../typings/index';
3
2
  export declare function TaxesAmount(props: BaseAmountComponent): JSX.Element;
4
3
  export default TaxesAmount;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseAmountComponent } from '../../typings/index';
3
2
  export declare function TotalAmount(props: BaseAmountComponent): JSX.Element;
4
3
  export default TotalAmount;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ConditionalElement } from '../../typings/index';
3
2
  import { type TGenericChildrenProps, type TResources } from '../utils/GenericFieldComponent';
4
3
  type ParcelFieldChildrenProps = TGenericChildrenProps<TResources['Parcel']>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { DefaultChildrenType } from '../../typings/globals';
3
2
  interface Props {
4
3
  children: DefaultChildrenType;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ConditionalElement } from '../../typings/index';
3
2
  import { type TGenericChildrenProps, type TResources } from '../utils/GenericFieldComponent';
4
3
  type ParcelLineItemFieldChildrenProps = TGenericChildrenProps<TResources['ParcelLineItem']>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ChildrenFunction } from '../../typings/index';
3
2
  import type { Parcel } from '@commercelayer/sdk';
4
3
  interface ChildrenProps extends Omit<Props, 'children'> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface Props {
3
2
  children: JSX.Element | JSX.Element[];
4
3
  filterBy?: string[];
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ChildrenFunction } from '../../typings/index';
3
2
  import type { Parcel } from '@commercelayer/sdk';
4
3
  interface ChildrenProps extends Omit<Props, 'children'> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type GatewayBaseType } from '../payment_gateways/PaymentGateway';
3
2
  type Props = GatewayBaseType;
4
3
  export declare function AdyenGateway(props: Props): JSX.Element | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type GatewayBaseType } from '../payment_gateways/PaymentGateway';
3
2
  type Props = GatewayBaseType;
4
3
  export declare function BraintreeGateway(props: Props): JSX.Element | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type GatewayBaseType } from '../payment_gateways/PaymentGateway';
3
2
  type Props = GatewayBaseType;
4
3
  export declare function CheckoutComGateway(props: Props): JSX.Element | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type GatewayBaseType } from '../payment_gateways/PaymentGateway';
3
2
  type Props = GatewayBaseType;
4
3
  export declare function ExternalGateway(props: Props): JSX.Element | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type GatewayBaseType } from '../payment_gateways/PaymentGateway';
3
2
  type Props = GatewayBaseType;
4
3
  export declare function KlarnaGateway(props: Props): JSX.Element | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type LoaderType } from '../../typings/index';
3
2
  import { type PaymentSourceProps } from '../payment_source/PaymentSource';
4
3
  export type GatewayBaseType = Props & {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type GatewayBaseType } from '../payment_gateways/PaymentGateway';
3
2
  type Props = Partial<GatewayBaseType>;
4
3
  export declare function PaypalGateway(props: Props): JSX.Element | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type GatewayBaseType } from '../payment_gateways/PaymentGateway';
3
2
  type Props = GatewayBaseType;
4
3
  export declare function StripeGateway(props: Props): JSX.Element | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type GatewayBaseType } from '../payment_gateways/PaymentGateway';
3
2
  type Props = GatewayBaseType;
4
3
  export declare function WireTransferGateway(props: Props): JSX.Element | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { LoaderType } from '../../typings/index';
3
2
  import type { Order, PaymentMethod as PaymentMethodType } from '@commercelayer/sdk';
4
3
  import type { PaymentResource } from '../../reducers/PaymentMethodReducer';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ChildrenFunction } from '../../typings/index';
3
2
  interface ChildrenProps extends Omit<Props, 'children'> {
4
3
  labelName: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type BaseAmountComponent } from '../../typings/index';
3
2
  interface Props extends BaseAmountComponent {
4
3
  type?: 'amount';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type PaymentSourceProps } from './PaymentSource';
3
2
  import { type HostedFieldFieldOptions } from 'braintree-web';
4
3
  type BraintreeHostedFields<Type> = {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type PaymentMethodConfig } from '../../reducers/PaymentMethodReducer';
3
2
  import { type PaymentSourceProps } from './PaymentSource';
4
3
  import { type FramesStyle } from 'frames-react';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type ChildrenFunction } from '../../typings/index';
3
2
  import type { StripeElementLocale } from '@stripe/stripe-js';
4
3
  import { type PaymentSourceProps } from './PaymentSource';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type PaymentMethodConfig } from '../../reducers/PaymentMethodReducer';
3
2
  import { type PaymentSourceProps } from './PaymentSource';
4
3
  type KlarnaPaymentProps = PaymentMethodConfig['klarnaPayment'] & JSX.IntrinsicElements['div'] & Partial<PaymentSourceProps['templateCustomerSaveToWallet']> & {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type LoaderType } from '../../typings/index';
3
2
  import { type CustomerCardsTemplateChildren } from '../utils/PaymentCardsTemplate';
4
3
  export interface CustomerCardsProps {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type IconBrand } from '../../context/PaymentSourceContext';
3
2
  import { type ChildrenFunction } from '../../typings/index';
4
3
  interface ChildrenProps extends Omit<Props, 'children'> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type IconBrand } from '../../context/PaymentSourceContext';
3
2
  import { type ChildrenFunction } from '../../typings/index';
4
3
  interface CustomComponent extends Omit<Props, 'children'> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { ChildrenFunction } from '../../typings/index';
3
2
  export type PaymentSourceDetailType = 'last4' | 'exp_year' | 'exp_month';
4
3
  interface ChildrenProps extends Omit<Props, 'children'> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface Props {
3
2
  clientSecret: string;
4
3
  }
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type StripeElementLocale, type StripeElementsOptions, type StripePaymentElementOptions } from '@stripe/stripe-js';
3
2
  import { type PaymentMethodConfig } from '../../reducers/PaymentMethodReducer';
4
3
  import { type PaymentSourceProps } from './PaymentSource';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface WireTransferConfig {
3
2
  infoMessage?: {
4
3
  text?: string | JSX.Element[];
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type Price as PriceType } from '@commercelayer/sdk';
3
2
  import { type ChildrenFunction, type LoaderType } from '../../typings/index';
4
3
  interface PriceChildrenProps extends Omit<PriceProps, 'children'> {
@@ -8,9 +7,28 @@ interface PriceChildrenProps extends Omit<PriceProps, 'children'> {
8
7
  }
9
8
  export interface PriceProps extends Omit<JSX.IntrinsicElements['span'], 'children'> {
10
9
  children?: ChildrenFunction<PriceChildrenProps>;
10
+ /**
11
+ * CSS class name to be added for the compare price
12
+ */
11
13
  compareClassName?: string;
14
+ /**
15
+ * When `false` the compare_at price will not be displayed
16
+ * @default true
17
+ */
12
18
  showCompare?: boolean;
19
+ /**
20
+ * The `sku_code` of the price to be fetched
21
+ */
13
22
  skuCode?: string | null;
14
23
  }
24
+ /**
25
+ * To display the price of your products with localized currency, discounts, and personalization rules, as shown in the code snippets below.
26
+ *
27
+ * Each price has an amount (the actual selling price) and an optional compare-at amount (the full price that you want to display to the customer — typically with a strikethrough).
28
+ * This component is the owner of the price information. It fetches the price of the specified SKU and dispatches it to the cl-price-amount children.
29
+ * <span type='info'>
30
+ * By default it shows the `formatted_amount` and `formatted_compare_at_amount` of the first price object, but it also allows to access to the full `Price`object via children props.
31
+ * </span>
32
+ */
15
33
  export declare function Price(props: PriceProps): JSX.Element;
16
34
  export default Price;