react-frontend-common-components 0.0.76 → 0.0.79

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 (78) hide show
  1. package/dist/index.d.ts +7 -5
  2. package/dist/index.js +13 -27
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.mjs +14 -28
  5. package/dist/index.mjs.map +1 -1
  6. package/package.json +40 -40
  7. package/rollup.config.js +44 -44
  8. package/src/components/app-avatar/app-avatar.tsx +24 -24
  9. package/src/components/app-back-arrow/app-back-arrow.css +17 -17
  10. package/src/components/app-back-arrow/app-back-arrow.tsx +37 -37
  11. package/src/components/app-badge/app-badge.css +11 -11
  12. package/src/components/app-badge/app-badge.tsx +44 -44
  13. package/src/components/app-bread-crumb/app-bread-crumb.tsx +16 -16
  14. package/src/components/app-button/app-button.css +13 -13
  15. package/src/components/app-button/app-button.tsx +51 -51
  16. package/src/components/app-card/app-card.css +8 -8
  17. package/src/components/app-card/app-card.tsx +43 -43
  18. package/src/components/app-carousel/app-carousel.css +68 -68
  19. package/src/components/app-carousel/app-carousel.tsx +62 -62
  20. package/src/components/app-chart/app-chart.css +6 -6
  21. package/src/components/app-chart/app-chart.tsx +98 -98
  22. package/src/components/app-checkbox-text/app-checkbox-text.css +12 -12
  23. package/src/components/app-checkbox-text/app-checkbox-text.tsx +32 -32
  24. package/src/components/app-collapse/app-collapse.tsx +57 -57
  25. package/src/components/app-custom-loader/app-custom-loader.css +116 -116
  26. package/src/components/app-custom-loader/app-custom-loader.tsx +23 -23
  27. package/src/components/app-divider/app-divider.tsx +16 -16
  28. package/src/components/app-float-button/app-float-button.tsx +23 -23
  29. package/src/components/app-image-box/app-image-box.css +22 -22
  30. package/src/components/app-image-box/app-image-box.tsx +42 -42
  31. package/src/components/app-input/app-input.css +59 -59
  32. package/src/components/app-input/app-input.tsx +93 -93
  33. package/src/components/app-label/app-label.css +5 -5
  34. package/src/components/app-label/app-label.tsx +34 -34
  35. package/src/components/app-list/app-list.tsx +26 -26
  36. package/src/components/app-loader/app-loader.css +16 -16
  37. package/src/components/app-loader/app-loader.tsx +28 -28
  38. package/src/components/app-location-map/app-location-map.css +4 -4
  39. package/src/components/app-location-map/app-location-map.tsx +62 -62
  40. package/src/components/app-modal/app-modal.css +34 -34
  41. package/src/components/app-modal/app-modal.tsx +61 -61
  42. package/src/components/app-otp-field/app-otp-field.css +28 -28
  43. package/src/components/app-otp-field/app-otp-field.tsx +70 -70
  44. package/src/components/app-pagination/app-pagination.tsx +40 -40
  45. package/src/components/app-password-input/app-password-input.css +41 -41
  46. package/src/components/app-password-input/app-password-input.tsx +90 -90
  47. package/src/components/app-phone-input/app-phone-input.css +12 -12
  48. package/src/components/app-phone-input/app-phone-input.tsx +56 -56
  49. package/src/components/app-popover/app-popover.css +5 -5
  50. package/src/components/app-popover/app-popover.tsx +45 -45
  51. package/src/components/app-progress/app-progress.tsx +40 -40
  52. package/src/components/app-radio-group/app-radio-group.css +6 -6
  53. package/src/components/app-radio-group/app-radio-group.tsx +45 -45
  54. package/src/components/app-select/app-select.css +33 -33
  55. package/src/components/app-select/app-select.tsx +90 -59
  56. package/src/components/app-select-add/app-select-add.css +21 -21
  57. package/src/components/app-select-add/app-select-add.tsx +34 -34
  58. package/src/components/app-sidebar/app-sidebar.css +49 -49
  59. package/src/components/app-sidebar/app-sidebar.tsx +87 -87
  60. package/src/components/app-tab/app-tab.css +22 -22
  61. package/src/components/app-tab/app-tab.tsx +31 -31
  62. package/src/components/app-table/app-table.tsx +42 -42
  63. package/src/components/app-tag/app-tag.css +11 -11
  64. package/src/components/app-tag/app-tag.tsx +48 -48
  65. package/src/components/app-textarea/app-textarea.css +25 -25
  66. package/src/components/app-textarea/app-textarea.tsx +59 -59
  67. package/src/components/app-title/app-title.css +12 -12
  68. package/src/components/app-title/app-title.tsx +28 -28
  69. package/src/components/app-toggle-button/app-toggle-button.css +27 -27
  70. package/src/components/app-toggle-button/app-toggle-button.tsx +43 -43
  71. package/src/components/app-upload-image/app-upload-image.css +26 -26
  72. package/src/components/app-upload-image/app-upload-image.tsx +90 -90
  73. package/src/components/over-view-card/over-view-card.css +15 -15
  74. package/src/components/over-view-card/over-view-card.tsx +26 -26
  75. package/src/index.ts +38 -38
  76. package/src/themes/icons/icons.tsx +146 -146
  77. package/src/themes/images/profile-img.svg +14 -14
  78. package/tsconfig.json +20 -20
@@ -1,43 +1,43 @@
1
- import React from "react";
2
- import { Card } from "antd";
3
- import { CardProps } from "antd/lib/card";
4
- import "./app-card.css";
5
-
6
- interface AppCardProps extends CardProps {
7
- title?: React.ReactNode;
8
- extra?: React.ReactNode;
9
- cover?: React.ReactNode;
10
- hoverable?: boolean;
11
- actions?: React.ReactNode[];
12
- className?: string;
13
- borderless?: boolean;
14
- }
15
-
16
- const AppCard = ({
17
- title,
18
- extra,
19
- cover,
20
- hoverable = false,
21
- actions,
22
- className,
23
- borderless,
24
- ...cardProps
25
- }: AppCardProps) => {
26
- return (
27
- <div className={`appCard ${className}`}>
28
- <Card
29
- title={title}
30
- extra={extra}
31
- cover={cover}
32
- hoverable={hoverable}
33
- className={`${borderless ? "borderless" : ""}`}
34
- actions={actions}
35
- {...cardProps}
36
- >
37
- {cardProps.children}
38
- </Card>
39
- </div>
40
- );
41
- };
42
-
43
- export default AppCard;
1
+ import React from "react";
2
+ import { Card } from "antd";
3
+ import { CardProps } from "antd/lib/card";
4
+ import "./app-card.css";
5
+
6
+ interface AppCardProps extends CardProps {
7
+ title?: React.ReactNode;
8
+ extra?: React.ReactNode;
9
+ cover?: React.ReactNode;
10
+ hoverable?: boolean;
11
+ actions?: React.ReactNode[];
12
+ className?: string;
13
+ borderless?: boolean;
14
+ }
15
+
16
+ const AppCard = ({
17
+ title,
18
+ extra,
19
+ cover,
20
+ hoverable = false,
21
+ actions,
22
+ className,
23
+ borderless,
24
+ ...cardProps
25
+ }: AppCardProps) => {
26
+ return (
27
+ <div className={`appCard ${className}`}>
28
+ <Card
29
+ title={title}
30
+ extra={extra}
31
+ cover={cover}
32
+ hoverable={hoverable}
33
+ className={`${borderless ? "borderless" : ""}`}
34
+ actions={actions}
35
+ {...cardProps}
36
+ >
37
+ {cardProps.children}
38
+ </Card>
39
+ </div>
40
+ );
41
+ };
42
+
43
+ export default AppCard;
@@ -1,68 +1,68 @@
1
- .appCarousel {
2
- position: relative;
3
- width: 100%;
4
-
5
- .ant-carousel .slick-slide {
6
- display: flex;
7
- justify-content: center;
8
- align-items: center;
9
- overflow: hidden;
10
- }
11
-
12
- .slick-dots {
13
- gap: 0.5rem;
14
- align-items: center;
15
- li {
16
- width: 6px !important;
17
- border-radius: 50%;
18
- margin: 0;
19
- button {
20
- height: 6px;
21
- }
22
- }
23
- }
24
- }
25
-
26
- .carouselItem {
27
- width: 100%;
28
- height: 100%;
29
- display: flex;
30
- justify-content: center;
31
- align-items: center;
32
-
33
- img {
34
- max-width: 100%;
35
- max-height: 100%;
36
- object-fit: cover;
37
- }
38
- }
39
-
40
- .prevArrow,
41
- .nextArrow {
42
- position: absolute;
43
- top: 50%;
44
- transform: translateY(-50%);
45
- border: none;
46
- color: rgb(0, 0, 0);
47
- font-size: 1.5rem;
48
- cursor: pointer;
49
- z-index: 1;
50
- display: flex;
51
- cursor: pointer;
52
- transition: background 0.3s ease;
53
- }
54
-
55
- .prevArrow {
56
- left: 10px;
57
- }
58
-
59
- .nextArrow {
60
- right: 10px;
61
- }
62
-
63
- .carouselLines {
64
- display: flex;
65
- justify-content: center;
66
- align-items: center;
67
- margin-top: 10px;
68
- }
1
+ .appCarousel {
2
+ position: relative;
3
+ width: 100%;
4
+
5
+ .ant-carousel .slick-slide {
6
+ display: flex;
7
+ justify-content: center;
8
+ align-items: center;
9
+ overflow: hidden;
10
+ }
11
+
12
+ .slick-dots {
13
+ gap: 0.5rem;
14
+ align-items: center;
15
+ li {
16
+ width: 6px !important;
17
+ border-radius: 50%;
18
+ margin: 0;
19
+ button {
20
+ height: 6px;
21
+ }
22
+ }
23
+ }
24
+ }
25
+
26
+ .carouselItem {
27
+ width: 100%;
28
+ height: 100%;
29
+ display: flex;
30
+ justify-content: center;
31
+ align-items: center;
32
+
33
+ img {
34
+ max-width: 100%;
35
+ max-height: 100%;
36
+ object-fit: cover;
37
+ }
38
+ }
39
+
40
+ .prevArrow,
41
+ .nextArrow {
42
+ position: absolute;
43
+ top: 50%;
44
+ transform: translateY(-50%);
45
+ border: none;
46
+ color: rgb(0, 0, 0);
47
+ font-size: 1.5rem;
48
+ cursor: pointer;
49
+ z-index: 1;
50
+ display: flex;
51
+ cursor: pointer;
52
+ transition: background 0.3s ease;
53
+ }
54
+
55
+ .prevArrow {
56
+ left: 10px;
57
+ }
58
+
59
+ .nextArrow {
60
+ right: 10px;
61
+ }
62
+
63
+ .carouselLines {
64
+ display: flex;
65
+ justify-content: center;
66
+ align-items: center;
67
+ margin-top: 10px;
68
+ }
@@ -1,62 +1,62 @@
1
- import React, { useRef } from "react";
2
- import { Carousel } from "antd";
3
- import type { CarouselProps } from "antd";
4
- import { LeftOutlined, RightOutlined } from "@ant-design/icons";
5
- import "./app-carousel.css";
6
-
7
- interface AppCarouselProps extends CarouselProps {
8
- items: React.ReactNode[];
9
- className?: string;
10
- nxtIcon?: React.ReactNode;
11
- prevIcon?: React.ReactNode;
12
- showIcon?: boolean;
13
- showDots?: boolean;
14
- showLines?: boolean;
15
- autoplay?: boolean;
16
- }
17
-
18
- const AppCarousel = ({
19
- items,
20
- className,
21
- nxtIcon,
22
- prevIcon,
23
- showIcon,
24
- showDots = true,
25
- autoplay,
26
- ...rest
27
- }: AppCarouselProps) => {
28
- const carouselRef = useRef<any>(null);
29
-
30
- const handlePrev = () => {
31
- carouselRef.current?.prev();
32
- };
33
-
34
- const handleNext = () => {
35
- carouselRef.current?.next();
36
- };
37
-
38
- return (
39
- <div className={`appCarousel ${className}`}>
40
- {showIcon && (
41
- <>
42
- <span className={"prevArrow"} onClick={handlePrev}>
43
- {prevIcon || <LeftOutlined />}
44
- </span>
45
- <span className={"nextArrow"} onClick={handleNext}>
46
- {nxtIcon || <RightOutlined />}
47
- </span>
48
- </>
49
- )}
50
-
51
- <Carousel autoplay={autoplay} ref={carouselRef} dots={showDots} {...rest}>
52
- {items.map((item, index) => (
53
- <div key={index} className={"carouselItem"}>
54
- {item}
55
- </div>
56
- ))}
57
- </Carousel>
58
- </div>
59
- );
60
- };
61
-
62
- export default AppCarousel;
1
+ import React, { useRef } from "react";
2
+ import { Carousel } from "antd";
3
+ import type { CarouselProps } from "antd";
4
+ import { LeftOutlined, RightOutlined } from "@ant-design/icons";
5
+ import "./app-carousel.css";
6
+
7
+ interface AppCarouselProps extends CarouselProps {
8
+ items: React.ReactNode[];
9
+ className?: string;
10
+ nxtIcon?: React.ReactNode;
11
+ prevIcon?: React.ReactNode;
12
+ showIcon?: boolean;
13
+ showDots?: boolean;
14
+ showLines?: boolean;
15
+ autoplay?: boolean;
16
+ }
17
+
18
+ const AppCarousel = ({
19
+ items,
20
+ className,
21
+ nxtIcon,
22
+ prevIcon,
23
+ showIcon,
24
+ showDots = true,
25
+ autoplay,
26
+ ...rest
27
+ }: AppCarouselProps) => {
28
+ const carouselRef = useRef<any>(null);
29
+
30
+ const handlePrev = () => {
31
+ carouselRef.current?.prev();
32
+ };
33
+
34
+ const handleNext = () => {
35
+ carouselRef.current?.next();
36
+ };
37
+
38
+ return (
39
+ <div className={`appCarousel ${className}`}>
40
+ {showIcon && (
41
+ <>
42
+ <span className={"prevArrow"} onClick={handlePrev}>
43
+ {prevIcon || <LeftOutlined />}
44
+ </span>
45
+ <span className={"nextArrow"} onClick={handleNext}>
46
+ {nxtIcon || <RightOutlined />}
47
+ </span>
48
+ </>
49
+ )}
50
+
51
+ <Carousel autoplay={autoplay} ref={carouselRef} dots={showDots} {...rest}>
52
+ {items.map((item, index) => (
53
+ <div key={index} className={"carouselItem"}>
54
+ {item}
55
+ </div>
56
+ ))}
57
+ </Carousel>
58
+ </div>
59
+ );
60
+ };
61
+
62
+ export default AppCarousel;
@@ -1,6 +1,6 @@
1
- .appChart {
2
- & > canvas {
3
- height: 100% !important;
4
- width: 100% !important;
5
- }
6
- }
1
+ .appChart {
2
+ & > canvas {
3
+ height: 100% !important;
4
+ width: 100% !important;
5
+ }
6
+ }
@@ -1,98 +1,98 @@
1
- import React from "react";
2
- import { Bar, Line, Pie, Doughnut } from "react-chartjs-2";
3
- import {
4
- Chart as ChartJS,
5
- CategoryScale,
6
- LinearScale,
7
- BarElement,
8
- LineElement,
9
- PointElement,
10
- ArcElement,
11
- Title,
12
- Tooltip,
13
- Legend,
14
- ChartData,
15
- ChartOptions,
16
- } from "chart.js";
17
- import "./app-chart.css";
18
-
19
- // Register the necessary modules
20
- ChartJS.register(
21
- CategoryScale,
22
- LinearScale,
23
- BarElement,
24
- LineElement,
25
- PointElement,
26
- ArcElement,
27
- Title,
28
- Tooltip,
29
- Legend
30
- );
31
-
32
- type ChartType = "bar" | "line" | "pie" | "doughnut";
33
-
34
- interface AppChartProps {
35
- type: ChartType;
36
- data: ChartData<"bar" | "line" | "pie" | "doughnut">;
37
- options?: ChartOptions<"bar" | "line" | "pie" | "doughnut">;
38
- className?: string;
39
- height?: number;
40
- width?: number;
41
- }
42
-
43
- const AppChart = ({
44
- type,
45
- data,
46
- options,
47
- className,
48
- height = 400,
49
- width = 600,
50
- ...props
51
- }: AppChartProps) => {
52
- const renderChart = () => {
53
- switch (type) {
54
- case "bar":
55
- return (
56
- <Bar
57
- data={data as ChartData<"bar">}
58
- options={options as ChartOptions<"bar">}
59
- className={className}
60
- />
61
- );
62
- case "line":
63
- return (
64
- <Line
65
- data={data as ChartData<"line">}
66
- options={options as ChartOptions<"line">}
67
- className={className}
68
- />
69
- );
70
- case "pie":
71
- return (
72
- <Pie
73
- data={data as ChartData<"pie">}
74
- options={options as ChartOptions<"pie">}
75
- className={className}
76
- />
77
- );
78
- case "doughnut":
79
- return (
80
- <Doughnut
81
- data={data as ChartData<"doughnut">}
82
- options={options as ChartOptions<"doughnut">}
83
- className={className}
84
- />
85
- );
86
- default:
87
- return null;
88
- }
89
- };
90
-
91
- return (
92
- <div style={{ height, width }} className={`appChart ${className}`}>
93
- {renderChart()}
94
- </div>
95
- );
96
- };
97
-
98
- export default AppChart;
1
+ import React from "react";
2
+ import { Bar, Line, Pie, Doughnut } from "react-chartjs-2";
3
+ import {
4
+ Chart as ChartJS,
5
+ CategoryScale,
6
+ LinearScale,
7
+ BarElement,
8
+ LineElement,
9
+ PointElement,
10
+ ArcElement,
11
+ Title,
12
+ Tooltip,
13
+ Legend,
14
+ ChartData,
15
+ ChartOptions,
16
+ } from "chart.js";
17
+ import "./app-chart.css";
18
+
19
+ // Register the necessary modules
20
+ ChartJS.register(
21
+ CategoryScale,
22
+ LinearScale,
23
+ BarElement,
24
+ LineElement,
25
+ PointElement,
26
+ ArcElement,
27
+ Title,
28
+ Tooltip,
29
+ Legend
30
+ );
31
+
32
+ type ChartType = "bar" | "line" | "pie" | "doughnut";
33
+
34
+ interface AppChartProps {
35
+ type: ChartType;
36
+ data: ChartData<"bar" | "line" | "pie" | "doughnut">;
37
+ options?: ChartOptions<"bar" | "line" | "pie" | "doughnut">;
38
+ className?: string;
39
+ height?: number;
40
+ width?: number;
41
+ }
42
+
43
+ const AppChart = ({
44
+ type,
45
+ data,
46
+ options,
47
+ className,
48
+ height = 400,
49
+ width = 600,
50
+ ...props
51
+ }: AppChartProps) => {
52
+ const renderChart = () => {
53
+ switch (type) {
54
+ case "bar":
55
+ return (
56
+ <Bar
57
+ data={data as ChartData<"bar">}
58
+ options={options as ChartOptions<"bar">}
59
+ className={className}
60
+ />
61
+ );
62
+ case "line":
63
+ return (
64
+ <Line
65
+ data={data as ChartData<"line">}
66
+ options={options as ChartOptions<"line">}
67
+ className={className}
68
+ />
69
+ );
70
+ case "pie":
71
+ return (
72
+ <Pie
73
+ data={data as ChartData<"pie">}
74
+ options={options as ChartOptions<"pie">}
75
+ className={className}
76
+ />
77
+ );
78
+ case "doughnut":
79
+ return (
80
+ <Doughnut
81
+ data={data as ChartData<"doughnut">}
82
+ options={options as ChartOptions<"doughnut">}
83
+ className={className}
84
+ />
85
+ );
86
+ default:
87
+ return null;
88
+ }
89
+ };
90
+
91
+ return (
92
+ <div style={{ height, width }} className={`appChart ${className}`}>
93
+ {renderChart()}
94
+ </div>
95
+ );
96
+ };
97
+
98
+ export default AppChart;
@@ -1,12 +1,12 @@
1
- .appCheckboxText {
2
- .checkboxText {
3
- & > span:last-child {
4
- line-height: unset;
5
- & > span {
6
- font-size: 15px;
7
- font-weight: 500;
8
- text-align: left;
9
- }
10
- }
11
- }
12
- }
1
+ .appCheckboxText {
2
+ .checkboxText {
3
+ & > span:last-child {
4
+ line-height: unset;
5
+ & > span {
6
+ font-size: 15px;
7
+ font-weight: 500;
8
+ text-align: left;
9
+ }
10
+ }
11
+ }
12
+ }
@@ -1,32 +1,32 @@
1
- import React from "react";
2
- import { Checkbox } from "antd";
3
- import { CheckboxChangeEvent } from "antd/es/checkbox";
4
- import "./app-checkbox-text.css";
5
-
6
- interface AppCheckboxTextProps {
7
- text: string;
8
- checked?: boolean;
9
- handleChange?: (e: CheckboxChangeEvent) => void;
10
- className?: string;
11
- }
12
-
13
- const AppCheckboxText = ({
14
- text,
15
- checked,
16
- handleChange,
17
- className,
18
- }: AppCheckboxTextProps) => {
19
- return (
20
- <div className={`appCheckboxText ${className}`}>
21
- <Checkbox
22
- className="checkboxText"
23
- checked={checked}
24
- onChange={handleChange}
25
- >
26
- <span dangerouslySetInnerHTML={{ __html: text }} />
27
- </Checkbox>
28
- </div>
29
- );
30
- };
31
-
32
- export default AppCheckboxText;
1
+ import React from "react";
2
+ import { Checkbox } from "antd";
3
+ import { CheckboxChangeEvent } from "antd/es/checkbox";
4
+ import "./app-checkbox-text.css";
5
+
6
+ interface AppCheckboxTextProps {
7
+ text: string;
8
+ checked?: boolean;
9
+ handleChange?: (e: CheckboxChangeEvent) => void;
10
+ className?: string;
11
+ }
12
+
13
+ const AppCheckboxText = ({
14
+ text,
15
+ checked,
16
+ handleChange,
17
+ className,
18
+ }: AppCheckboxTextProps) => {
19
+ return (
20
+ <div className={`appCheckboxText ${className}`}>
21
+ <Checkbox
22
+ className="checkboxText"
23
+ checked={checked}
24
+ onChange={handleChange}
25
+ >
26
+ <span dangerouslySetInnerHTML={{ __html: text }} />
27
+ </Checkbox>
28
+ </div>
29
+ );
30
+ };
31
+
32
+ export default AppCheckboxText;