paymob-pixel-alpha 1.1.77 → 1.1.78

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.
@@ -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
@@ -38227,13 +38227,13 @@ const TabElement = ({
38227
38227
  const isSelected = selectedPaymentMethodType === type;
38228
38228
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
38229
38229
  onClick: () => setSelectedPayment(paymentMethod),
38230
- className: classNames('text-gray-500 font-semibold text-sm flex flex-col items-start gap-2 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'),
38230
+ 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
38231
  style: customStyle != null && (_customStyle$button = customStyle.button) != null && _customStyle$button.borderColor && isSelected ? {
38232
38232
  borderColor: customStyle.button.borderColor,
38233
38233
  borderRadius: customStyle.tabs.borderRadius
38234
38234
  } : {},
38235
38235
  children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("i", {
38236
- className: classNames('w-10 h-10 self-start', isSelected ? 'text-blue-500' : 'text-gray-500'),
38236
+ className: classNames('w-6 h-6 self-start', isSelected ? 'text-blue-500' : 'text-gray-500'),
38237
38237
  children: [typeof icon === 'string' && /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
38238
38238
  className: "w-10 h-8 rounded-[6px] border border-[#EAECF0] bg-center bg-cover bg-no-repeat",
38239
38239
  src: icon,
@@ -38601,6 +38601,33 @@ const getPaymentLogo = (type, externalIcon) => {
38601
38601
  return aani_namespaceObject;
38602
38602
  }
38603
38603
  };
38604
+ ;// ./src/assets/icons/card.tsx
38605
+
38606
+ const CardIcon = props => /*#__PURE__*/(0,jsx_runtime.jsx)("svg", Object.assign({
38607
+ xmlns: "http://www.w3.org/2000/svg",
38608
+ width: 24,
38609
+ height: 24,
38610
+ fill: "none"
38611
+ }, props, {
38612
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)("path", {
38613
+ fill: "currentColor",
38614
+ 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"
38615
+ })
38616
+ }));
38617
+ ;// ./src/assets/icons/installments.tsx
38618
+
38619
+
38620
+ const InstallmentsIcon = props => /*#__PURE__*/(0,jsx_runtime.jsx)("svg", Object.assign({
38621
+ xmlns: "http://www.w3.org/2000/svg",
38622
+ width: 24,
38623
+ height: 24,
38624
+ fill: "none"
38625
+ }, props, {
38626
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)("path", {
38627
+ fill: "currentColor",
38628
+ 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"
38629
+ })
38630
+ }));
38604
38631
  ;// ./src/components/Payments/List/TabView.tsx
38605
38632
 
38606
38633
  const TabView_excluded = ["paymentMethods"];
@@ -38609,6 +38636,8 @@ const TabView_excluded = ["paymentMethods"];
38609
38636
 
38610
38637
 
38611
38638
 
38639
+
38640
+
38612
38641
  function TabView(props) {
38613
38642
  var _restProps$customStyl;
38614
38643
  const {
@@ -38625,6 +38654,17 @@ function TabView(props) {
38625
38654
  if (!(paymentMethods != null && paymentMethods.length) || !selectedPaymentMethod) {
38626
38655
  return null;
38627
38656
  }
38657
+ function getPaymentMethodLogo(paymentMethodType) {
38658
+ if (paymentMethodType === 'card') {
38659
+ return /*#__PURE__*/(0,jsx_runtime.jsx)(CardIcon, {
38660
+ className: "w-full h-full"
38661
+ });
38662
+ } else if (paymentMethodType === 'card-installment') {
38663
+ return /*#__PURE__*/(0,jsx_runtime.jsx)(InstallmentsIcon, {});
38664
+ } else {
38665
+ return getPaymentLogo(paymentMethodType);
38666
+ }
38667
+ }
38628
38668
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
38629
38669
  className: "flex flex-col flex-grow",
38630
38670
  children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
@@ -38635,7 +38675,7 @@ function TabView(props) {
38635
38675
  children: paymentMethods.map(paymentMethod => /*#__PURE__*/(0,jsx_runtime.jsx)(TabElement, {
38636
38676
  selectedPaymentMethodType: selectedPaymentMethod.type,
38637
38677
  paymentMethod: paymentMethod,
38638
- icon: getPaymentLogo(paymentMethod.type),
38678
+ icon: getPaymentMethodLogo(paymentMethod.type),
38639
38679
  setSelectedPayment: selected => {
38640
38680
  setSelectedPaymentMethod(Object.assign({}, selected, {
38641
38681
  userSelected: true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "paymob-pixel-alpha",
3
- "version": "1.1.77",
3
+ "version": "1.1.78",
4
4
  "keywords": ["paymob","pixel","paymob-pixel"],
5
5
  "main": "./main.js",
6
6
  "license": "MIT",