@openlettermarketing/olc-react-sdk 0.0.18 → 0.0.20

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 (138) hide show
  1. package/build/index.js +3 -3
  2. package/build/index.js.map +1 -1
  3. package/build/types/App.d.ts +1 -0
  4. package/build/types/components/TemplateBuilder/index.d.ts +1 -0
  5. package/build/types/components/TopNavigation/index.d.ts +1 -0
  6. package/build/types/index.d.ts +3 -2
  7. package/package.json +1 -1
  8. package/.eslintignore +0 -1
  9. package/.eslintrc.cjs +0 -18
  10. package/.eslintrc.yml +0 -47
  11. package/.prettierignore +0 -3
  12. package/.prettierrc.yml +0 -5
  13. package/CHANGELOG.md +0 -4
  14. package/babel.config.json +0 -10
  15. package/examples/.eslintrc.yml +0 -4
  16. package/index.html +0 -18
  17. package/public/vite.svg +0 -1
  18. package/src/App.tsx +0 -72
  19. package/src/assets/Fonts/Lexi-Regular.ttf +0 -0
  20. package/src/assets/images/input/cancel.tsx +0 -20
  21. package/src/assets/images/input/search.tsx +0 -20
  22. package/src/assets/images/modal-icons/cancelIcon.png +0 -0
  23. package/src/assets/images/modal-icons/del.tsx +0 -19
  24. package/src/assets/images/modal-icons/delete.svg +0 -3
  25. package/src/assets/images/modal-icons/modal-cross.tsx +0 -23
  26. package/src/assets/images/modal-icons/save.tsx +0 -23
  27. package/src/assets/images/templates/add-icon.svg +0 -5
  28. package/src/assets/images/templates/back-arrow.tsx +0 -19
  29. package/src/assets/images/templates/back-dialog-icon.png +0 -0
  30. package/src/assets/images/templates/back-dialog-icon.svg +0 -3
  31. package/src/assets/images/templates/barcode.png +0 -0
  32. package/src/assets/images/templates/bi-fold-self-mailers.tsx +0 -28
  33. package/src/assets/images/templates/black-trash-icon.svg +0 -3
  34. package/src/assets/images/templates/cancel.svg +0 -4
  35. package/src/assets/images/templates/cancelIcon.png +0 -0
  36. package/src/assets/images/templates/clipboard.svg +0 -3
  37. package/src/assets/images/templates/contact-search.svg +0 -3
  38. package/src/assets/images/templates/content-copy-icon.tsx +0 -24
  39. package/src/assets/images/templates/cross.svg +0 -3
  40. package/src/assets/images/templates/custom-template-icon-black.svg +0 -3
  41. package/src/assets/images/templates/custom-template-icon.svg +0 -3
  42. package/src/assets/images/templates/custom-template.tsx +0 -23
  43. package/src/assets/images/templates/dummy-template.svg +0 -21
  44. package/src/assets/images/templates/dynamic-field.tsx +0 -119
  45. package/src/assets/images/templates/edit-pencil-icon.tsx +0 -21
  46. package/src/assets/images/templates/filter-2.svg +0 -13
  47. package/src/assets/images/templates/info-icon.svg +0 -12
  48. package/src/assets/images/templates/info-icon.tsx +0 -37
  49. package/src/assets/images/templates/one-barcode.png +0 -0
  50. package/src/assets/images/templates/personal-letter.tsx +0 -53
  51. package/src/assets/images/templates/plus-icon.svg +0 -5
  52. package/src/assets/images/templates/postcard.tsx +0 -32
  53. package/src/assets/images/templates/professional-letter.tsx +0 -53
  54. package/src/assets/images/templates/real-penned-letters.tsx +0 -57
  55. package/src/assets/images/templates/search.svg +0 -3
  56. package/src/assets/images/templates/size-image-lg.tsx +0 -20
  57. package/src/assets/images/templates/size-image-mid.tsx +0 -20
  58. package/src/assets/images/templates/size-image.tsx +0 -20
  59. package/src/assets/images/templates/template-copy.svg +0 -3
  60. package/src/assets/images/templates/template-default-design.tsx +0 -21
  61. package/src/assets/images/templates/template-delete.svg +0 -3
  62. package/src/assets/images/templates/template-edit.svg +0 -4
  63. package/src/assets/images/templates/template-save-icon.svg +0 -3
  64. package/src/assets/images/templates/template-search-2.svg +0 -9
  65. package/src/assets/images/templates/template-search.svg +0 -4
  66. package/src/assets/images/templates/thumbnail.svg +0 -10
  67. package/src/assets/images/templates/trash-icon.svg +0 -13
  68. package/src/assets/images/templates/tri-fold-self-mailers.tsx +0 -93
  69. package/src/components/CreateTemplate/index.tsx +0 -379
  70. package/src/components/CreateTemplate/styles.scss +0 -363
  71. package/src/components/GenericUIBlocks/Button/index.tsx +0 -21
  72. package/src/components/GenericUIBlocks/Button/styles.scss +0 -15
  73. package/src/components/GenericUIBlocks/CircularProgress/index.tsx +0 -18
  74. package/src/components/GenericUIBlocks/CircularProgress/styles.scss +0 -98
  75. package/src/components/GenericUIBlocks/Dialog/index.tsx +0 -127
  76. package/src/components/GenericUIBlocks/Dialog/styles.scss +0 -106
  77. package/src/components/GenericUIBlocks/Divider/index.tsx +0 -12
  78. package/src/components/GenericUIBlocks/Divider/styles.scss +0 -7
  79. package/src/components/GenericUIBlocks/GeneralSelect/index.tsx +0 -86
  80. package/src/components/GenericUIBlocks/GeneralSelect/styles.scss +0 -77
  81. package/src/components/GenericUIBlocks/GeneralTooltip/index.tsx +0 -24
  82. package/src/components/GenericUIBlocks/GeneralTooltip/styles.scss +0 -9
  83. package/src/components/GenericUIBlocks/GenericSnackbar/index.tsx +0 -53
  84. package/src/components/GenericUIBlocks/GenericSnackbar/styles.scss +0 -34
  85. package/src/components/GenericUIBlocks/Grid/index.tsx +0 -82
  86. package/src/components/GenericUIBlocks/Input/index.tsx +0 -89
  87. package/src/components/GenericUIBlocks/Input/styles.scss +0 -80
  88. package/src/components/GenericUIBlocks/Typography/index.tsx +0 -18
  89. package/src/components/GenericUIBlocks/Typography/styles.scss +0 -27
  90. package/src/components/SidePanel/customFields/customFieldSection.tsx +0 -173
  91. package/src/components/SidePanel/customFields/styles.scss +0 -47
  92. package/src/components/SidePanel/index.tsx +0 -42
  93. package/src/components/SidePanel/templates/customTemplateSection.tsx +0 -503
  94. package/src/components/SidePanel/templates/styles.scss +0 -151
  95. package/src/components/TemplateBuilder/index.tsx +0 -301
  96. package/src/components/TemplateBuilder/styles.scss +0 -66
  97. package/src/components/TopNavigation/ConfirmNavigateDialog/index.tsx +0 -58
  98. package/src/components/TopNavigation/ConfirmNavigateDialog/styles.scss +0 -123
  99. package/src/components/TopNavigation/EditTemplateNameModel/index.tsx +0 -98
  100. package/src/components/TopNavigation/EditTemplateNameModel/styles.scss +0 -88
  101. package/src/components/TopNavigation/SaveTemplateModel/index.tsx +0 -60
  102. package/src/components/TopNavigation/SaveTemplateModel/styles.scss +0 -128
  103. package/src/components/TopNavigation/index.tsx +0 -405
  104. package/src/components/TopNavigation/styles.scss +0 -83
  105. package/src/importMeta.d.ts +0 -9
  106. package/src/index.scss +0 -137
  107. package/src/index.tsx +0 -80
  108. package/src/libs/test.ts +0 -7
  109. package/src/redux/actions/action-types.ts +0 -42
  110. package/src/redux/actions/customFieldAction.ts +0 -28
  111. package/src/redux/actions/snackbarActions.ts +0 -16
  112. package/src/redux/actions/templateActions.ts +0 -456
  113. package/src/redux/reducers/customFieldReducer.ts +0 -97
  114. package/src/redux/reducers/index.ts +0 -14
  115. package/src/redux/reducers/snackbarReducer.ts +0 -41
  116. package/src/redux/reducers/templateReducer.ts +0 -353
  117. package/src/redux/store.ts +0 -18
  118. package/src/styles/colors.scss +0 -61
  119. package/src/test/mocks.js +0 -89
  120. package/src/test/setupJest.js +0 -1
  121. package/src/utils/api.ts +0 -36
  122. package/src/utils/constants.ts +0 -40
  123. package/src/utils/customStyles.ts +0 -135
  124. package/src/utils/fetchWrapper.ts +0 -68
  125. package/src/utils/fonts.json +0 -1597
  126. package/src/utils/helper.ts +0 -19
  127. package/src/utils/local-storage.ts +0 -15
  128. package/src/utils/message.ts +0 -71
  129. package/src/utils/template-builder.ts +0 -147
  130. package/src/utils/templateRestrictedArea/biFold.ts +0 -433
  131. package/src/utils/templateRestrictedArea/postCard.ts +0 -439
  132. package/src/utils/templateRestrictedArea/professional.ts +0 -422
  133. package/src/utils/templateRestrictedArea/realPenned.ts +0 -244
  134. package/src/utils/templateRestrictedArea/triFold.ts +0 -434
  135. package/tsconfig.json +0 -29
  136. package/tsconfig.node.json +0 -12
  137. package/vite.config.ts +0 -8
  138. package/webpack.config.js +0 -80
@@ -1,106 +0,0 @@
1
- /* The Modal (background) */
2
- .modal {
3
- display: none; /* Hidden by default */
4
- justify-content: center;
5
- align-items: center;
6
- position: fixed; /* Stay in place */
7
- z-index: 99999; /* Sit on top */
8
- left: 0;
9
- top: 0;
10
- width: 100%; /* Full width */
11
- height: 100%; /* Full height */
12
- overflow: auto; /* Enable scroll if needed */
13
- background-color: rgb(0, 0, 0); /* Fallback color */
14
- background-color: rgba(0, 0, 0, 0.4); /* Black w/ opacity */
15
- /* Modal Content */
16
- .modal-content {
17
- position: relative;
18
- background-color: var(--dialogModalBgColor);
19
- margin: auto;
20
- padding: 0;
21
- border: 1px solid #888;
22
- width: 80%;
23
- box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
24
- -webkit-animation-name: animatetop;
25
- -webkit-animation-duration: 0.4s;
26
- animation-name: animatetop;
27
- animation-duration: 0.4s;
28
- border-radius: 11px;
29
- .modal-header {
30
- position: relative;
31
- height: 100%;
32
- min-height: 20px;
33
- color: var(--dialogModalTextColor);
34
- /* The Close Button */
35
- .close {
36
- color: var(--dialogModalTextColor);
37
- float: right;
38
- font-size: 28px;
39
- font-weight: bold;
40
- position: absolute;
41
- right: 10px;
42
- top: 0;
43
- }
44
-
45
- .close:hover,
46
- .close:focus {
47
- color: var(--dialogModalTextColor);
48
- text-decoration: none;
49
- cursor: pointer;
50
- }
51
- }
52
-
53
- .modal-body {
54
- padding: 2px 16px;
55
- display: flex;
56
- justify-content: center;
57
- align-items: center;
58
- flex-direction: column;
59
- color: var(--dialogModalTextColor);
60
- .modal-icon{
61
- svg{
62
- width: 100%;
63
- max-width: 60px;
64
- height: 100%;
65
- min-height: 70px;
66
- fill: var(--dialogModalSVGColor);
67
- }
68
- }
69
- }
70
-
71
- .modal-footer {
72
- padding: 2px 16px;
73
- color: var(--dialogModalTextColor);
74
- position: absolute;
75
- bottom: 10px;
76
- width: 100%;
77
- display: flex;
78
- justify-content: center;
79
- align-items: center;
80
- gap: 20px;
81
- }
82
- }
83
-
84
- /* Add Animation */
85
- @-webkit-keyframes animatetop {
86
- from {
87
- top: -300px;
88
- opacity: 0;
89
- }
90
- to {
91
- top: 0;
92
- opacity: 1;
93
- }
94
- }
95
-
96
- @keyframes animatetop {
97
- from {
98
- top: -300px;
99
- opacity: 0;
100
- }
101
- to {
102
- top: 0;
103
- opacity: 1;
104
- }
105
- }
106
- }
@@ -1,12 +0,0 @@
1
- import React from 'react'
2
-
3
- // styles
4
- import './styles.scss'
5
-
6
- const Divider: React.FC = () => {
7
- return (
8
- <hr className='basic-divider' />
9
- )
10
- }
11
-
12
- export default Divider
@@ -1,7 +0,0 @@
1
- .basic-divider{
2
- width: 100%;
3
- border: none;
4
- border-top: 0.5px solid #0000004D;
5
- max-width: 1600px;
6
- margin: 3px auto;
7
- }
@@ -1,86 +0,0 @@
1
- import React from 'react';
2
-
3
- // react select
4
- import Select, {StylesConfig} from 'react-select';
5
-
6
- // components
7
- import Typography from '../Typography';
8
-
9
- // styles
10
- import './styles.scss';
11
-
12
- interface Option {
13
- id?: number | string;
14
- value: string;
15
- label: string;
16
- }
17
-
18
- interface GeneralSelectProps {
19
- options: Option[];
20
- placeholder?: string;
21
- error?: string;
22
- label?: string;
23
- selectedValue: Option | null;
24
- isError: boolean;
25
- setSelectedValue: (option: Option | null) => void;
26
- }
27
-
28
- const colourStyles: StylesConfig<Option, false> = {
29
- dropdownIndicator: (styles, {isFocused, selectProps}) => ({
30
- ...styles,
31
- color: isFocused && selectProps.menuIsOpen ? 'var(--primaryColor)' : 'grey',
32
- transform:
33
- !isFocused && !selectProps.menuIsOpen ? 'rotate(180deg)' : undefined,
34
- }),
35
- option: (styles, {isDisabled, isFocused, isSelected}) => {
36
- return {
37
- ...styles,
38
- backgroundColor: isDisabled
39
- ? undefined
40
- : isSelected && isFocused
41
- ? 'var(--selectOptionSelectedBg)'
42
- : isFocused && !isSelected
43
- ? 'var(--selectOptionFocusedColor)'
44
- : undefined,
45
- };
46
- },
47
- };
48
-
49
- const errorStyles = {
50
- color: '#FF0000',
51
- fontWeight: '400'
52
- };
53
-
54
- const GeneralSelect: React.FC<GeneralSelectProps> = ({
55
- options,
56
- placeholder,
57
- error,
58
- label,
59
- isError,
60
- selectedValue,
61
- setSelectedValue,
62
- }) => {
63
- return (
64
- <div className="select-layout">
65
- <label>{label && label}</label>
66
- <Select
67
- value={selectedValue}
68
- options={options}
69
- onChange={setSelectedValue}
70
- styles={colourStyles}
71
- className="generic-select-container"
72
- classNamePrefix="generic-select"
73
- placeholder={placeholder}
74
- blurInputOnSelect
75
- />
76
- {isError && (
77
- <Typography variant="p" style={errorStyles}>
78
- <sup>*</sup>
79
- {error}
80
- </Typography>
81
- )}
82
- </div>
83
- );
84
- };
85
-
86
- export default GeneralSelect;
@@ -1,77 +0,0 @@
1
- .select-layout {
2
- display: flex;
3
- flex-direction: column;
4
- align-items: flex-start;
5
- justify-content: flex-start;
6
- width: 100%;
7
- gap: 8px;
8
-
9
- label {
10
- color: var(--selectTextColor);
11
- font-size: 14px;
12
- font-style: normal;
13
- font-weight: 500;
14
- line-height: normal;
15
- margin-bottom: 5px;
16
- }
17
-
18
- .generic-select-container {
19
- width: 100%;
20
- cursor: pointer;
21
- font-size: 16px;
22
- line-height: 21px;
23
- .generic-select__control {
24
- height: 100%;
25
- min-height: 55px;
26
- background-color: var(--selectBgColor);
27
- border: 0.5px solid var(--selectBorderColor);
28
- border-radius: 7px;
29
- padding-left: 10px;
30
- .generic-select__value-container {
31
- .generic-select__single-value {
32
- color: var(--selectTextColor);
33
- }
34
- }
35
- &:hover {
36
- border: 0.5px solid var(--selectBorderColor);
37
- }
38
- &::placeholder {
39
- opacity: 0.5;
40
- }
41
- &.generic-select__control--is-focused {
42
- border: 0.5px solid var(--selectBorderColor);
43
- box-shadow: none;
44
- }
45
- .generic-select__indicators {
46
- transition: 0.2s ease-in all;
47
- .generic-select__indicator-separator {
48
- display: none !important;
49
- }
50
- }
51
- }
52
-
53
- .generic-select__menu {
54
- background-color: var(--selectMenuBgColor);
55
- .generic-select__menu-list {
56
- padding: 0px 5px;
57
- .generic-select__option {
58
- font-size: 14px;
59
- font-weight: 400;
60
- line-height: 16.94px;
61
- text-align: left;
62
- color: var(--selectOptionTextColor);
63
- padding: auto 10px;
64
- border-bottom: 0.5px solid var(--selectOptionBorderColor);
65
- cursor: pointer;
66
- &:last-child {
67
- border: none;
68
- }
69
- &.generic-select__option--is-focused {
70
- background-color: var(--selectOptionFocusedColor);
71
- color: var(--selectOptionFocusedTextColor);
72
- }
73
- }
74
- }
75
- }
76
- }
77
- }
@@ -1,24 +0,0 @@
1
- import React from 'react';
2
-
3
- // react-tooltip
4
- import { Tooltip } from 'react-tooltip';
5
- import 'react-tooltip/dist/react-tooltip.css';
6
-
7
- // styles
8
- import './styles.scss';
9
-
10
- interface GeneralTooltipProps {
11
- anchorSelect: string;
12
- place: 'top' | 'right' | 'bottom' | 'left';
13
- title: string;
14
- }
15
-
16
- const GeneralTooltip: React.FC<GeneralTooltipProps> = ({ anchorSelect, place, title }) => {
17
- return (
18
- <Tooltip className="basic-tooltip" anchorSelect={anchorSelect} place={place}>
19
- {title}
20
- </Tooltip>
21
- );
22
- };
23
-
24
- export default GeneralTooltip;
@@ -1,9 +0,0 @@
1
- .basic-tooltip {
2
- width: 90% !important;
3
- max-width: fit-content !important;
4
- text-align: center !important;
5
- background-color: #ffffff !important;
6
- color: #000000 !important;
7
- box-shadow: 0px 0px 12px 0px #989595 !important;
8
- opacity: 1 !important;
9
- }
@@ -1,53 +0,0 @@
1
- import React, { useEffect } from 'react';
2
-
3
- // Toastify
4
- import {ToastContainer, toast} from 'react-toastify';
5
- import 'react-toastify/dist/ReactToastify.css';
6
-
7
- //Hooks
8
- import { useDispatch, useSelector } from "react-redux";
9
- import { AppDispatch, RootState } from '../../../redux/store';
10
-
11
- // Actions
12
- import { closeSnackbar } from '../../../redux/actions/snackbarActions';
13
-
14
- // Components
15
- import Typography from '../Typography';
16
-
17
- // styles
18
- import './styles.scss'
19
-
20
- const GenericSnackbar:React.FC = () => {
21
- const open = useSelector(
22
- (state: RootState) => state.snackbarReducers.snackbar.open
23
- );
24
-
25
- const heading = useSelector(
26
- (state: RootState) => state.snackbarReducers.snackbar.heading
27
- );
28
- const message = useSelector(
29
- (state: RootState) => state.snackbarReducers.snackbar.message
30
- );
31
-
32
- const dispatch: AppDispatch = useDispatch();
33
-
34
- const Element = (
35
- <div className="toast-content">
36
- <Typography>{heading || ''}</Typography>
37
- <Typography>{message || ''}</Typography>
38
- </div>
39
- );
40
-
41
- const notify = () => toast(Element);
42
-
43
- useEffect(() =>{
44
- if(open){
45
- notify()
46
- dispatch(closeSnackbar())
47
- }
48
- }, [open])
49
-
50
- return <ToastContainer className="toast-container" toastClassName='basic-toast' bodyClassName="toast-body" hideProgressBar autoClose={3000}/>;
51
- }
52
-
53
- export default GenericSnackbar;
@@ -1,34 +0,0 @@
1
- .toast-container {
2
- width: 100%;
3
- max-width: 400px;
4
-
5
- .basic-toast {
6
- background-color: #ef7820;
7
- button {
8
- opacity: 1;
9
- svg {
10
- height: 20px;
11
- width: 20px;
12
- fill: #ffffff;
13
- }
14
- }
15
- .toast-body {
16
- .toast-content {
17
- height: 100%;
18
- max-height: 50px;
19
- display: flex;
20
- justify-content: flex-start;
21
- align-items: flex-start;
22
- gap: 10px;
23
- flex-direction: column;
24
- p {
25
- color: #ffffff;
26
- margin: 0;
27
- &:first-child {
28
- font-weight: 600;
29
- }
30
- }
31
- }
32
- }
33
- }
34
- }
@@ -1,82 +0,0 @@
1
- // src/components/Grid.js
2
- import React from 'react';
3
-
4
- // styled components
5
- import styled from 'styled-components';
6
-
7
- interface GridItemProps {
8
- xs?: number;
9
- sm?: number;
10
- md?: number;
11
- lg?: number;
12
- xl?: number;
13
- }
14
-
15
- const breakpoints = {
16
- xs: '0px',
17
- sm: '600px',
18
- md: '960px',
19
- lg: '1280px',
20
- xl: '1920px',
21
- };
22
-
23
- const Container = styled.div`
24
- display: flex;
25
- flex-wrap: wrap;
26
- width: 100%;
27
- `;
28
-
29
- const Col = styled.div<GridItemProps>`
30
- padding: 0 8px;
31
- box-sizing: border-box;
32
- ${(props) =>
33
- props.xs &&
34
- `flex: 0 0 ${(props.xs / 12) * 100}%;
35
- max-width: ${
36
- (props.xs / 12) * 100
37
- }%;`}
38
- @media (min-width: ${breakpoints.sm}) {
39
- ${(props) =>
40
- props.sm &&
41
- `flex: 0 0 ${(props.sm / 12) * 100}%;
42
- max-width: ${
43
- (props.sm / 12) * 100
44
- }%;`}
45
- }
46
- @media (min-width: ${breakpoints.md}) {
47
- ${(props) =>
48
- props.md &&
49
- `flex: 0 0 ${(props.md / 12) * 100}%;
50
- max-width: ${
51
- (props.md / 12) * 100
52
- }%;`}
53
- }
54
- @media (min-width: ${breakpoints.lg}) {
55
- ${(props) =>
56
- props.lg &&
57
- `flex: 0 0 ${(props.lg / 12) * 100}%;
58
- max-width: ${
59
- (props.lg / 12) * 100
60
- }%;`}
61
- }
62
- @media (min-width: ${breakpoints.xl}) {
63
- ${(props) =>
64
- props.xl &&
65
- `flex: 0 0 ${(props.xl / 12) * 100}%;
66
- max-width: ${
67
- (props.xl / 12) * 100
68
- }%;`}
69
- }
70
- `;
71
-
72
- export const GridContainer = ({children, style = {}}: any) => {
73
- return <Container style={style}>{children}</Container>;
74
- };
75
-
76
- export const GridItem = ({xs, sm, md, lg, xl, children}: any) => {
77
- return (
78
- <Col xs={xs} sm={sm} md={md} lg={lg} xl={xl}>
79
- {children}
80
- </Col>
81
- );
82
- };
@@ -1,89 +0,0 @@
1
- import React, {ChangeEvent, FC} from 'react';
2
-
3
- // components
4
- import Typography from '../Typography';
5
-
6
- // icon
7
- import Search from '../../../assets/images/input/search';
8
- import Cancel from '../../../assets/images/input/cancel';
9
-
10
- // styles
11
- import './styles.scss';
12
-
13
- const errorStyles = {
14
- color: '#FF0000',
15
- fontWeight: "400"
16
- };
17
-
18
- interface InputProps {
19
- variant?: keyof JSX.IntrinsicElements;
20
- type: any;
21
- value: string;
22
- onChange: (
23
- e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement | any>
24
- ) => void;
25
- placeholder?: string;
26
- label?: string;
27
- error?: string;
28
- inputIcon?: boolean;
29
- searchApplied?: boolean;
30
- onClick?: () => void;
31
- removeSearchInput?: () => void;
32
- onKeyDown?: () => void;
33
- }
34
-
35
- const Input: FC<InputProps> = ({
36
- variant = 'input',
37
- type,
38
- value,
39
- onChange,
40
- placeholder,
41
- label,
42
- error,
43
- inputIcon = false,
44
- onClick,
45
- searchApplied,
46
- removeSearchInput,
47
- onKeyDown,
48
- }) => {
49
- const InputVariant = variant || 'input';
50
-
51
- return (
52
- <div className="input-layout">
53
- <label className="basic-label">{label ? label : ''}</label>
54
- <div className={`input-with-icon ${searchApplied && 'focused'}`}>
55
- <InputVariant
56
- type={type}
57
- value={value}
58
- onChange={onChange}
59
- placeholder={placeholder}
60
- className="basic-input"
61
- onKeyDown={onKeyDown}
62
- />
63
- {inputIcon && (
64
- <>
65
- {searchApplied && value.length > 0 ? (
66
- <div className="cancel-input-button" onClick={removeSearchInput}>
67
- <Cancel fill="var(--inputSearchIcon)" />
68
- </div>
69
- ) : null}
70
- <div
71
- className="search-input-button"
72
- onClick={value.length > 0 ? onClick : () => {}}
73
- >
74
- <Search fill="#ED5C2F" />
75
- </div>
76
- </>
77
- )}
78
- </div>
79
- {error && (
80
- <Typography variant="p" style={errorStyles}>
81
- <sup>*</sup>
82
- {error}
83
- </Typography>
84
- )}
85
- </div>
86
- );
87
- };
88
-
89
- export default Input;
@@ -1,80 +0,0 @@
1
- .input-layout {
2
- display: flex;
3
- flex-direction: column;
4
- align-items: flex-start;
5
- justify-content: flex-start;
6
- width: 100%;
7
- gap: 10px;
8
-
9
- .basic-label {
10
- font-size: 14px;
11
- font-weight: 400;
12
- }
13
-
14
- .input-with-icon {
15
- display: flex;
16
- justify-content: center;
17
- align-items: center;
18
- border: 0.5px solid var(--inputBorderColor);
19
- border-radius: 7px;
20
- height: 100%;
21
- min-height: 55px;
22
- width: 100%;
23
- background-color: var(--inputBgColor);
24
-
25
- .basic-input {
26
- width: 100%;
27
- padding: 5px 20px;
28
- background: transparent;
29
- font-size: 14px;
30
- font-family: 'Inter', sans-serif !important;
31
- font-weight: 500;
32
- line-height: 24px;
33
- color: var(--inputTextColor);
34
- border: none;
35
- border-radius: 7px;
36
- &:focus {
37
- outline: none;
38
- }
39
- &::placeholder {
40
- opacity: 50%;
41
- color: var(--inputTextColor);
42
- }
43
- }
44
-
45
- .search-input-button {
46
- position: relative;
47
- display: flex;
48
- justify-content: center;
49
- align-items: center;
50
- &::before {
51
- content: '';
52
- position: absolute;
53
- background-color: #303030;
54
- height: 100%;
55
- width: 1px;
56
- top: 0;
57
- right: 40px;
58
- }
59
- svg {
60
- margin-right: 10px;
61
- cursor: pointer;
62
- }
63
- }
64
-
65
- .cancel-input-button {
66
- display: flex;
67
- justify-content: center;
68
- align-items: center;
69
- svg {
70
- width: 15px !important;
71
- margin-right: 10px;
72
- cursor: pointer;
73
- }
74
- }
75
- }
76
-
77
- .focused {
78
- background-color: var(--inputSearchAppliedBg);
79
- }
80
- }
@@ -1,18 +0,0 @@
1
- import React, { CSSProperties, ReactNode } from 'react';
2
-
3
- // styles
4
- import './styles.scss';
5
-
6
- interface TypographyProps {
7
- children?: ReactNode;
8
- style?: CSSProperties;
9
- variant?: keyof JSX.IntrinsicElements;
10
- className?: string;
11
- }
12
-
13
- const Typography: React.FC<TypographyProps> = ({ children = '', style = {}, variant = 'p', className = '' }) => {
14
- const Tag = variant || 'p';
15
- return <Tag className={className} style={style}>{children}</Tag>;
16
- };
17
-
18
- export default Typography;