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,87 +1,86 @@
1
- import React from "react";
2
- import { Layout, Menu } from "antd";
3
- import "./app-sidebar.css";
4
-
5
- const { Sider } = Layout;
6
-
7
- interface SidebarProps {
8
- links: {
9
- onClick?: () => void;
10
- label: string;
11
- path: string;
12
- icon: React.ReactNode;
13
- activeIcon?: React.ReactNode;
14
- tag?: React.ReactNode;
15
- }[];
16
- sideBarHead?: React.ReactNode;
17
- footerLinks?: {
18
- label: string;
19
- path: string;
20
- icon: React.ReactNode;
21
- activeIcon?: React.ReactNode;
22
- }[];
23
- className?: string;
24
- activeLink?: string;
25
- }
26
-
27
- const Sidebar = ({
28
- links,
29
- sideBarHead,
30
- footerLinks,
31
- className,
32
- activeLink,
33
- }: SidebarProps) => {
34
- const handleNavigation = (path: string) => {
35
- if (path) {
36
- window.location.href = path;
37
- }
38
- };
39
-
40
- const handleClick = (path: string, onClick?: () => void) => {
41
- if (onClick) {
42
- onClick();
43
- } else {
44
- handleNavigation(path);
45
- }
46
- };
47
-
48
- const menuItems = links.map((link) => ({
49
- key: link.path || link.label,
50
-
51
- icon:
52
- link.path === activeLink && link.activeIcon ? link.activeIcon : link.icon,
53
- className: link.path === activeLink ? "active" : "",
54
- label: (
55
- <span onClick={() => handleClick(link.path, link.onClick)}>
56
- {link.label}
57
- {link.tag && <span className={"tag"}>{link.tag}</span>}
58
- </span>
59
- ),
60
- }));
61
-
62
- const footerMenuItems = footerLinks?.map((link) => ({
63
- key: link.path,
64
- icon:
65
- link.path === activeLink && link.activeIcon ? link.activeIcon : link.icon,
66
- className: link.path === activeLink ? "active" : "",
67
- label: (
68
- <span onClick={() => handleNavigation(link.path)}>{link.label}</span>
69
- ),
70
- }));
71
-
72
- return (
73
- <div className={`sideBar ${className}`}>
74
- <Sider className={"sider"}>
75
- <div className={"sideBarHead"}>{sideBarHead}</div>
76
- <Menu mode="inline" className={"menu"} items={menuItems} />
77
- {footerLinks && (
78
- <div className={"footer"}>
79
- <Menu mode="inline" items={footerMenuItems} />
80
- </div>
81
- )}
82
- </Sider>
83
- </div>
84
- );
85
- };
86
-
87
- export default Sidebar;
1
+ import React from "react";
2
+ import { Layout, Menu } from "antd";
3
+ import "./app-sidebar.css";
4
+
5
+ const { Sider } = Layout;
6
+
7
+ interface SidebarProps {
8
+ links: {
9
+ onClick?: () => void;
10
+ label: string;
11
+ path: string;
12
+ icon: React.ReactNode;
13
+ activeIcon?: React.ReactNode;
14
+ tag?: React.ReactNode;
15
+ }[];
16
+ sideBarHead?: React.ReactNode;
17
+ footerLinks?: {
18
+ label: string;
19
+ path: string;
20
+ icon: React.ReactNode;
21
+ activeIcon?: React.ReactNode;
22
+ }[];
23
+ className?: string;
24
+ activeLink?: string;
25
+ }
26
+
27
+ const Sidebar = ({
28
+ links,
29
+ sideBarHead,
30
+ footerLinks,
31
+ className,
32
+ activeLink,
33
+ }: SidebarProps) => {
34
+ const handleNavigation = (path: string) => {
35
+ if (path) {
36
+ window.location.href = path;
37
+ }
38
+ };
39
+
40
+ const handleClick = (path: string, onClick?: () => void) => {
41
+ if (onClick) {
42
+ onClick();
43
+ } else {
44
+ handleNavigation(path);
45
+ }
46
+ };
47
+
48
+ const menuItems = links.map((link) => ({
49
+ key: link.path || link.label,
50
+ icon:
51
+ link.path === activeLink && link.activeIcon ? link.activeIcon : link.icon,
52
+ className: link.path === activeLink ? "active" : "",
53
+ label: (
54
+ <span onClick={() => handleClick(link.path, link.onClick)}>
55
+ <span>{link.label}</span>
56
+ {link.tag && <span className={"tag"}>{link.tag}</span>}
57
+ </span>
58
+ ),
59
+ }));
60
+
61
+ const footerMenuItems = footerLinks?.map((link) => ({
62
+ key: link.path,
63
+ icon:
64
+ link.path === activeLink && link.activeIcon ? link.activeIcon : link.icon,
65
+ className: link.path === activeLink ? "active" : "",
66
+ label: (
67
+ <span onClick={() => handleNavigation(link.path)}>{link.label}</span>
68
+ ),
69
+ }));
70
+
71
+ return (
72
+ <div className={`sideBar ${className}`}>
73
+ <Sider className={"sider"}>
74
+ <div className={"sideBarHead"}>{sideBarHead}</div>
75
+ <Menu mode="inline" className={"menu"} items={menuItems} />
76
+ {footerLinks && (
77
+ <div className={"footer"}>
78
+ <Menu mode="inline" items={footerMenuItems} />
79
+ </div>
80
+ )}
81
+ </Sider>
82
+ </div>
83
+ );
84
+ };
85
+
86
+ export default Sidebar;
@@ -1,22 +1,22 @@
1
- .appTab {
2
- .tab {
3
- .ant-tabs-nav {
4
- &::before {
5
- border: unset !important;
6
- }
7
- .ant-tabs-nav-wrap {
8
- .ant-tabs-nav-list {
9
- display: flex;
10
- gap: 3.5rem;
11
- align-items: center;
12
- .ant-tabs-tab {
13
- margin: 0;
14
- }
15
- .ant-tabs-ink-bar {
16
- display: none;
17
- }
18
- }
19
- }
20
- }
21
- }
22
- }
1
+ .appTab {
2
+ .tab {
3
+ .ant-tabs-nav {
4
+ &::before {
5
+ border: unset !important;
6
+ }
7
+ .ant-tabs-nav-wrap {
8
+ .ant-tabs-nav-list {
9
+ display: flex;
10
+ gap: 3.5rem;
11
+ align-items: center;
12
+ .ant-tabs-tab {
13
+ margin: 0;
14
+ }
15
+ .ant-tabs-ink-bar {
16
+ display: none;
17
+ }
18
+ }
19
+ }
20
+ }
21
+ }
22
+ }
@@ -1,34 +1,34 @@
1
- import React from "react";
2
- import { Tabs } from "antd";
3
- import type { TabsProps } from "antd";
4
- import "./app-tab.css";
5
-
6
- interface AppTabProps {
7
- className?: string;
8
- items?: TabsProps["items"];
9
- handleChange?: (activeKey: string) => void;
10
- defaultActiveKey?: string;
11
- activeKey?:string;
12
- }
13
-
14
- const AppTab = ({
15
- className,
16
- items,
17
- handleChange,
18
- defaultActiveKey,
19
- activeKey,
20
- }: AppTabProps) => {
21
- return (
22
- <div className={`appTab ${className}`}>
23
- <Tabs
24
- defaultActiveKey={defaultActiveKey}
25
- activeKey={activeKey}
26
- items={items}
27
- onChange={handleChange}
28
- className={"tab"}
29
- />
30
- </div>
31
- );
32
- };
33
-
34
- export default AppTab;
1
+ import React from "react";
2
+ import { Tabs } from "antd";
3
+ import type { TabsProps } from "antd";
4
+ import "./app-tab.css";
5
+
6
+ interface AppTabProps {
7
+ className?: string;
8
+ items?: TabsProps["items"];
9
+ handleChange?: (activeKey: string) => void;
10
+ defaultActiveKey?: string;
11
+ activeKey?:string;
12
+ }
13
+
14
+ const AppTab = ({
15
+ className,
16
+ items,
17
+ handleChange,
18
+ defaultActiveKey,
19
+ activeKey,
20
+ }: AppTabProps) => {
21
+ return (
22
+ <div className={`appTab ${className}`}>
23
+ <Tabs
24
+ defaultActiveKey={defaultActiveKey}
25
+ activeKey={activeKey}
26
+ items={items}
27
+ onChange={handleChange}
28
+ className={"tab"}
29
+ />
30
+ </div>
31
+ );
32
+ };
33
+
34
+ export default AppTab;
@@ -1,42 +1,42 @@
1
- import { Table, TableProps } from "antd";
2
- import { ColumnsType } from "antd/lib/table";
3
-
4
- interface AppTableProps<T> extends TableProps<T> {
5
- columns: ColumnsType<T>;
6
- dataSource: T[];
7
- rowKey?: string;
8
- bordered?: boolean;
9
- pagination?: TableProps<T>["pagination"];
10
- size?: "small" | "middle" | "large";
11
- scroll?: TableProps<T>["scroll"];
12
- className?: string;
13
- }
14
-
15
- const AppTable = <T extends object>({
16
- columns,
17
- dataSource,
18
- rowKey,
19
- bordered = false,
20
- pagination = { pageSize: 10 },
21
- size = "middle",
22
- scroll,
23
- className,
24
- ...tableProps
25
- }: AppTableProps<T>) => {
26
- return (
27
- <div className={className}>
28
- <Table
29
- columns={columns}
30
- dataSource={dataSource}
31
- rowKey={rowKey}
32
- bordered={bordered}
33
- pagination={pagination}
34
- size={size}
35
- scroll={scroll}
36
- {...tableProps}
37
- />
38
- </div>
39
- );
40
- };
41
-
42
- export default AppTable;
1
+ import { Table, TableProps } from "antd";
2
+ import { ColumnsType } from "antd/lib/table";
3
+
4
+ interface AppTableProps<T> extends TableProps<T> {
5
+ columns: ColumnsType<T>;
6
+ dataSource: T[];
7
+ rowKey?: string;
8
+ bordered?: boolean;
9
+ pagination?: TableProps<T>["pagination"];
10
+ size?: "small" | "middle" | "large";
11
+ scroll?: TableProps<T>["scroll"];
12
+ className?: string;
13
+ }
14
+
15
+ const AppTable = <T extends object>({
16
+ columns,
17
+ dataSource,
18
+ rowKey,
19
+ bordered = false,
20
+ pagination = { pageSize: 10 },
21
+ size = "middle",
22
+ scroll,
23
+ className,
24
+ ...tableProps
25
+ }: AppTableProps<T>) => {
26
+ return (
27
+ <div className={className}>
28
+ <Table
29
+ columns={columns}
30
+ dataSource={dataSource}
31
+ rowKey={rowKey}
32
+ bordered={bordered}
33
+ pagination={pagination}
34
+ size={size}
35
+ scroll={scroll}
36
+ {...tableProps}
37
+ />
38
+ </div>
39
+ );
40
+ };
41
+
42
+ export default AppTable;
@@ -1,11 +1,11 @@
1
- .appTab {
2
- width: max-content;
3
- .ant-tag {
4
- display: flex;
5
- align-items: center;
6
- margin: 0;
7
- border-radius: 8px;
8
- padding: 4px 8px;
9
- line-height: normal;
10
- }
11
- }
1
+ .appTab {
2
+ width: max-content;
3
+ .ant-tag {
4
+ display: flex;
5
+ align-items: center;
6
+ margin: 0;
7
+ border-radius: 8px;
8
+ padding: 4px 8px;
9
+ line-height: normal;
10
+ }
11
+ }
@@ -1,48 +1,48 @@
1
- import React, { useState } from "react";
2
- import { Tag } from "antd";
3
- import "./app-tag.css";
4
-
5
- interface AppTagProps {
6
- color?: string;
7
- closable?: boolean;
8
- onClick?: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
9
- style?: React.CSSProperties;
10
- className?: string;
11
- children: React.ReactNode;
12
- closeIcon?: React.ReactNode;
13
- }
14
-
15
- const AppTag = ({
16
- color,
17
- closable = false,
18
- onClick,
19
- style,
20
- className,
21
- children,
22
- closeIcon,
23
- }: AppTagProps) => {
24
- const [visible, setVisible] = useState(true);
25
-
26
- const handleClose = () => {
27
- setVisible(false);
28
- };
29
-
30
- if (!visible) return null;
31
-
32
- return (
33
- <div className={`appTab ${className}`}>
34
- <Tag
35
- color={color}
36
- closable={closable}
37
- onClose={handleClose}
38
- onClick={onClick}
39
- style={style}
40
- closeIcon={closeIcon}
41
- >
42
- {children}
43
- </Tag>
44
- </div>
45
- );
46
- };
47
-
48
- export default AppTag;
1
+ import React, { useState } from "react";
2
+ import { Tag } from "antd";
3
+ import "./app-tag.css";
4
+
5
+ interface AppTagProps {
6
+ color?: string;
7
+ closable?: boolean;
8
+ onClick?: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
9
+ style?: React.CSSProperties;
10
+ className?: string;
11
+ children: React.ReactNode;
12
+ closeIcon?: React.ReactNode;
13
+ }
14
+
15
+ const AppTag = ({
16
+ color,
17
+ closable = false,
18
+ onClick,
19
+ style,
20
+ className,
21
+ children,
22
+ closeIcon,
23
+ }: AppTagProps) => {
24
+ const [visible, setVisible] = useState(true);
25
+
26
+ const handleClose = () => {
27
+ setVisible(false);
28
+ };
29
+
30
+ if (!visible) return null;
31
+
32
+ return (
33
+ <div className={`appTab ${className}`}>
34
+ <Tag
35
+ color={color}
36
+ closable={closable}
37
+ onClose={handleClose}
38
+ onClick={onClick}
39
+ style={style}
40
+ closeIcon={closeIcon}
41
+ >
42
+ {children}
43
+ </Tag>
44
+ </div>
45
+ );
46
+ };
47
+
48
+ export default AppTag;
@@ -1,25 +1,25 @@
1
- .appTextArea {
2
- .ant-input-outlined {
3
- border-color: #bfbebe;
4
- &:hover {
5
- border-color: #bfbebe;
6
- }
7
- }
8
- .ant-input::placeholder {
9
- color: #202123 !important;
10
- font-size: 14px;
11
- font-weight: 500;
12
- line-height: normal;
13
- }
14
-
15
- *:focus {
16
- outline: 0 !important;
17
- box-shadow: unset !important;
18
- }
19
- }
20
-
21
- .error {
22
- color: red;
23
- font-size: 0.875rem;
24
- margin-top: 0.25rem;
25
- }
1
+ .appTextArea {
2
+ .ant-input-outlined {
3
+ border-color: #bfbebe;
4
+ &:hover {
5
+ border-color: #bfbebe;
6
+ }
7
+ }
8
+ .ant-input::placeholder {
9
+ color: #202123 !important;
10
+ font-size: 14px;
11
+ font-weight: 500;
12
+ line-height: normal;
13
+ }
14
+
15
+ *:focus {
16
+ outline: 0 !important;
17
+ box-shadow: unset !important;
18
+ }
19
+ }
20
+
21
+ .error {
22
+ color: red;
23
+ font-size: 0.875rem;
24
+ margin-top: 0.25rem;
25
+ }
@@ -1,59 +1,59 @@
1
- import { Input } from "antd";
2
- import { ChangeEventHandler, KeyboardEventHandler } from "react";
3
- import "./app-textarea.css";
4
-
5
- interface textAreaProps {
6
- id?: string;
7
- label?: string;
8
- name?: string;
9
- value?: string;
10
- dataTestId?: string;
11
- defaultValue?: string;
12
- onPressEnter?: KeyboardEventHandler<HTMLTextAreaElement>;
13
- handleChange?: ChangeEventHandler<HTMLTextAreaElement>;
14
- autoSize?: {
15
- minRows?: number;
16
- maxRows?: number;
17
- };
18
- rows?: number;
19
- cols?: number;
20
- placeholder?: string;
21
- className?: string;
22
- error?: string;
23
- }
24
-
25
- const AppTextarea = ({
26
- id,
27
- placeholder,
28
- name,
29
- value,
30
- dataTestId,
31
- defaultValue,
32
- onPressEnter,
33
- handleChange,
34
- rows,
35
- cols,
36
- className,
37
- error,
38
- }: textAreaProps) => {
39
- return (
40
- <div className={`appTextArea ${className}`}>
41
- <Input.TextArea
42
- data-test-id={dataTestId}
43
- id={id}
44
- name={name}
45
- placeholder={placeholder}
46
- value={value}
47
- className={"textArea"}
48
- onChange={handleChange}
49
- defaultValue={defaultValue}
50
- onPressEnter={onPressEnter}
51
- rows={rows}
52
- cols={cols}
53
- />
54
- {error && <div className={"error"}>{error}</div>}
55
- </div>
56
- );
57
- };
58
-
59
- export default AppTextarea;
1
+ import { Input } from "antd";
2
+ import { ChangeEventHandler, KeyboardEventHandler } from "react";
3
+ import "./app-textarea.css";
4
+
5
+ interface textAreaProps {
6
+ id?: string;
7
+ label?: string;
8
+ name?: string;
9
+ value?: string;
10
+ dataTestId?: string;
11
+ defaultValue?: string;
12
+ onPressEnter?: KeyboardEventHandler<HTMLTextAreaElement>;
13
+ handleChange?: ChangeEventHandler<HTMLTextAreaElement>;
14
+ autoSize?: {
15
+ minRows?: number;
16
+ maxRows?: number;
17
+ };
18
+ rows?: number;
19
+ cols?: number;
20
+ placeholder?: string;
21
+ className?: string;
22
+ error?: string;
23
+ }
24
+
25
+ const AppTextarea = ({
26
+ id,
27
+ placeholder,
28
+ name,
29
+ value,
30
+ dataTestId,
31
+ defaultValue,
32
+ onPressEnter,
33
+ handleChange,
34
+ rows,
35
+ cols,
36
+ className,
37
+ error,
38
+ }: textAreaProps) => {
39
+ return (
40
+ <div className={`appTextArea ${className}`}>
41
+ <Input.TextArea
42
+ data-test-id={dataTestId}
43
+ id={id}
44
+ name={name}
45
+ placeholder={placeholder}
46
+ value={value}
47
+ className={"textArea"}
48
+ onChange={handleChange}
49
+ defaultValue={defaultValue}
50
+ onPressEnter={onPressEnter}
51
+ rows={rows}
52
+ cols={cols}
53
+ />
54
+ {error && <div className={"error"}>{error}</div>}
55
+ </div>
56
+ );
57
+ };
58
+
59
+ export default AppTextarea;