react-frontend-common-components 0.0.83 → 0.0.85

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 (77) hide show
  1. package/dist/index.js +27 -23
  2. package/dist/index.js.map +1 -1
  3. package/dist/index.mjs +27 -23
  4. package/dist/index.mjs.map +1 -1
  5. package/package.json +43 -40
  6. package/rollup.config.js +44 -44
  7. package/src/components/app-avatar/app-avatar.tsx +24 -24
  8. package/src/components/app-back-arrow/app-back-arrow.css +17 -17
  9. package/src/components/app-back-arrow/app-back-arrow.tsx +37 -37
  10. package/src/components/app-badge/app-badge.css +11 -11
  11. package/src/components/app-badge/app-badge.tsx +44 -44
  12. package/src/components/app-bread-crumb/app-bread-crumb.tsx +16 -16
  13. package/src/components/app-button/app-button.css +13 -13
  14. package/src/components/app-button/app-button.tsx +51 -51
  15. package/src/components/app-card/app-card.css +8 -8
  16. package/src/components/app-card/app-card.tsx +43 -43
  17. package/src/components/app-carousel/app-carousel.css +68 -68
  18. package/src/components/app-carousel/app-carousel.tsx +62 -62
  19. package/src/components/app-chart/app-chart.css +6 -6
  20. package/src/components/app-chart/app-chart.tsx +98 -98
  21. package/src/components/app-checkbox-text/app-checkbox-text.css +12 -12
  22. package/src/components/app-checkbox-text/app-checkbox-text.tsx +32 -32
  23. package/src/components/app-collapse/app-collapse.tsx +57 -57
  24. package/src/components/app-custom-loader/app-custom-loader.css +116 -116
  25. package/src/components/app-custom-loader/app-custom-loader.tsx +23 -23
  26. package/src/components/app-divider/app-divider.tsx +16 -16
  27. package/src/components/app-float-button/app-float-button.tsx +23 -23
  28. package/src/components/app-image-box/app-image-box.css +22 -22
  29. package/src/components/app-image-box/app-image-box.tsx +42 -42
  30. package/src/components/app-input/app-input.css +81 -81
  31. package/src/components/app-input/app-input.tsx +119 -119
  32. package/src/components/app-label/app-label.css +5 -5
  33. package/src/components/app-label/app-label.tsx +34 -34
  34. package/src/components/app-list/app-list.tsx +26 -26
  35. package/src/components/app-loader/app-loader.css +16 -16
  36. package/src/components/app-loader/app-loader.tsx +28 -28
  37. package/src/components/app-location-map/app-location-map.css +4 -4
  38. package/src/components/app-location-map/app-location-map.tsx +62 -62
  39. package/src/components/app-modal/app-modal.css +34 -34
  40. package/src/components/app-modal/app-modal.tsx +61 -61
  41. package/src/components/app-otp-field/app-otp-field.css +28 -28
  42. package/src/components/app-otp-field/app-otp-field.tsx +70 -70
  43. package/src/components/app-pagination/app-pagination.tsx +40 -40
  44. package/src/components/app-password-input/app-password-input.css +41 -41
  45. package/src/components/app-password-input/app-password-input.tsx +90 -90
  46. package/src/components/app-phone-input/app-phone-input.css +12 -12
  47. package/src/components/app-phone-input/app-phone-input.tsx +56 -56
  48. package/src/components/app-popover/app-popover.css +5 -5
  49. package/src/components/app-popover/app-popover.tsx +45 -45
  50. package/src/components/app-progress/app-progress.tsx +40 -40
  51. package/src/components/app-radio-group/app-radio-group.css +6 -6
  52. package/src/components/app-radio-group/app-radio-group.tsx +45 -45
  53. package/src/components/app-select/app-select.css +55 -55
  54. package/src/components/app-select/app-select.tsx +130 -130
  55. package/src/components/app-select-add/app-select-add.css +21 -21
  56. package/src/components/app-select-add/app-select-add.tsx +34 -34
  57. package/src/components/app-sidebar/app-sidebar.css +49 -49
  58. package/src/components/app-sidebar/app-sidebar.tsx +86 -87
  59. package/src/components/app-tab/app-tab.css +22 -22
  60. package/src/components/app-tab/app-tab.tsx +34 -34
  61. package/src/components/app-table/app-table.tsx +42 -42
  62. package/src/components/app-tag/app-tag.css +11 -11
  63. package/src/components/app-tag/app-tag.tsx +48 -48
  64. package/src/components/app-textarea/app-textarea.css +25 -25
  65. package/src/components/app-textarea/app-textarea.tsx +59 -59
  66. package/src/components/app-title/app-title.css +12 -12
  67. package/src/components/app-title/app-title.tsx +28 -28
  68. package/src/components/app-toggle-button/app-toggle-button.css +27 -27
  69. package/src/components/app-toggle-button/app-toggle-button.tsx +43 -43
  70. package/src/components/app-upload-image/app-upload-image.css +26 -26
  71. package/src/components/app-upload-image/app-upload-image.tsx +90 -90
  72. package/src/components/over-view-card/over-view-card.css +15 -15
  73. package/src/components/over-view-card/over-view-card.tsx +26 -26
  74. package/src/index.ts +38 -38
  75. package/src/themes/icons/icons.tsx +146 -146
  76. package/src/themes/images/profile-img.svg +14 -14
  77. package/tsconfig.json +20 -20
@@ -1,55 +1,55 @@
1
- .appselect {
2
- font-weight: 500;
3
- font-size: var(--font-14);
4
- position: relative;
5
- *:focus,
6
- *:active,
7
- *:focus-within {
8
- outline: 0 !important;
9
- box-shadow: unset !important;
10
- }
11
- .ant-select {
12
- width: 100%;
13
- height: 40px;
14
- .ant-select-selector {
15
- .ant-select-selection-placeholder {
16
- color: #202123 !important;
17
- font-size: 14px;
18
- font-weight: 500;
19
- line-height: normal;
20
- }
21
- }
22
- &:hover {
23
- .ant-select-selector {
24
- border-color: #d9d9d9 !important;
25
- }
26
- }
27
- }
28
- }
29
-
30
- .error {
31
- color: red;
32
- font-size: 0.875rem;
33
- margin-top: 0.25rem;
34
- }
35
-
36
- .placeHolder {
37
- line-height: normal;
38
- position: absolute;
39
- bottom: 50%;
40
- transform: translateY(50%);
41
- left: 11px;
42
- z-index: 1 !important;
43
- }
44
- .requiredText {
45
- opacity: 60%;
46
- color: #686869 !important;
47
- font-size: 14px;
48
- font-weight: 500;
49
- line-height: normal;
50
- }
51
- .star {
52
- color: rgba(255, 40, 25, 1);
53
- display: inline-block;
54
- transform: translateX(1.5px);
55
- }
1
+ .appselect {
2
+ font-weight: 500;
3
+ font-size: var(--font-14);
4
+ position: relative;
5
+ *:focus,
6
+ *:active,
7
+ *:focus-within {
8
+ outline: 0 !important;
9
+ box-shadow: unset !important;
10
+ }
11
+ .ant-select {
12
+ width: 100%;
13
+ height: 40px;
14
+ .ant-select-selector {
15
+ .ant-select-selection-placeholder {
16
+ color: #202123 !important;
17
+ font-size: 14px;
18
+ font-weight: 500;
19
+ line-height: normal;
20
+ }
21
+ }
22
+ &:hover {
23
+ .ant-select-selector {
24
+ border-color: #d9d9d9 !important;
25
+ }
26
+ }
27
+ }
28
+ }
29
+
30
+ .error {
31
+ color: red;
32
+ font-size: 0.875rem;
33
+ margin-top: 0.25rem;
34
+ }
35
+
36
+ .placeHolder {
37
+ line-height: normal;
38
+ position: absolute;
39
+ bottom: 50%;
40
+ transform: translateY(50%);
41
+ left: 11px;
42
+ z-index: 1 !important;
43
+ }
44
+ .requiredText {
45
+ opacity: 60%;
46
+ color: #686869 !important;
47
+ font-size: 14px;
48
+ font-weight: 500;
49
+ line-height: normal;
50
+ }
51
+ .star {
52
+ color: rgba(255, 40, 25, 1);
53
+ display: inline-block;
54
+ transform: translateX(1.5px);
55
+ }
@@ -1,130 +1,130 @@
1
- import React, { useState, useEffect, useRef } from "react";
2
- import { Select, SelectProps } from "antd";
3
- import { MouseEventHandler } from "react";
4
- import "./app-select.css";
5
-
6
- interface Options {
7
- value: string;
8
- label: string;
9
- flag?: string;
10
- }
11
-
12
- interface AppSelectProps extends SelectProps {
13
- className?: string;
14
- value?: string | null;
15
- dataTestId?: string;
16
- id?: string;
17
- disabled?: boolean;
18
- handleChange?: (value: string | string[]) => void;
19
- onClick?: MouseEventHandler<HTMLElement>;
20
- options?: Options[];
21
- onSelectChange?: (value: string) => void;
22
- required?: boolean;
23
- placeholder?: string;
24
- errorMessage?: string;
25
- showSearch?: boolean;
26
- }
27
-
28
- const AppSelect = ({
29
- value,
30
- handleChange,
31
- options,
32
- disabled,
33
- placeholder,
34
- className,
35
- errorMessage,
36
- showSearch,
37
- required,
38
- ...props
39
- }: AppSelectProps) => {
40
- const selectRef = useRef<HTMLDivElement>(null);
41
- const [selectedValue, setSelectedValue] = useState<string | null>(
42
- value || null
43
- );
44
-
45
- useEffect(() => {
46
- if (value !== undefined) {
47
- setSelectedValue(value);
48
- }
49
- }, [value]);
50
-
51
- const handleSelectChange = (val: string | string[]) => {
52
- setSelectedValue(val ? String(val) : null);
53
- handleChange?.(val);
54
- };
55
-
56
- return (
57
- <div className={`appselect ${className}`} ref={selectRef}>
58
- {/* Show placeholder only when nothing is selected */}
59
- {required && !selectedValue && (
60
- <div
61
- className="placeHolder"
62
- onClick={() => {
63
- const selectElement = selectRef.current?.querySelector(
64
- ".ant-select-selector"
65
- ) as HTMLElement;
66
- if (selectElement) {
67
- selectElement.click();
68
- setTimeout(() => {
69
- selectElement.dispatchEvent(
70
- new MouseEvent("mousedown", { bubbles: true })
71
- );
72
- }, 0);
73
- }
74
- }}
75
- >
76
- <label className="requiredText" htmlFor={props.id}>
77
- {placeholder}
78
- </label>
79
- <span className="star">*</span>
80
- </div>
81
- )}
82
-
83
- <Select
84
- className={"select"}
85
- showSearch={showSearch}
86
- disabled={disabled}
87
- value={selectedValue || null}
88
- placeholder={`${required ? "" : placeholder}`}
89
- onChange={handleSelectChange}
90
- filterOption={(input, option) =>
91
- (option?.label || "")
92
- .toString()
93
- .toLowerCase()
94
- .includes(input.toLowerCase())
95
- }
96
- options={options?.map(({ value, label, flag }) => ({
97
- label: (
98
- <>
99
- {flag ? (
100
- <div
101
- style={{
102
- display: "grid",
103
- alignItems: "center",
104
- gridTemplateColumns: "0.2fr 1fr",
105
- gap: 12,
106
- }}
107
- >
108
- <img
109
- src={flag}
110
- alt={label}
111
- style={{ width: 32, height: 20 }}
112
- />
113
- <span>{label}</span>
114
- </div>
115
- ) : (
116
- <span>{label}</span>
117
- )}
118
- </>
119
- ),
120
- value,
121
- }))}
122
- {...props}
123
- />
124
-
125
- {errorMessage && <div className={"error"}>{errorMessage}</div>}
126
- </div>
127
- );
128
- };
129
-
130
- export default AppSelect;
1
+ import React, { useState, useEffect, useRef } from "react";
2
+ import { Select, SelectProps } from "antd";
3
+ import { MouseEventHandler } from "react";
4
+ import "./app-select.css";
5
+
6
+ interface Options {
7
+ value: string;
8
+ label: string;
9
+ flag?: string;
10
+ }
11
+
12
+ interface AppSelectProps extends SelectProps {
13
+ className?: string;
14
+ value?: string | null;
15
+ dataTestId?: string;
16
+ id?: string;
17
+ disabled?: boolean;
18
+ handleChange?: (value: string | string[]) => void;
19
+ onClick?: MouseEventHandler<HTMLElement>;
20
+ options?: Options[];
21
+ onSelectChange?: (value: string) => void;
22
+ required?: boolean;
23
+ placeholder?: string;
24
+ errorMessage?: string;
25
+ showSearch?: boolean;
26
+ }
27
+
28
+ const AppSelect = ({
29
+ value,
30
+ handleChange,
31
+ options,
32
+ disabled,
33
+ placeholder,
34
+ className,
35
+ errorMessage,
36
+ showSearch,
37
+ required,
38
+ ...props
39
+ }: AppSelectProps) => {
40
+ const selectRef = useRef<HTMLDivElement>(null);
41
+ const [selectedValue, setSelectedValue] = useState<string | null>(
42
+ value || null
43
+ );
44
+
45
+ useEffect(() => {
46
+ if (value !== undefined) {
47
+ setSelectedValue(value);
48
+ }
49
+ }, [value]);
50
+
51
+ const handleSelectChange = (val: string | string[]) => {
52
+ setSelectedValue(val ? String(val) : null);
53
+ handleChange?.(val);
54
+ };
55
+
56
+ return (
57
+ <div className={`appselect ${className}`} ref={selectRef}>
58
+ {/* Show placeholder only when nothing is selected */}
59
+ {required && !selectedValue && (
60
+ <div
61
+ className="placeHolder"
62
+ onClick={() => {
63
+ const selectElement = selectRef.current?.querySelector(
64
+ ".ant-select-selector"
65
+ ) as HTMLElement;
66
+ if (selectElement) {
67
+ selectElement.click();
68
+ setTimeout(() => {
69
+ selectElement.dispatchEvent(
70
+ new MouseEvent("mousedown", { bubbles: true })
71
+ );
72
+ }, 0);
73
+ }
74
+ }}
75
+ >
76
+ <label className="requiredText" htmlFor={props.id}>
77
+ {placeholder}
78
+ </label>
79
+ <span className="star">*</span>
80
+ </div>
81
+ )}
82
+
83
+ <Select
84
+ className={"select"}
85
+ showSearch={showSearch}
86
+ disabled={disabled}
87
+ value={selectedValue || null}
88
+ placeholder={`${required ? "" : placeholder}`}
89
+ onChange={handleSelectChange}
90
+ filterOption={(input, option) =>
91
+ (option?.label || "")
92
+ .toString()
93
+ .toLowerCase()
94
+ .includes(input.toLowerCase())
95
+ }
96
+ options={options?.map(({ value, label, flag }) => ({
97
+ label: (
98
+ <>
99
+ {flag ? (
100
+ <div
101
+ style={{
102
+ display: "grid",
103
+ alignItems: "center",
104
+ gridTemplateColumns: "0.2fr 1fr",
105
+ gap: 12,
106
+ }}
107
+ >
108
+ <img
109
+ src={flag}
110
+ alt={label}
111
+ style={{ width: 32, height: 20 }}
112
+ />
113
+ <span>{label}</span>
114
+ </div>
115
+ ) : (
116
+ <span>{label}</span>
117
+ )}
118
+ </>
119
+ ),
120
+ value,
121
+ }))}
122
+ {...props}
123
+ />
124
+
125
+ {errorMessage && <div className={"error"}>{errorMessage}</div>}
126
+ </div>
127
+ );
128
+ };
129
+
130
+ export default AppSelect;
@@ -1,21 +1,21 @@
1
- .appSelectAdd {
2
- *:focus,
3
- *:active,
4
- *:focus-within {
5
- outline: 0 !important;
6
- box-shadow: unset !important;
7
- }
8
- .ant-select {
9
- &:hover {
10
- .ant-select-selector {
11
- border-color: #d9d9d9 !important;
12
- }
13
- }
14
- }
15
- }
16
-
17
- .error {
18
- color: red;
19
- font-size: 0.875rem;
20
- margin-top: 0.25rem;
21
- }
1
+ .appSelectAdd {
2
+ *:focus,
3
+ *:active,
4
+ *:focus-within {
5
+ outline: 0 !important;
6
+ box-shadow: unset !important;
7
+ }
8
+ .ant-select {
9
+ &:hover {
10
+ .ant-select-selector {
11
+ border-color: #d9d9d9 !important;
12
+ }
13
+ }
14
+ }
15
+ }
16
+
17
+ .error {
18
+ color: red;
19
+ font-size: 0.875rem;
20
+ margin-top: 0.25rem;
21
+ }
@@ -1,34 +1,34 @@
1
- import React from "react";
2
- import { Select } from "antd";
3
- import type { SelectProps } from "antd";
4
- import "./app-select-add.css";
5
-
6
- interface AppSelectAddProps extends SelectProps {
7
- options?: SelectProps["options"];
8
- placeholder?: string;
9
- onChange?: (value: string) => void;
10
- className?: string;
11
- }
12
-
13
- const AppSelectAdd = ({
14
- options = [],
15
- placeholder = "Tags Mode",
16
- onChange,
17
- className,
18
- ...rest
19
- }: AppSelectAddProps) => {
20
- return (
21
- <div className={`appSelectAdd ${className}`}>
22
- <Select
23
- mode="tags"
24
- style={{ width: "100%" }}
25
- placeholder={placeholder}
26
- onChange={onChange}
27
- options={options}
28
- {...rest}
29
- />
30
- </div>
31
- );
32
- };
33
-
34
- export default AppSelectAdd;
1
+ import React from "react";
2
+ import { Select } from "antd";
3
+ import type { SelectProps } from "antd";
4
+ import "./app-select-add.css";
5
+
6
+ interface AppSelectAddProps extends SelectProps {
7
+ options?: SelectProps["options"];
8
+ placeholder?: string;
9
+ onChange?: (value: string) => void;
10
+ className?: string;
11
+ }
12
+
13
+ const AppSelectAdd = ({
14
+ options = [],
15
+ placeholder = "Tags Mode",
16
+ onChange,
17
+ className,
18
+ ...rest
19
+ }: AppSelectAddProps) => {
20
+ return (
21
+ <div className={`appSelectAdd ${className}`}>
22
+ <Select
23
+ mode="tags"
24
+ style={{ width: "100%" }}
25
+ placeholder={placeholder}
26
+ onChange={onChange}
27
+ options={options}
28
+ {...rest}
29
+ />
30
+ </div>
31
+ );
32
+ };
33
+
34
+ export default AppSelectAdd;
@@ -1,49 +1,49 @@
1
- .sideBar {
2
- height: 100vh;
3
- width: max-content;
4
- .sider {
5
- height: 100%;
6
- .ant-layout-sider-children {
7
- height: 100%;
8
- display: flex;
9
- flex-direction: column;
10
- row-gap: 2.875rem;
11
- .ant-menu {
12
- border: none;
13
- &::after {
14
- display: none;
15
- }
16
- &::before {
17
- display: none;
18
- }
19
- }
20
- }
21
- }
22
- }
23
-
24
- .sideBarHead {
25
- padding: 16px;
26
- }
27
-
28
- .menu {
29
- border-right: 0;
30
- }
31
-
32
- .footer {
33
- position: relative;
34
- &::before {
35
- content: "";
36
- height: 1px;
37
- width: 80%;
38
- position: absolute;
39
- top: 0;
40
- right: 50%;
41
- left: 50%;
42
- transform: translateX(-50%);
43
- background-color: #acacac;
44
- }
45
- }
46
-
47
- .tag {
48
- margin-left: 8px;
49
- }
1
+ .sideBar {
2
+ height: 100vh;
3
+ width: max-content;
4
+ .sider {
5
+ height: 100%;
6
+ .ant-layout-sider-children {
7
+ height: 100%;
8
+ display: flex;
9
+ flex-direction: column;
10
+ row-gap: 2.875rem;
11
+ .ant-menu {
12
+ border: none;
13
+ &::after {
14
+ display: none;
15
+ }
16
+ &::before {
17
+ display: none;
18
+ }
19
+ }
20
+ }
21
+ }
22
+ }
23
+
24
+ .sideBarHead {
25
+ padding: 16px;
26
+ }
27
+
28
+ .menu {
29
+ border-right: 0;
30
+ }
31
+
32
+ .footer {
33
+ position: relative;
34
+ &::before {
35
+ content: "";
36
+ height: 1px;
37
+ width: 80%;
38
+ position: absolute;
39
+ top: 0;
40
+ right: 50%;
41
+ left: 50%;
42
+ transform: translateX(-50%);
43
+ background-color: #acacac;
44
+ }
45
+ }
46
+
47
+ .tag {
48
+ margin-left: 8px;
49
+ }