@dev-blinq/ui-systems 1.0.3 → 1.0.5
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.css +418 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.mts +46 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +5 -1
- package/build +0 -22
- package/index.html +0 -14
- package/public/colors.css +0 -141
- package/src/components/CustomButton/CustomButton.tsx +0 -42
- package/src/components/CustomButton/CustomButtonProps.ts +0 -12
- package/src/components/CustomButton/CustomButtonTypes.ts +0 -28
- package/src/components/CustomButton/css/color/default.css +0 -84
- package/src/components/CustomButton/css/color/disabled.css +0 -58
- package/src/components/CustomButton/css/color/focused.css +0 -39
- package/src/components/CustomButton/css/color/hover.css +0 -39
- package/src/components/CustomButton/css/customButton.css +0 -73
- package/src/components/CustomButton/css/index.css +0 -6
- package/src/components/CustomButton/css/size.css +0 -23
- package/src/components/CustomCheckbox.tsx +0 -24
- package/src/components/CustomInput/ChooseInput.tsx +0 -36
- package/src/components/CustomInput/CustomInput.tsx +0 -43
- package/src/components/CustomInput/CustomInputProps.ts +0 -40
- package/src/components/CustomInput/css/index.css +0 -7
- package/src/components/CustomInput/css/input.css +0 -76
- package/src/components/CustomInput/css/size.css +0 -3
- package/src/components/CustomInput/css/state/default.css +0 -0
- package/src/components/CustomInput/css/state/disabled.css +0 -5
- package/src/components/CustomInput/css/state/error.css +0 -3
- package/src/components/CustomInput/css/state/filled.css +0 -0
- package/src/components/CustomInput/css/state/focused.css +0 -6
- package/src/components/CustomInput/css/state/hover.css +0 -5
- package/src/components/CustomInput/types/Action.tsx +0 -34
- package/src/components/CustomInput/types/CreditCard.tsx +0 -25
- package/src/components/CustomInput/types/Currency.tsx +0 -68
- package/src/components/CustomInput/types/Date.tsx +0 -20
- package/src/components/CustomInput/types/Link.tsx +0 -32
- package/src/components/CustomInput/types/Number.tsx +0 -23
- package/src/components/CustomInput/types/Password.tsx +0 -30
- package/src/components/CustomInput/types/Telephone.tsx +0 -0
- package/src/components/CustomInput/types/Text.tsx +0 -27
- package/src/components/Typography/Typography.tsx +0 -28
- package/src/components/Typography/css/bold.css +0 -20
- package/src/components/Typography/css/category/display.css +0 -20
- package/src/components/Typography/css/category/heading.css +0 -41
- package/src/components/Typography/css/category/text.css +0 -48
- package/src/components/Typography/css/index.css +0 -4
- package/src/icons/details.tsx +0 -10
- package/src/icons/index.tsx +0 -2
- package/src/icons/lock.tsx +0 -29
- package/src/icons/mail.svg +0 -4
- package/src/icons/mail.tsx +0 -23
- package/src/icons/password-eye.tsx +0 -10
- package/src/index.ts +0 -3
- package/src/playground/App.tsx +0 -105
- package/src/playground/main.tsx +0 -9
- package/src/svg.d.ts +0 -5
- package/tsconfig.json +0 -17
- package/tsup.config.ts +0 -10
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
.button[data-colorHierarchy="brand/primary"]:focus {
|
|
2
|
-
box-shadow: 0px 0px 0px 4px var(--primary-30, #b5c5e7);
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.button[data-colorHierarchy="gray/secondary"]:focus {
|
|
6
|
-
box-shadow: 0px 0px 0px 4px var(--neutural-50, #e6e6e6);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.button[data-colorHierarchy="white/secondary"]:focus {
|
|
10
|
-
box-shadow: 0px 0px 0px 4px var(--neutural-50, #e6e6e6);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.button[data-colorHierarchy="gray/linkContainer"]:focus {
|
|
14
|
-
box-shadow: 0px 0px 0px 4px var(--neutural-50, #e6e6e6);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.button[data-colorHierarchy="gray/link"]:focus {
|
|
18
|
-
box-shadow: 0px 0px 0px 4px var(--neutural-50, #e6e6e6);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.button[data-colorHierarchy="brand/link"]:focus {
|
|
22
|
-
box-shadow: 0px 0px 0px 4px var(--primary-30, #b5c5e7);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.button[data-colorHierarchy="destructive/primary"]:focus {
|
|
26
|
-
box-shadow: 0px 0px 0px 4px var(--destructive-30, #f9c7bc);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.button[data-colorHierarchy="destructive/secondary"]:focus {
|
|
30
|
-
box-shadow: 0px 0px 0px 4px var(--destructive-30, #f9c7bc);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.button[data-colorHierarchy="destructive/linkContainer"]:focus {
|
|
34
|
-
box-shadow: 0px 0px 0px 4px var(--destructive-30, #f9c7bc);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.button[data-colorHierarchy=""]:focus {
|
|
38
|
-
box-shadow: 0px 0px 0px 4px var(--destructive-30, #f9c7bc);
|
|
39
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
.button[data-colorHierarchy="brand/primary"]:hover {
|
|
2
|
-
background: var(--surface-primary-hover, #08379e);
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.button[data-colorHierarchy="gray/secondary"]:hover {
|
|
6
|
-
background: var(--surface-secondary-hover, #ececed);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.button[data-colorHierarchy="white/secondary"]:hover {
|
|
10
|
-
background: var(--surface-white---hover, #f9f9f9);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.button[data-colorHierarchy="gray/linkContainer"]:hover {
|
|
14
|
-
background: var(--surface-secondary, #f1f1f1);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.button[data-colorHierarchy="gray/link"]:hover {
|
|
18
|
-
background-color: #fff;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.button[data-colorHierarchy="brand/link"]:hover {
|
|
22
|
-
background-color: #fff;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.button[data-colorHierarchy="destructive/primary"]:hover {
|
|
26
|
-
background: var(--surface-error-hover, #d33f1e);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.button[data-colorHierarchy="destructive/secondary"]:hover {
|
|
30
|
-
background: var(--surface-error-secondary-hover, #fbdad3);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.button[data-colorHierarchy="destructive/linkContainer"]:hover {
|
|
34
|
-
background: var(--colors-red-5, #fef6f4);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.button[data-colorHierarchy=""]:hover {
|
|
38
|
-
background-color: #fff;
|
|
39
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
.button {
|
|
2
|
-
display: inline-flex;
|
|
3
|
-
justify-content: center;
|
|
4
|
-
align-items: center;
|
|
5
|
-
font-size: 14px;
|
|
6
|
-
font-weight: bold;
|
|
7
|
-
cursor: pointer;
|
|
8
|
-
transition: all 0.3s ease;
|
|
9
|
-
border: none;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/* .button[data-color='brand'] {
|
|
13
|
-
background-color: var(--brand-color, #093DB0);
|
|
14
|
-
color: #fff;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.button[data-color='gray'] {
|
|
18
|
-
background-color: var(--gray-color, #6c757d);
|
|
19
|
-
color: #fff;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.button[data-color='destructive'] {
|
|
23
|
-
background-color: var(--destructive-color, #dc3545);
|
|
24
|
-
color: #fff;
|
|
25
|
-
} */
|
|
26
|
-
|
|
27
|
-
/* .button[data-color='white'] {
|
|
28
|
-
background-color: #fff;
|
|
29
|
-
color: #000;
|
|
30
|
-
border: 1px solid var(--gray-color, #6c757d);
|
|
31
|
-
} */
|
|
32
|
-
|
|
33
|
-
/* .button[data-hierarchy='primary'] {
|
|
34
|
-
box-shadow: 0px 0px 0px 2px var(--primary-color, #007bff);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.button[data-hierarchy='secondary'] {
|
|
38
|
-
box-shadow: none;
|
|
39
|
-
border: 1px solid var(--secondary-color, #6c757d);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.button[data-hierarchy='link'] {
|
|
43
|
-
background: none;
|
|
44
|
-
border: none;
|
|
45
|
-
color: var(--brand-color, #007bff);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.button[data-hierarchy='linkContainer'] {
|
|
49
|
-
background-color: #f8f9fa;
|
|
50
|
-
color: var(--brand-color, #007bff);
|
|
51
|
-
border: 1px solid var(--gray-color, #6c757d);
|
|
52
|
-
} */
|
|
53
|
-
|
|
54
|
-
/*
|
|
55
|
-
.button[data-state='default'] {
|
|
56
|
-
opacity: 1;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.button[data-state='hover'] {
|
|
60
|
-
opacity: 0.9;
|
|
61
|
-
background: #08379E;
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.button[data-state='focused'] {
|
|
66
|
-
box-shadow: 0px 0px 0px 4px var(--primary-30, #B5C5E7);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.button[data-state='disabled'] {
|
|
70
|
-
opacity: 0.5;
|
|
71
|
-
cursor: not-allowed;
|
|
72
|
-
}
|
|
73
|
-
*/
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
.button[data-size="sm"] {
|
|
2
|
-
padding: 8px 12px;
|
|
3
|
-
gap: 8px;
|
|
4
|
-
border-radius: 12px;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.button[data-size="md"] {
|
|
8
|
-
padding: 10px 14px;
|
|
9
|
-
gap: 8px;
|
|
10
|
-
border-radius: 12px;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.button[data-size="lg"] {
|
|
14
|
-
padding: 12px 16px;
|
|
15
|
-
gap: 10px;
|
|
16
|
-
border-radius: 12px;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.button[data-size="xl"] {
|
|
20
|
-
padding: 16px 24px;
|
|
21
|
-
gap: 12px;
|
|
22
|
-
border-radius: 16px;
|
|
23
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
type CustomCheckboxProps = {
|
|
4
|
-
checked: boolean;
|
|
5
|
-
onChange?: (checked: boolean) => void;
|
|
6
|
-
label?: string;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
const CustomCheckbox: React.FC<CustomCheckboxProps> = ({ checked, onChange, label, disabled }) => {
|
|
11
|
-
return (
|
|
12
|
-
<label className="flex items-center space-x-3">
|
|
13
|
-
<input
|
|
14
|
-
type="checkbox"
|
|
15
|
-
checked={checked}
|
|
16
|
-
onChange={(e) => onChange && onChange(e.target.checked)}
|
|
17
|
-
disabled={disabled}
|
|
18
|
-
/>
|
|
19
|
-
{label && <span>{label}</span>}
|
|
20
|
-
</label>
|
|
21
|
-
);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export default CustomCheckbox;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { InputContext } from "./CustomInputProps";
|
|
2
|
-
import { DefaultInput } from "./types/Text";
|
|
3
|
-
import { ActionInput } from "./types/Action";
|
|
4
|
-
import { CurrencyInput } from "./types/Currency";
|
|
5
|
-
import { CreditCardInput } from "./types/CreditCard";
|
|
6
|
-
import { DateInput } from "./types/Date";
|
|
7
|
-
import { LinkInput } from "./types/Link";
|
|
8
|
-
import { PasswordInput } from "./types/Password";
|
|
9
|
-
|
|
10
|
-
import { NumberInput } from "./types/Number";
|
|
11
|
-
|
|
12
|
-
// export type Type = "default" | "action" | "currency" | "creditCard" | "date" | "link" | "password" | "search" | "tel" | "number"
|
|
13
|
-
|
|
14
|
-
export const ChooseInput = (context: InputContext) => {
|
|
15
|
-
switch (context.type) {
|
|
16
|
-
case "default":
|
|
17
|
-
return DefaultInput(context);
|
|
18
|
-
case "action":
|
|
19
|
-
return ActionInput(context);
|
|
20
|
-
case "currency":
|
|
21
|
-
return CurrencyInput(context);
|
|
22
|
-
case "creditCard":
|
|
23
|
-
return CreditCardInput(context);
|
|
24
|
-
case "date":
|
|
25
|
-
return DateInput(context);
|
|
26
|
-
case "link":
|
|
27
|
-
return LinkInput(context);
|
|
28
|
-
case "password":
|
|
29
|
-
return PasswordInput(context);
|
|
30
|
-
|
|
31
|
-
case "number":
|
|
32
|
-
return NumberInput(context);
|
|
33
|
-
default:
|
|
34
|
-
return DefaultInput(context);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { CustomInputProps, InputContext } from "./CustomInputProps";
|
|
3
|
-
import "./css/index.css";
|
|
4
|
-
import { DetailsIcon } from "../../icons/details";
|
|
5
|
-
import TypographyCustom from "../Typography/Typography";
|
|
6
|
-
import { ChooseInput } from "./ChooseInput";
|
|
7
|
-
|
|
8
|
-
const CustomInput: React.FC<CustomInputProps> = ({
|
|
9
|
-
size = "lg",
|
|
10
|
-
type = "default",
|
|
11
|
-
disabled = false,
|
|
12
|
-
label = "",
|
|
13
|
-
errExists = false,
|
|
14
|
-
placeholder,
|
|
15
|
-
leftIcon,
|
|
16
|
-
rightIcon,
|
|
17
|
-
style,
|
|
18
|
-
onAction,
|
|
19
|
-
...props
|
|
20
|
-
}) => {
|
|
21
|
-
const context: InputContext = {
|
|
22
|
-
type,
|
|
23
|
-
placeholder,
|
|
24
|
-
disabled,
|
|
25
|
-
errExists,
|
|
26
|
-
leftIcon,
|
|
27
|
-
rightIcon,
|
|
28
|
-
onAction, // application if type is action
|
|
29
|
-
...props,
|
|
30
|
-
};
|
|
31
|
-
return (
|
|
32
|
-
<div style={style}>
|
|
33
|
-
{label && (
|
|
34
|
-
<TypographyCustom category="text" Size="sm" bold="semibold">
|
|
35
|
-
{label}
|
|
36
|
-
</TypographyCustom>
|
|
37
|
-
)}
|
|
38
|
-
<ChooseInput {...context} />
|
|
39
|
-
</div>
|
|
40
|
-
);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export default CustomInput;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { ReactNode, CSSProperties } from "react";
|
|
2
|
-
// import inputprop from mui that will be extended by custominputprops
|
|
3
|
-
import { InputProps } from "@mui/material";
|
|
4
|
-
|
|
5
|
-
export type Size = "md" | "lg";
|
|
6
|
-
export type Type =
|
|
7
|
-
| "default"
|
|
8
|
-
| "action"
|
|
9
|
-
| "currency"
|
|
10
|
-
| "creditCard"
|
|
11
|
-
| "date"
|
|
12
|
-
| "link"
|
|
13
|
-
| "password"
|
|
14
|
-
| "search"
|
|
15
|
-
| "tel"
|
|
16
|
-
| "number";
|
|
17
|
-
export interface CustomInputProps {
|
|
18
|
-
Size?: Size;
|
|
19
|
-
type?: Type;
|
|
20
|
-
label?: string;
|
|
21
|
-
disabled?: boolean;
|
|
22
|
-
errExists?: boolean;
|
|
23
|
-
placeholder: string;
|
|
24
|
-
leftIcon?: any; //ReactNode
|
|
25
|
-
rightIcon?: any; //ReactNode
|
|
26
|
-
onAction?: () => void;
|
|
27
|
-
style?: CSSProperties;
|
|
28
|
-
[key: string]: any;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface InputContext {
|
|
32
|
-
type: string;
|
|
33
|
-
placeholder: string;
|
|
34
|
-
disabled: boolean;
|
|
35
|
-
errExists: boolean;
|
|
36
|
-
leftIcon?: any; //ReactNode
|
|
37
|
-
rightIcon?: any; //ReactNode
|
|
38
|
-
onAction?: (text: string | undefined) => void;
|
|
39
|
-
[key: string]: any;
|
|
40
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
.custom-input {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: row;
|
|
4
|
-
padding: 12px;
|
|
5
|
-
align-items: center;
|
|
6
|
-
gap: 12px;
|
|
7
|
-
width: 296px;
|
|
8
|
-
align-self: stretch;
|
|
9
|
-
border-radius: var(--border-radius-radius-pre-lg, 12px);
|
|
10
|
-
|
|
11
|
-
border: 1px solid var(--border-default, #e6e6e6);
|
|
12
|
-
background: var(--surface-white, #fff);
|
|
13
|
-
|
|
14
|
-
/* Shadow/xs */
|
|
15
|
-
box-shadow: 0px 1px 2px 0px rgba(23, 23, 23, 0.05);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.custom-input input {
|
|
19
|
-
width: 100%;
|
|
20
|
-
border: none;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.custom-input input::placeholder {
|
|
24
|
-
color: var(--text-disabled, #939197);
|
|
25
|
-
font-weight: 500;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.custom-input input:hover,
|
|
29
|
-
.custom-input input:focus,
|
|
30
|
-
.custom-input input:active {
|
|
31
|
-
border: none;
|
|
32
|
-
outline: none;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.custom-input .left-icon,
|
|
36
|
-
.custom-input .right-icon {
|
|
37
|
-
display: flex;
|
|
38
|
-
align-items: center;
|
|
39
|
-
justify-content: center;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.custom-input input {
|
|
43
|
-
font-family: var(--font-family);
|
|
44
|
-
color: var(--text-primary, #080808);
|
|
45
|
-
font-weight: 600;
|
|
46
|
-
font-size: 14px;
|
|
47
|
-
font-style: normal;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.custom-input .grey-box {
|
|
51
|
-
margin: -12px;
|
|
52
|
-
padding: 12px;
|
|
53
|
-
gap: 6px;
|
|
54
|
-
display: flex;
|
|
55
|
-
flex-direction: row;
|
|
56
|
-
background: #f9f9f9;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.custom-input .grey-right-box {
|
|
60
|
-
padding: 12px;
|
|
61
|
-
border-top-right-radius: 12px;
|
|
62
|
-
border-bottom-right-radius: 12px;
|
|
63
|
-
border-left: 1px solid #e6e6e6;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.custom-input .grey-left-box {
|
|
67
|
-
padding: 12px 14px;
|
|
68
|
-
border-top-left-radius: 12px;
|
|
69
|
-
border-bottom-left-radius: 12px;
|
|
70
|
-
border-right: 1px solid #e6e6e6;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.custom-input select:focus {
|
|
74
|
-
border: none;
|
|
75
|
-
outline: none;
|
|
76
|
-
}
|
|
File without changes
|
|
File without changes
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { InputContext } from "../CustomInputProps";
|
|
2
|
-
import TypographyCustom from "../../Typography/Typography";
|
|
3
|
-
import React, { useRef } from "react";
|
|
4
|
-
|
|
5
|
-
export const ActionInput = (context: InputContext) => {
|
|
6
|
-
const inputRef = useRef<HTMLInputElement>(null);
|
|
7
|
-
return (
|
|
8
|
-
<div className="custom-input" data-type={context.type} data-error={context.errExists}>
|
|
9
|
-
{/* {context.leftIcon && <div className="left-icon">{context.leftIcon}</div>} */}
|
|
10
|
-
{context.leftIcon && <img src={context.leftIcon} alt="icon" />}
|
|
11
|
-
<input
|
|
12
|
-
type="text"
|
|
13
|
-
placeholder={context.placeholder}
|
|
14
|
-
disabled={context.disabled}
|
|
15
|
-
ref={inputRef}
|
|
16
|
-
{...context.props}
|
|
17
|
-
/>
|
|
18
|
-
<div className="grey-box grey-right-box">
|
|
19
|
-
<TypographyCustom
|
|
20
|
-
category="text"
|
|
21
|
-
Size="sm"
|
|
22
|
-
bold="medium"
|
|
23
|
-
onClick={() => {
|
|
24
|
-
context.onAction && context.onAction(inputRef.current?.value);
|
|
25
|
-
}}
|
|
26
|
-
>
|
|
27
|
-
{context.actionLabel}
|
|
28
|
-
</TypographyCustom>
|
|
29
|
-
{/* {context.rightIcon && <div className="right-icon">{context.rightIcon}</div>} */}
|
|
30
|
-
{context.rightIcon && <img src={context.rightIcon} alt="icon" />}
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
);
|
|
34
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { InputContext } from "../CustomInputProps";
|
|
2
|
-
import { DetailsIcon } from "../../../icons/details";
|
|
3
|
-
export const CreditCardInput = (context: InputContext) => {
|
|
4
|
-
return (
|
|
5
|
-
<div className="custom-input" data-type={context.type} data-error={context.errExists}>
|
|
6
|
-
<input
|
|
7
|
-
type="text"
|
|
8
|
-
placeholder={"0000 0000 0000 0000"}
|
|
9
|
-
disabled={context.disabled}
|
|
10
|
-
{...context.props}
|
|
11
|
-
style={{
|
|
12
|
-
fontFamily: "var(--font-family)",
|
|
13
|
-
color: "var(--text-primary, #080808)",
|
|
14
|
-
fontWeight: 600,
|
|
15
|
-
fontSize: "14px",
|
|
16
|
-
fontStyle: "normal",
|
|
17
|
-
}}
|
|
18
|
-
/>
|
|
19
|
-
<div className="right-icon">
|
|
20
|
-
{" "}
|
|
21
|
-
<DetailsIcon />
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { InputContext } from "../CustomInputProps";
|
|
2
|
-
import React, { useState, useEffect } from "react";
|
|
3
|
-
import { countries } from "countries-list";
|
|
4
|
-
import getSymbolFromCurrency from "currency-symbol-map";
|
|
5
|
-
import TypographyCustom from "../../Typography/Typography";
|
|
6
|
-
|
|
7
|
-
export const CurrencyInput = (context: InputContext) => {
|
|
8
|
-
const [amount, setAmount] = useState<string>("");
|
|
9
|
-
const [selectedCurrency, setSelectedCurrency] = useState<string>("USD");
|
|
10
|
-
const [countryCurrencies, setCountryCurrencies] = useState<string[]>([]);
|
|
11
|
-
const inputRef = React.useRef<HTMLInputElement>(null);
|
|
12
|
-
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
// Create an array of unique currencies
|
|
15
|
-
const uniqueCurrencies = [...new Set(Object.values(countries).map((country: any) => country.currency))];
|
|
16
|
-
setCountryCurrencies(uniqueCurrencies);
|
|
17
|
-
}, []);
|
|
18
|
-
|
|
19
|
-
const handleAmountChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
20
|
-
setAmount(e.target.value);
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const handleCurrencyChange = (e: React.ChangeEvent<HTMLSelectElement>) => {
|
|
24
|
-
setSelectedCurrency(e.target.value);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<div className="currency-input-container">
|
|
29
|
-
<div className="custom-input" data-type={context.type} data-error={context.errExists}>
|
|
30
|
-
<div className="grey-box grey-left-box">
|
|
31
|
-
<TypographyCustom category="text" Size="sm" bold="semibold">
|
|
32
|
-
{getSymbolFromCurrency(selectedCurrency) || "$"}
|
|
33
|
-
</TypographyCustom>
|
|
34
|
-
</div>
|
|
35
|
-
|
|
36
|
-
<input
|
|
37
|
-
type="text"
|
|
38
|
-
placeholder={"amount"}
|
|
39
|
-
style={{ marginLeft: "12px" }}
|
|
40
|
-
onChange={handleAmountChange}
|
|
41
|
-
disabled={context.disabled}
|
|
42
|
-
ref={inputRef}
|
|
43
|
-
{...context.props}
|
|
44
|
-
/>
|
|
45
|
-
<div className="grey-box grey-right-box">
|
|
46
|
-
<select
|
|
47
|
-
value={selectedCurrency}
|
|
48
|
-
onChange={handleCurrencyChange}
|
|
49
|
-
className="currency-select"
|
|
50
|
-
style={{
|
|
51
|
-
fontFamily: "var(--font-family)",
|
|
52
|
-
fontWeight: "500",
|
|
53
|
-
width: "55px",
|
|
54
|
-
border: "none",
|
|
55
|
-
background: "transparent",
|
|
56
|
-
}}
|
|
57
|
-
>
|
|
58
|
-
{countryCurrencies.map((currency) => (
|
|
59
|
-
<option key={currency} value={currency}>
|
|
60
|
-
{currency}
|
|
61
|
-
</option>
|
|
62
|
-
))}
|
|
63
|
-
</select>
|
|
64
|
-
</div>
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
);
|
|
68
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { InputContext } from "../CustomInputProps";
|
|
2
|
-
export const DateInput = (context: InputContext) => {
|
|
3
|
-
return (
|
|
4
|
-
<div className="custom-input" data-type={context.type} data-error={context.errExists}>
|
|
5
|
-
<input
|
|
6
|
-
type="date"
|
|
7
|
-
placeholder={context.placeholder}
|
|
8
|
-
disabled={context.disabled}
|
|
9
|
-
{...context.props}
|
|
10
|
-
style={{
|
|
11
|
-
fontFamily: "var(--font-family)",
|
|
12
|
-
color: "var(--text-primary, #080808)",
|
|
13
|
-
fontWeight: 600,
|
|
14
|
-
fontSize: "14px",
|
|
15
|
-
fontStyle: "normal",
|
|
16
|
-
}}
|
|
17
|
-
/>
|
|
18
|
-
</div>
|
|
19
|
-
);
|
|
20
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { InputContext } from "../CustomInputProps";
|
|
2
|
-
import { DetailsIcon } from "../../../icons/details";
|
|
3
|
-
import TypographyCustom from "../../Typography/Typography";
|
|
4
|
-
export const LinkInput = (context: InputContext) => {
|
|
5
|
-
return (
|
|
6
|
-
<div className="custom-input" data-type={context.type} data-error={context.errExists}>
|
|
7
|
-
<div className="grey-box grey-left-box">
|
|
8
|
-
<TypographyCustom category="text" Size="sm" bold="medium">
|
|
9
|
-
https://
|
|
10
|
-
</TypographyCustom>
|
|
11
|
-
</div>
|
|
12
|
-
<input
|
|
13
|
-
type="text"
|
|
14
|
-
placeholder="Link Text"
|
|
15
|
-
disabled={context.disabled}
|
|
16
|
-
{...context.props}
|
|
17
|
-
style={{
|
|
18
|
-
fontFamily: "var(--font-family)",
|
|
19
|
-
color: "var(--text-primary, #080808)",
|
|
20
|
-
fontWeight: 600,
|
|
21
|
-
fontSize: "14px",
|
|
22
|
-
fontStyle: "normal",
|
|
23
|
-
marginLeft: "12px",
|
|
24
|
-
}}
|
|
25
|
-
/>
|
|
26
|
-
<div className="right-icon">
|
|
27
|
-
{/* {context.rightIcon ? context.rightIcon : <DetailsIcon />} */}
|
|
28
|
-
{context.rightIcon ? <img src={context.rightIcon} alt="icon" /> : <DetailsIcon />}
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
);
|
|
32
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { InputContext } from "../CustomInputProps";
|
|
2
|
-
|
|
3
|
-
export const NumberInput = (context: InputContext) => {
|
|
4
|
-
return (
|
|
5
|
-
<div className="custom-input" data-type={context.type} data-error={context.errExists}>
|
|
6
|
-
{/* {context.leftIcon && <div className="left-icon">{context.leftIcon}</div>} */}
|
|
7
|
-
{context.leftIcon && <img src={context.leftIcon} alt="icon" />}
|
|
8
|
-
<input
|
|
9
|
-
type="number"
|
|
10
|
-
placeholder={context.placeholder ? context.placeholder : "Enter Value"}
|
|
11
|
-
disabled={context.disabled}
|
|
12
|
-
{...context.props}
|
|
13
|
-
style={{
|
|
14
|
-
fontFamily: "var(--font-family)",
|
|
15
|
-
color: "var(--text-primary, #080808)",
|
|
16
|
-
fontWeight: 600,
|
|
17
|
-
fontSize: "14px",
|
|
18
|
-
fontStyle: "normal",
|
|
19
|
-
}}
|
|
20
|
-
/>
|
|
21
|
-
</div>
|
|
22
|
-
);
|
|
23
|
-
};
|