ar-design 0.1.56 → 0.1.58

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 (29) hide show
  1. package/dist/assets/css/components/charts/pie/pie.css +84 -0
  2. package/dist/assets/css/components/data-display/chip/chip.css +9 -1
  3. package/dist/assets/css/components/data-display/paper/paper.css +1 -0
  4. package/dist/assets/css/components/data-display/table/table.css +1 -0
  5. package/dist/assets/css/components/feedback/modal/modal.css +3 -4
  6. package/dist/assets/css/components/feedback/notification/notification.css +66 -70
  7. package/dist/components/charts/index.d.ts +2 -0
  8. package/dist/components/charts/index.js +2 -0
  9. package/dist/components/charts/pie/IProps.d.ts +7 -0
  10. package/dist/components/charts/pie/IProps.js +1 -0
  11. package/dist/components/charts/pie/index.d.ts +5 -0
  12. package/dist/components/charts/pie/index.js +55 -0
  13. package/dist/components/data-display/chip/index.js +4 -2
  14. package/dist/components/data-display/typography/paragraph/IProps.d.ts +2 -2
  15. package/dist/components/feedback/confirm/index.js +5 -5
  16. package/dist/components/feedback/modal/index.js +6 -5
  17. package/dist/components/feedback/notification/index.d.ts +1 -1
  18. package/dist/components/feedback/notification/index.js +62 -17
  19. package/dist/components/form/button/IProps.d.ts +2 -2
  20. package/dist/components/form/button-action/index.js +5 -6
  21. package/dist/components/form/checkbox/IProps.d.ts +2 -2
  22. package/dist/components/form/date-picker/index.js +5 -7
  23. package/dist/components/form/input/IProps.d.ts +2 -2
  24. package/dist/components/form/radio/IProps.d.ts +2 -2
  25. package/dist/components/form/radio/index.js +1 -8
  26. package/dist/components/form/select/index.js +5 -7
  27. package/dist/libs/types/IGlobalProps.d.ts +0 -1
  28. package/dist/libs/types/index.d.ts +4 -0
  29. package/package.json +2 -1
@@ -0,0 +1,84 @@
1
+ .ar-pie-chart-wrapper {
2
+ display: flex;
3
+ flex-direction: column;
4
+ justify-content: center;
5
+ align-items: center;
6
+ gap: 1rem 0;
7
+ }
8
+ .ar-pie-chart-wrapper > div {
9
+ display: flex;
10
+ flex-direction: row;
11
+ align-items: center;
12
+ gap: 0 2rem;
13
+ }
14
+
15
+ .ar-pie-chart-wrapper > .title {
16
+ width: 100%;
17
+ color: var(--gray-700);
18
+ font-size: 1.2rem;
19
+ font-weight: bold;
20
+ text-align: left;
21
+ }
22
+
23
+ .ar-pie-chart-wrapper > div > .ar-pie-chart {
24
+ position: relative;
25
+ width: 200px;
26
+ height: 200px;
27
+ border-radius: var(--border-radius-pill);
28
+ user-select: none;
29
+ }
30
+ .ar-pie-chart-wrapper > div > .ar-pie-chart > article {
31
+ position: absolute;
32
+ inset: 0.5rem;
33
+ display: flex;
34
+ justify-content: center;
35
+ align-items: center;
36
+ background-color: var(--white);
37
+ border-radius: var(--border-radius-pill);
38
+ box-shadow: inset 0 0 0 5px rgba(var(--black-rgb), 0.1);
39
+ color: var(--gray-700);
40
+ }
41
+
42
+ .ar-pie-chart-wrapper > div > .information-field {
43
+ display: flex;
44
+ flex-direction: column;
45
+ flex-wrap: wrap;
46
+ flex: 1;
47
+ justify-content: flex-start;
48
+ align-items: flex-start;
49
+ gap: 0.5rem 0;
50
+ width: 100%;
51
+ }
52
+ .ar-pie-chart-wrapper > div > .information-field > article {
53
+ display: flex;
54
+ flex-direction: row;
55
+ flex: 2;
56
+ align-items: center;
57
+ gap: 0 0.5rem;
58
+ }
59
+ .ar-pie-chart-wrapper > div > .information-field > article > span:first-child {
60
+ position: relative;
61
+ min-width: 1.75rem;
62
+ min-height: 1rem;
63
+ padding-left: 0.85rem;
64
+ border-radius: var(--border-radius-sm);
65
+ color: var(--white);
66
+ font-size: 0.75rem;
67
+ font-weight: bold;
68
+ line-height: 1rem;
69
+ overflow: hidden;
70
+ }
71
+ .ar-pie-chart-wrapper > div > .information-field > article > span:first-child::before {
72
+ position: absolute;
73
+ left: 0;
74
+ top: 50%;
75
+ transform: translateY(-50%);
76
+ content: "%";
77
+ background-color: rgba(var(--black-rgb), 0.2);
78
+ width: 0.75rem;
79
+ font-size: 0.65rem;
80
+ text-align: center;
81
+ }
82
+ .ar-pie-chart-wrapper > div > .information-field > article > span:last-child {
83
+ font-size: 0.75rem;
84
+ }
@@ -1,6 +1,14 @@
1
1
  .ar-chip {
2
- padding: 0.25rem 0.5rem;
2
+ display: flex;
3
+ justify-content: center;
4
+ align-items: center;
5
+ gap: 0 0.5rem;
6
+ height: 1.75rem;
7
+ padding: 0 0.5rem;
3
8
  font-size: 0.75rem;
4
9
  font-weight: 600;
5
10
  white-space: nowrap;
11
+ user-select: none;
12
+ -webkit-text-stroke: 0.5px var(--white);
13
+ letter-spacing: 1px;
6
14
  }
@@ -1,4 +1,5 @@
1
1
  .ar-paper {
2
+ position: relative;
2
3
  background-color: var(--white);
3
4
  padding: 2rem;
4
5
  border-radius: var(--border-radius-lg);
@@ -97,6 +97,7 @@
97
97
  display: flex;
98
98
  flex-direction: row;
99
99
  justify-content: flex-end;
100
+ align-items: center;
100
101
  }
101
102
 
102
103
  @import url("./scroll.css");
@@ -6,7 +6,6 @@
6
6
  position: fixed;
7
7
  inset: 0;
8
8
  background-color: rgba(var(--black-rgb), 0.5);
9
- backdrop-filter: blur(10px);
10
9
  }
11
10
 
12
11
  /* #region Open or Close */
@@ -17,19 +16,19 @@
17
16
  z-index: 100;
18
17
  }
19
18
  .ar-modal-wrapper:is(.opened) > .ar-modal {
20
- top: 4.5rem;
19
+ top: 1.75rem;
21
20
  transition: top 250ms ease-in-out;
22
21
  }
23
22
 
24
23
  .ar-modal-wrapper:is(.closed) {
25
24
  visibility: hidden;
26
25
  opacity: 0;
27
- transition: visibility 250ms 300ms, opacity 250ms 300ms ease-in-out;
26
+ transition: visibility 250ms, opacity 250ms ease-in-out;
28
27
  z-index: 99;
29
28
  }
30
29
  .ar-modal-wrapper:is(.closed) > .ar-modal {
31
30
  top: -100%;
32
- transition: top 250ms 300ms ease-in-out;
31
+ transition: top 250ms ease-in-out;
33
32
  }
34
33
  /* #endregion */
35
34
  /* Open or Close */
@@ -1,148 +1,135 @@
1
- .notification {
1
+ .ar-notification-item {
2
+ opacity: 1;
2
3
  position: fixed;
3
- display: flex;
4
- flex-direction: column-reverse;
5
- gap: 1.25rem 0;
6
- user-select: none;
7
- z-index: 1051;
8
- }
9
-
10
- .notification.top-left {
11
- top: 1rem;
12
- left: 1rem;
13
- }
14
- .notification.top-right {
15
- top: 1rem;
16
- right: 1rem;
17
- }
18
- .notification.bottom-left {
19
- bottom: 1rem;
20
- left: 1rem;
21
- }
22
- .notification.bottom-right {
23
- bottom: 1rem;
24
- right: 1rem;
25
- }
26
-
27
- .notification > .item {
4
+ left: 2rem;
28
5
  display: flex;
29
6
  flex-direction: row;
30
7
  gap: 0 0.5rem;
31
- width: 100%;
32
- height: 5rem;
8
+ background-color: var(--white);
9
+ width: 350px;
10
+ height: 7.5rem;
33
11
  border-radius: var(--border-radius-xl);
12
+ box-shadow: 0 5px 15px -5px rgba(var(--black-rgb), 0.25);
13
+ transition: all 250ms ease-in-out;
34
14
  overflow: hidden;
35
15
  /* Sırasıyla; Ad, Süre, Hız, Gecikme Süresi, Tekrar Sayısı, Yön, Bitiş Süreci */
36
- animation: openSnackbar ease-in-out 500ms 0s 1 normal both;
37
- }
38
-
39
- .notification > .item.success {
40
- background-color: var(--success);
41
- }
42
- .notification > .item.warning {
43
- background-color: var(--warning);
16
+ animation: openedSnackbar ease-in-out 500ms 0s 1 normal both;
17
+ z-index: 1051;
44
18
  }
45
- .notification > .item.information {
46
- background-color: var(--info);
19
+ .ar-notification-item.previous {
20
+ /* Sırasıyla; Ad, Süre, Hız, Gecikme Süresi, Tekrar Sayısı, Yön, Bitiş Süreci */
21
+ animation: previousSnackbar ease-in-out 500ms 0s 1 normal both;
47
22
  }
48
- .notification > .item.error {
49
- background-color: var(--danger);
23
+ .ar-notification-item.closed {
24
+ /* Sırasıyla; Ad, Süre, Hız, Gecikme Süresi, Tekrar Sayısı, Yön, Bitiş Süreci */
25
+ animation: closedSnackbar ease-in-out 500ms 0s 1 normal both;
50
26
  }
51
27
 
52
- .notification > .item > .icon {
28
+ .ar-notification-item > .icon {
53
29
  position: relative;
54
30
  min-width: 3rem;
55
31
  border-top-left-radius: var(--border-radius-xl);
56
32
  border-bottom-left-radius: var(--border-radius-xl);
57
33
  overflow: hidden;
58
34
  }
59
- .notification > .item > .icon > span {
35
+ .ar-notification-item > .icon > span {
60
36
  position: absolute;
61
37
  border-radius: var(--border-radius-pill);
62
38
  }
63
- /* .notification > .item > .icon > span:nth-child(1) {
39
+ .ar-notification-item > .icon > span:nth-child(1) {
64
40
  top: 0.5rem;
65
41
  left: 0.5rem;
66
42
  width: 0.25rem;
67
43
  height: 0.25rem;
68
44
  }
69
- .notification > .item > .icon > span:nth-child(2) {
45
+ .ar-notification-item > .icon > span:nth-child(2) {
70
46
  top: 1.5rem;
71
47
  left: 0.5rem;
72
48
  width: 0.5rem;
73
49
  height: 0.5rem;
74
50
  }
75
- .notification > .item > .icon > span:nth-child(3) {
51
+ .ar-notification-item > .icon > span:nth-child(3) {
76
52
  top: 2rem;
77
53
  left: 1.75rem;
78
54
  width: 1rem;
79
55
  height: 1rem;
80
56
  }
81
- .notification > .item > .icon > span:nth-child(4) {
57
+ .ar-notification-item > .icon > span:nth-child(4) {
82
58
  bottom: -1.5rem;
83
59
  left: -0.5rem;
84
60
  width: 3rem;
85
61
  height: 3rem;
86
62
  }
87
- .notification > .item > .icon > span:nth-child(5) {
63
+ .ar-notification-item > .icon > span:nth-child(5) {
88
64
  bottom: 1.15rem;
89
65
  left: 1rem;
90
66
  width: 0.55rem;
91
67
  height: 0.55rem;
92
- } */
93
- .notification > .item > .icon > span.success {
68
+ }
69
+ .ar-notification-item > .icon > span.success {
94
70
  background-color: var(--success);
95
71
  }
96
- .notification > .item > .icon > span.warning {
72
+ .ar-notification-item > .icon > span.warning {
97
73
  background-color: var(--warning);
98
74
  }
99
- .notification > .item > .icon > span.information {
75
+ .ar-notification-item > .icon > span.information {
100
76
  background-color: var(--info);
101
77
  }
102
- .notification > .item > .icon > span.error {
78
+ .ar-notification-item > .icon > span.error {
103
79
  background-color: var(--danger);
104
80
  }
105
81
 
106
- .notification > .item > .content {
82
+ .ar-notification-item > .content {
107
83
  display: flex;
108
84
  flex-direction: column;
109
85
  justify-content: center;
110
- gap: 0.25rem 0;
86
+ gap: 0.75rem 0;
111
87
  width: 100%;
112
88
  padding: 0 1rem;
113
- color: var(--white);
89
+ color: var(--gray-700);
114
90
  }
115
- .notification > .item > .content > .title {
116
- font-size: 1.3rem;
91
+ .ar-notification-item > .content > .title {
92
+ font-size: 1.2rem;
117
93
  }
118
- .notification > .item > .content > .message {
94
+ .ar-notification-item > .content > .message {
95
+ color: var(--gray-600);
119
96
  }
120
97
 
121
- .notification > .item > .close {
122
- display: flex;
123
- justify-content: center;
124
- align-items: center;
98
+ .ar-notification-item > .close {
125
99
  min-width: 2.5rem;
126
- background-color: rgba(var(--black-rgb), 0.1);
127
- color: rgba(var(--white-rgb), 0.75);
100
+ }
101
+ .ar-notification-item > .close::before,
102
+ .ar-notification-item > .close::after {
103
+ position: absolute;
104
+ top: 0.75rem;
105
+ right: 1.25rem;
106
+ content: "";
107
+ width: 2px;
108
+ height: 15px;
109
+ background-color: var(--gray-500);
110
+ transform-origin: center;
111
+ transform: rotate(45deg);
112
+ }
113
+ .ar-notification-item > .close::after {
114
+ transform: rotate(-45deg);
128
115
  }
129
116
 
130
117
  @media only screen and (max-width: 480px) {
131
- .notification.top-left {
118
+ .ar-notification.top-left {
132
119
  inset: 1rem 1rem auto 1rem;
133
120
  }
134
- .notification.top-right {
121
+ .ar-notification.top-right {
135
122
  inset: 1rem 1rem auto 1rem;
136
123
  }
137
- .notification.bottom-left {
124
+ .ar-notification.bottom-left {
138
125
  inset: auto 1rem 1rem 1rem;
139
126
  }
140
- .notification.bottom-right {
127
+ .ar-notification.bottom-right {
141
128
  inset: auto 1rem 1rem 1rem;
142
129
  }
143
130
  }
144
131
 
145
- @keyframes openSnackbar {
132
+ @keyframes openedSnackbar {
146
133
  0% {
147
134
  transform: translateX(-500px);
148
135
  }
@@ -151,7 +138,16 @@
151
138
  }
152
139
  }
153
140
 
154
- @keyframes removeSnackbar {
141
+ @keyframes previousSnackbar {
142
+ 0% {
143
+ transform: translateX(0) translateY(0);
144
+ }
145
+ 100% {
146
+ transform: translateX(0) translateY(120px);
147
+ }
148
+ }
149
+
150
+ @keyframes closedSnackbar {
155
151
  0% {
156
152
  transform: translateX(0);
157
153
  }
@@ -0,0 +1,2 @@
1
+ import Pie from "./pie";
2
+ export { Pie };
@@ -0,0 +1,2 @@
1
+ import Pie from "./pie";
2
+ export { Pie };
@@ -0,0 +1,7 @@
1
+ import { PieChartDataType } from "../../../libs/types";
2
+ interface IProps {
3
+ title: string;
4
+ data: PieChartDataType[];
5
+ size?: number;
6
+ }
7
+ export default IProps;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import IProps from "./IProps";
3
+ import "../../../assets/css/components/charts/pie/pie.css";
4
+ declare const Pie: React.FC<IProps>;
5
+ export default Pie;
@@ -0,0 +1,55 @@
1
+ import React, { useEffect, useRef, useState } from "react";
2
+ import "../../../assets/css/components/charts/pie/pie.css";
3
+ const Pie = ({ title, data, size }) => {
4
+ // refs
5
+ const _arPieChart = useRef(null);
6
+ // const _randomIndex = useRef<number[]>([]);
7
+ // state
8
+ const [conic, setConic] = useState([]);
9
+ // variable/s
10
+ const conicColors = [
11
+ ["#fff35e", "#000"], // Sarı
12
+ ["#ffc752", "#000"], // Açık Sarı
13
+ ["#ff9151", "#fff"], // Turuncu
14
+ ["#ee544e", "#fff"], // Kırmızı
15
+ ["#e52b66", "#fff"], // Pembemsi Kırmızı
16
+ ["#3c1d43", "#fff"], // Koyu Mor
17
+ ["#582d62", "#fff"], // Mor
18
+ ["#0470a7", "#fff"], // Açık Mavi
19
+ ["#068aa8", "#fff"], // Mavi-Turkuaz
20
+ ["#72a9bb", "#fff"], // Açık Mavi-Gri
21
+ ];
22
+ useEffect(() => {
23
+ if (!_arPieChart.current || data.length === 0)
24
+ return;
25
+ const conicGradients = [];
26
+ let total = data.reduce((sum, value) => sum + value.value, 0);
27
+ let normalizedData = data.map((value) => (value.value / total) * 100);
28
+ let start = 0;
29
+ // Gelen data uzunluğunda rastgele bir sayı dizisi oluşturuyor.
30
+ // do {
31
+ // const r = Math.floor(Math.random() * conicColors.length);
32
+ // if (!_randomIndex.current.includes(r)) _randomIndex.current.push(r);
33
+ // } while (_randomIndex.current.length < data.length);
34
+ normalizedData.forEach((percent, index) => {
35
+ let end = start + percent;
36
+ if (index === 0)
37
+ conicGradients.push(`#fff ${start + 0.5}% ${start}%`);
38
+ conicGradients.push(`${conicColors[index][0]} ${start}% ${end}%`);
39
+ conicGradients.push(`#fff ${end}% ${end + 0.5}%`);
40
+ start = end;
41
+ });
42
+ setConic(conicGradients);
43
+ }, [data]);
44
+ return (React.createElement("div", { className: "ar-pie-chart-wrapper" },
45
+ React.createElement("div", { className: "title" },
46
+ React.createElement("span", null, title)),
47
+ React.createElement("div", null,
48
+ React.createElement("div", { ref: _arPieChart, className: "ar-pie-chart", style: { background: `conic-gradient(${conic.join(", ")})`, width: size, height: size } },
49
+ React.createElement("article", null)),
50
+ React.createElement("div", { className: "information-field" }, data.map((item, index) => (React.createElement("article", { key: index },
51
+ React.createElement("span", { style: { backgroundColor: conicColors[index][0] } },
52
+ React.createElement("span", { style: { color: conicColors[index][1] } }, item.value)),
53
+ React.createElement("span", null, item.text))))))));
54
+ };
55
+ export default Pie;
@@ -2,9 +2,11 @@
2
2
  import React from "react";
3
3
  import "../../../assets/css/components/data-display/chip/chip.css";
4
4
  import Utils from "../../../libs/infrastructure/shared/Utils";
5
- const Chip = ({ variant = "outlined", status = "primary", border = { radius: "sm" }, text, }) => {
5
+ const Chip = ({ variant = "outlined", status = "primary", border = { radius: "sm" }, text, icon, }) => {
6
6
  let _chipClassName = ["ar-chip"];
7
7
  _chipClassName.push(...Utils.GetClassName(variant, status, border, undefined, undefined, undefined));
8
- return React.createElement("span", { className: _chipClassName.map((c) => c).join(" ") }, text);
8
+ return (React.createElement("div", { className: _chipClassName.map((c) => c).join(" ") },
9
+ icon?.element && React.createElement("span", null, icon?.element),
10
+ React.createElement("span", null, text)));
9
11
  };
10
12
  export default Chip;
@@ -1,6 +1,6 @@
1
1
  import { ParagraphColors, Status } from "../../../../libs/types";
2
- import { IChildren, IGlobalProps } from "../../../../libs/types/IGlobalProps";
3
- interface IProps extends Omit<IGlobalProps, "status">, IChildren {
2
+ import { IChildren, IGlobalProps, ISizes } from "../../../../libs/types/IGlobalProps";
3
+ interface IProps extends Omit<IGlobalProps, "status">, IChildren, ISizes {
4
4
  color?: ParagraphColors | Status;
5
5
  align?: "left" | "center" | "right";
6
6
  }
@@ -40,12 +40,12 @@ const Confirm = ({ children, title, message, content, onConfirm }) => {
40
40
  document.addEventListener("click", handleClickOutSide);
41
41
  document.addEventListener("keydown", handleKeys);
42
42
  document.addEventListener("scroll", handleScroll);
43
+ }
44
+ else {
43
45
  // Dinleyicileri kaldır.
44
- return () => {
45
- document.removeEventListener("click", handleClickOutSide);
46
- document.removeEventListener("keydown", handleKeys);
47
- document.removeEventListener("scroll", handleScroll);
48
- };
46
+ document.removeEventListener("click", handleClickOutSide);
47
+ document.removeEventListener("keydown", handleKeys);
48
+ document.removeEventListener("scroll", handleScroll);
49
49
  }
50
50
  }, [open]);
51
51
  return (React.createElement("div", { ref: _arConfirmWrapper, className: "ar-confirm-wrapper", role: "dialog" },
@@ -25,13 +25,14 @@ const Modal = ({ children, open, title, size = "normal", footer }) => {
25
25
  // useEffects
26
26
  useEffect(() => {
27
27
  if (open.get) {
28
+ document.body.style.overflow = "hidden";
28
29
  // document.addEventListener("click", handleClickOutSide);
29
30
  document.addEventListener("keydown", handleKeys);
30
- // Dinleyicileri kaldır.
31
- return () => {
32
- // document.removeEventListener("click", handleClickOutSide);
33
- document.removeEventListener("keydown", handleKeys);
34
- };
31
+ }
32
+ else {
33
+ document.body.style.removeProperty("overflow");
34
+ // document.removeEventListener("click", handleClickOutSide);
35
+ document.removeEventListener("keydown", handleKeys);
35
36
  }
36
37
  }, [open.get]);
37
38
  return (React.createElement("div", { className: _modalWrapperClassName.map((c) => c).join(" ") },
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
2
  import IProps from "./IProps";
3
3
  import "../../../assets/css/components/feedback/notification/notification.css";
4
- declare const Notification: ({ title, message, status, direction, trigger }: IProps) => React.JSX.Element;
4
+ declare const Notification: ({ title, message, status, direction, trigger }: IProps) => React.JSX.Element[];
5
5
  export default Notification;
@@ -3,38 +3,83 @@ import { useEffect, useRef, useState } from "react";
3
3
  import React from "react";
4
4
  import "../../../assets/css/components/feedback/notification/notification.css";
5
5
  const Notification = ({ title, message, status, direction = "bottom-left", trigger }) => {
6
- // useRefs
7
6
  const _firstLoad = useRef(false);
8
- const _index = useRef(0);
7
+ const _notificationItems = useRef([]);
9
8
  const _interval = useRef();
10
- // useStates
9
+ // const _automaticRemoveInterval = useRef<NodeJS.Timeout>();
10
+ // const _closedInterval = useRef<NodeJS.Timeout>();
11
+ const _i = useRef(0);
11
12
  const [items, setItems] = useState([]);
12
- // useEffects
13
13
  useEffect(() => {
14
14
  if (!_firstLoad.current) {
15
15
  _firstLoad.current = true;
16
16
  return;
17
17
  }
18
- _index.current += 1;
19
- const createItem = (React.createElement("div", { className: `item ${status}` },
20
- React.createElement("div", { className: "content" },
21
- React.createElement("span", { className: `title ${status}` }, title),
22
- React.createElement("span", { className: "message" }, message)),
23
- React.createElement("div", { className: "close", "data-index": _index.current, onClick: (event) => {
24
- const target = event.currentTarget;
25
- setItems((item) => item.filter((x) => x.index !== Number(target.dataset.index)));
26
- } }, "x")));
27
- setItems((items) => [...items, { index: _index.current, element: createItem }]);
18
+ setItems((prevItems) => [...prevItems, { id: _i.current++, title, message, status, direction }]);
28
19
  }, [trigger]);
29
20
  useEffect(() => {
30
21
  if (items.length === 0)
31
22
  return;
32
- // Ekleme işlemi bittikten bir süre sonra tekrar kaldırma işlemi yapılmaktadır.
23
+ // const firstNotification = _notificationItems.current[0];
24
+ // _automaticRemoveInterval.current = setTimeout(() => {
25
+ // if (firstNotification) firstNotification.classList.add("closed");
26
+ // _interval.current = setTimeout(() => {
27
+ // setItems((prevItems) => prevItems.slice(1));
28
+ // if (firstNotification) firstNotification.classList.remove("closed");
29
+ // clearTimeout(_interval.current);
30
+ // }, 500);
31
+ // clearTimeout(_automaticRemoveInterval.current);
32
+ // }, 3000);
33
33
  _interval.current = setTimeout(() => {
34
- setItems((items) => items.slice(0, -1));
34
+ setItems((prevItems) => prevItems.slice(1));
35
+ // if (firstNotification) firstNotification.classList.remove("closed");
35
36
  clearTimeout(_interval.current);
36
37
  }, 3000);
38
+ return () => {
39
+ // clearTimeout(_automaticRemoveInterval.current);
40
+ clearTimeout(_interval.current);
41
+ };
37
42
  }, [items]);
38
- return (React.createElement("div", { className: `notification ${direction}` }, items.map((item, index) => (React.createElement(React.Fragment, { key: index }, item.element)))));
43
+ const getBottomPosition = (index) => {
44
+ let bottom = 30; // Başlangıçta 30px'lik bir boşluk ekliyoruz.
45
+ // Önceki öğenin yüksekliğini dikkate alarak bottom hesaplanıyor.
46
+ if (_notificationItems.current[index - 1]) {
47
+ bottom = _notificationItems.current.slice(0, index).reduce((acc, el) => {
48
+ const rect = el.getBoundingClientRect();
49
+ return acc + rect.height + 20; // +20 değeri ara boşluğu artıyor.
50
+ }, 30); // 30px'lik boşluğu başlangıçta ekliyoruz.
51
+ }
52
+ return bottom;
53
+ };
54
+ return items.map((item, index) => {
55
+ const bottom = getBottomPosition(index);
56
+ return (React.createElement("div", { key: index, ref: (element) => (_notificationItems.current[index] = element), className: "ar-notification-item", style: items.length > 5
57
+ ? {
58
+ backgroundColor: `rgba(var(--white-rgb), ${index === items.length - 1 ? 1 : 0.1})`,
59
+ backdropFilter: "blur(10px)",
60
+ bottom: (index === 0 ? 30 : 10) * (index + 1),
61
+ }
62
+ : { bottom } },
63
+ React.createElement("div", { className: "icon" },
64
+ React.createElement("span", { className: item.status }),
65
+ React.createElement("span", { className: item.status }),
66
+ React.createElement("span", { className: item.status }),
67
+ React.createElement("span", { className: item.status }),
68
+ React.createElement("span", { className: item.status })),
69
+ React.createElement("div", { className: "content" },
70
+ React.createElement("span", { className: "title" }, item.title),
71
+ React.createElement("span", { className: "message" }, item.message)),
72
+ React.createElement("div", { className: "close", onClick: () => {
73
+ // clearTimeout(_automaticRemoveInterval.current);
74
+ clearTimeout(_interval.current);
75
+ setItems((prev) => prev.filter((_item) => _item.id !== item.id));
76
+ // if (_notificationItems.current[index]) _notificationItems.current[index]!.classList.add("closed");
77
+ // _closedInterval.current = setTimeout(() => {
78
+ // setItems((prev) => prev.filter((_item) => _item.id !== item.id));
79
+ // if (_notificationItems.current[index]) _notificationItems.current[index]!.classList.remove("closed");
80
+ // clearTimeout(_closedInterval.current);
81
+ // }, 500);
82
+ } })));
83
+ });
39
84
  };
40
85
  export default Notification;
@@ -1,5 +1,5 @@
1
- import { IGlobalProps } from "../../../libs/types/IGlobalProps";
2
- interface IProps extends Omit<IGlobalProps, "children" | "disabled">, React.ButtonHTMLAttributes<HTMLButtonElement> {
1
+ import { IGlobalProps, ISizes } from "../../../libs/types/IGlobalProps";
2
+ interface IProps extends Omit<IGlobalProps, "children" | "disabled">, ISizes, React.ButtonHTMLAttributes<HTMLButtonElement> {
3
3
  /**
4
4
  * Bileşenin şekil varyantını belirtir ve genellikle sadece ikon için kullanılmalıdır.
5
5
  * İki seçenekten biri olabilir: "circle" veya "square".
@@ -27,14 +27,13 @@ const ButtonAction = ({ buttons }) => {
27
27
  if (open) {
28
28
  document.addEventListener("click", handleClickOutSide);
29
29
  document.addEventListener("keydown", handleKeys);
30
- // Sayfa boyutu değiştirilmesi söz konusu olursa eğer bu kısım çalışacaktır.
31
30
  window.addEventListener("resize", handleResizeEvent);
31
+ }
32
+ else {
32
33
  // Dinleyicileri kaldır.
33
- return () => {
34
- document.removeEventListener("click", handleClickOutSide);
35
- document.removeEventListener("keydown", handleKeys);
36
- window.removeEventListener("resize", handleResizeEvent);
37
- };
34
+ document.removeEventListener("click", handleClickOutSide);
35
+ document.removeEventListener("keydown", handleKeys);
36
+ window.removeEventListener("resize", handleResizeEvent);
38
37
  }
39
38
  }, [open]);
40
39
  return (React.createElement("div", { ref: _arButtonAction, className: "ar-button-action" },
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
- import { IGlobalProps } from "../../../libs/types/IGlobalProps";
3
- interface IProps extends Omit<IGlobalProps, "children" | "icon" | "disabled">, Omit<React.InputHTMLAttributes<HTMLInputElement>, "children" | "type" | "size"> {
2
+ import { IGlobalProps, ISizes } from "../../../libs/types/IGlobalProps";
3
+ interface IProps extends Omit<IGlobalProps, "children" | "icon" | "disabled">, ISizes, Omit<React.InputHTMLAttributes<HTMLInputElement>, "children" | "type" | "size"> {
4
4
  label?: string;
5
5
  }
6
6
  export default IProps;
@@ -114,7 +114,7 @@ const DatePicker = ({ onChange, isClock, ...attributes }) => {
114
114
  if (isNaN(inputDate.getTime()))
115
115
  return;
116
116
  const [date, time] = inputDate.toISOString().split("T");
117
- const [clock, ms] = time.split(".");
117
+ const [clock, _] = time.split(".");
118
118
  _beginDate.current.value = !_clockOpen.current ? date : `${date}T${clock}`;
119
119
  }
120
120
  };
@@ -216,14 +216,12 @@ const DatePicker = ({ onChange, isClock, ...attributes }) => {
216
216
  document.addEventListener("click", handleClickOutSide);
217
217
  document.addEventListener("keydown", handleKeys);
218
218
  document.addEventListener("scroll", handleScroll);
219
- // Dinleyicileri kaldır ve zamanlayıcıyı temizle.
220
- return () => {
221
- document.removeEventListener("click", handleClickOutSide);
222
- document.removeEventListener("keydown", handleKeys);
223
- document.removeEventListener("scroll", handleScroll);
224
- };
225
219
  }
226
220
  else {
221
+ // Dinleyicileri kaldır ve zamanlayıcıyı temizle.
222
+ document.removeEventListener("click", handleClickOutSide);
223
+ document.removeEventListener("keydown", handleKeys);
224
+ document.removeEventListener("scroll", handleScroll);
227
225
  setCalendarClassName((prev) => [...prev, "closed"]);
228
226
  }
229
227
  }, [dateTrigger, calendarOpen]);
@@ -1,8 +1,8 @@
1
1
  import React from "react";
2
2
  import IButtonProps from "../button/IProps";
3
3
  import { Variants } from "../../../libs/types";
4
- import { IGlobalProps, IValidation } from "../../../libs/types/IGlobalProps";
5
- interface IProps extends Omit<IGlobalProps, "children" | "disabled">, Omit<React.InputHTMLAttributes<HTMLInputElement>, "children" | "size">, IValidation {
4
+ import { IGlobalProps, ISizes, IValidation } from "../../../libs/types/IGlobalProps";
5
+ interface IProps extends Omit<IGlobalProps, "children" | "disabled">, ISizes, Omit<React.InputHTMLAttributes<HTMLInputElement>, "children" | "size">, IValidation {
6
6
  button?: IButtonProps;
7
7
  addon?: {
8
8
  variant?: Variants;
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
- import { IGlobalProps } from "../../../libs/types/IGlobalProps";
3
- interface IProps extends Omit<IGlobalProps, "children">, Omit<React.InputHTMLAttributes<HTMLInputElement>, "children" | "size"> {
2
+ import { IGlobalProps, ISizes } from "../../../libs/types/IGlobalProps";
3
+ interface IProps extends Omit<IGlobalProps, "children">, ISizes, Omit<React.InputHTMLAttributes<HTMLInputElement>, "children" | "size"> {
4
4
  label?: string;
5
5
  }
6
6
  export default IProps;
@@ -1,13 +1,11 @@
1
1
  "use client";
2
- import React, { forwardRef, useRef, useState } from "react";
2
+ import React, { forwardRef, useRef } from "react";
3
3
  import "../../../assets/css/components/form/radio/radio.css";
4
4
  import Utils from "../../../libs/infrastructure/shared/Utils";
5
5
  const Radio = forwardRef(({ label, size = "normal", status, border = { radius: "sm" }, upperCase, ...attributes }, ref) => {
6
6
  // refs
7
7
  const _checkbox = useRef(null);
8
8
  const _checkboxClassName = ["ar-radio"];
9
- // states
10
- const [checked, setChecked] = useState(false);
11
9
  _checkboxClassName.push(...Utils.GetClassName("filled", undefined, border, size, undefined, attributes.className));
12
10
  return (React.createElement("div", { className: "ar-radio-wrapper" },
13
11
  React.createElement("label", null,
@@ -16,11 +14,6 @@ const Radio = forwardRef(({ label, size = "normal", status, border = { radius: "
16
14
  const _current = _checkbox.current;
17
15
  if (!_current)
18
16
  return;
19
- // 'checked' durumunun false olup olmadığını kontrol et
20
- if (event.target.checked === false) {
21
- console.log("Radio button is unchecked");
22
- }
23
- setChecked(event.target.checked);
24
17
  })();
25
18
  (() => attributes.onChange && attributes.onChange(event))();
26
19
  } }),
@@ -153,15 +153,13 @@ const Select = ({ variant = "outlined", status, border = { radius: "sm" }, optio
153
153
  document.addEventListener("click", handleClickOutSide);
154
154
  document.addEventListener("keydown", handleKeys);
155
155
  document.addEventListener("scroll", handleScroll);
156
- // Dinleyicileri kaldır ve zamanlayıcıyı temizle.
157
- return () => {
158
- clearTimeout(_otoFocus);
159
- document.removeEventListener("click", handleClickOutSide);
160
- document.removeEventListener("keydown", handleKeys);
161
- document.removeEventListener("scroll", handleScroll);
162
- };
163
156
  }
164
157
  else {
158
+ // Dinleyicileri kaldır ve zamanlayıcıyı temizle.
159
+ clearTimeout(_otoFocus);
160
+ document.removeEventListener("click", handleClickOutSide);
161
+ document.removeEventListener("keydown", handleKeys);
162
+ document.removeEventListener("scroll", handleScroll);
165
163
  // Options paneli kapanma süresi 250ms.
166
164
  // 300ms sonra temizlenmesinin sebebi kapanırken birder veriler gerliyor ve panel yüksekliği artıyor.
167
165
  setTimeout(() => {
@@ -75,7 +75,6 @@ export interface IGlobalProps {
75
75
  * ```
76
76
  */
77
77
  border?: Border;
78
- size?: Sizes;
79
78
  /**
80
79
  * Bileşendeki metni büyük harflere dönüştürüp dönüştürmeyeceğini belirtir.
81
80
  * Boolean (true/false) değeri alır.
@@ -52,3 +52,7 @@ export type ValidationProperties<T> = {
52
52
  }[];
53
53
  where?: (param: T) => boolean;
54
54
  };
55
+ export type PieChartDataType = {
56
+ value: number;
57
+ text: string;
58
+ };
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "ar-design",
3
- "version": "0.1.56",
3
+ "version": "0.1.58",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "exports": {
8
8
  ".": "./dist/index.js",
9
+ "./@charts": "./dist/components/charts/index.js",
9
10
  "./@service": "./dist/libs/core/service/index.js",
10
11
  "./@config": "./dist/libs/core/application/contexts/index.js",
11
12
  "./@hooks": "./dist/libs/core/application/hooks/index.js",