@weareconceptstudio/account 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/dist/components/AccountButton/style.js +2 -1
  2. package/dist/components/TotalCheckout/AddNewCard/index.d.ts +6 -0
  3. package/dist/components/TotalCheckout/AddNewCard/index.js +11 -0
  4. package/dist/components/TotalCheckout/AddNewCard/style.d.ts +2 -0
  5. package/dist/components/TotalCheckout/AddNewCard/style.js +90 -0
  6. package/dist/components/TotalCheckout/CardComp/index.d.ts +9 -0
  7. package/dist/components/TotalCheckout/CardComp/index.js +36 -0
  8. package/dist/components/TotalCheckout/CardComp/style.d.ts +2 -0
  9. package/dist/components/TotalCheckout/CardComp/style.js +203 -0
  10. package/dist/components/TotalCheckout/CommentComp/index.d.ts +3 -0
  11. package/dist/components/TotalCheckout/CommentComp/index.js +15 -0
  12. package/dist/components/TotalCheckout/CommentComp/style.d.ts +2 -0
  13. package/dist/components/TotalCheckout/CommentComp/style.js +33 -0
  14. package/dist/components/TotalCheckout/FreeShippingComp/index.d.ts +2 -2
  15. package/dist/components/TotalCheckout/FreeShippingComp/index.js +3 -4
  16. package/dist/components/TotalCheckout/FreeShippingComp/style.js +1 -1
  17. package/dist/components/TotalCheckout/MuramoneyComp/index.d.ts +9 -0
  18. package/dist/components/TotalCheckout/MuramoneyComp/index.js +32 -0
  19. package/dist/components/TotalCheckout/MuramoneyComp/style.d.ts +2 -0
  20. package/dist/components/TotalCheckout/MuramoneyComp/style.js +117 -0
  21. package/dist/components/TotalCheckout/MuramoneyComp/utils.d.ts +10 -0
  22. package/dist/components/TotalCheckout/MuramoneyComp/utils.js +14 -0
  23. package/dist/components/TotalCheckout/PaymentComp/index.d.ts +9 -0
  24. package/dist/components/TotalCheckout/PaymentComp/index.js +14 -0
  25. package/dist/components/TotalCheckout/PaymentComp/style.d.ts +2 -0
  26. package/dist/components/TotalCheckout/PaymentComp/style.js +50 -0
  27. package/dist/components/TotalCheckout/PaymentMethodsComp/index.d.ts +8 -0
  28. package/dist/components/TotalCheckout/PaymentMethodsComp/index.js +82 -0
  29. package/dist/components/TotalCheckout/PaymentMethodsComp/style.d.ts +2 -0
  30. package/dist/components/TotalCheckout/PaymentMethodsComp/style.js +162 -0
  31. package/dist/components/TotalCheckout/PromoCodeComp/index.d.ts +2 -1
  32. package/dist/components/TotalCheckout/PromoCodeComp/index.js +18 -15
  33. package/dist/components/TotalCheckout/PromoCodeComp/style.js +4 -11
  34. package/dist/components/TotalCheckout/SelectPaymentMethodPopup/index.d.ts +3 -0
  35. package/dist/components/TotalCheckout/SelectPaymentMethodPopup/index.js +65 -0
  36. package/dist/components/TotalCheckout/SelectPaymentMethodPopup/style.d.ts +2 -0
  37. package/dist/components/TotalCheckout/SelectPaymentMethodPopup/style.js +153 -0
  38. package/dist/components/TotalCheckout/index.js +26 -45
  39. package/dist/components/TotalCheckout/style.js +119 -17
  40. package/dist/modules/account/AccountBalanceTemplate/HeroBalance/ProgressBalance/ProgressComponent/index.js +0 -1
  41. package/dist/modules/account/AccountBalanceTemplate/HeroBalance/ProgressBalance/index.js +1 -3
  42. package/dist/modules/account/AccountBalanceTemplate/HeroBalance/index.js +1 -3
  43. package/dist/modules/account/AccountBalanceTemplate/StatusBalance/ItemStatus/index.js +1 -3
  44. package/dist/modules/address/SelectAddressPopup/index.js +38 -5
  45. package/dist/modules/address/SelectAddressPopup/style.js +6 -0
  46. package/dist/modules/cart/CartTemplate/index.js +2 -2
  47. package/dist/modules/cart/EmptyCart/icons.d.ts +2 -0
  48. package/dist/modules/cart/EmptyCart/icons.js +10 -0
  49. package/dist/modules/cart/EmptyCart/index.js +3 -1
  50. package/dist/modules/cart/EmptyCart/style.js +40 -0
  51. package/dist/modules/cart/SimpleItems/Item/index.js +1 -2
  52. package/dist/modules/cart/SimpleItems/ItemMobile/index.js +1 -2
  53. package/dist/modules/checkout/CheckoutTemplate/StepReview/index.js +22 -1
  54. package/dist/modules/checkout/ThankYouTemplate/icons.js +16 -3
  55. package/dist/modules/checkout/ThankYouTemplate/style.js +8 -1
  56. package/dist/modules/index.d.ts +1 -0
  57. package/dist/modules/index.js +1 -0
  58. package/dist/modules/order/OrderDetails/index.js +3 -3
  59. package/dist/modules/order/OrderStatus/index.d.ts +6 -0
  60. package/dist/modules/order/OrderStatus/index.js +25 -0
  61. package/dist/modules/order/OrderedItems/index.js +1 -2
  62. package/dist/modules/order/OrdersList/OrderItem/index.js +4 -3
  63. package/dist/modules/order/OrdersList/index.js +4 -4
  64. package/dist/modules/payment/PaymentMethodsTemplate/index.d.ts +3 -0
  65. package/dist/modules/payment/PaymentMethodsTemplate/index.js +41 -0
  66. package/dist/modules/payment/PaymentMethodsTemplate/style.d.ts +2 -0
  67. package/dist/modules/payment/PaymentMethodsTemplate/style.js +53 -0
  68. package/dist/modules/payment/index.d.ts +1 -0
  69. package/dist/modules/payment/index.js +1 -0
  70. package/dist/styles/theme.js +1 -0
  71. package/dist/styles/variables.js +1 -0
  72. package/dist/translations/en.d.ts +12 -0
  73. package/dist/translations/en.js +14 -2
  74. package/dist/translations/hy.d.ts +12 -0
  75. package/dist/translations/hy.js +14 -2
  76. package/dist/translations/index.d.ts +36 -0
  77. package/dist/translations/ru.d.ts +12 -0
  78. package/dist/translations/ru.js +14 -2
  79. package/package.json +1 -1
  80. package/dist/utils/_functions.d.ts +0 -2
  81. package/dist/utils/_functions.js +0 -18
@@ -0,0 +1,14 @@
1
+ export const balanceFields = [
2
+ {
3
+ fieldType: 'input',
4
+ labelProps: {
5
+ // label: 'muramoneyCodeLabel',
6
+ name: 'balance',
7
+ // required: false,
8
+ errorKey: 'balance',
9
+ },
10
+ fieldProps: {
11
+ placeholder: 'balancePlaceholder',
12
+ },
13
+ },
14
+ ];
@@ -0,0 +1,9 @@
1
+ export default PaymentComp;
2
+ declare function PaymentComp({ title, onClick, className, fillCheckoutData, checkoutData }: {
3
+ title: any;
4
+ onClick: any;
5
+ className: any;
6
+ fillCheckoutData: any;
7
+ checkoutData: any;
8
+ }): React.JSX.Element;
9
+ import React from 'react';
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { Text } from '@weareconceptstudio/core';
3
+ import AccountButton from '../../AccountButton';
4
+ import PaymentMethodsComp from '../PaymentMethodsComp';
5
+ //* Style
6
+ import PaymentCompStyle from './style';
7
+ const PaymentComp = ({ title, onClick, className, fillCheckoutData, checkoutData }) => {
8
+ return (React.createElement(PaymentCompStyle, { className: `item-container ${className || ''}` },
9
+ React.createElement("div", { className: `change-payment-wrap` },
10
+ React.createElement(Text, { className: `account-p account-p2 account-font-bold account-primary-color1`, text: title }),
11
+ checkoutData.paymentType && (React.createElement(AccountButton, { text: `change`, btnType: `green-small-text`, onClick: onClick }))),
12
+ React.createElement(PaymentMethodsComp, { checkoutData: checkoutData, fillCheckoutData: fillCheckoutData, showAll: false })));
13
+ };
14
+ export default PaymentComp;
@@ -0,0 +1,2 @@
1
+ export default PaymentCompStyle;
2
+ declare const PaymentCompStyle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -0,0 +1,50 @@
1
+ import styled from 'styled-components';
2
+ const PaymentCompStyle = styled.div `
3
+ --account_checkoutMTop: var(--sp16x);
4
+ --account_changePaymentWrapMBot: var(--sp5x);
5
+
6
+ margin-top: var(--account_checkoutMTop);
7
+
8
+ .change-payment-wrap {
9
+ display: flex;
10
+ align-items: center;
11
+ justify-content: space-between;
12
+ margin-bottom: var(--account_changePaymentWrapMBot);
13
+ }
14
+
15
+ @media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXLMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeL}) {
16
+ --account_checkoutMTop: var(--sp11x);
17
+ --account_changePaymentWrapMBot: var(--sp4x);
18
+ }
19
+
20
+ @media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeLMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeM}) {
21
+ --account_checkoutMTop: var(--sp8x);
22
+ --account_changePaymentWrapMBot: var(--sp4x);
23
+ }
24
+
25
+ @media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeMMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeS}) {
26
+ --account_checkoutMTop: var(--sp8x);
27
+ --account_changePaymentWrapMBot: var(--sp3x);
28
+ }
29
+
30
+ @media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeSMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXS}) {
31
+ --account_checkoutMTop: var(--sp8x);
32
+ --account_changePaymentWrapMBot: var(--sp3x);
33
+ }
34
+
35
+ @media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXSMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_TabletSize}) {
36
+ --account_checkoutMTop: var(--sp8x);
37
+ --account_changePaymentWrapMBot: var(--sp3x);
38
+ }
39
+
40
+ @media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeS}) {
41
+ --account_checkoutMTop: var(--sp8x);
42
+ --account_changePaymentWrapMBot: var(--sp3x);
43
+ }
44
+
45
+ @media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeSMin}) {
46
+ --account_checkoutMTop: var(--sp10x);
47
+ --account_changePaymentWrapMBot: var(--sp2x);
48
+ }
49
+ `;
50
+ export default PaymentCompStyle;
@@ -0,0 +1,8 @@
1
+ export default PaymentMethodsComp;
2
+ declare function PaymentMethodsComp({ className, fillCheckoutData, checkoutData, showAll }: {
3
+ className: any;
4
+ fillCheckoutData: any;
5
+ checkoutData: any;
6
+ showAll: any;
7
+ }): React.JSX.Element;
8
+ import React from 'react';
@@ -0,0 +1,82 @@
1
+ import React, { useState } from 'react';
2
+ import { Text } from '@weareconceptstudio/core';
3
+ //* Style
4
+ import PaymentMethodsCompStyle from './style';
5
+ const PaymentMethodsComp = ({ className, fillCheckoutData, checkoutData, showAll }) => {
6
+ const paymentOptions = [
7
+ {
8
+ label: 'Cash',
9
+ value: 'cash_on_delivery',
10
+ svg: '/images/payment/cash.svg',
11
+ },
12
+ {
13
+ label: 'Card',
14
+ value: 'credit_card',
15
+ svg: '/images/payment/card.svg',
16
+ },
17
+ {
18
+ label: 'Idram',
19
+ value: 'idram',
20
+ svg: '/images/payment/idram.svg',
21
+ },
22
+ {
23
+ label: 'POS TERMINAL',
24
+ value: 'pos_terminal',
25
+ svg: '/images/payment/pos-terminal.svg',
26
+ },
27
+ {
28
+ label: 'Telcell',
29
+ value: 'telcell',
30
+ svg: '/images/payment/telcell.svg',
31
+ },
32
+ {
33
+ label: 'Inecopay',
34
+ value: 'inecopay',
35
+ svg: '/images/payment/inecopay.svg',
36
+ },
37
+ ];
38
+ const [selectedPayment, setSelectedPayment] = useState(checkoutData.paymentType || '');
39
+ const cardDetails = checkoutData.paymentType === 'credit_card'
40
+ ? {
41
+ type: 'MasterCard', // Or 'Visa', based on your logic
42
+ number: '**** **** **** 1234',
43
+ expDate: '12/24',
44
+ }
45
+ : null;
46
+ let filteredOptions;
47
+ if (showAll) {
48
+ filteredOptions = paymentOptions;
49
+ }
50
+ else if (checkoutData.paymentType) {
51
+ filteredOptions = paymentOptions.filter((option) => option.value === checkoutData.paymentType);
52
+ }
53
+ else {
54
+ filteredOptions = paymentOptions;
55
+ }
56
+ if (cardDetails && !showAll) {
57
+ filteredOptions = filteredOptions.map((option) => option.value === 'credit_card'
58
+ ? {
59
+ ...option,
60
+ label: React.createElement("span", { className: 'card-type' }, cardDetails.type),
61
+ }
62
+ : option);
63
+ }
64
+ const handleSelect = (value) => {
65
+ setSelectedPayment(value);
66
+ fillCheckoutData('paymentType', value);
67
+ };
68
+ return (React.createElement(PaymentMethodsCompStyle, { className: `payment-item-container ${className || ''}`, singlePayment: !!checkoutData.paymentType }, filteredOptions.map((option) => (React.createElement("div", { className: 'custom-payment-options', key: option.value },
69
+ React.createElement("div", { className: 'payment-option-top' },
70
+ React.createElement("div", { className: 'payment-item-left' },
71
+ React.createElement("img", { src: option.svg, alt: `${option.label} icon` }),
72
+ React.createElement(Text, { className: 'payment-label account-p account-p3 account-font-regular account-primary-color1' }, option.label)),
73
+ React.createElement("div", { key: option.value, className: `circle-selected-wrap cursor-pointer ${selectedPayment === option.value ? 'active' : ''}`, onClick: () => handleSelect(option.value) },
74
+ React.createElement("svg", { version: '1.1', viewBox: '0 0 32 32', xmlns: 'http://www.w3.org/2000/svg', className: `checkbox-icon ${selectedPayment === option.value ? 'selected' : 'note-selected'}` },
75
+ React.createElement("path", { d: 'M13.345 30.462c-1.062 0-1.859-0.531-2.39-1.328l-9.56-16.996c-0.797-1.328-0.266-2.921 1.062-3.718 1.328-0.531 2.921 0 3.718 1.328l7.436 13.012 12.481-20.183c0.797-1.328 2.39-1.593 3.718-0.797s1.593 2.39 0.797 3.718l-14.871 23.635c-0.531 0.797-1.328 1.328-2.39 1.328z' })))),
76
+ option.value === 'credit_card' && cardDetails && !showAll && (React.createElement("div", { className: 'card-details' },
77
+ React.createElement("span", { className: 'card-number' }, cardDetails.number),
78
+ React.createElement("span", { className: 'card-exp-date' },
79
+ "Exp. Date ",
80
+ cardDetails.expDate))))))));
81
+ };
82
+ export default PaymentMethodsComp;
@@ -0,0 +1,2 @@
1
+ export default PaymentMethodsCompStyle;
2
+ declare const PaymentMethodsCompStyle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -0,0 +1,162 @@
1
+ import styled from 'styled-components';
2
+ const PaymentMethodsCompStyle = styled.div `
3
+ --account_itemBorderRadius: var(--sp1-5x);
4
+ --account_itemInternalPadTB: var(--sp2x);
5
+ --account_itemInternalPadLR: var(--sp4x);
6
+ --account_flexWrapperMTop: var(--sp2x);
7
+ --account_itemDistance: var(--sp3x);
8
+ --account_circleSize: var(--sp4x);
9
+ --account_checkSize: var(--sp2x);
10
+
11
+ display: flex;
12
+ flex-wrap: wrap;
13
+ row-gap: var(--account_flexWrapperMTop);
14
+ column-gap: var(--account_itemDistance);
15
+
16
+ .custom-payment-options {
17
+ width: ${(props) => (props.singlePayment ? '100%' : 'calc(50% - var(--account_itemDistance) / 2)')};
18
+ border: 2px solid var(--account_primaryColor5);
19
+ border-radius: var(--account_itemBorderRadius);
20
+ padding: var(--account_itemInternalPadTB) var(--account_itemInternalPadLR);
21
+ padding-left: calc(var(--account_itemInternalPadLR) - 4px);
22
+
23
+ .payment-option-top {
24
+ display: flex;
25
+ justify-content: space-between;
26
+ align-items: center;
27
+
28
+ .payment-item-left {
29
+ display: flex;
30
+ justify-content: flex-start;
31
+ align-items: center;
32
+ gap: var(--sp1x);
33
+ }
34
+ }
35
+
36
+ .card-details {
37
+ display: flex;
38
+ flex-direction: column;
39
+ gap: var(--sp1x);
40
+ margin-top: var(--sp1x);
41
+ color: var(--account_primaryColor1);
42
+ font-size: var(--account_p);
43
+ line-height: var(--account_lineHeight);
44
+ font-family: var(--account_Font);
45
+ font-weight: 400;
46
+
47
+ .card-exp-date {
48
+ font-size: var(--account_p);
49
+ }
50
+ .card-number {
51
+ display: inline-flex; /* Align items inline and center vertically */
52
+ align-items: center;
53
+ }
54
+ .card-number .star {
55
+ display: inline-block;
56
+ align-self: center; /* Center the * vertically */
57
+ font-size: inherit; /* Match the font size of the card number */
58
+ line-height: inherit; /* Match the line height */
59
+ }
60
+ }
61
+ }
62
+
63
+ .circle-selected-wrap {
64
+ width: var(--account_circleSize) !important;
65
+ height: var(--account_circleSize) !important;
66
+ border-radius: 50%;
67
+ border: 2px solid var(--account_primaryColor5);
68
+ background-color: var(--account_backgroundColor);
69
+ display: flex;
70
+ align-items: center;
71
+ justify-content: center;
72
+ .selected,
73
+ .note-selected {
74
+ color: var(--account_backgroundColor);
75
+ }
76
+
77
+ &.active {
78
+ border: 2px solid var(--account_primaryColor1);
79
+ background-color: var(--account_primaryColor1);
80
+ }
81
+
82
+ .checkbox-icon {
83
+ display: flex;
84
+ justify-content: center;
85
+ align-items: center;
86
+
87
+ width: var(--account_checkSize);
88
+ height: var(--account_checkSize);
89
+ fill: var(--account_backgroundColor);
90
+ }
91
+ }
92
+
93
+ @media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXLMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeL}) {
94
+ --account_itemInternalPadTB: var(--sp2x);
95
+ --account_itemInternalPadLR: var(--sp3x);
96
+ --account_flexWrapperMTop: var(--sp2x);
97
+ --account_itemDistance: var(--sp3x);
98
+ --account_circleSize: var(--sp3x);
99
+ --account_checkSize: var(--sp1-5x);
100
+ }
101
+
102
+ @media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeLMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeM}) {
103
+ --account_itemInternalPadTB: var(--sp1-5x);
104
+ --account_itemInternalPadLR: var(--sp3x);
105
+ --account_flexWrapperMTop: var(--sp1-5x);
106
+ --account_itemDistance: var(--sp3x);
107
+ --account_circleSize: var(--sp3x);
108
+ --account_checkSize: var(--sp1-5x);
109
+ }
110
+
111
+ @media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeMMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeS}) {
112
+ --account_itemInternalPadTB: var(--sp1-5x);
113
+ --account_itemInternalPadLR: var(--sp3x);
114
+ --account_flexWrapperMTop: var(--sp1-5x);
115
+ --account_itemDistance: var(--sp2x);
116
+ --account_circleSize: var(--sp3x);
117
+ --account_checkSize: var(--sp1-5x);
118
+ }
119
+
120
+ @media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeSMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXS}) {
121
+ --account_itemInternalPadTB: var(--sp1-5x);
122
+ --account_itemInternalPadLR: var(--sp2x);
123
+ --account_flexWrapperMTop: var(--sp1-5x);
124
+ --account_itemDistance: var(--sp2x);
125
+ --account_circleSize: var(--sp2-5x);
126
+ --account_checkSize: var(--sp1x);
127
+ }
128
+
129
+ @media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXSMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_TabletSize}) {
130
+ --account_itemInternalPadTB: var(--sp1-5x);
131
+ --account_itemInternalPadLR: var(--sp2x);
132
+ --account_flexWrapperMTop: var(--sp1-5x);
133
+ --account_itemDistance: var(--sp2x);
134
+ --account_circleSize: var(--sp2-5x);
135
+ --account_checkSize: var(--sp1x);
136
+ }
137
+
138
+ @media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeS}) {
139
+ --account_itemInternalPadTB: var(--sp1-5x);
140
+ --account_itemInternalPadLR: var(--sp1-5x);
141
+ --account_itemBorderRadius: var(--sp1x);
142
+ --account_flexWrapperMTop: var(--sp1-5x);
143
+ --account_flexWrapperMTop: var(--sp2x);
144
+ --account_itemDistance: var(--sp2x);
145
+ --account_circleSize: var(--sp2-5x);
146
+ --account_checkSize: var(--sp1x);
147
+ }
148
+
149
+ @media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeSMin}) {
150
+ --account_itemInternalPadTB: var(--sp1-5x);
151
+ --account_itemInternalPadLR: var(--sp1-5x);
152
+ --account_flexWrapperMTop: var(--sp1-5x);
153
+ --account_itemDistance: var(--sp2x);
154
+ --account_circleSize: var(--sp2-5x);
155
+ --account_checkSize: var(--sp1x);
156
+
157
+ .custom-payment-options {
158
+ width: 100%;
159
+ }
160
+ }
161
+ `;
162
+ export default PaymentMethodsCompStyle;
@@ -1,5 +1,6 @@
1
1
  export default PromoCodeComp;
2
- declare function PromoCodeComp({ isPromoCode }: {
2
+ declare function PromoCodeComp({ isPromoCode, promo_code }: {
3
3
  isPromoCode?: boolean;
4
+ promo_code: any;
4
5
  }): React.JSX.Element;
5
6
  import React from 'react';
@@ -1,29 +1,32 @@
1
1
  import React, { useState } from 'react';
2
- import { Text } from '@weareconceptstudio/core';
2
+ import { Text, CollapseItem } from '@weareconceptstudio/core';
3
3
  import { FormBuilder } from '@weareconceptstudio/form';
4
4
  import AccountButton from '../../AccountButton';
5
5
  import { promoCodeFields } from './utils';
6
6
  //* Style
7
7
  import PromoCodeCompStyle from './style';
8
- // TODO: Fake Promo Text
9
- const fakePromoText = '10% of first order';
10
- const PromoCodeComp = ({ isPromoCode = true }) => {
8
+ const PromoCodeComp = ({ isPromoCode = true, promo_code }) => {
11
9
  //! States
12
- const [show, setShow] = useState(true);
13
10
  const [couponCode, setCouponCode] = useState(false);
11
+ const [disable, setDisable] = useState(false);
14
12
  //! On Finish
15
13
  const onFinish = () => {
16
14
  setCouponCode(true);
15
+ setDisable(true);
17
16
  };
18
- return isPromoCode ? (React.createElement(PromoCodeCompStyle, null, show ? (React.createElement(Text, { className: 'account-p account-p4 account-primary-color1 account-font-medium promo-code-text', text: 'gotPromotionCode', onClick: () => {
19
- setShow(false);
20
- } })) : couponCode ? (React.createElement("div", { className: `promo-code-success-block` },
21
- React.createElement(Text, { className: 'account-p account-p4 account-primary-color2 account-font-medium promo-code-success-text' }, fakePromoText),
22
- React.createElement(Text, { text: 'remove', className: 'account-p account-p4 account-primary-color2 account-font-medium promo-code-remove-text', onClick: () => {
23
- setCouponCode(false);
24
- } }))) : (React.createElement(FormBuilder, { onSubmit: onFinish, fields: promoCodeFields, className: `promo-code-block`, formOptions: {
25
- className: 'promo-code-container',
26
- } },
27
- React.createElement(AccountButton, { text: `add`, type: 'submit', btnType: `promo-code-version` }))))) : null;
17
+ return isPromoCode ? (React.createElement(PromoCodeCompStyle, { className: 'collapse-distance' },
18
+ React.createElement(CollapseItem, { disable: disable, title: React.createElement(React.Fragment, null,
19
+ React.createElement("div", null,
20
+ React.createElement("svg", { xmlns: 'http://www.w3.org/2000/svg', width: '12', height: '12', viewBox: '0 0 12 12', fill: 'none' },
21
+ React.createElement("path", { d: 'M0 6H12', stroke: 'black', strokeWidth: '2' }),
22
+ React.createElement("path", { d: 'M6 12L6 0', stroke: 'black', strokeWidth: '2' }))),
23
+ React.createElement(Text, { className: 'account-p account-p4 account-primary-color1 account-font-medium promo-code-text', text: 'gotPromotionCode' })), description: React.createElement(React.Fragment, null, couponCode ? (React.createElement("div", { className: `promo-code-success-block` },
24
+ React.createElement(Text, { className: 'account-p account-p4 account-primary-color2 account-font-medium promo-code-success-text' }, promo_code),
25
+ React.createElement(Text, { text: 'remove', className: 'account-p account-p4 account-primary-color2 account-font-medium promo-code-remove-text', onClick: () => {
26
+ setCouponCode(false);
27
+ } }))) : (React.createElement(FormBuilder, { onSubmit: onFinish, fields: promoCodeFields, className: `promo-code-block`, formOptions: {
28
+ className: 'promo-code-container',
29
+ } },
30
+ React.createElement(AccountButton, { text: `add`, type: 'submit', btnType: `promo-code-version` })))) }))) : null;
28
31
  };
29
32
  export default PromoCodeComp;
@@ -6,8 +6,10 @@ const PromoCodeCompStyle = styled.div `
6
6
  --account_promoCodeInputPadLR: var(--sp2x);
7
7
  --account_promoCodeContainerGap: var(--sp2x);
8
8
 
9
- margin-top: var(--account_promoCodeCompDistance);
10
- margin-bottom: calc(var(--account_promoCodeCompDistance) - var(--sp2x));
9
+ --account_promoCodeBlockMarTop: var(--sp3x);
10
+ --account_promoCodeBlockPadTop: var(--sp3x);
11
+
12
+ border-top: 1px solid rgba(0, 0, 0, 0.4);
11
13
 
12
14
  .promo-code-container {
13
15
  display: flex;
@@ -34,15 +36,6 @@ const PromoCodeCompStyle = styled.div `
34
36
  width: fit-content;
35
37
  transition: color var(--account_trTime) ease-out;
36
38
  cursor: pointer;
37
-
38
- /* //! Mouse Detect */
39
- @media (pointer: fine) {
40
- @media (hover: hover) {
41
- &:hover {
42
- color: var(--account_primaryColor3);
43
- }
44
- }
45
- }
46
39
  }
47
40
 
48
41
  .promo-code-success-block {
@@ -0,0 +1,3 @@
1
+ export default SelectPaymentMethodPopup;
2
+ declare const SelectPaymentMethodPopup: React.NamedExoticComponent<object>;
3
+ import React from 'react';
@@ -0,0 +1,65 @@
1
+ import React, { memo as Memo, useEffect, useState } from 'react';
2
+ import { useUi, Text } from '@weareconceptstudio/core';
3
+ //* Components
4
+ import AccountButton from '../../AccountButton';
5
+ import PaymentMethodsComp from '../PaymentMethodsComp';
6
+ import AddNewCard from '../AddNewCard';
7
+ import CardComp from '../CardComp';
8
+ //* Style
9
+ import SelectPaymentMethodPopupStyle from './style';
10
+ const SelectPaymentMethodPopup = Memo(({ title, type, fillCheckoutData, checkoutData }) => {
11
+ const { openPopup, closePopup } = useUi();
12
+ const [selectedPaymentType, setSelectedPaymentType] = useState(checkoutData.paymentType);
13
+ const [selectedCard, setSelectedCard] = useState('');
14
+ useEffect(() => {
15
+ setSelectedPaymentType(checkoutData.paymentType);
16
+ }, [checkoutData.paymentType]);
17
+ const handlePaymentMethodChangeSubmit = () => {
18
+ fillCheckoutData('paymentType', selectedPaymentType);
19
+ if (selectedPaymentType === 'credit_card') {
20
+ fillCheckoutData('selectedCard', selectedCard);
21
+ }
22
+ closePopup();
23
+ };
24
+ const [cardOptions, setCardOptions] = useState([
25
+ {
26
+ id: 1,
27
+ type: 'MasterCard',
28
+ number: '3122 4577 8799 8877',
29
+ fullName: 'Sasoun Papelyan',
30
+ expDate: '12/24',
31
+ },
32
+ {
33
+ id: 2,
34
+ type: 'Visa',
35
+ number: '4577 1234 3122 1234',
36
+ fullName: 'Gohar Vardevanyan',
37
+ expDate: '12/25',
38
+ },
39
+ {
40
+ id: 3,
41
+ type: 'MasterCard',
42
+ number: '8799 1234 3122 1234',
43
+ fullName: 'Sasoun Papelyan',
44
+ expDate: '12/27',
45
+ },
46
+ ]);
47
+ const handleDelete = (cardId) => {
48
+ setCardOptions((prevOptions) => prevOptions.filter((card) => card.id !== cardId));
49
+ };
50
+ return (React.createElement(SelectPaymentMethodPopupStyle, null,
51
+ React.createElement("div", { className: `select-payment-wrap` },
52
+ React.createElement(Text, { tag: `h6`, className: 'account-p account-p2 account-font-bold account-primary-color1', text: title })),
53
+ React.createElement("div", { className: `flex-wrapper` },
54
+ React.createElement(AddNewCard, { title: 'addNewCard' }),
55
+ cardOptions.map((card, index) => (React.createElement(CardComp, { key: index, cardOption: card, selectedPayment: selectedCard, onSelect: setSelectedCard, onDelete: handleDelete })))),
56
+ React.createElement("div", { className: 'line' }),
57
+ React.createElement(PaymentMethodsComp, { checkoutData: { ...checkoutData, paymentType: selectedPaymentType }, fillCheckoutData: (key, val) => {
58
+ if (key === 'paymentType')
59
+ setSelectedPaymentType(val);
60
+ }, showAll: true }),
61
+ React.createElement("div", { className: `cancel-and-save-wrap` },
62
+ React.createElement(AccountButton, { btnType: `green-large-text`, text: `cancel`, onClick: closePopup }),
63
+ React.createElement(AccountButton, { btnType: `full-width`, text: `saveAndApply`, onClick: handlePaymentMethodChangeSubmit }))));
64
+ });
65
+ export default SelectPaymentMethodPopup;
@@ -0,0 +1,2 @@
1
+ export default SelectPaymentMethodPopupStyle;
2
+ declare const SelectPaymentMethodPopupStyle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, never>> & string;