paymob-pixel-alpha 1.1.77 → 1.1.79
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/assets/icons/card.tsx +15 -0
- package/assets/icons/installments.tsx +15 -0
- package/main.js +77 -33
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SVGProps } from "react"
|
|
2
|
+
export const CardIcon = (props: SVGProps<SVGSVGElement>) => (
|
|
3
|
+
<svg
|
|
4
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+
width={24}
|
|
6
|
+
height={24}
|
|
7
|
+
fill="none"
|
|
8
|
+
{...props}
|
|
9
|
+
>
|
|
10
|
+
<path
|
|
11
|
+
fill='currentColor'
|
|
12
|
+
d="M7.781 14.813c.457 0 .844.386.844.843a.833.833 0 0 1-.844.844H6.094c-.492 0-.844-.352-.844-.844 0-.457.352-.844.844-.844H7.78Zm6.75 0c.457 0 .844.386.844.843a.833.833 0 0 1-.844.844h-3.937c-.492 0-.844-.352-.844-.844 0-.457.352-.844.844-.844h3.937Zm5.344-10.688c1.23 0 2.25 1.02 2.25 2.25v11.25c0 1.266-1.02 2.25-2.25 2.25H4.125a2.221 2.221 0 0 1-2.25-2.25V6.375c0-1.23.984-2.25 2.25-2.25h15.75Zm0 1.688H4.125a.578.578 0 0 0-.563.562V7.5h16.875V6.375c0-.281-.28-.563-.562-.563Zm.563 5.062H3.563v6.75c0 .316.246.563.562.563h15.75a.578.578 0 0 0 .563-.563v-6.75Z"
|
|
13
|
+
/>
|
|
14
|
+
</svg>
|
|
15
|
+
)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
export const InstallmentsIcon = (props: React.SVGProps<SVGSVGElement>) => (
|
|
3
|
+
<svg
|
|
4
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+
width={24}
|
|
6
|
+
height={24}
|
|
7
|
+
fill="none"
|
|
8
|
+
{...props}
|
|
9
|
+
>
|
|
10
|
+
<path
|
|
11
|
+
fill='currentColor'
|
|
12
|
+
d="M21.117 7.522c.387.211.633.598.633 1.02 0 .668-.563 1.195-1.23 1.195H4.945A1.185 1.185 0 0 1 3.75 8.542c0-.422.21-.809.598-1.02l7.98-4.43c.246-.105.563-.105.809 0l7.98 4.43Zm-9.492-.035c0-.597.492-1.125 1.125-1.125.598 0 1.125.528 1.125 1.125 0 .211-.07.422-.176.563h4.922L12.75 4.815 6.844 8.05h4.922c-.106-.14-.141-.352-.141-.563ZM6 10.862h1.688v5.625h2.25v-5.625h1.687v5.625h2.25v-5.625h1.688v5.625h2.25v-5.625H19.5v5.625h.281c.457 0 .844.387.844.844a.833.833 0 0 1-.844.844H6c-.492 0-.844-.352-.844-.844 0-.457.352-.844.844-.844v-5.625ZM20.906 19.3c.457 0 .844.386.844.844a.833.833 0 0 1-.844.843H4.875c-.492 0-.844-.351-.844-.843 0-.457.352-.844.844-.844h16.031Z"
|
|
13
|
+
/>
|
|
14
|
+
</svg>
|
|
15
|
+
)
|
package/main.js
CHANGED
|
@@ -23794,36 +23794,40 @@ function BankSelectionStep(props) {
|
|
|
23794
23794
|
className: BankSelectionStep_bank_selection_module['payment-input-container'],
|
|
23795
23795
|
children: loading ? /*#__PURE__*/(0,jsx_runtime.jsx)(dist_Skeleton, {
|
|
23796
23796
|
height: 45
|
|
23797
|
-
}) : /*#__PURE__*/(0,jsx_runtime.
|
|
23798
|
-
|
|
23799
|
-
|
|
23800
|
-
children:
|
|
23801
|
-
|
|
23802
|
-
|
|
23803
|
-
|
|
23804
|
-
|
|
23805
|
-
|
|
23806
|
-
|
|
23807
|
-
|
|
23808
|
-
|
|
23809
|
-
|
|
23810
|
-
|
|
23811
|
-
|
|
23812
|
-
|
|
23813
|
-
|
|
23814
|
-
|
|
23815
|
-
|
|
23816
|
-
|
|
23817
|
-
|
|
23818
|
-
|
|
23819
|
-
|
|
23820
|
-
|
|
23821
|
-
|
|
23822
|
-
|
|
23823
|
-
|
|
23824
|
-
|
|
23825
|
-
|
|
23826
|
-
|
|
23797
|
+
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("dialog", {
|
|
23798
|
+
open: true,
|
|
23799
|
+
className: "static w-full",
|
|
23800
|
+
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(Dropdown_Dropdown, {
|
|
23801
|
+
label: "Bank",
|
|
23802
|
+
width: "full",
|
|
23803
|
+
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(DropdownButton, {
|
|
23804
|
+
placeholder: "Select your bank",
|
|
23805
|
+
text: (_selectedBankOption$v = selectedBankOption == null ? void 0 : selectedBankOption.value) != null ? _selectedBankOption$v : '',
|
|
23806
|
+
leadingIcon: selectedBankOption && selectedBankOption.icon ? /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
23807
|
+
className: `${BankSelectionStep_bank_selection_module['bank-logo']} h-full rounded-full`,
|
|
23808
|
+
src: selectedBankOption.icon
|
|
23809
|
+
}) : undefined,
|
|
23810
|
+
onClearHandler: handleClearSelectedBank,
|
|
23811
|
+
disabled: disabled
|
|
23812
|
+
}), /*#__PURE__*/(0,jsx_runtime.jsx)(DropdownMenu, {
|
|
23813
|
+
verticalPlacement: "auto",
|
|
23814
|
+
children: dropdownOptions.map(option => /*#__PURE__*/(0,jsx_runtime.jsx)(DropdownMenuItem, {
|
|
23815
|
+
text: option.label,
|
|
23816
|
+
selected: (selectedBank == null ? void 0 : selectedBank.value) === option.value,
|
|
23817
|
+
onClickHandler: () => handleSelectBank(option),
|
|
23818
|
+
render: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
23819
|
+
className: "flex items-center gap-2",
|
|
23820
|
+
children: [option.icon && /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
23821
|
+
className: `${BankSelectionStep_bank_selection_module['bank-logo']} h-6 w-auto`,
|
|
23822
|
+
src: option.icon
|
|
23823
|
+
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
23824
|
+
className: "text-[#101828] font-medium text-sm",
|
|
23825
|
+
children: option.label
|
|
23826
|
+
})]
|
|
23827
|
+
})
|
|
23828
|
+
}, option.value))
|
|
23829
|
+
})]
|
|
23830
|
+
})
|
|
23827
23831
|
})
|
|
23828
23832
|
}), !showMinInstallmentAmountError && selectedBank && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
23829
23833
|
className: "w-full flex mt-4 flex-col gap-2",
|
|
@@ -38227,13 +38231,13 @@ const TabElement = ({
|
|
|
38227
38231
|
const isSelected = selectedPaymentMethodType === type;
|
|
38228
38232
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
38229
38233
|
onClick: () => setSelectedPayment(paymentMethod),
|
|
38230
|
-
className: classNames('text-gray-500 font-semibold text-sm flex flex-col items-start gap-
|
|
38234
|
+
className: classNames('text-gray-500 font-semibold text-sm flex flex-col items-start gap-3 border p-3 relative rounded-xl transition-all duration-300 cursor-pointer text-start flex-1', 'w-full sm:w-1/3 md:w-1/4 lg:w-1/6', isSelected ? 'text-blue-500 border-blue-500' : 'border-gray-200'),
|
|
38231
38235
|
style: customStyle != null && (_customStyle$button = customStyle.button) != null && _customStyle$button.borderColor && isSelected ? {
|
|
38232
38236
|
borderColor: customStyle.button.borderColor,
|
|
38233
38237
|
borderRadius: customStyle.tabs.borderRadius
|
|
38234
38238
|
} : {},
|
|
38235
38239
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("i", {
|
|
38236
|
-
className: classNames('w-
|
|
38240
|
+
className: classNames('w-6 h-6 self-start', isSelected ? 'text-blue-500' : 'text-gray-500'),
|
|
38237
38241
|
children: [typeof icon === 'string' && /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
38238
38242
|
className: "w-10 h-8 rounded-[6px] border border-[#EAECF0] bg-center bg-cover bg-no-repeat",
|
|
38239
38243
|
src: icon,
|
|
@@ -38601,6 +38605,33 @@ const getPaymentLogo = (type, externalIcon) => {
|
|
|
38601
38605
|
return aani_namespaceObject;
|
|
38602
38606
|
}
|
|
38603
38607
|
};
|
|
38608
|
+
;// ./src/assets/icons/card.tsx
|
|
38609
|
+
|
|
38610
|
+
const CardIcon = props => /*#__PURE__*/(0,jsx_runtime.jsx)("svg", Object.assign({
|
|
38611
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
38612
|
+
width: 24,
|
|
38613
|
+
height: 24,
|
|
38614
|
+
fill: "none"
|
|
38615
|
+
}, props, {
|
|
38616
|
+
children: /*#__PURE__*/(0,jsx_runtime.jsx)("path", {
|
|
38617
|
+
fill: "currentColor",
|
|
38618
|
+
d: "M7.781 14.813c.457 0 .844.386.844.843a.833.833 0 0 1-.844.844H6.094c-.492 0-.844-.352-.844-.844 0-.457.352-.844.844-.844H7.78Zm6.75 0c.457 0 .844.386.844.843a.833.833 0 0 1-.844.844h-3.937c-.492 0-.844-.352-.844-.844 0-.457.352-.844.844-.844h3.937Zm5.344-10.688c1.23 0 2.25 1.02 2.25 2.25v11.25c0 1.266-1.02 2.25-2.25 2.25H4.125a2.221 2.221 0 0 1-2.25-2.25V6.375c0-1.23.984-2.25 2.25-2.25h15.75Zm0 1.688H4.125a.578.578 0 0 0-.563.562V7.5h16.875V6.375c0-.281-.28-.563-.562-.563Zm.563 5.062H3.563v6.75c0 .316.246.563.562.563h15.75a.578.578 0 0 0 .563-.563v-6.75Z"
|
|
38619
|
+
})
|
|
38620
|
+
}));
|
|
38621
|
+
;// ./src/assets/icons/installments.tsx
|
|
38622
|
+
|
|
38623
|
+
|
|
38624
|
+
const InstallmentsIcon = props => /*#__PURE__*/(0,jsx_runtime.jsx)("svg", Object.assign({
|
|
38625
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
38626
|
+
width: 24,
|
|
38627
|
+
height: 24,
|
|
38628
|
+
fill: "none"
|
|
38629
|
+
}, props, {
|
|
38630
|
+
children: /*#__PURE__*/(0,jsx_runtime.jsx)("path", {
|
|
38631
|
+
fill: "currentColor",
|
|
38632
|
+
d: "M21.117 7.522c.387.211.633.598.633 1.02 0 .668-.563 1.195-1.23 1.195H4.945A1.185 1.185 0 0 1 3.75 8.542c0-.422.21-.809.598-1.02l7.98-4.43c.246-.105.563-.105.809 0l7.98 4.43Zm-9.492-.035c0-.597.492-1.125 1.125-1.125.598 0 1.125.528 1.125 1.125 0 .211-.07.422-.176.563h4.922L12.75 4.815 6.844 8.05h4.922c-.106-.14-.141-.352-.141-.563ZM6 10.862h1.688v5.625h2.25v-5.625h1.687v5.625h2.25v-5.625h1.688v5.625h2.25v-5.625H19.5v5.625h.281c.457 0 .844.387.844.844a.833.833 0 0 1-.844.844H6c-.492 0-.844-.352-.844-.844 0-.457.352-.844.844-.844v-5.625ZM20.906 19.3c.457 0 .844.386.844.844a.833.833 0 0 1-.844.843H4.875c-.492 0-.844-.351-.844-.843 0-.457.352-.844.844-.844h16.031Z"
|
|
38633
|
+
})
|
|
38634
|
+
}));
|
|
38604
38635
|
;// ./src/components/Payments/List/TabView.tsx
|
|
38605
38636
|
|
|
38606
38637
|
const TabView_excluded = ["paymentMethods"];
|
|
@@ -38609,6 +38640,8 @@ const TabView_excluded = ["paymentMethods"];
|
|
|
38609
38640
|
|
|
38610
38641
|
|
|
38611
38642
|
|
|
38643
|
+
|
|
38644
|
+
|
|
38612
38645
|
function TabView(props) {
|
|
38613
38646
|
var _restProps$customStyl;
|
|
38614
38647
|
const {
|
|
@@ -38625,6 +38658,17 @@ function TabView(props) {
|
|
|
38625
38658
|
if (!(paymentMethods != null && paymentMethods.length) || !selectedPaymentMethod) {
|
|
38626
38659
|
return null;
|
|
38627
38660
|
}
|
|
38661
|
+
function getPaymentMethodLogo(paymentMethodType) {
|
|
38662
|
+
if (paymentMethodType === 'card') {
|
|
38663
|
+
return /*#__PURE__*/(0,jsx_runtime.jsx)(CardIcon, {
|
|
38664
|
+
className: "w-full h-full"
|
|
38665
|
+
});
|
|
38666
|
+
} else if (paymentMethodType === 'card-installment') {
|
|
38667
|
+
return /*#__PURE__*/(0,jsx_runtime.jsx)(InstallmentsIcon, {});
|
|
38668
|
+
} else {
|
|
38669
|
+
return getPaymentLogo(paymentMethodType);
|
|
38670
|
+
}
|
|
38671
|
+
}
|
|
38628
38672
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
38629
38673
|
className: "flex flex-col flex-grow",
|
|
38630
38674
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
@@ -38635,7 +38679,7 @@ function TabView(props) {
|
|
|
38635
38679
|
children: paymentMethods.map(paymentMethod => /*#__PURE__*/(0,jsx_runtime.jsx)(TabElement, {
|
|
38636
38680
|
selectedPaymentMethodType: selectedPaymentMethod.type,
|
|
38637
38681
|
paymentMethod: paymentMethod,
|
|
38638
|
-
icon:
|
|
38682
|
+
icon: getPaymentMethodLogo(paymentMethod.type),
|
|
38639
38683
|
setSelectedPayment: selected => {
|
|
38640
38684
|
setSelectedPaymentMethod(Object.assign({}, selected, {
|
|
38641
38685
|
userSelected: true
|