@clickaroo/checkout-ui 0.1.3-beta → 0.1.5-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/storybook/storybook-static/assets/APIs.en-BZfNNuoc.js +372 -0
- package/dist/storybook/storybook-static/assets/APIs.en-BZzPbEJW.js +372 -0
- package/dist/storybook/storybook-static/assets/APIs.en-Bf5J1Ifk.js +372 -0
- package/dist/storybook/storybook-static/assets/APIs.en-DSVQkUt3.js +372 -0
- package/dist/storybook/storybook-static/assets/APIs.en-DcEWunRx.js +372 -0
- package/dist/storybook/storybook-static/assets/APIs.en-DfWH0fys.js +372 -0
- package/dist/storybook/storybook-static/assets/APIs.en-TWb_-3VC.js +372 -0
- package/dist/storybook/storybook-static/assets/APIs.en-m6cq4XTv.js +372 -0
- package/dist/storybook/storybook-static/assets/APIs.en-nicPQ5AW.js +372 -0
- package/dist/storybook/storybook-static/assets/CheckoutPage-BsnzMxJk.js +3 -0
- package/dist/storybook/storybook-static/assets/CheckoutPage-CDW7SRyI.js +3 -0
- package/dist/storybook/storybook-static/assets/CheckoutPage-CrHN6Fcv.js +3 -0
- package/dist/storybook/storybook-static/assets/CheckoutPage-DFb28rrp.js +3 -0
- package/dist/storybook/storybook-static/assets/CheckoutPage-DSLcTghb.js +3 -0
- package/dist/storybook/storybook-static/assets/CheckoutPage-DYMMhAMX.js +3 -0
- package/dist/storybook/storybook-static/assets/CheckoutPage-DgZ1RopD.js +3 -0
- package/dist/storybook/storybook-static/assets/CheckoutPage-DvHYA1Jd.js +3 -0
- package/dist/storybook/storybook-static/assets/CheckoutPage-d8MZfjpI.js +3 -0
- package/dist/storybook/storybook-static/assets/CheckoutPage.en-BeknEgWZ.js +147 -0
- package/dist/storybook/storybook-static/assets/CheckoutPage.en-Bsh4jm31.js +147 -0
- package/dist/storybook/storybook-static/assets/CheckoutPage.en-Byu6MnFF.js +147 -0
- package/dist/storybook/storybook-static/assets/CheckoutPage.en-C5I1UUQc.js +147 -0
- package/dist/storybook/storybook-static/assets/CheckoutPage.en-CNVaEQvK.js +147 -0
- package/dist/storybook/storybook-static/assets/CheckoutPage.en-D87qzfwm.js +147 -0
- package/dist/storybook/storybook-static/assets/CheckoutPage.en-DLb_7NPf.js +147 -0
- package/dist/storybook/storybook-static/assets/CheckoutPage.en-DQ0u0fHa.js +147 -0
- package/dist/storybook/storybook-static/assets/CheckoutPage.en-DiHMI_iH.js +147 -0
- package/dist/storybook/storybook-static/assets/CheckoutPage.stories-B5y94bOo.js +44 -0
- package/dist/storybook/storybook-static/assets/CheckoutPage.stories-B8Vyz9GJ.js +44 -0
- package/dist/storybook/storybook-static/assets/CheckoutPage.stories-BRP4VrvR.js +44 -0
- package/dist/storybook/storybook-static/assets/CheckoutPage.stories-BahbUp4O.js +44 -0
- package/dist/storybook/storybook-static/assets/CheckoutPage.stories-DAo0u2QI.js +44 -0
- package/dist/storybook/storybook-static/assets/CheckoutPage.stories-DFK1bMdr.js +44 -0
- package/dist/storybook/storybook-static/assets/CheckoutPage.stories-DLD3oWo_.js +44 -0
- package/dist/storybook/storybook-static/assets/CheckoutPage.stories-DeC6lyzr.js +44 -0
- package/dist/storybook/storybook-static/assets/CheckoutPage.stories-DvaZetee.js +44 -0
- package/dist/storybook/storybook-static/assets/Color-YHDXOIA2-B0J9WR4k.js +1 -0
- package/dist/storybook/storybook-static/assets/Color-YHDXOIA2-BE_XGTCZ.js +1 -0
- package/dist/storybook/storybook-static/assets/Color-YHDXOIA2-B_hoSOu5.js +1 -0
- package/dist/storybook/storybook-static/assets/Color-YHDXOIA2-Bly_OAJP.js +1 -0
- package/dist/storybook/storybook-static/assets/Color-YHDXOIA2-BorkAxO4.js +1 -0
- package/dist/storybook/storybook-static/assets/Color-YHDXOIA2-C2GhQi7e.js +1 -0
- package/dist/storybook/storybook-static/assets/Color-YHDXOIA2-D3zu28Rn.js +1 -0
- package/dist/storybook/storybook-static/assets/Color-YHDXOIA2-DI94E3AI.js +1 -0
- package/dist/storybook/storybook-static/assets/Color-YHDXOIA2-DVI1_7_g.js +1 -0
- package/dist/storybook/storybook-static/assets/CustomCheckout.en-8VNcggT9.js +211 -0
- package/dist/storybook/storybook-static/assets/CustomCheckout.en-BMJEFVTk.js +211 -0
- package/dist/storybook/storybook-static/assets/CustomCheckout.en-Bg4oz9hS.js +211 -0
- package/dist/storybook/storybook-static/assets/CustomCheckout.en-Bq25x8qa.js +211 -0
- package/dist/storybook/storybook-static/assets/CustomCheckout.en-BvF7SmOy.js +211 -0
- package/dist/storybook/storybook-static/assets/CustomCheckout.en-CckpRGsp.js +211 -0
- package/dist/storybook/storybook-static/assets/CustomCheckout.en-D80ZpldF.js +211 -0
- package/dist/storybook/storybook-static/assets/CustomCheckout.en-uXQeih6h.js +211 -0
- package/dist/storybook/storybook-static/assets/CustomCheckout.en-wshSoFMr.js +211 -0
- package/dist/storybook/storybook-static/assets/CustomCheckout.stories-B8CnjGCn.js +6 -0
- package/dist/storybook/storybook-static/assets/CustomCheckout.stories-BQkpNbox.js +6 -0
- package/dist/storybook/storybook-static/assets/CustomCheckout.stories-BrF5j7zs.js +6 -0
- package/dist/storybook/storybook-static/assets/CustomCheckout.stories-CKQKzMq0.js +6 -0
- package/dist/storybook/storybook-static/assets/CustomCheckout.stories-DhCrUQc1.js +6 -0
- package/dist/storybook/storybook-static/assets/CustomCheckout.stories-F2GZKkIG.js +6 -0
- package/dist/storybook/storybook-static/assets/CustomCheckout.stories-V2NHLbZo.js +6 -0
- package/dist/storybook/storybook-static/assets/CustomCheckout.stories-ZCeqtMGJ.js +6 -0
- package/dist/storybook/storybook-static/assets/CustomCheckout.stories-rMIVoUs4.js +6 -0
- package/dist/storybook/storybook-static/assets/CustomerInfo-BMTfZ9z3.js +1 -0
- package/dist/storybook/storybook-static/assets/CustomerInfo-BqCSWi4I.js +1 -0
- package/dist/storybook/storybook-static/assets/CustomerInfo-BwyY9803.js +1 -0
- package/dist/storybook/storybook-static/assets/CustomerInfo-CPNuEjrH.js +1 -0
- package/dist/storybook/storybook-static/assets/CustomerInfo-CTx1dFS3.js +1 -0
- package/dist/storybook/storybook-static/assets/CustomerInfo-Cp0u57C5.js +1 -0
- package/dist/storybook/storybook-static/assets/CustomerInfo-D3WHpN32.js +1 -0
- package/dist/storybook/storybook-static/assets/CustomerInfo-DShSrjMR.js +1 -0
- package/dist/storybook/storybook-static/assets/CustomerInfo-mKAI6gWW.js +1 -0
- package/dist/storybook/storybook-static/assets/CustomerInfo.stories-BAbhNSal.js +9 -0
- package/dist/storybook/storybook-static/assets/CustomerInfo.stories-BeF8Yh1A.js +9 -0
- package/dist/storybook/storybook-static/assets/CustomerInfo.stories-BwCrEBgN.js +9 -0
- package/dist/storybook/storybook-static/assets/CustomerInfo.stories-CYx1hKNg.js +9 -0
- package/dist/storybook/storybook-static/assets/CustomerInfo.stories-D1l3Glaq.js +9 -0
- package/dist/storybook/storybook-static/assets/CustomerInfo.stories-DB2C3zqQ.js +9 -0
- package/dist/storybook/storybook-static/assets/CustomerInfo.stories-Dv6cHWui.js +9 -0
- package/dist/storybook/storybook-static/assets/CustomerInfo.stories-jpdDC3ta.js +9 -0
- package/dist/storybook/storybook-static/assets/CustomerInfo.stories-tyhy9PWf.js +9 -0
- package/dist/storybook/storybook-static/assets/DeliveryAddress-CD42v0od.js +2 -0
- package/dist/storybook/storybook-static/assets/DeliveryAddress-CeuByf4d.js +2 -0
- package/dist/storybook/storybook-static/assets/DeliveryAddress-DOxyPw17.js +2 -0
- package/dist/storybook/storybook-static/assets/DeliveryAddress-DY5lFnTv.js +2 -0
- package/dist/storybook/storybook-static/assets/DeliveryAddress-DaRy4l-D.js +2 -0
- package/dist/storybook/storybook-static/assets/DeliveryAddress-Lfanl1PO.js +2 -0
- package/dist/storybook/storybook-static/assets/DeliveryAddress-QAGxLlLf.js +2 -0
- package/dist/storybook/storybook-static/assets/DeliveryAddress-TRtlNz2v.js +2 -0
- package/dist/storybook/storybook-static/assets/DeliveryAddress-X81XGbKD.js +2 -0
- package/dist/storybook/storybook-static/assets/DeliveryAddress.stories-BvAXTiNm.js +9 -0
- package/dist/storybook/storybook-static/assets/DeliveryAddress.stories-C1JtetLS.js +9 -0
- package/dist/storybook/storybook-static/assets/DeliveryAddress.stories-C8sE6JJZ.js +9 -0
- package/dist/storybook/storybook-static/assets/DeliveryAddress.stories-CBScReyV.js +9 -0
- package/dist/storybook/storybook-static/assets/DeliveryAddress.stories-CTyS3zFt.js +9 -0
- package/dist/storybook/storybook-static/assets/DeliveryAddress.stories-CqmJ_Wn7.js +9 -0
- package/dist/storybook/storybook-static/assets/DeliveryAddress.stories-DHyw5QNl.js +9 -0
- package/dist/storybook/storybook-static/assets/DeliveryAddress.stories-FMwTSh9f.js +9 -0
- package/dist/storybook/storybook-static/assets/DeliveryAddress.stories-vQ0cdVl6.js +9 -0
- package/dist/storybook/storybook-static/assets/DocsRenderer-CFRXHY34-4VFo0TRH.js +2 -0
- package/dist/storybook/storybook-static/assets/DocsRenderer-CFRXHY34-BKek9MhZ.js +2 -0
- package/dist/storybook/storybook-static/assets/DocsRenderer-CFRXHY34-C4t3f4os.js +2 -0
- package/dist/storybook/storybook-static/assets/DocsRenderer-CFRXHY34-CtrnOF1G.js +2 -0
- package/dist/storybook/storybook-static/assets/DocsRenderer-CFRXHY34-DU1kBIGp.js +2 -0
- package/dist/storybook/storybook-static/assets/DocsRenderer-CFRXHY34-DzgR8M-W.js +2 -0
- package/dist/storybook/storybook-static/assets/DocsRenderer-CFRXHY34-OiuU2wez.js +2 -0
- package/dist/storybook/storybook-static/assets/DocsRenderer-CFRXHY34-Q5WDl3Gp.js +2 -0
- package/dist/storybook/storybook-static/assets/DocsRenderer-CFRXHY34-sE6BxCwu.js +2 -0
- package/dist/storybook/storybook-static/assets/Guide.en-BJ4qiYIc.js +107 -0
- package/dist/storybook/storybook-static/assets/Guide.en-BRVwtDXj.js +107 -0
- package/dist/storybook/storybook-static/assets/Guide.en-Boc44Lax.js +107 -0
- package/dist/storybook/storybook-static/assets/Guide.en-CKA244dX.js +107 -0
- package/dist/storybook/storybook-static/assets/Guide.en-CiR7CrYZ.js +107 -0
- package/dist/storybook/storybook-static/assets/Guide.en-Citkzdg9.js +107 -0
- package/dist/storybook/storybook-static/assets/Guide.en-DPJzC5RR.js +107 -0
- package/dist/storybook/storybook-static/assets/Guide.en-Dn9xb9YI.js +107 -0
- package/dist/storybook/storybook-static/assets/Guide.en-XzxJQK_F.js +107 -0
- package/dist/storybook/storybook-static/assets/PaymentMethods-BFtlMopq.js +2 -0
- package/dist/storybook/storybook-static/assets/PaymentMethods-BNEEARzu.js +2 -0
- package/dist/storybook/storybook-static/assets/PaymentMethods-BnPZRrAs.js +2 -0
- package/dist/storybook/storybook-static/assets/PaymentMethods-Buladk2O.js +2 -0
- package/dist/storybook/storybook-static/assets/PaymentMethods-CBXk2f9N.js +2 -0
- package/dist/storybook/storybook-static/assets/PaymentMethods-DmV3o0ow.js +2 -0
- package/dist/storybook/storybook-static/assets/PaymentMethods-DxorWSOl.js +2 -0
- package/dist/storybook/storybook-static/assets/PaymentMethods-afz1CTO5.js +2 -0
- package/dist/storybook/storybook-static/assets/PaymentMethods-e9HqQtxN.js +2 -0
- package/dist/storybook/storybook-static/assets/PaymentMethods.stories-6fZvfvMO.js +9 -0
- package/dist/storybook/storybook-static/assets/PaymentMethods.stories-Bc4jYrum.js +9 -0
- package/dist/storybook/storybook-static/assets/PaymentMethods.stories-CcjSRFbb.js +9 -0
- package/dist/storybook/storybook-static/assets/PaymentMethods.stories-ChiL9TJn.js +9 -0
- package/dist/storybook/storybook-static/assets/PaymentMethods.stories-D1SSfWqv.js +9 -0
- package/dist/storybook/storybook-static/assets/PaymentMethods.stories-DJpOtGJg.js +9 -0
- package/dist/storybook/storybook-static/assets/PaymentMethods.stories-Dyg3R8Cs.js +9 -0
- package/dist/storybook/storybook-static/assets/PaymentMethods.stories-U-xbCFtF.js +9 -0
- package/dist/storybook/storybook-static/assets/PaymentMethods.stories-pOuLDPwE.js +9 -0
- package/dist/storybook/storybook-static/assets/QuickStart.en-8otT6VDx.js +136 -0
- package/dist/storybook/storybook-static/assets/QuickStart.en-B2goyY4Q.js +136 -0
- package/dist/storybook/storybook-static/assets/QuickStart.en-Bz56Z2wW.js +136 -0
- package/dist/storybook/storybook-static/assets/QuickStart.en-C1fKNHfm.js +136 -0
- package/dist/storybook/storybook-static/assets/QuickStart.en-CEFLfOWt.js +136 -0
- package/dist/storybook/storybook-static/assets/QuickStart.en-Ct2dMZNT.js +136 -0
- package/dist/storybook/storybook-static/assets/QuickStart.en-D5OiYfrB.js +136 -0
- package/dist/storybook/storybook-static/assets/QuickStart.en-D6K1vnx2.js +136 -0
- package/dist/storybook/storybook-static/assets/QuickStart.en-wgtxGAFt.js +136 -0
- package/dist/storybook/storybook-static/assets/ValidateInput-BKNagaQv.js +2 -0
- package/dist/storybook/storybook-static/assets/ValidateInput-BMZhq5zE.js +2 -0
- package/dist/storybook/storybook-static/assets/ValidateInput-CECRKp4c.js +2 -0
- package/dist/storybook/storybook-static/assets/ValidateInput-CXYuXafK.js +2 -0
- package/dist/storybook/storybook-static/assets/ValidateInput-Cl2O4HCX.js +2 -0
- package/dist/storybook/storybook-static/assets/ValidateInput-DcnOO9py.js +2 -0
- package/dist/storybook/storybook-static/assets/ValidateInput-LNzX4jJP.js +2 -0
- package/dist/storybook/storybook-static/assets/ValidateInput-np1-zwvJ.js +2 -0
- package/dist/storybook/storybook-static/assets/ValidateInput-sZgX3GCF.js +2 -0
- package/dist/storybook/storybook-static/assets/entry-preview-BAF1DioI.js +2 -0
- package/dist/storybook/storybook-static/assets/entry-preview-BAb-nh3P.js +2 -0
- package/dist/storybook/storybook-static/assets/entry-preview-BQMc41xo.js +2 -0
- package/dist/storybook/storybook-static/assets/entry-preview-Bnn64O7J.js +2 -0
- package/dist/storybook/storybook-static/assets/entry-preview-C4SPQchM.js +2 -0
- package/dist/storybook/storybook-static/assets/entry-preview-CAnH1TUA.js +2 -0
- package/dist/storybook/storybook-static/assets/entry-preview-Dbi49YCK.js +2 -0
- package/dist/storybook/storybook-static/assets/entry-preview-GhM6ttN0.js +2 -0
- package/dist/storybook/storybook-static/assets/entry-preview-hHv11-z5.js +2 -0
- package/dist/storybook/storybook-static/assets/iframe-CakT_Hx-.js +211 -0
- package/dist/storybook/storybook-static/assets/iframe-Ce3kgeV4.js +211 -0
- package/dist/storybook/storybook-static/assets/iframe-Crv4raYy.js +211 -0
- package/dist/storybook/storybook-static/assets/iframe-CueR_wS4.js +211 -0
- package/dist/storybook/storybook-static/assets/iframe-DWFwLXCc.js +211 -0
- package/dist/storybook/storybook-static/assets/iframe-DsSsblW_.js +211 -0
- package/dist/storybook/storybook-static/assets/iframe-PThBYPHV.js +211 -0
- package/dist/storybook/storybook-static/assets/iframe-SJLFWhX6.js +211 -0
- package/dist/storybook/storybook-static/assets/iframe-eGyOKkka.js +211 -0
- package/dist/storybook/storybook-static/assets/index-3vMs57rT.js +575 -0
- package/dist/storybook/storybook-static/assets/index-BlPVJQpb.js +575 -0
- package/dist/storybook/storybook-static/assets/index-Bz3Q1Yw_.js +575 -0
- package/dist/storybook/storybook-static/assets/index-CZFGp9Su.js +575 -0
- package/dist/storybook/storybook-static/assets/index-CkNSuRJg.js +575 -0
- package/dist/storybook/storybook-static/assets/index-D66ljFJA.js +575 -0
- package/dist/storybook/storybook-static/assets/index-DnrKlQ76.js +575 -0
- package/dist/storybook/storybook-static/assets/index-DoDFfets.js +575 -0
- package/dist/storybook/storybook-static/assets/index-LRKEu_dQ.js +575 -0
- package/dist/storybook/storybook-static/assets/preview-884UjfA3.js +2 -0
- package/dist/storybook/storybook-static/assets/preview-C1X5Ys-q.js +2 -0
- package/dist/storybook/storybook-static/assets/preview-CbAwkmzD.js +2 -0
- package/dist/storybook/storybook-static/assets/preview-DGJdQn9n.js +2 -0
- package/dist/storybook/storybook-static/assets/preview-DJkpO_nB.js +2 -0
- package/dist/storybook/storybook-static/assets/preview-DNROAajq.js +2 -0
- package/dist/storybook/storybook-static/assets/preview-De1PUXkc.js +2 -0
- package/dist/storybook/storybook-static/assets/preview-DyVoah3G.js +2 -0
- package/dist/storybook/storybook-static/assets/preview-EmPtksy2.js +2 -0
- package/dist/storybook/storybook-static/assets/useCheckoutContext-3YTrU8Qh.js +27 -0
- package/dist/storybook/storybook-static/assets/useCheckoutContext-B8tsk5b5.js +27 -0
- package/dist/storybook/storybook-static/assets/useCheckoutContext-BW2h13W8.js +27 -0
- package/dist/storybook/storybook-static/assets/useCheckoutContext-BXtGY5u3.js +27 -0
- package/dist/storybook/storybook-static/assets/useCheckoutContext-C6u4Rp5U.js +27 -0
- package/dist/storybook/storybook-static/assets/useCheckoutContext-C7KjDyWW.js +27 -0
- package/dist/storybook/storybook-static/assets/useCheckoutContext-CroxIBFh.js +27 -0
- package/dist/storybook/storybook-static/assets/useCheckoutContext-DuJ1Ep0-.js +27 -0
- package/dist/storybook/storybook-static/assets/useCheckoutContext-L3zhltsm.js +27 -0
- package/dist/storybook/storybook-static/iframe.html +1 -1
- package/dist/storybook/storybook-static/project.json +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import{j as e}from"./jsx-runtime-DiklIkkE.js";import{useMDXComponents as t}from"./index-ChEI-nsM.js";import{M as i,C as s}from"./index-DnrKlQ76.js";import{D as c}from"./CheckoutPage.stories-DFK1bMdr.js";import"./index-DRjF_FHU.js";import"./iframe-SJLFWhX6.js";import"./index-B7ki2Uzk.js";import"./index-D-Mha1DF.js";import"./index-DrFu-skq.js";import"./useCheckoutContext-CroxIBFh.js";import"./CheckoutPage-DFb28rrp.js";import"./CustomerInfo-BMTfZ9z3.js";import"./ValidateInput-BMZhq5zE.js";import"./DeliveryAddress-DOxyPw17.js";import"./PaymentMethods-DxorWSOl.js";function r(o){const n={a:"a",blockquote:"blockquote",code:"code",h1:"h1",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...t(),...o.components};return e.jsxs(e.Fragment,{children:[e.jsx(i,{title:"Documentation/QuickStart"}),`
|
|
2
|
+
`,e.jsx(n.h1,{id:"overview",children:"Overview"}),`
|
|
3
|
+
`,e.jsxs(n.p,{children:["This component library is designed for the ",e.jsx(n.strong,{children:"checkout page"})," in your e-commerce flow. Here's how it fits into a typical purchase journey:"]}),`
|
|
4
|
+
`,e.jsxs(n.ol,{children:[`
|
|
5
|
+
`,e.jsxs(n.li,{children:[e.jsx(n.strong,{children:"Product/Landing Page"}),": Users browse products on your product or landing page. You should provide a button or link that navigates users to the checkout page when they're ready to purchase."]}),`
|
|
6
|
+
`,e.jsxs(n.li,{children:[e.jsx(n.strong,{children:"Checkout Page"}),": This is where you integrate this component library. Users can submit their purchase information here."]}),`
|
|
7
|
+
`,e.jsxs(n.li,{children:[e.jsx(n.strong,{children:"Finish Page"}),": After successful payment, redirect users to a finish page to confirm their order completion."]}),`
|
|
8
|
+
`]}),`
|
|
9
|
+
`,e.jsx(n.h1,{id:"quick-start",children:"Quick Start"}),`
|
|
10
|
+
`,e.jsx(n.p,{children:"The checkout component handles the entire checkout process including customer information collection, delivery address management, and payment processing."}),`
|
|
11
|
+
`,e.jsx(n.p,{children:"In this guide, you will learn how to quickly integrate the checkout components into your React application. For more detailed information and advanced usage, check out the Guide section."}),`
|
|
12
|
+
`,e.jsx(n.h3,{id:"installation",children:"Installation"}),`
|
|
13
|
+
`,e.jsx(n.p,{children:"Install using your preferred package manager:"}),`
|
|
14
|
+
`,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-bash",children:`# pnpm (recommended)
|
|
15
|
+
pnpm add @clickaroo/checkout-ui
|
|
16
|
+
|
|
17
|
+
# or npm
|
|
18
|
+
npm install @clickaroo/checkout-ui
|
|
19
|
+
|
|
20
|
+
# or yarn
|
|
21
|
+
yarn add @clickaroo/checkout-ui
|
|
22
|
+
`})}),`
|
|
23
|
+
`,e.jsx(n.h4,{id:"peer-dependencies",children:"Peer Dependencies"}),`
|
|
24
|
+
`,e.jsxs(n.p,{children:["This library requires ",e.jsx(n.code,{children:"react"})," (>= 16.8.0) as peer dependencies."]}),`
|
|
25
|
+
`,e.jsxs(n.ul,{children:[`
|
|
26
|
+
`,e.jsxs(n.li,{children:[e.jsx(n.strong,{children:"npm 7+"}),": Will automatically install them"]}),`
|
|
27
|
+
`,e.jsxs(n.li,{children:[e.jsx(n.strong,{children:"npm 6 / pnpm"}),": You may need to install them manually if you see warnings"]}),`
|
|
28
|
+
`,e.jsxs(n.li,{children:[e.jsx(n.strong,{children:"yarn v2+"}),": Will error if they are missing"]}),`
|
|
29
|
+
`]}),`
|
|
30
|
+
`,e.jsx(n.p,{children:"Most React projects already have these installed, so you typically don't need to do anything extra."}),`
|
|
31
|
+
`,e.jsx(n.h3,{id:"token-parameter",children:"Token Parameter"}),`
|
|
32
|
+
`,e.jsxs(n.p,{children:["The component library requires a ",e.jsx(n.code,{children:"clro_token"})," parameter to identify the checkout session. This token should be provided in the URL query parameter when users navigate to the checkout page:"]}),`
|
|
33
|
+
`,e.jsx(n.pre,{children:e.jsx(n.code,{children:`https://your-checkout-page.com?clro_token=YOUR_TOKEN_HERE
|
|
34
|
+
`})}),`
|
|
35
|
+
`,e.jsx(n.p,{children:"The token will be automatically extracted from the URL and stored in localStorage for subsequent requests."}),`
|
|
36
|
+
`,e.jsx(n.h3,{id:"use-checkout-all-in-one",children:"Use Checkout All in One"}),`
|
|
37
|
+
`,e.jsxs(n.p,{children:["The simplest way is to use the ",e.jsx(n.code,{children:"CheckoutPage"})," component directly, which includes the complete checkout flow."]}),`
|
|
38
|
+
`,e.jsx(s,{of:c}),`
|
|
39
|
+
`,e.jsxs(n.blockquote,{children:[`
|
|
40
|
+
`,e.jsxs(n.p,{children:[e.jsx(n.strong,{children:"Note"}),": If you need Google address suggestions for the address field, you must provide a ",e.jsx(n.code,{children:"googleApiKey"})," that meets the ",e.jsx(n.a,{href:"https://developers.google.com/maps/documentation/places/web-service/get-api-key?hl=en&setupProd=prerequisites",rel:"nofollow",children:"google places api requirements"}),"."]}),`
|
|
41
|
+
`]}),`
|
|
42
|
+
`,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-tsx",children:`import { CheckoutPage } from '@clickaroo/checkout-ui';
|
|
43
|
+
|
|
44
|
+
function MyCheckout() {
|
|
45
|
+
const cart = [
|
|
46
|
+
{
|
|
47
|
+
sku: "TEST001",
|
|
48
|
+
offerPricePoint: "OPP-TEST001",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
sku: "TEST002",
|
|
52
|
+
offerPricePoint: "OPP-TEST002",
|
|
53
|
+
},
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
return <CheckoutPage cart={cart} googleApiKey={YOUR_GOOGLE_API_KEY} />;
|
|
57
|
+
}
|
|
58
|
+
`})}),`
|
|
59
|
+
`,e.jsxs(n.blockquote,{children:[`
|
|
60
|
+
`,e.jsxs(n.p,{children:[e.jsx(n.strong,{children:"Tips"}),`:
|
|
61
|
+
Each object in the `,e.jsx(n.code,{children:"cart"})," array only needs to contain the two required fields: ",e.jsx(n.code,{children:"sku"})," and ",e.jsx(n.code,{children:"offerPricePoint"}),". However, you can also pass other optional product information fields (such as ",e.jsx(n.code,{children:"title"}),", ",e.jsx(n.code,{children:"price"}),", ",e.jsx(n.code,{children:"image"}),", etc.), which will be saved to the order's metadata."]}),`
|
|
62
|
+
`]}),`
|
|
63
|
+
`,e.jsxs(n.p,{children:["You can read more about all the possible configuration options in ",e.jsx(n.a,{href:"./?path=/docs/components-checkoutpage--checkoutpage-english",children:"CheckoutPage Documentation"}),"."]}),`
|
|
64
|
+
`,e.jsx(n.h3,{id:"event-callbacks",children:"Event Callbacks"}),`
|
|
65
|
+
`,e.jsxs(n.p,{children:["The ",e.jsx(n.code,{children:"CheckoutPage"})," component provides several event callbacks that allow you to monitor and respond to different stages of the checkout process. These callbacks enable you to track user behavior, handle loading states, and implement custom logic."]}),`
|
|
66
|
+
`,e.jsx(n.p,{children:"Here's a complete example that includes all event callbacks:"}),`
|
|
67
|
+
`,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-tsx",children:`import { CheckoutPage } from '@clickaroo/checkout-ui';
|
|
68
|
+
import { useNavigate } from 'react-router-dom'; // or your routing library
|
|
69
|
+
|
|
70
|
+
function MyCheckout() {
|
|
71
|
+
const navigate = useNavigate();
|
|
72
|
+
|
|
73
|
+
const cart = [
|
|
74
|
+
{
|
|
75
|
+
sku: "TEST001",
|
|
76
|
+
offerPricePoint: "OPP-TEST001",
|
|
77
|
+
title: "Product 1",
|
|
78
|
+
price: 99.99,
|
|
79
|
+
},
|
|
80
|
+
];
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<CheckoutPage
|
|
84
|
+
cart={cart}
|
|
85
|
+
googleApiKey={YOUR_GOOGLE_API_KEY}
|
|
86
|
+
onCheckoutInit={() => {
|
|
87
|
+
console.log('Checkout initialized');
|
|
88
|
+
}}
|
|
89
|
+
onPaymentInfoComplete={(cart, totalAmount) => {
|
|
90
|
+
console.log('Payment info complete');
|
|
91
|
+
}}
|
|
92
|
+
onOrderSubmit={(cart, totalAmount) => {
|
|
93
|
+
console.log('Order submitted');
|
|
94
|
+
}}
|
|
95
|
+
onOrderSuccess={(orderCode, tradeCode) => {
|
|
96
|
+
console.log('Order successful:', orderCode);
|
|
97
|
+
// Redirect to finish page
|
|
98
|
+
navigate(\`/finish/\${orderCode}\`);
|
|
99
|
+
}}
|
|
100
|
+
/>
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
`})}),`
|
|
104
|
+
`,e.jsx(n.p,{children:e.jsx(n.strong,{children:"Key Points:"})}),`
|
|
105
|
+
`,e.jsxs(n.ul,{children:[`
|
|
106
|
+
`,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"onCheckoutInit"}),": Triggered when the checkout page loads"]}),`
|
|
107
|
+
`,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"onPaymentInfoComplete"}),": Triggered when the payment form is valid"]}),`
|
|
108
|
+
`,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"onOrderSubmit"}),": Triggered when user clicks submit"]}),`
|
|
109
|
+
`,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"onOrderSuccess"}),": Triggered when order is successfully created"]}),`
|
|
110
|
+
`]}),`
|
|
111
|
+
`,e.jsx(n.h3,{id:"display-order-details-on-finish-page",children:"Display Order Details on Finish Page"}),`
|
|
112
|
+
`,e.jsxs(n.p,{children:["After the user successfully completes the payment and is redirected to the finish page, you can use the ",e.jsx(n.code,{children:"useOrderDetail"})," hook to display order information:"]}),`
|
|
113
|
+
`,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-tsx",children:`import { useOrderDetail } from '@clickaroo/checkout-ui';
|
|
114
|
+
import { useParams } from 'react-router-dom';
|
|
115
|
+
|
|
116
|
+
function OrderCompletePage() {
|
|
117
|
+
const { orderCode } = useParams();
|
|
118
|
+
const { orderDetail, loading, error } = useOrderDetail(orderCode || '');
|
|
119
|
+
|
|
120
|
+
if (loading) return <div>Loading order details...</div>;
|
|
121
|
+
if (error) return <div>Error: {error}</div>;
|
|
122
|
+
if (!orderDetail) return <div>Order not found</div>;
|
|
123
|
+
|
|
124
|
+
return (
|
|
125
|
+
<div>
|
|
126
|
+
<h1>Order Complete!</h1>
|
|
127
|
+
<p>Order Code: {orderDetail.order_code}</p>
|
|
128
|
+
<p>Customer Information: {orderDetail.customer.email} {orderDetail.customer.phone}</p>
|
|
129
|
+
<p>Total: {orderDetail.total_amount}</p>
|
|
130
|
+
<p>Product Detail: {orderDetail.metadata}</p>
|
|
131
|
+
{/* Display more order details as needed */}
|
|
132
|
+
</div>
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
`})}),`
|
|
136
|
+
`,e.jsxs(n.p,{children:["For more advanced usage, check out the ",e.jsx(n.a,{href:"./?path=/docs/documentation-apis--docs",children:"APIs documentation"}),"."]})]})}function b(o={}){const{wrapper:n}={...t(),...o.components};return n?e.jsx(n,{...o,children:e.jsx(r,{...o})}):r(o)}export{b as default};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import{j as e}from"./jsx-runtime-DiklIkkE.js";import{useMDXComponents as t}from"./index-ChEI-nsM.js";import{M as i,C as s}from"./index-LRKEu_dQ.js";import{D as c}from"./CheckoutPage.stories-DLD3oWo_.js";import"./index-DRjF_FHU.js";import"./iframe-Ce3kgeV4.js";import"./index-B7ki2Uzk.js";import"./index-D-Mha1DF.js";import"./index-DrFu-skq.js";import"./useCheckoutContext-B8tsk5b5.js";import"./CheckoutPage-BsnzMxJk.js";import"./CustomerInfo-CTx1dFS3.js";import"./ValidateInput-Cl2O4HCX.js";import"./DeliveryAddress-X81XGbKD.js";import"./PaymentMethods-BNEEARzu.js";function r(o){const n={a:"a",blockquote:"blockquote",code:"code",h1:"h1",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...t(),...o.components};return e.jsxs(e.Fragment,{children:[e.jsx(i,{title:"Documentation/QuickStart"}),`
|
|
2
|
+
`,e.jsx(n.h1,{id:"overview",children:"Overview"}),`
|
|
3
|
+
`,e.jsxs(n.p,{children:["This component library is designed for the ",e.jsx(n.strong,{children:"checkout page"})," in your e-commerce flow. Here's how it fits into a typical purchase journey:"]}),`
|
|
4
|
+
`,e.jsxs(n.ol,{children:[`
|
|
5
|
+
`,e.jsxs(n.li,{children:[e.jsx(n.strong,{children:"Product/Landing Page"}),": Users browse products on your product or landing page. You should provide a button or link that navigates users to the checkout page when they're ready to purchase."]}),`
|
|
6
|
+
`,e.jsxs(n.li,{children:[e.jsx(n.strong,{children:"Checkout Page"}),": This is where you integrate this component library. Users can submit their purchase information here."]}),`
|
|
7
|
+
`,e.jsxs(n.li,{children:[e.jsx(n.strong,{children:"Finish Page"}),": After successful payment, redirect users to a finish page to confirm their order completion."]}),`
|
|
8
|
+
`]}),`
|
|
9
|
+
`,e.jsx(n.h1,{id:"quick-start",children:"Quick Start"}),`
|
|
10
|
+
`,e.jsx(n.p,{children:"The checkout component handles the entire checkout process including customer information collection, delivery address management, and payment processing."}),`
|
|
11
|
+
`,e.jsx(n.p,{children:"In this guide, you will learn how to quickly integrate the checkout components into your React application. For more detailed information and advanced usage, check out the Guide section."}),`
|
|
12
|
+
`,e.jsx(n.h3,{id:"installation",children:"Installation"}),`
|
|
13
|
+
`,e.jsx(n.p,{children:"Install using your preferred package manager:"}),`
|
|
14
|
+
`,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-bash",children:`# pnpm (recommended)
|
|
15
|
+
pnpm add @clickaroo/checkout-ui
|
|
16
|
+
|
|
17
|
+
# or npm
|
|
18
|
+
npm install @clickaroo/checkout-ui
|
|
19
|
+
|
|
20
|
+
# or yarn
|
|
21
|
+
yarn add @clickaroo/checkout-ui
|
|
22
|
+
`})}),`
|
|
23
|
+
`,e.jsx(n.h4,{id:"peer-dependencies",children:"Peer Dependencies"}),`
|
|
24
|
+
`,e.jsxs(n.p,{children:["This library requires ",e.jsx(n.code,{children:"react"})," (>= 16.8.0) as peer dependencies."]}),`
|
|
25
|
+
`,e.jsxs(n.ul,{children:[`
|
|
26
|
+
`,e.jsxs(n.li,{children:[e.jsx(n.strong,{children:"npm 7+"}),": Will automatically install them"]}),`
|
|
27
|
+
`,e.jsxs(n.li,{children:[e.jsx(n.strong,{children:"npm 6 / pnpm"}),": You may need to install them manually if you see warnings"]}),`
|
|
28
|
+
`,e.jsxs(n.li,{children:[e.jsx(n.strong,{children:"yarn v2+"}),": Will error if they are missing"]}),`
|
|
29
|
+
`]}),`
|
|
30
|
+
`,e.jsx(n.p,{children:"Most React projects already have these installed, so you typically don't need to do anything extra."}),`
|
|
31
|
+
`,e.jsx(n.h3,{id:"token-parameter",children:"Token Parameter"}),`
|
|
32
|
+
`,e.jsxs(n.p,{children:["The component library requires a ",e.jsx(n.code,{children:"clro_token"})," parameter to identify the checkout session. This token should be provided in the URL query parameter when users navigate to the checkout page:"]}),`
|
|
33
|
+
`,e.jsx(n.pre,{children:e.jsx(n.code,{children:`https://your-checkout-page.com?clro_token=YOUR_TOKEN_HERE
|
|
34
|
+
`})}),`
|
|
35
|
+
`,e.jsx(n.p,{children:"The token will be automatically extracted from the URL and stored in localStorage for subsequent requests."}),`
|
|
36
|
+
`,e.jsx(n.h3,{id:"use-checkout-all-in-one",children:"Use Checkout All in One"}),`
|
|
37
|
+
`,e.jsxs(n.p,{children:["The simplest way is to use the ",e.jsx(n.code,{children:"CheckoutPage"})," component directly, which includes the complete checkout flow."]}),`
|
|
38
|
+
`,e.jsx(s,{of:c}),`
|
|
39
|
+
`,e.jsxs(n.blockquote,{children:[`
|
|
40
|
+
`,e.jsxs(n.p,{children:[e.jsx(n.strong,{children:"Note"}),": If you need Google address suggestions for the address field, you must provide a ",e.jsx(n.code,{children:"googleApiKey"})," that meets the ",e.jsx(n.a,{href:"https://developers.google.com/maps/documentation/places/web-service/get-api-key?hl=en&setupProd=prerequisites",rel:"nofollow",children:"google places api requirements"}),"."]}),`
|
|
41
|
+
`]}),`
|
|
42
|
+
`,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-tsx",children:`import { CheckoutPage } from '@clickaroo/checkout-ui';
|
|
43
|
+
|
|
44
|
+
function MyCheckout() {
|
|
45
|
+
const cart = [
|
|
46
|
+
{
|
|
47
|
+
sku: "TEST001",
|
|
48
|
+
offerPricePoint: "OPP-TEST001",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
sku: "TEST002",
|
|
52
|
+
offerPricePoint: "OPP-TEST002",
|
|
53
|
+
},
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
return <CheckoutPage cart={cart} googleApiKey={YOUR_GOOGLE_API_KEY} />;
|
|
57
|
+
}
|
|
58
|
+
`})}),`
|
|
59
|
+
`,e.jsxs(n.blockquote,{children:[`
|
|
60
|
+
`,e.jsxs(n.p,{children:[e.jsx(n.strong,{children:"Tips"}),`:
|
|
61
|
+
Each object in the `,e.jsx(n.code,{children:"cart"})," array only needs to contain the two required fields: ",e.jsx(n.code,{children:"sku"})," and ",e.jsx(n.code,{children:"offerPricePoint"}),". However, you can also pass other optional product information fields (such as ",e.jsx(n.code,{children:"title"}),", ",e.jsx(n.code,{children:"price"}),", ",e.jsx(n.code,{children:"image"}),", etc.), which will be saved to the order's metadata."]}),`
|
|
62
|
+
`]}),`
|
|
63
|
+
`,e.jsxs(n.p,{children:["You can read more about all the possible configuration options in ",e.jsx(n.a,{href:"./?path=/docs/components-checkoutpage--checkoutpage-english",children:"CheckoutPage Documentation"}),"."]}),`
|
|
64
|
+
`,e.jsx(n.h3,{id:"event-callbacks",children:"Event Callbacks"}),`
|
|
65
|
+
`,e.jsxs(n.p,{children:["The ",e.jsx(n.code,{children:"CheckoutPage"})," component provides several event callbacks that allow you to monitor and respond to different stages of the checkout process. These callbacks enable you to track user behavior, handle loading states, and implement custom logic."]}),`
|
|
66
|
+
`,e.jsx(n.p,{children:"Here's a complete example that includes all event callbacks:"}),`
|
|
67
|
+
`,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-tsx",children:`import { CheckoutPage } from '@clickaroo/checkout-ui';
|
|
68
|
+
import { useNavigate } from 'react-router-dom'; // or your routing library
|
|
69
|
+
|
|
70
|
+
function MyCheckout() {
|
|
71
|
+
const navigate = useNavigate();
|
|
72
|
+
|
|
73
|
+
const cart = [
|
|
74
|
+
{
|
|
75
|
+
sku: "TEST001",
|
|
76
|
+
offerPricePoint: "OPP-TEST001",
|
|
77
|
+
title: "Product 1",
|
|
78
|
+
price: 99.99,
|
|
79
|
+
},
|
|
80
|
+
];
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<CheckoutPage
|
|
84
|
+
cart={cart}
|
|
85
|
+
googleApiKey={YOUR_GOOGLE_API_KEY}
|
|
86
|
+
onCheckoutInit={() => {
|
|
87
|
+
console.log('Checkout initialized');
|
|
88
|
+
}}
|
|
89
|
+
onPaymentInfoComplete={(cart, totalAmount) => {
|
|
90
|
+
console.log('Payment info complete');
|
|
91
|
+
}}
|
|
92
|
+
onOrderSubmit={(cart, totalAmount) => {
|
|
93
|
+
console.log('Order submitted');
|
|
94
|
+
}}
|
|
95
|
+
onOrderSuccess={(orderCode, tradeCode) => {
|
|
96
|
+
console.log('Order successful:', orderCode);
|
|
97
|
+
// Redirect to finish page
|
|
98
|
+
navigate(\`/finish/\${orderCode}\`);
|
|
99
|
+
}}
|
|
100
|
+
/>
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
`})}),`
|
|
104
|
+
`,e.jsx(n.p,{children:e.jsx(n.strong,{children:"Key Points:"})}),`
|
|
105
|
+
`,e.jsxs(n.ul,{children:[`
|
|
106
|
+
`,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"onCheckoutInit"}),": Triggered when the checkout page loads"]}),`
|
|
107
|
+
`,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"onPaymentInfoComplete"}),": Triggered when the payment form is valid"]}),`
|
|
108
|
+
`,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"onOrderSubmit"}),": Triggered when user clicks submit"]}),`
|
|
109
|
+
`,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"onOrderSuccess"}),": Triggered when order is successfully created"]}),`
|
|
110
|
+
`]}),`
|
|
111
|
+
`,e.jsx(n.h3,{id:"display-order-details-on-finish-page",children:"Display Order Details on Finish Page"}),`
|
|
112
|
+
`,e.jsxs(n.p,{children:["After the user successfully completes the payment and is redirected to the finish page, you can use the ",e.jsx(n.code,{children:"useOrderDetail"})," hook to display order information:"]}),`
|
|
113
|
+
`,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-tsx",children:`import { useOrderDetail } from '@clickaroo/checkout-ui';
|
|
114
|
+
import { useParams } from 'react-router-dom';
|
|
115
|
+
|
|
116
|
+
function OrderCompletePage() {
|
|
117
|
+
const { orderCode } = useParams();
|
|
118
|
+
const { orderDetail, loading, error } = useOrderDetail(orderCode || '');
|
|
119
|
+
|
|
120
|
+
if (loading) return <div>Loading order details...</div>;
|
|
121
|
+
if (error) return <div>Error: {error}</div>;
|
|
122
|
+
if (!orderDetail) return <div>Order not found</div>;
|
|
123
|
+
|
|
124
|
+
return (
|
|
125
|
+
<div>
|
|
126
|
+
<h1>Order Complete!</h1>
|
|
127
|
+
<p>Order Code: {orderDetail.order_code}</p>
|
|
128
|
+
<p>Customer Information: {orderDetail.customer.email} {orderDetail.customer.phone}</p>
|
|
129
|
+
<p>Total: {orderDetail.total_amount}</p>
|
|
130
|
+
<p>Product Detail: {orderDetail.metadata}</p>
|
|
131
|
+
{/* Display more order details as needed */}
|
|
132
|
+
</div>
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
`})}),`
|
|
136
|
+
`,e.jsxs(n.p,{children:["For more advanced usage, check out the ",e.jsx(n.a,{href:"./?path=/docs/documentation-apis--docs",children:"APIs documentation"}),"."]})]})}function b(o={}){const{wrapper:n}={...t(),...o.components};return n?e.jsx(n,{...o,children:e.jsx(r,{...o})}):r(o)}export{b as default};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import{j as e}from"./jsx-runtime-DiklIkkE.js";import{useMDXComponents as t}from"./index-ChEI-nsM.js";import{M as i,C as s}from"./index-Bz3Q1Yw_.js";import{D as c}from"./CheckoutPage.stories-B5y94bOo.js";import"./index-DRjF_FHU.js";import"./iframe-eGyOKkka.js";import"./index-B7ki2Uzk.js";import"./index-D-Mha1DF.js";import"./index-DrFu-skq.js";import"./useCheckoutContext-L3zhltsm.js";import"./CheckoutPage-DvHYA1Jd.js";import"./CustomerInfo-BqCSWi4I.js";import"./ValidateInput-np1-zwvJ.js";import"./DeliveryAddress-TRtlNz2v.js";import"./PaymentMethods-CBXk2f9N.js";function r(o){const n={a:"a",blockquote:"blockquote",code:"code",h1:"h1",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...t(),...o.components};return e.jsxs(e.Fragment,{children:[e.jsx(i,{title:"Documentation/QuickStart"}),`
|
|
2
|
+
`,e.jsx(n.h1,{id:"overview",children:"Overview"}),`
|
|
3
|
+
`,e.jsxs(n.p,{children:["This component library is designed for the ",e.jsx(n.strong,{children:"checkout page"})," in your e-commerce flow. Here's how it fits into a typical purchase journey:"]}),`
|
|
4
|
+
`,e.jsxs(n.ol,{children:[`
|
|
5
|
+
`,e.jsxs(n.li,{children:[e.jsx(n.strong,{children:"Product/Landing Page"}),": Users browse products on your product or landing page. You should provide a button or link that navigates users to the checkout page when they're ready to purchase."]}),`
|
|
6
|
+
`,e.jsxs(n.li,{children:[e.jsx(n.strong,{children:"Checkout Page"}),": This is where you integrate this component library. Users can submit their purchase information here."]}),`
|
|
7
|
+
`,e.jsxs(n.li,{children:[e.jsx(n.strong,{children:"Finish Page"}),": After successful payment, redirect users to a finish page to confirm their order completion."]}),`
|
|
8
|
+
`]}),`
|
|
9
|
+
`,e.jsx(n.h1,{id:"quick-start",children:"Quick Start"}),`
|
|
10
|
+
`,e.jsx(n.p,{children:"The checkout component handles the entire checkout process including customer information collection, delivery address management, and payment processing."}),`
|
|
11
|
+
`,e.jsx(n.p,{children:"In this guide, you will learn how to quickly integrate the checkout components into your React application. For more detailed information and advanced usage, check out the Guide section."}),`
|
|
12
|
+
`,e.jsx(n.h3,{id:"installation",children:"Installation"}),`
|
|
13
|
+
`,e.jsx(n.p,{children:"Install using your preferred package manager:"}),`
|
|
14
|
+
`,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-bash",children:`# pnpm (recommended)
|
|
15
|
+
pnpm add @clickaroo/checkout-ui
|
|
16
|
+
|
|
17
|
+
# or npm
|
|
18
|
+
npm install @clickaroo/checkout-ui
|
|
19
|
+
|
|
20
|
+
# or yarn
|
|
21
|
+
yarn add @clickaroo/checkout-ui
|
|
22
|
+
`})}),`
|
|
23
|
+
`,e.jsx(n.h4,{id:"peer-dependencies",children:"Peer Dependencies"}),`
|
|
24
|
+
`,e.jsxs(n.p,{children:["This library requires ",e.jsx(n.code,{children:"react"})," (>= 16.8.0) as peer dependencies."]}),`
|
|
25
|
+
`,e.jsxs(n.ul,{children:[`
|
|
26
|
+
`,e.jsxs(n.li,{children:[e.jsx(n.strong,{children:"npm 7+"}),": Will automatically install them"]}),`
|
|
27
|
+
`,e.jsxs(n.li,{children:[e.jsx(n.strong,{children:"npm 6 / pnpm"}),": You may need to install them manually if you see warnings"]}),`
|
|
28
|
+
`,e.jsxs(n.li,{children:[e.jsx(n.strong,{children:"yarn v2+"}),": Will error if they are missing"]}),`
|
|
29
|
+
`]}),`
|
|
30
|
+
`,e.jsx(n.p,{children:"Most React projects already have these installed, so you typically don't need to do anything extra."}),`
|
|
31
|
+
`,e.jsx(n.h3,{id:"token-parameter",children:"Token Parameter"}),`
|
|
32
|
+
`,e.jsxs(n.p,{children:["The component library requires a ",e.jsx(n.code,{children:"clro_token"})," parameter to identify the checkout session. This token should be provided in the URL query parameter when users navigate to the checkout page:"]}),`
|
|
33
|
+
`,e.jsx(n.pre,{children:e.jsx(n.code,{children:`https://your-checkout-page.com?clro_token=YOUR_TOKEN_HERE
|
|
34
|
+
`})}),`
|
|
35
|
+
`,e.jsx(n.p,{children:"The token will be automatically extracted from the URL and stored in localStorage for subsequent requests."}),`
|
|
36
|
+
`,e.jsx(n.h3,{id:"use-checkout-all-in-one",children:"Use Checkout All in One"}),`
|
|
37
|
+
`,e.jsxs(n.p,{children:["The simplest way is to use the ",e.jsx(n.code,{children:"CheckoutPage"})," component directly, which includes the complete checkout flow."]}),`
|
|
38
|
+
`,e.jsx(s,{of:c}),`
|
|
39
|
+
`,e.jsxs(n.blockquote,{children:[`
|
|
40
|
+
`,e.jsxs(n.p,{children:[e.jsx(n.strong,{children:"Note"}),": If you need Google address suggestions for the address field, you must provide a ",e.jsx(n.code,{children:"googleApiKey"})," that meets the ",e.jsx(n.a,{href:"https://developers.google.com/maps/documentation/places/web-service/get-api-key?hl=en&setupProd=prerequisites",rel:"nofollow",children:"google places api requirements"}),"."]}),`
|
|
41
|
+
`]}),`
|
|
42
|
+
`,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-tsx",children:`import { CheckoutPage } from '@clickaroo/checkout-ui';
|
|
43
|
+
|
|
44
|
+
function MyCheckout() {
|
|
45
|
+
const cart = [
|
|
46
|
+
{
|
|
47
|
+
sku: "TEST001",
|
|
48
|
+
offerPricePoint: "OPP-TEST001",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
sku: "TEST002",
|
|
52
|
+
offerPricePoint: "OPP-TEST002",
|
|
53
|
+
},
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
return <CheckoutPage cart={cart} googleApiKey={YOUR_GOOGLE_API_KEY} />;
|
|
57
|
+
}
|
|
58
|
+
`})}),`
|
|
59
|
+
`,e.jsxs(n.blockquote,{children:[`
|
|
60
|
+
`,e.jsxs(n.p,{children:[e.jsx(n.strong,{children:"Tips"}),`:
|
|
61
|
+
Each object in the `,e.jsx(n.code,{children:"cart"})," array only needs to contain the two required fields: ",e.jsx(n.code,{children:"sku"})," and ",e.jsx(n.code,{children:"offerPricePoint"}),". However, you can also pass other optional product information fields (such as ",e.jsx(n.code,{children:"title"}),", ",e.jsx(n.code,{children:"price"}),", ",e.jsx(n.code,{children:"image"}),", etc.), which will be saved to the order's metadata."]}),`
|
|
62
|
+
`]}),`
|
|
63
|
+
`,e.jsxs(n.p,{children:["You can read more about all the possible configuration options in ",e.jsx(n.a,{href:"./?path=/docs/components-checkoutpage--checkoutpage-english",children:"CheckoutPage Documentation"}),"."]}),`
|
|
64
|
+
`,e.jsx(n.h3,{id:"event-callbacks",children:"Event Callbacks"}),`
|
|
65
|
+
`,e.jsxs(n.p,{children:["The ",e.jsx(n.code,{children:"CheckoutPage"})," component provides several event callbacks that allow you to monitor and respond to different stages of the checkout process. These callbacks enable you to track user behavior, handle loading states, and implement custom logic."]}),`
|
|
66
|
+
`,e.jsx(n.p,{children:"Here's a complete example that includes all event callbacks:"}),`
|
|
67
|
+
`,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-tsx",children:`import { CheckoutPage } from '@clickaroo/checkout-ui';
|
|
68
|
+
import { useNavigate } from 'react-router-dom'; // or your routing library
|
|
69
|
+
|
|
70
|
+
function MyCheckout() {
|
|
71
|
+
const navigate = useNavigate();
|
|
72
|
+
|
|
73
|
+
const cart = [
|
|
74
|
+
{
|
|
75
|
+
sku: "TEST001",
|
|
76
|
+
offerPricePoint: "OPP-TEST001",
|
|
77
|
+
title: "Product 1",
|
|
78
|
+
price: 99.99,
|
|
79
|
+
},
|
|
80
|
+
];
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<CheckoutPage
|
|
84
|
+
cart={cart}
|
|
85
|
+
googleApiKey={YOUR_GOOGLE_API_KEY}
|
|
86
|
+
onCheckoutInit={() => {
|
|
87
|
+
console.log('Checkout initialized');
|
|
88
|
+
}}
|
|
89
|
+
onPaymentInfoComplete={(cart, totalAmount) => {
|
|
90
|
+
console.log('Payment info complete');
|
|
91
|
+
}}
|
|
92
|
+
onOrderSubmit={(cart, totalAmount) => {
|
|
93
|
+
console.log('Order submitted');
|
|
94
|
+
}}
|
|
95
|
+
onOrderSuccess={(orderCode, tradeCode) => {
|
|
96
|
+
console.log('Order successful:', orderCode);
|
|
97
|
+
// Redirect to finish page
|
|
98
|
+
navigate(\`/finish/\${orderCode}\`);
|
|
99
|
+
}}
|
|
100
|
+
/>
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
`})}),`
|
|
104
|
+
`,e.jsx(n.p,{children:e.jsx(n.strong,{children:"Key Points:"})}),`
|
|
105
|
+
`,e.jsxs(n.ul,{children:[`
|
|
106
|
+
`,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"onCheckoutInit"}),": Triggered when the checkout page loads"]}),`
|
|
107
|
+
`,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"onPaymentInfoComplete"}),": Triggered when the payment form is valid"]}),`
|
|
108
|
+
`,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"onOrderSubmit"}),": Triggered when user clicks submit"]}),`
|
|
109
|
+
`,e.jsxs(n.li,{children:[e.jsx(n.code,{children:"onOrderSuccess"}),": Triggered when order is successfully created"]}),`
|
|
110
|
+
`]}),`
|
|
111
|
+
`,e.jsx(n.h3,{id:"display-order-details-on-finish-page",children:"Display Order Details on Finish Page"}),`
|
|
112
|
+
`,e.jsxs(n.p,{children:["After the user successfully completes the payment and is redirected to the finish page, you can use the ",e.jsx(n.code,{children:"useOrderDetail"})," hook to display order information:"]}),`
|
|
113
|
+
`,e.jsx(n.pre,{children:e.jsx(n.code,{className:"language-tsx",children:`import { useOrderDetail } from '@clickaroo/checkout-ui';
|
|
114
|
+
import { useParams } from 'react-router-dom';
|
|
115
|
+
|
|
116
|
+
function OrderCompletePage() {
|
|
117
|
+
const { orderCode } = useParams();
|
|
118
|
+
const { orderDetail, loading, error } = useOrderDetail(orderCode || '');
|
|
119
|
+
|
|
120
|
+
if (loading) return <div>Loading order details...</div>;
|
|
121
|
+
if (error) return <div>Error: {error}</div>;
|
|
122
|
+
if (!orderDetail) return <div>Order not found</div>;
|
|
123
|
+
|
|
124
|
+
return (
|
|
125
|
+
<div>
|
|
126
|
+
<h1>Order Complete!</h1>
|
|
127
|
+
<p>Order Code: {orderDetail.order_code}</p>
|
|
128
|
+
<p>Customer Information: {orderDetail.customer.email} {orderDetail.customer.phone}</p>
|
|
129
|
+
<p>Total: {orderDetail.total_amount}</p>
|
|
130
|
+
<p>Product Detail: {orderDetail.metadata}</p>
|
|
131
|
+
{/* Display more order details as needed */}
|
|
132
|
+
</div>
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
`})}),`
|
|
136
|
+
`,e.jsxs(n.p,{children:["For more advanced usage, check out the ",e.jsx(n.a,{href:"./?path=/docs/documentation-apis--docs",children:"APIs documentation"}),"."]})]})}function b(o={}){const{wrapper:n}={...t(),...o.components};return n?e.jsx(n,{...o,children:e.jsx(r,{...o})}):r(o)}export{b as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j as r}from"./jsx-runtime-DiklIkkE.js";import{r as o,R}from"./index-DRjF_FHU.js";import{Z as j}from"./useCheckoutContext-C7KjDyWW.js";const H=({label:d,value:t,onChange:T,onBlur:p,onFocus:m,type:v="text",placeholder:h,icon:f,prefix:u,inputClass:w="",error:q,schema:n,validateOnChange:g=!1,validateOnBlur:I=!0,onValidationChange:l,...M})=>{const[F,b]=o.useState(!1),[N,L]=o.useState(null),c=q||N,s=o.useCallback(e=>{var i;if(!n)return null;try{return n.parse(e),null}catch(x){return x instanceof j&&((i=x.issues[0])==null?void 0:i.message)||"Validation failed"}},[n]),a=o.useCallback(e=>{L(e),l&&l(e)},[l]),y=R.useRef(t),E=R.useRef(!1);return o.useEffect(()=>{if(n){if(g){const e=s(t);a(e);return}if(E.current){if(t!==y.current&&t){const e=s(t);a(e)}}else{if(t){const e=s(t);a(e)}E.current=!0}y.current=t}},[t,n,g,s,a]),r.jsxs("div",{className:"relative w-full",children:[r.jsx("label",{className:`text-sm text-[#2A2B35] bg-white px-1 pointer-events-none
|
|
2
|
+
transition-all duration-200 z-10`,children:d}),r.jsxs("div",{className:"relative flex items-center",children:[u&&r.jsx("div",{className:"absolute left-0 top-0 bottom-0 z-10 flex items-center",children:u}),r.jsx("input",{type:v,value:t,onFocus:e=>{b(!0),m&&m(e)},onBlur:e=>{if(b(!1),n&&I){const i=s(t);a(i)}p&&p(e)},onChange:T,placeholder:F?"":h||d,className:`w-full border border-solid border-[#e6e6e6] shadow-sm rounded-md p-[0.64rem] ${u?"pl-20":"pl-3"} text-base bg-white placeholder-custom transition pr-12 appearance-none outline-none font-[inherit] ${c?"!border-2 !border-[#df1b41] focus:!border-[#df1b41] !text-[#df1b41] focus:!ring-0 focus:!outline-none":"border-[#e6e6e6] focus:border-[#8AA3D4] focus:shadow-focus focus:!outline-none"} ${w}`,...M}),f&&r.jsx("span",{className:"absolute right-3 top-0 bottom-0 flex items-center text-black",children:f})]}),c&&r.jsx("p",{className:"mt-1 text-sm text-[#df1b41] px-2",children:c})]})};H.__docgenInfo={description:"",methods:[],displayName:"FloatingLabelInput",props:{label:{required:!0,tsType:{name:"string"},description:""},value:{required:!0,tsType:{name:"string"},description:""},onChange:{required:!0,tsType:{name:"signature",type:"function",raw:"(e: React.ChangeEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ReactChangeEvent",raw:"React.ChangeEvent<HTMLInputElement>",elements:[{name:"HTMLInputElement"}]},name:"e"}],return:{name:"void"}}},description:""},onBlur:{required:!1,tsType:{name:"signature",type:"function",raw:"(e: React.FocusEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ReactFocusEvent",raw:"React.FocusEvent<HTMLInputElement>",elements:[{name:"HTMLInputElement"}]},name:"e"}],return:{name:"void"}}},description:""},onFocus:{required:!1,tsType:{name:"signature",type:"function",raw:"(e: React.FocusEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ReactFocusEvent",raw:"React.FocusEvent<HTMLInputElement>",elements:[{name:"HTMLInputElement"}]},name:"e"}],return:{name:"void"}}},description:""},type:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:'"text"',computed:!1}},placeholder:{required:!1,tsType:{name:"string"},description:""},icon:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},prefix:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},inputClass:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:'""',computed:!1}},error:{required:!1,tsType:{name:"string"},description:""},schema:{required:!1,tsType:{name:"z.ZodSchema",elements:[{name:"string"}],raw:"z.ZodSchema<string>"},description:""},validateOnChange:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},validateOnBlur:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"true",computed:!1}},onValidationChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(error: string | null) => void",signature:{arguments:[{type:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},name:"error"}],return:{name:"void"}}},description:""}},composes:["Omit"]};export{H as F};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j as r}from"./jsx-runtime-DiklIkkE.js";import{r as o,R}from"./index-DRjF_FHU.js";import{Z as j}from"./useCheckoutContext-CroxIBFh.js";const H=({label:d,value:t,onChange:T,onBlur:p,onFocus:m,type:v="text",placeholder:h,icon:f,prefix:u,inputClass:w="",error:q,schema:n,validateOnChange:g=!1,validateOnBlur:I=!0,onValidationChange:l,...M})=>{const[F,b]=o.useState(!1),[N,L]=o.useState(null),c=q||N,s=o.useCallback(e=>{var i;if(!n)return null;try{return n.parse(e),null}catch(x){return x instanceof j&&((i=x.issues[0])==null?void 0:i.message)||"Validation failed"}},[n]),a=o.useCallback(e=>{L(e),l&&l(e)},[l]),y=R.useRef(t),E=R.useRef(!1);return o.useEffect(()=>{if(n){if(g){const e=s(t);a(e);return}if(E.current){if(t!==y.current&&t){const e=s(t);a(e)}}else{if(t){const e=s(t);a(e)}E.current=!0}y.current=t}},[t,n,g,s,a]),r.jsxs("div",{className:"relative w-full",children:[r.jsx("label",{className:`text-sm text-[#2A2B35] bg-white px-1 pointer-events-none
|
|
2
|
+
transition-all duration-200 z-10`,children:d}),r.jsxs("div",{className:"relative flex items-center",children:[u&&r.jsx("div",{className:"absolute left-0 top-0 bottom-0 z-10 flex items-center",children:u}),r.jsx("input",{type:v,value:t,onFocus:e=>{b(!0),m&&m(e)},onBlur:e=>{if(b(!1),n&&I){const i=s(t);a(i)}p&&p(e)},onChange:T,placeholder:F?"":h||d,className:`w-full border border-solid border-[#e6e6e6] shadow-sm rounded-md p-[0.64rem] ${u?"pl-20":"pl-3"} text-base bg-white placeholder-custom transition pr-12 appearance-none outline-none font-[inherit] ${c?"!border-2 !border-[#df1b41] focus:!border-[#df1b41] !text-[#df1b41] focus:!ring-0 focus:!outline-none":"border-[#e6e6e6] focus:border-[#8AA3D4] focus:shadow-focus focus:!outline-none"} ${w}`,...M}),f&&r.jsx("span",{className:"absolute right-3 top-0 bottom-0 flex items-center text-black",children:f})]}),c&&r.jsx("p",{className:"mt-1 text-sm text-[#df1b41] px-2",children:c})]})};H.__docgenInfo={description:"",methods:[],displayName:"FloatingLabelInput",props:{label:{required:!0,tsType:{name:"string"},description:""},value:{required:!0,tsType:{name:"string"},description:""},onChange:{required:!0,tsType:{name:"signature",type:"function",raw:"(e: React.ChangeEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ReactChangeEvent",raw:"React.ChangeEvent<HTMLInputElement>",elements:[{name:"HTMLInputElement"}]},name:"e"}],return:{name:"void"}}},description:""},onBlur:{required:!1,tsType:{name:"signature",type:"function",raw:"(e: React.FocusEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ReactFocusEvent",raw:"React.FocusEvent<HTMLInputElement>",elements:[{name:"HTMLInputElement"}]},name:"e"}],return:{name:"void"}}},description:""},onFocus:{required:!1,tsType:{name:"signature",type:"function",raw:"(e: React.FocusEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ReactFocusEvent",raw:"React.FocusEvent<HTMLInputElement>",elements:[{name:"HTMLInputElement"}]},name:"e"}],return:{name:"void"}}},description:""},type:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:'"text"',computed:!1}},placeholder:{required:!1,tsType:{name:"string"},description:""},icon:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},prefix:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},inputClass:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:'""',computed:!1}},error:{required:!1,tsType:{name:"string"},description:""},schema:{required:!1,tsType:{name:"z.ZodSchema",elements:[{name:"string"}],raw:"z.ZodSchema<string>"},description:""},validateOnChange:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},validateOnBlur:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"true",computed:!1}},onValidationChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(error: string | null) => void",signature:{arguments:[{type:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},name:"error"}],return:{name:"void"}}},description:""}},composes:["Omit"]};export{H as F};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j as r}from"./jsx-runtime-DiklIkkE.js";import{r as o,R}from"./index-DRjF_FHU.js";import{Z as j}from"./useCheckoutContext-BW2h13W8.js";const H=({label:d,value:t,onChange:T,onBlur:p,onFocus:m,type:v="text",placeholder:h,icon:f,prefix:u,inputClass:w="",error:q,schema:n,validateOnChange:g=!1,validateOnBlur:I=!0,onValidationChange:l,...M})=>{const[F,b]=o.useState(!1),[N,L]=o.useState(null),c=q||N,s=o.useCallback(e=>{var i;if(!n)return null;try{return n.parse(e),null}catch(x){return x instanceof j&&((i=x.issues[0])==null?void 0:i.message)||"Validation failed"}},[n]),a=o.useCallback(e=>{L(e),l&&l(e)},[l]),y=R.useRef(t),E=R.useRef(!1);return o.useEffect(()=>{if(n){if(g){const e=s(t);a(e);return}if(E.current){if(t!==y.current&&t){const e=s(t);a(e)}}else{if(t){const e=s(t);a(e)}E.current=!0}y.current=t}},[t,n,g,s,a]),r.jsxs("div",{className:"relative w-full",children:[r.jsx("label",{className:`text-sm text-[#2A2B35] bg-white px-1 pointer-events-none
|
|
2
|
+
transition-all duration-200 z-10`,children:d}),r.jsxs("div",{className:"relative flex items-center",children:[u&&r.jsx("div",{className:"absolute left-0 top-0 bottom-0 z-10 flex items-center",children:u}),r.jsx("input",{type:v,value:t,onFocus:e=>{b(!0),m&&m(e)},onBlur:e=>{if(b(!1),n&&I){const i=s(t);a(i)}p&&p(e)},onChange:T,placeholder:F?"":h||d,className:`w-full border border-solid border-[#e6e6e6] shadow-sm rounded-md p-[0.64rem] ${u?"pl-20":"pl-3"} text-base bg-white placeholder-custom transition pr-12 appearance-none outline-none font-[inherit] ${c?"!border-2 !border-[#df1b41] focus:!border-[#df1b41] !text-[#df1b41] focus:!ring-0 focus:!outline-none":"border-[#e6e6e6] focus:border-[#8AA3D4] focus:shadow-focus focus:!outline-none"} ${w}`,...M}),f&&r.jsx("span",{className:"absolute right-3 top-0 bottom-0 flex items-center text-black",children:f})]}),c&&r.jsx("p",{className:"mt-1 text-sm text-[#df1b41] px-2",children:c})]})};H.__docgenInfo={description:"",methods:[],displayName:"FloatingLabelInput",props:{label:{required:!0,tsType:{name:"string"},description:""},value:{required:!0,tsType:{name:"string"},description:""},onChange:{required:!0,tsType:{name:"signature",type:"function",raw:"(e: React.ChangeEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ReactChangeEvent",raw:"React.ChangeEvent<HTMLInputElement>",elements:[{name:"HTMLInputElement"}]},name:"e"}],return:{name:"void"}}},description:""},onBlur:{required:!1,tsType:{name:"signature",type:"function",raw:"(e: React.FocusEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ReactFocusEvent",raw:"React.FocusEvent<HTMLInputElement>",elements:[{name:"HTMLInputElement"}]},name:"e"}],return:{name:"void"}}},description:""},onFocus:{required:!1,tsType:{name:"signature",type:"function",raw:"(e: React.FocusEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ReactFocusEvent",raw:"React.FocusEvent<HTMLInputElement>",elements:[{name:"HTMLInputElement"}]},name:"e"}],return:{name:"void"}}},description:""},type:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:'"text"',computed:!1}},placeholder:{required:!1,tsType:{name:"string"},description:""},icon:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},prefix:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},inputClass:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:'""',computed:!1}},error:{required:!1,tsType:{name:"string"},description:""},schema:{required:!1,tsType:{name:"z.ZodSchema",elements:[{name:"string"}],raw:"z.ZodSchema<string>"},description:""},validateOnChange:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},validateOnBlur:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"true",computed:!1}},onValidationChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(error: string | null) => void",signature:{arguments:[{type:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},name:"error"}],return:{name:"void"}}},description:""}},composes:["Omit"]};export{H as F};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j as r}from"./jsx-runtime-DiklIkkE.js";import{r as o,R}from"./index-DRjF_FHU.js";import{Z as j}from"./useCheckoutContext-3YTrU8Qh.js";const H=({label:d,value:t,onChange:T,onBlur:p,onFocus:m,type:v="text",placeholder:h,icon:f,prefix:u,inputClass:w="",error:q,schema:n,validateOnChange:g=!1,validateOnBlur:I=!0,onValidationChange:l,...M})=>{const[F,b]=o.useState(!1),[N,L]=o.useState(null),c=q||N,s=o.useCallback(e=>{var i;if(!n)return null;try{return n.parse(e),null}catch(x){return x instanceof j&&((i=x.issues[0])==null?void 0:i.message)||"Validation failed"}},[n]),a=o.useCallback(e=>{L(e),l&&l(e)},[l]),y=R.useRef(t),E=R.useRef(!1);return o.useEffect(()=>{if(n){if(g){const e=s(t);a(e);return}if(E.current){if(t!==y.current&&t){const e=s(t);a(e)}}else{if(t){const e=s(t);a(e)}E.current=!0}y.current=t}},[t,n,g,s,a]),r.jsxs("div",{className:"relative w-full",children:[r.jsx("label",{className:`text-sm text-[#2A2B35] bg-white px-1 pointer-events-none
|
|
2
|
+
transition-all duration-200 z-10`,children:d}),r.jsxs("div",{className:"relative flex items-center",children:[u&&r.jsx("div",{className:"absolute left-0 top-0 bottom-0 z-10 flex items-center",children:u}),r.jsx("input",{type:v,value:t,onFocus:e=>{b(!0),m&&m(e)},onBlur:e=>{if(b(!1),n&&I){const i=s(t);a(i)}p&&p(e)},onChange:T,placeholder:F?"":h||d,className:`w-full border border-solid border-[#e6e6e6] shadow-sm rounded-md p-[0.64rem] ${u?"pl-20":"pl-3"} text-base bg-white placeholder-custom transition pr-12 appearance-none outline-none font-[inherit] ${c?"!border-2 !border-[#df1b41] focus:!border-[#df1b41] !text-[#df1b41] focus:!ring-0 focus:!outline-none":"border-[#e6e6e6] focus:border-[#8AA3D4] focus:shadow-focus focus:!outline-none"} ${w}`,...M}),f&&r.jsx("span",{className:"absolute right-3 top-0 bottom-0 flex items-center text-black",children:f})]}),c&&r.jsx("p",{className:"mt-1 text-sm text-[#df1b41] px-2",children:c})]})};H.__docgenInfo={description:"",methods:[],displayName:"FloatingLabelInput",props:{label:{required:!0,tsType:{name:"string"},description:""},value:{required:!0,tsType:{name:"string"},description:""},onChange:{required:!0,tsType:{name:"signature",type:"function",raw:"(e: React.ChangeEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ReactChangeEvent",raw:"React.ChangeEvent<HTMLInputElement>",elements:[{name:"HTMLInputElement"}]},name:"e"}],return:{name:"void"}}},description:""},onBlur:{required:!1,tsType:{name:"signature",type:"function",raw:"(e: React.FocusEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ReactFocusEvent",raw:"React.FocusEvent<HTMLInputElement>",elements:[{name:"HTMLInputElement"}]},name:"e"}],return:{name:"void"}}},description:""},onFocus:{required:!1,tsType:{name:"signature",type:"function",raw:"(e: React.FocusEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ReactFocusEvent",raw:"React.FocusEvent<HTMLInputElement>",elements:[{name:"HTMLInputElement"}]},name:"e"}],return:{name:"void"}}},description:""},type:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:'"text"',computed:!1}},placeholder:{required:!1,tsType:{name:"string"},description:""},icon:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},prefix:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},inputClass:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:'""',computed:!1}},error:{required:!1,tsType:{name:"string"},description:""},schema:{required:!1,tsType:{name:"z.ZodSchema",elements:[{name:"string"}],raw:"z.ZodSchema<string>"},description:""},validateOnChange:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},validateOnBlur:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"true",computed:!1}},onValidationChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(error: string | null) => void",signature:{arguments:[{type:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},name:"error"}],return:{name:"void"}}},description:""}},composes:["Omit"]};export{H as F};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j as r}from"./jsx-runtime-DiklIkkE.js";import{r as o,R}from"./index-DRjF_FHU.js";import{Z as j}from"./useCheckoutContext-B8tsk5b5.js";const H=({label:d,value:t,onChange:T,onBlur:p,onFocus:m,type:v="text",placeholder:h,icon:f,prefix:u,inputClass:w="",error:q,schema:n,validateOnChange:g=!1,validateOnBlur:I=!0,onValidationChange:l,...M})=>{const[F,b]=o.useState(!1),[N,L]=o.useState(null),c=q||N,s=o.useCallback(e=>{var i;if(!n)return null;try{return n.parse(e),null}catch(x){return x instanceof j&&((i=x.issues[0])==null?void 0:i.message)||"Validation failed"}},[n]),a=o.useCallback(e=>{L(e),l&&l(e)},[l]),y=R.useRef(t),E=R.useRef(!1);return o.useEffect(()=>{if(n){if(g){const e=s(t);a(e);return}if(E.current){if(t!==y.current&&t){const e=s(t);a(e)}}else{if(t){const e=s(t);a(e)}E.current=!0}y.current=t}},[t,n,g,s,a]),r.jsxs("div",{className:"relative w-full",children:[r.jsx("label",{className:`text-sm text-[#2A2B35] bg-white px-1 pointer-events-none
|
|
2
|
+
transition-all duration-200 z-10`,children:d}),r.jsxs("div",{className:"relative flex items-center",children:[u&&r.jsx("div",{className:"absolute left-0 top-0 bottom-0 z-10 flex items-center",children:u}),r.jsx("input",{type:v,value:t,onFocus:e=>{b(!0),m&&m(e)},onBlur:e=>{if(b(!1),n&&I){const i=s(t);a(i)}p&&p(e)},onChange:T,placeholder:F?"":h||d,className:`w-full border border-solid border-[#e6e6e6] shadow-sm rounded-md p-[0.64rem] ${u?"pl-20":"pl-3"} text-base bg-white placeholder-custom transition pr-12 appearance-none outline-none font-[inherit] ${c?"!border-2 !border-[#df1b41] focus:!border-[#df1b41] !text-[#df1b41] focus:!ring-0 focus:!outline-none":"border-[#e6e6e6] focus:border-[#8AA3D4] focus:shadow-focus focus:!outline-none"} ${w}`,...M}),f&&r.jsx("span",{className:"absolute right-3 top-0 bottom-0 flex items-center text-black",children:f})]}),c&&r.jsx("p",{className:"mt-1 text-sm text-[#df1b41] px-2",children:c})]})};H.__docgenInfo={description:"",methods:[],displayName:"FloatingLabelInput",props:{label:{required:!0,tsType:{name:"string"},description:""},value:{required:!0,tsType:{name:"string"},description:""},onChange:{required:!0,tsType:{name:"signature",type:"function",raw:"(e: React.ChangeEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ReactChangeEvent",raw:"React.ChangeEvent<HTMLInputElement>",elements:[{name:"HTMLInputElement"}]},name:"e"}],return:{name:"void"}}},description:""},onBlur:{required:!1,tsType:{name:"signature",type:"function",raw:"(e: React.FocusEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ReactFocusEvent",raw:"React.FocusEvent<HTMLInputElement>",elements:[{name:"HTMLInputElement"}]},name:"e"}],return:{name:"void"}}},description:""},onFocus:{required:!1,tsType:{name:"signature",type:"function",raw:"(e: React.FocusEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ReactFocusEvent",raw:"React.FocusEvent<HTMLInputElement>",elements:[{name:"HTMLInputElement"}]},name:"e"}],return:{name:"void"}}},description:""},type:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:'"text"',computed:!1}},placeholder:{required:!1,tsType:{name:"string"},description:""},icon:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},prefix:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},inputClass:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:'""',computed:!1}},error:{required:!1,tsType:{name:"string"},description:""},schema:{required:!1,tsType:{name:"z.ZodSchema",elements:[{name:"string"}],raw:"z.ZodSchema<string>"},description:""},validateOnChange:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},validateOnBlur:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"true",computed:!1}},onValidationChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(error: string | null) => void",signature:{arguments:[{type:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},name:"error"}],return:{name:"void"}}},description:""}},composes:["Omit"]};export{H as F};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j as r}from"./jsx-runtime-DiklIkkE.js";import{r as o,R}from"./index-DRjF_FHU.js";import{Z as j}from"./useCheckoutContext-DuJ1Ep0-.js";const H=({label:d,value:t,onChange:T,onBlur:p,onFocus:m,type:v="text",placeholder:h,icon:f,prefix:u,inputClass:w="",error:q,schema:n,validateOnChange:g=!1,validateOnBlur:I=!0,onValidationChange:l,...M})=>{const[F,b]=o.useState(!1),[N,L]=o.useState(null),c=q||N,s=o.useCallback(e=>{var i;if(!n)return null;try{return n.parse(e),null}catch(x){return x instanceof j&&((i=x.issues[0])==null?void 0:i.message)||"Validation failed"}},[n]),a=o.useCallback(e=>{L(e),l&&l(e)},[l]),y=R.useRef(t),E=R.useRef(!1);return o.useEffect(()=>{if(n){if(g){const e=s(t);a(e);return}if(E.current){if(t!==y.current&&t){const e=s(t);a(e)}}else{if(t){const e=s(t);a(e)}E.current=!0}y.current=t}},[t,n,g,s,a]),r.jsxs("div",{className:"relative w-full",children:[r.jsx("label",{className:`text-sm text-[#2A2B35] bg-white px-1 pointer-events-none
|
|
2
|
+
transition-all duration-200 z-10`,children:d}),r.jsxs("div",{className:"relative flex items-center",children:[u&&r.jsx("div",{className:"absolute left-0 top-0 bottom-0 z-10 flex items-center",children:u}),r.jsx("input",{type:v,value:t,onFocus:e=>{b(!0),m&&m(e)},onBlur:e=>{if(b(!1),n&&I){const i=s(t);a(i)}p&&p(e)},onChange:T,placeholder:F?"":h||d,className:`w-full border border-solid border-[#e6e6e6] shadow-sm rounded-md p-[0.64rem] ${u?"pl-20":"pl-3"} text-base bg-white placeholder-custom transition pr-12 appearance-none outline-none font-[inherit] ${c?"!border-2 !border-[#df1b41] focus:!border-[#df1b41] !text-[#df1b41] focus:!ring-0 focus:!outline-none":"border-[#e6e6e6] focus:border-[#8AA3D4] focus:shadow-focus focus:!outline-none"} ${w}`,...M}),f&&r.jsx("span",{className:"absolute right-3 top-0 bottom-0 flex items-center text-black",children:f})]}),c&&r.jsx("p",{className:"mt-1 text-sm text-[#df1b41] px-2",children:c})]})};H.__docgenInfo={description:"",methods:[],displayName:"FloatingLabelInput",props:{label:{required:!0,tsType:{name:"string"},description:""},value:{required:!0,tsType:{name:"string"},description:""},onChange:{required:!0,tsType:{name:"signature",type:"function",raw:"(e: React.ChangeEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ReactChangeEvent",raw:"React.ChangeEvent<HTMLInputElement>",elements:[{name:"HTMLInputElement"}]},name:"e"}],return:{name:"void"}}},description:""},onBlur:{required:!1,tsType:{name:"signature",type:"function",raw:"(e: React.FocusEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ReactFocusEvent",raw:"React.FocusEvent<HTMLInputElement>",elements:[{name:"HTMLInputElement"}]},name:"e"}],return:{name:"void"}}},description:""},onFocus:{required:!1,tsType:{name:"signature",type:"function",raw:"(e: React.FocusEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ReactFocusEvent",raw:"React.FocusEvent<HTMLInputElement>",elements:[{name:"HTMLInputElement"}]},name:"e"}],return:{name:"void"}}},description:""},type:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:'"text"',computed:!1}},placeholder:{required:!1,tsType:{name:"string"},description:""},icon:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},prefix:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},inputClass:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:'""',computed:!1}},error:{required:!1,tsType:{name:"string"},description:""},schema:{required:!1,tsType:{name:"z.ZodSchema",elements:[{name:"string"}],raw:"z.ZodSchema<string>"},description:""},validateOnChange:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},validateOnBlur:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"true",computed:!1}},onValidationChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(error: string | null) => void",signature:{arguments:[{type:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},name:"error"}],return:{name:"void"}}},description:""}},composes:["Omit"]};export{H as F};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j as r}from"./jsx-runtime-DiklIkkE.js";import{r as o,R}from"./index-DRjF_FHU.js";import{Z as j}from"./useCheckoutContext-BXtGY5u3.js";const H=({label:d,value:t,onChange:T,onBlur:p,onFocus:m,type:v="text",placeholder:h,icon:f,prefix:u,inputClass:w="",error:q,schema:n,validateOnChange:g=!1,validateOnBlur:I=!0,onValidationChange:l,...M})=>{const[F,b]=o.useState(!1),[N,L]=o.useState(null),c=q||N,s=o.useCallback(e=>{var i;if(!n)return null;try{return n.parse(e),null}catch(x){return x instanceof j&&((i=x.issues[0])==null?void 0:i.message)||"Validation failed"}},[n]),a=o.useCallback(e=>{L(e),l&&l(e)},[l]),y=R.useRef(t),E=R.useRef(!1);return o.useEffect(()=>{if(n){if(g){const e=s(t);a(e);return}if(E.current){if(t!==y.current&&t){const e=s(t);a(e)}}else{if(t){const e=s(t);a(e)}E.current=!0}y.current=t}},[t,n,g,s,a]),r.jsxs("div",{className:"relative w-full",children:[r.jsx("label",{className:`text-sm text-[#2A2B35] bg-white px-1 pointer-events-none
|
|
2
|
+
transition-all duration-200 z-10`,children:d}),r.jsxs("div",{className:"relative flex items-center",children:[u&&r.jsx("div",{className:"absolute left-0 top-0 bottom-0 z-10 flex items-center",children:u}),r.jsx("input",{type:v,value:t,onFocus:e=>{b(!0),m&&m(e)},onBlur:e=>{if(b(!1),n&&I){const i=s(t);a(i)}p&&p(e)},onChange:T,placeholder:F?"":h||d,className:`w-full border border-solid border-[#e6e6e6] shadow-sm rounded-md p-[0.64rem] ${u?"pl-20":"pl-3"} text-base bg-white placeholder-custom transition pr-12 appearance-none outline-none font-[inherit] ${c?"!border-2 !border-[#df1b41] focus:!border-[#df1b41] !text-[#df1b41] focus:!ring-0 focus:!outline-none":"border-[#e6e6e6] focus:border-[#8AA3D4] focus:shadow-focus focus:!outline-none"} ${w}`,...M}),f&&r.jsx("span",{className:"absolute right-3 top-0 bottom-0 flex items-center text-black",children:f})]}),c&&r.jsx("p",{className:"mt-1 text-sm text-[#df1b41] px-2",children:c})]})};H.__docgenInfo={description:"",methods:[],displayName:"FloatingLabelInput",props:{label:{required:!0,tsType:{name:"string"},description:""},value:{required:!0,tsType:{name:"string"},description:""},onChange:{required:!0,tsType:{name:"signature",type:"function",raw:"(e: React.ChangeEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ReactChangeEvent",raw:"React.ChangeEvent<HTMLInputElement>",elements:[{name:"HTMLInputElement"}]},name:"e"}],return:{name:"void"}}},description:""},onBlur:{required:!1,tsType:{name:"signature",type:"function",raw:"(e: React.FocusEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ReactFocusEvent",raw:"React.FocusEvent<HTMLInputElement>",elements:[{name:"HTMLInputElement"}]},name:"e"}],return:{name:"void"}}},description:""},onFocus:{required:!1,tsType:{name:"signature",type:"function",raw:"(e: React.FocusEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ReactFocusEvent",raw:"React.FocusEvent<HTMLInputElement>",elements:[{name:"HTMLInputElement"}]},name:"e"}],return:{name:"void"}}},description:""},type:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:'"text"',computed:!1}},placeholder:{required:!1,tsType:{name:"string"},description:""},icon:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},prefix:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},inputClass:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:'""',computed:!1}},error:{required:!1,tsType:{name:"string"},description:""},schema:{required:!1,tsType:{name:"z.ZodSchema",elements:[{name:"string"}],raw:"z.ZodSchema<string>"},description:""},validateOnChange:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},validateOnBlur:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"true",computed:!1}},onValidationChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(error: string | null) => void",signature:{arguments:[{type:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},name:"error"}],return:{name:"void"}}},description:""}},composes:["Omit"]};export{H as F};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j as r}from"./jsx-runtime-DiklIkkE.js";import{r as o,R}from"./index-DRjF_FHU.js";import{Z as j}from"./useCheckoutContext-L3zhltsm.js";const H=({label:d,value:t,onChange:T,onBlur:p,onFocus:m,type:v="text",placeholder:h,icon:f,prefix:u,inputClass:w="",error:q,schema:n,validateOnChange:g=!1,validateOnBlur:I=!0,onValidationChange:l,...M})=>{const[F,b]=o.useState(!1),[N,L]=o.useState(null),c=q||N,s=o.useCallback(e=>{var i;if(!n)return null;try{return n.parse(e),null}catch(x){return x instanceof j&&((i=x.issues[0])==null?void 0:i.message)||"Validation failed"}},[n]),a=o.useCallback(e=>{L(e),l&&l(e)},[l]),y=R.useRef(t),E=R.useRef(!1);return o.useEffect(()=>{if(n){if(g){const e=s(t);a(e);return}if(E.current){if(t!==y.current&&t){const e=s(t);a(e)}}else{if(t){const e=s(t);a(e)}E.current=!0}y.current=t}},[t,n,g,s,a]),r.jsxs("div",{className:"relative w-full",children:[r.jsx("label",{className:`text-sm text-[#2A2B35] bg-white px-1 pointer-events-none
|
|
2
|
+
transition-all duration-200 z-10`,children:d}),r.jsxs("div",{className:"relative flex items-center",children:[u&&r.jsx("div",{className:"absolute left-0 top-0 bottom-0 z-10 flex items-center",children:u}),r.jsx("input",{type:v,value:t,onFocus:e=>{b(!0),m&&m(e)},onBlur:e=>{if(b(!1),n&&I){const i=s(t);a(i)}p&&p(e)},onChange:T,placeholder:F?"":h||d,className:`w-full border border-solid border-[#e6e6e6] shadow-sm rounded-md p-[0.64rem] ${u?"pl-20":"pl-3"} text-base bg-white placeholder-custom transition pr-12 appearance-none outline-none font-[inherit] ${c?"!border-2 !border-[#df1b41] focus:!border-[#df1b41] !text-[#df1b41] focus:!ring-0 focus:!outline-none":"border-[#e6e6e6] focus:border-[#8AA3D4] focus:shadow-focus focus:!outline-none"} ${w}`,...M}),f&&r.jsx("span",{className:"absolute right-3 top-0 bottom-0 flex items-center text-black",children:f})]}),c&&r.jsx("p",{className:"mt-1 text-sm text-[#df1b41] px-2",children:c})]})};H.__docgenInfo={description:"",methods:[],displayName:"FloatingLabelInput",props:{label:{required:!0,tsType:{name:"string"},description:""},value:{required:!0,tsType:{name:"string"},description:""},onChange:{required:!0,tsType:{name:"signature",type:"function",raw:"(e: React.ChangeEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ReactChangeEvent",raw:"React.ChangeEvent<HTMLInputElement>",elements:[{name:"HTMLInputElement"}]},name:"e"}],return:{name:"void"}}},description:""},onBlur:{required:!1,tsType:{name:"signature",type:"function",raw:"(e: React.FocusEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ReactFocusEvent",raw:"React.FocusEvent<HTMLInputElement>",elements:[{name:"HTMLInputElement"}]},name:"e"}],return:{name:"void"}}},description:""},onFocus:{required:!1,tsType:{name:"signature",type:"function",raw:"(e: React.FocusEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ReactFocusEvent",raw:"React.FocusEvent<HTMLInputElement>",elements:[{name:"HTMLInputElement"}]},name:"e"}],return:{name:"void"}}},description:""},type:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:'"text"',computed:!1}},placeholder:{required:!1,tsType:{name:"string"},description:""},icon:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},prefix:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},inputClass:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:'""',computed:!1}},error:{required:!1,tsType:{name:"string"},description:""},schema:{required:!1,tsType:{name:"z.ZodSchema",elements:[{name:"string"}],raw:"z.ZodSchema<string>"},description:""},validateOnChange:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},validateOnBlur:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"true",computed:!1}},onValidationChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(error: string | null) => void",signature:{arguments:[{type:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},name:"error"}],return:{name:"void"}}},description:""}},composes:["Omit"]};export{H as F};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j as r}from"./jsx-runtime-DiklIkkE.js";import{r as o,R}from"./index-DRjF_FHU.js";import{Z as j}from"./useCheckoutContext-C6u4Rp5U.js";const H=({label:d,value:t,onChange:T,onBlur:p,onFocus:m,type:v="text",placeholder:h,icon:f,prefix:u,inputClass:w="",error:q,schema:n,validateOnChange:g=!1,validateOnBlur:I=!0,onValidationChange:l,...M})=>{const[F,b]=o.useState(!1),[N,L]=o.useState(null),c=q||N,s=o.useCallback(e=>{var i;if(!n)return null;try{return n.parse(e),null}catch(x){return x instanceof j&&((i=x.issues[0])==null?void 0:i.message)||"Validation failed"}},[n]),a=o.useCallback(e=>{L(e),l&&l(e)},[l]),y=R.useRef(t),E=R.useRef(!1);return o.useEffect(()=>{if(n){if(g){const e=s(t);a(e);return}if(E.current){if(t!==y.current&&t){const e=s(t);a(e)}}else{if(t){const e=s(t);a(e)}E.current=!0}y.current=t}},[t,n,g,s,a]),r.jsxs("div",{className:"relative w-full",children:[r.jsx("label",{className:`text-sm text-[#2A2B35] bg-white px-1 pointer-events-none
|
|
2
|
+
transition-all duration-200 z-10`,children:d}),r.jsxs("div",{className:"relative flex items-center",children:[u&&r.jsx("div",{className:"absolute left-0 top-0 bottom-0 z-10 flex items-center",children:u}),r.jsx("input",{type:v,value:t,onFocus:e=>{b(!0),m&&m(e)},onBlur:e=>{if(b(!1),n&&I){const i=s(t);a(i)}p&&p(e)},onChange:T,placeholder:F?"":h||d,className:`w-full border border-solid border-[#e6e6e6] shadow-sm rounded-md p-[0.64rem] ${u?"pl-20":"pl-3"} text-base bg-white placeholder-custom transition pr-12 appearance-none outline-none font-[inherit] ${c?"!border-2 !border-[#df1b41] focus:!border-[#df1b41] !text-[#df1b41] focus:!ring-0 focus:!outline-none":"border-[#e6e6e6] focus:border-[#8AA3D4] focus:shadow-focus focus:!outline-none"} ${w}`,...M}),f&&r.jsx("span",{className:"absolute right-3 top-0 bottom-0 flex items-center text-black",children:f})]}),c&&r.jsx("p",{className:"mt-1 text-sm text-[#df1b41] px-2",children:c})]})};H.__docgenInfo={description:"",methods:[],displayName:"FloatingLabelInput",props:{label:{required:!0,tsType:{name:"string"},description:""},value:{required:!0,tsType:{name:"string"},description:""},onChange:{required:!0,tsType:{name:"signature",type:"function",raw:"(e: React.ChangeEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ReactChangeEvent",raw:"React.ChangeEvent<HTMLInputElement>",elements:[{name:"HTMLInputElement"}]},name:"e"}],return:{name:"void"}}},description:""},onBlur:{required:!1,tsType:{name:"signature",type:"function",raw:"(e: React.FocusEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ReactFocusEvent",raw:"React.FocusEvent<HTMLInputElement>",elements:[{name:"HTMLInputElement"}]},name:"e"}],return:{name:"void"}}},description:""},onFocus:{required:!1,tsType:{name:"signature",type:"function",raw:"(e: React.FocusEvent<HTMLInputElement>) => void",signature:{arguments:[{type:{name:"ReactFocusEvent",raw:"React.FocusEvent<HTMLInputElement>",elements:[{name:"HTMLInputElement"}]},name:"e"}],return:{name:"void"}}},description:""},type:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:'"text"',computed:!1}},placeholder:{required:!1,tsType:{name:"string"},description:""},icon:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},prefix:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},inputClass:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:'""',computed:!1}},error:{required:!1,tsType:{name:"string"},description:""},schema:{required:!1,tsType:{name:"z.ZodSchema",elements:[{name:"string"}],raw:"z.ZodSchema<string>"},description:""},validateOnChange:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},validateOnBlur:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"true",computed:!1}},onValidationChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(error: string | null) => void",signature:{arguments:[{type:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},name:"error"}],return:{name:"void"}}},description:""}},composes:["Omit"]};export{H as F};
|