react-frontend-common-components 0.0.17 → 0.0.18

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-frontend-common-components",
3
- "version": "0.0.17",
3
+ "version": "0.0.18",
4
4
  "description": "Reusable frontend library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -32,7 +32,6 @@
32
32
  "chart.js": "^4.4.4",
33
33
  "react-chartjs-2": "^5.2.0",
34
34
  "react-icons": "^5.3.0",
35
- "react-intl-tel-input": "^8.2.0",
36
35
  "react-otp-input": "^3.1.1",
37
36
  "rollup": "^4.21.2",
38
37
  "uuid": "^10.0.0"
package/src/index.ts CHANGED
@@ -35,4 +35,4 @@ export { default as AppTable } from "./components/app-table/app-table";
35
35
  export { default as AppProgress } from "./components/app-progress/app-progress";
36
36
  export { default as AppPopover } from "./components/app-popover/app-popover";
37
37
  export { default as AppFloatButton } from "./components/app-float-button/app-float-button";
38
- // export { default as AppPhoneField } from "./components/app-phone-field/app-phone-field";
38
+
@@ -1,61 +0,0 @@
1
- .appPhoneField {
2
- .allow-dropdown {
3
- width: 100%;
4
- }
5
- .intelWrapper {
6
- .intl-tel-input.allow-dropdown .flag-container {
7
- height: unset !important;
8
-
9
- & > div:first-child {
10
- display: flex;
11
- align-items: center;
12
- position: relative;
13
- background-color: transparent;
14
- .selected-dial-code {
15
- padding-left: 0.5rem;
16
- }
17
-
18
- &::after {
19
- content: "";
20
- background-color: #dcdcdc;
21
- height: 50%;
22
- width: 1px;
23
- position: absolute;
24
- right: 0;
25
- top: 50%;
26
- bottom: 50%;
27
- transform: translateY(-50%);
28
- }
29
-
30
- & > div:nth-child(2) {
31
- margin-right: 0.2rem;
32
- margin-bottom: 0 !important;
33
- font-size: 12px;
34
- font-weight: 500;
35
- letter-spacing: -0.02em;
36
- text-align: left;
37
- }
38
- }
39
- }
40
- }
41
-
42
- .customintlinput {
43
- width: 100%;
44
- min-height: 40px;
45
- font-size: var(--font-14);
46
- font-weight: 500;
47
- color: #000000 !important;
48
- border: 1px solid #bfbebe;
49
- border-radius: 10px;
50
- height: 40px;
51
- &:focus-visible {
52
- outline: unset !important;
53
- }
54
- }
55
- }
56
-
57
- .error {
58
- color: red;
59
- font-size: 0.875rem;
60
- margin-top: 0.25rem;
61
- }
@@ -1,60 +0,0 @@
1
- import React from "react";
2
- import "react-intl-tel-input/dist/main.css";
3
- import IntlTelInput from "react-intl-tel-input";
4
- import "./app-phone-field.css";
5
-
6
- interface AppPhoneFieldProps {
7
- phone: string;
8
- setPhone: (phone: string) => void;
9
- phoneError: string;
10
- setPhoneError: (error: string) => void;
11
- setCustomerCountryCode: (code: string) => void;
12
- className?: string;
13
- }
14
-
15
- const AppPhoneField = ({
16
- phone,
17
- setPhone,
18
- phoneError,
19
- setPhoneError,
20
- setCustomerCountryCode,
21
- className,
22
- }: AppPhoneFieldProps) => {
23
- return (
24
- <div className={`appPhoneField ${className}`}>
25
- <div className={"intelWrapper"}>
26
- <IntlTelInput
27
- containerClassName={`${"intltelinput"} intl-tel-input`}
28
- inputClassName={`${"customintlinput"} custom-intl-input`}
29
- separateDialCode={true}
30
- defaultCountry="ae"
31
- placeholder="50-1234567"
32
- preferredCountries={["ae"]}
33
- value={phone}
34
- onPhoneNumberChange={(isValid, value, country, fullNumber) => {
35
- if (!isNaN(Number(value))) {
36
- setPhone(value);
37
- setCustomerCountryCode("+" + country.dialCode);
38
- setPhoneError("");
39
- } else if (value === "") {
40
- setPhoneError("");
41
- } else {
42
- setPhoneError("You can only enter numbers.");
43
- }
44
- }}
45
- onSelectFlag={(
46
- currentNumber,
47
- selectedCountryData,
48
- fullNumber,
49
- isValid
50
- ) => {
51
- setCustomerCountryCode("+" + selectedCountryData.dialCode);
52
- }}
53
- />
54
- </div>
55
- <p className={"error"}>{phoneError && phoneError}</p>
56
- </div>
57
- );
58
- };
59
-
60
- export default AppPhoneField;