ar-design 0.1.52 → 0.1.53

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.
@@ -1,8 +1,8 @@
1
1
  .ar-paper {
2
- /* background-color: var(--white); */
3
- /* padding: 2rem; */
4
- /* border-radius: var(--border-radius-sm); */
5
- /* box-shadow: 0 0 20px -15px rgba(var(--black-rgb), 0.25); */
2
+ background-color: var(--white);
3
+ padding: 2rem;
4
+ border-radius: var(--border-radius-lg);
5
+ box-shadow: 0 0 20px 0 rgba(var(--black-rgb), 0.02);
6
6
  }
7
7
  .ar-paper > .header {
8
8
  display: flex;
@@ -14,26 +14,26 @@
14
14
  height: 100%;
15
15
  }
16
16
  .ar-layout > main > aside.ar-aside.left {
17
- min-width: 20%;
17
+ flex: 2;
18
18
  min-height: calc(100vh - 7.5rem);
19
19
  border-right: solid 1px var(--gray-200);
20
20
  }
21
21
  .ar-layout > main > aside.ar-aside.right {
22
- min-width: 20%;
22
+ flex: 2;
23
23
  }
24
24
  .ar-layout > main > section {
25
+ flex: 8;
25
26
  height: fit-content;
26
- padding: 0 2rem;
27
27
  border-radius: var(--border-radius-lg);
28
28
  }
29
29
  .ar-layout > main:not(:has(> .ar-aside)) > section {
30
30
  min-width: 100%;
31
31
  }
32
- .ar-layout > main:has(> .ar-aside) > section {
33
- min-width: calc(80% - 2.5%);
32
+ .ar-layout > main:has(> .ar-aside.left) > section {
33
+ padding-left: 2rem;
34
34
  }
35
- .ar-layout > main:has(> .ar-aside) > section:has(~ .ar-aside) {
36
- min-width: calc(60% - 5%);
35
+ .ar-layout > main:has(> .ar-aside.left) > section:has(~ .ar-aside.right) {
36
+ padding: 0 2rem;
37
37
  }
38
38
 
39
39
  @import url("./header.css");
@@ -23,19 +23,25 @@ const Confirm = ({ children, title, message, content, onConfirm }) => {
23
23
  if (key === "Escape")
24
24
  setOpen(false);
25
25
  };
26
- const handleResizeEvent = () => setOpen(false);
26
+ const handleScroll = () => {
27
+ if (!_arConfirmWrapper.current || !_arConfirm.current)
28
+ return;
29
+ const wrapper = _arConfirmWrapper.current.getBoundingClientRect();
30
+ const confirm = _arConfirm.current.getBoundingClientRect();
31
+ setCoordinatX(wrapper.left - confirm.width - 10);
32
+ setCoordinatY(wrapper.top);
33
+ };
27
34
  // useEffects
28
35
  useEffect(() => {
29
36
  if (open) {
30
37
  document.addEventListener("click", handleClickOutSide);
31
38
  document.addEventListener("keydown", handleKeys);
32
- // Sayfa boyutu değiştirilmesi söz konusu olursa eğer bu kısım çalışacaktır.
33
- window.addEventListener("resize", handleResizeEvent);
39
+ document.addEventListener("scroll", handleScroll);
34
40
  // Dinleyicileri kaldır.
35
41
  return () => {
36
42
  document.removeEventListener("click", handleClickOutSide);
37
43
  document.removeEventListener("keydown", handleKeys);
38
- window.removeEventListener("resize", handleResizeEvent);
44
+ document.removeEventListener("scroll", handleScroll);
39
45
  };
40
46
  }
41
47
  }, [open]);
@@ -54,12 +60,7 @@ const Confirm = ({ children, title, message, content, onConfirm }) => {
54
60
  setOpen(false);
55
61
  } }, "Hay\u0131r")))),
56
62
  React.createElement("div", { onClick: () => {
57
- if (!_arConfirmWrapper.current || !_arConfirm.current)
58
- return;
59
- const wrapper = _arConfirmWrapper.current.getBoundingClientRect();
60
- const confirm = _arConfirm.current.getBoundingClientRect();
61
- setCoordinatX(wrapper.left - confirm.width - 10);
62
- setCoordinatY(wrapper.top);
63
+ handleScroll();
63
64
  setOpen((prev) => !prev);
64
65
  } }, children)));
65
66
  };
@@ -13,6 +13,7 @@ declare class Api {
13
13
  input?: RequestInfo;
14
14
  data: any;
15
15
  headers?: HeadersInit;
16
+ init?: RequestInit | undefined;
16
17
  }): Promise<Response>;
17
18
  Put(values: {
18
19
  input?: RequestInfo;
@@ -20,6 +20,7 @@ class Api {
20
20
  headers: { ...this.HeaderProperties, ...values.headers },
21
21
  method: "POST",
22
22
  body: JSON.stringify(values.data),
23
+ ...values.init,
23
24
  });
24
25
  return response;
25
26
  }
@@ -62,7 +63,7 @@ class Api {
62
63
  console.error("400");
63
64
  break;
64
65
  case 401:
65
- console.error("401");
66
+ // console.error("401");
66
67
  break;
67
68
  case 404:
68
69
  console.error("404");
@@ -20,6 +20,7 @@ declare class Service {
20
20
  input?: RequestInfo;
21
21
  data: TData;
22
22
  headers?: HeadersInit;
23
+ init?: RequestInit | undefined;
23
24
  }): Promise<Result<TResponse>>;
24
25
  Put<TResponse, TData>(values?: {
25
26
  input?: RequestInfo;
@@ -36,6 +36,7 @@ class Service {
36
36
  input: endPoint,
37
37
  data: values?.data,
38
38
  headers: values?.headers,
39
+ init: values?.init,
39
40
  });
40
41
  const text = (await response.text()).trim();
41
42
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ar-design",
3
- "version": "0.1.52",
3
+ "version": "0.1.53",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",