ar-design 0.1.21 → 0.1.23
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.
- package/dist/assets/css/components/data-display/chip/chip.css +1 -0
- package/dist/assets/css/components/data-display/divider/divider.css +4 -1
- package/dist/assets/css/components/data-display/paper/paper.css +20 -0
- package/dist/assets/css/components/data-display/table/scroll.css +61 -0
- package/dist/assets/css/components/data-display/table/table.css +89 -0
- package/dist/assets/css/components/data-display/typography/title/core.css +1 -2
- package/dist/assets/css/components/feedback/alert/alert.css +0 -1
- package/dist/assets/css/components/feedback/modal/content.css +6 -0
- package/dist/assets/css/components/feedback/modal/footer.css +9 -0
- package/dist/assets/css/components/feedback/modal/header.css +56 -0
- package/dist/assets/css/components/feedback/modal/modal.css +54 -0
- package/dist/assets/css/components/feedback/notification/notification.css +162 -0
- package/dist/assets/css/components/form/button/button.css +7 -0
- package/dist/assets/css/components/form/button/core/icon.css +15 -15
- package/dist/assets/css/components/form/button-group/button-group.css +6 -0
- package/dist/assets/css/components/form/checkbox/core/border.css +1 -2
- package/dist/assets/css/components/form/date-picker/calendar/content.css +68 -0
- package/dist/assets/css/components/form/date-picker/calendar/footer.css +10 -0
- package/dist/assets/css/components/form/date-picker/calendar/header.css +33 -0
- package/dist/assets/css/components/form/date-picker/clock/clock.css +30 -0
- package/dist/assets/css/components/form/date-picker/clock/content.css +56 -0
- package/dist/assets/css/components/form/date-picker/clock/footer.css +7 -0
- package/dist/assets/css/components/form/date-picker/clock/header.css +6 -0
- package/dist/assets/css/components/form/date-picker/date-picker.css +51 -0
- package/dist/assets/css/components/form/input/core/border.css +1 -2
- package/dist/assets/css/components/form/input/core/button.css +1 -2
- package/dist/assets/css/components/form/select/options.css +2 -1
- package/dist/assets/css/components/form/switch/core/border.css +1 -2
- package/dist/assets/css/components/layout/header.css +1 -0
- package/dist/assets/css/components/layout/layout.css +0 -2
- package/dist/assets/css/components/navigation/menu/menu.css +1 -0
- package/dist/assets/css/components/navigation/pagination/pagination.css +60 -0
- package/dist/assets/css/core/ar-core.css +19 -4
- package/dist/assets/css/core/variants/animation.css +1 -2
- package/dist/assets/css/core/variants/borderless/borderless.css +25 -50
- package/dist/assets/css/core/variants/dashed/dashed.css +9 -10
- package/dist/assets/css/core/variants/filled/filled.css +57 -26
- package/dist/assets/css/core/variants/outlined/outlined.css +10 -11
- package/dist/components/data-display/chip/index.js +5 -11
- package/dist/components/data-display/paper/index.d.ts +8 -0
- package/dist/components/data-display/paper/index.js +12 -0
- package/dist/components/data-display/table/Actions.d.ts +8 -0
- package/dist/components/data-display/table/Actions.js +2 -0
- package/dist/components/data-display/table/IProps.d.ts +14 -0
- package/dist/components/data-display/table/IProps.js +1 -0
- package/dist/components/data-display/table/index.d.ts +12 -0
- package/dist/components/data-display/table/index.js +217 -0
- package/dist/components/feedback/modal/IProps.d.ts +20 -0
- package/dist/components/feedback/modal/IProps.js +1 -0
- package/dist/components/feedback/modal/index.d.ts +5 -0
- package/dist/components/feedback/modal/index.js +45 -0
- package/dist/components/feedback/notification/IProps.d.ts +9 -0
- package/dist/components/feedback/notification/IProps.js +1 -0
- package/dist/components/feedback/notification/index.d.ts +5 -0
- package/dist/components/feedback/notification/index.js +40 -0
- package/dist/components/form/button/IProps.d.ts +1 -1
- package/dist/components/form/button/index.js +12 -26
- package/dist/components/form/button-group/index.js +5 -6
- package/dist/components/form/checkbox/IProps.d.ts +1 -1
- package/dist/components/form/checkbox/index.d.ts +1 -1
- package/dist/components/form/checkbox/index.js +11 -18
- package/dist/components/form/date-picker/Props.d.ts +7 -0
- package/dist/components/form/date-picker/Props.js +1 -0
- package/dist/components/form/date-picker/index.d.ts +5 -0
- package/dist/components/form/date-picker/index.js +328 -0
- package/dist/components/form/input/IProps.d.ts +1 -1
- package/dist/components/form/input/index.js +19 -35
- package/dist/components/form/select/Props.d.ts +1 -1
- package/dist/components/form/select/index.js +48 -44
- package/dist/components/form/switch/index.js +4 -3
- package/dist/components/layout/Header.js +1 -1
- package/dist/components/layout/IProps.d.ts +2 -2
- package/dist/components/layout/LSider.js +2 -2
- package/dist/components/layout/RSider.js +3 -3
- package/dist/components/layout/index.js +5 -8
- package/dist/components/navigation/menu/Types.d.ts +1 -1
- package/dist/components/navigation/menu/index.js +12 -10
- package/dist/components/navigation/pagination/IProps.d.ts +7 -0
- package/dist/components/navigation/pagination/IProps.js +1 -0
- package/dist/components/navigation/pagination/index.d.ts +5 -0
- package/dist/components/navigation/pagination/index.js +77 -0
- package/dist/index.d.ts +7 -3
- package/dist/index.js +11 -10
- package/dist/libs/core/application/contexts/Config.d.ts +26 -0
- package/dist/libs/core/application/contexts/Config.js +20 -0
- package/dist/libs/core/application/contexts/Notification.d.ts +16 -0
- package/dist/libs/core/application/contexts/Notification.js +19 -0
- package/dist/libs/core/application/contexts/index.d.ts +3 -0
- package/dist/libs/core/application/contexts/index.js +3 -0
- package/dist/libs/core/application/hooks/index.d.ts +32 -18
- package/dist/libs/core/application/hooks/index.js +15 -2
- package/dist/libs/core/service/Api.d.ts +35 -0
- package/dist/libs/core/service/Api.js +86 -0
- package/dist/libs/core/service/index.d.ts +28 -0
- package/dist/libs/core/service/index.js +48 -0
- package/dist/libs/infrastructure/shared/Utils.d.ts +6 -0
- package/dist/libs/infrastructure/shared/Utils.js +15 -0
- package/dist/libs/types/IGlobalProps.d.ts +46 -13
- package/dist/libs/types/index.d.ts +22 -2
- package/package.json +3 -1
- package/dist/libs/core/application/contexts/Layout.d.ts +0 -23
- package/dist/libs/core/application/contexts/Layout.js +0 -17
- package/dist/libs/index.d.ts +0 -0
- package/dist/libs/index.js +0 -3
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React, { createContext, useState } from "react";
|
|
3
|
+
import Notification from "../../../../components/feedback/notification";
|
|
4
|
+
const NotificationContext = createContext({});
|
|
5
|
+
const NotificationProvider = ({ children, direction }) => {
|
|
6
|
+
const [title, setTitle] = useState("Example");
|
|
7
|
+
const [message, setMessage] = useState("Lorem Ipsum, dizgi ve baskı endüstrisinde kullanılan mıgır metinlerdir.");
|
|
8
|
+
const [status, setStatus] = useState("success");
|
|
9
|
+
const [trigger, setTrigger] = useState(false);
|
|
10
|
+
return (React.createElement(NotificationContext.Provider, { value: {
|
|
11
|
+
setTitle,
|
|
12
|
+
setMessage,
|
|
13
|
+
setStatus,
|
|
14
|
+
setTrigger,
|
|
15
|
+
} },
|
|
16
|
+
children,
|
|
17
|
+
React.createElement(Notification, { title: title, message: message, status: status, direction: direction, trigger: trigger })));
|
|
18
|
+
};
|
|
19
|
+
export { NotificationContext, NotificationProvider };
|
|
@@ -1,26 +1,40 @@
|
|
|
1
|
+
import { Status } from "../contexts/Notification";
|
|
1
2
|
export declare const useLayout: () => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
config: {
|
|
4
|
+
layout: {
|
|
5
|
+
sider: {
|
|
6
|
+
left: {
|
|
7
|
+
element: import("react").ReactNode | null;
|
|
8
|
+
active: boolean;
|
|
9
|
+
};
|
|
10
|
+
right: {
|
|
11
|
+
element: import("react").ReactNode | null;
|
|
12
|
+
active: boolean;
|
|
13
|
+
};
|
|
11
14
|
};
|
|
12
15
|
};
|
|
16
|
+
perPage: number;
|
|
13
17
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
setConfig: import("react").Dispatch<import("react").SetStateAction<{
|
|
19
|
+
layout: {
|
|
20
|
+
sider: {
|
|
21
|
+
left: {
|
|
22
|
+
element: import("react").ReactNode | null;
|
|
23
|
+
active: boolean;
|
|
24
|
+
};
|
|
25
|
+
right: {
|
|
26
|
+
element: import("react").ReactNode | null;
|
|
27
|
+
active: boolean;
|
|
28
|
+
};
|
|
23
29
|
};
|
|
24
30
|
};
|
|
31
|
+
perPage: number;
|
|
25
32
|
}>>;
|
|
26
33
|
};
|
|
34
|
+
export declare const useNotification: () => {
|
|
35
|
+
notification: ({ title, message, status, }: {
|
|
36
|
+
title: string;
|
|
37
|
+
message: string;
|
|
38
|
+
status: Status;
|
|
39
|
+
}) => void;
|
|
40
|
+
};
|
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
import { useContext } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { ConfigContext } from "../contexts/Config";
|
|
3
|
+
import { NotificationContext } from "../contexts/Notification";
|
|
3
4
|
export const useLayout = () => {
|
|
4
|
-
const context = useContext(
|
|
5
|
+
const context = useContext(ConfigContext);
|
|
5
6
|
if (!context) {
|
|
6
7
|
throw new Error("useLayout must be used within a LayoutProvider");
|
|
7
8
|
}
|
|
8
9
|
return context;
|
|
9
10
|
};
|
|
11
|
+
export const useNotification = () => {
|
|
12
|
+
// contexts
|
|
13
|
+
const { setTitle, setMessage, setStatus, setTrigger } = useContext(NotificationContext);
|
|
14
|
+
// methods
|
|
15
|
+
const notification = ({ title, message, status, }) => {
|
|
16
|
+
setTitle && setTitle(title);
|
|
17
|
+
setMessage && setMessage(message);
|
|
18
|
+
setStatus && setStatus(status);
|
|
19
|
+
setTrigger && setTrigger((trigger) => !trigger);
|
|
20
|
+
};
|
|
21
|
+
return { notification };
|
|
22
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
declare class Api {
|
|
2
|
+
private _host?;
|
|
3
|
+
private _core?;
|
|
4
|
+
constructor(values: {
|
|
5
|
+
host?: string;
|
|
6
|
+
core?: string;
|
|
7
|
+
});
|
|
8
|
+
Get<T>(values: {
|
|
9
|
+
input?: RequestInfo | undefined;
|
|
10
|
+
headers?: HeadersInit;
|
|
11
|
+
}): Promise<T>;
|
|
12
|
+
Post<T>(values: {
|
|
13
|
+
input?: RequestInfo;
|
|
14
|
+
data: any;
|
|
15
|
+
headers?: HeadersInit;
|
|
16
|
+
}): Promise<T>;
|
|
17
|
+
Put<T>(values: {
|
|
18
|
+
input?: RequestInfo;
|
|
19
|
+
data?: any;
|
|
20
|
+
headers?: HeadersInit;
|
|
21
|
+
}): Promise<T>;
|
|
22
|
+
Delete<T>(values: {
|
|
23
|
+
input?: RequestInfo;
|
|
24
|
+
headers?: HeadersInit;
|
|
25
|
+
}): Promise<T>;
|
|
26
|
+
/**
|
|
27
|
+
* Burada bir fetch işlemi gerçekleştirilmekte fakat farklı olarak burayı `interceptor` olarak kullanmaktayız.
|
|
28
|
+
* @param input
|
|
29
|
+
* @param init
|
|
30
|
+
* @returns
|
|
31
|
+
*/
|
|
32
|
+
private CustomFetch;
|
|
33
|
+
private HeaderProperties;
|
|
34
|
+
}
|
|
35
|
+
export default Api;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
class Api {
|
|
2
|
+
_host;
|
|
3
|
+
_core;
|
|
4
|
+
constructor(values) {
|
|
5
|
+
this._host = values.host || window.location.origin;
|
|
6
|
+
this._core = values.core || "";
|
|
7
|
+
}
|
|
8
|
+
async Get(values) {
|
|
9
|
+
const request = await this.CustomFetch(`${this._host}/${this._core ? this._core + "/" : ""}${values.input}`, {
|
|
10
|
+
headers: {
|
|
11
|
+
...this.HeaderProperties,
|
|
12
|
+
...values.headers,
|
|
13
|
+
},
|
|
14
|
+
method: "GET",
|
|
15
|
+
});
|
|
16
|
+
return await request.json();
|
|
17
|
+
}
|
|
18
|
+
async Post(values) {
|
|
19
|
+
const request = await this.CustomFetch(`${this._host}/${this._core ? this._core + "/" : ""}${values.input}`, {
|
|
20
|
+
headers: { ...this.HeaderProperties, ...values.headers },
|
|
21
|
+
method: "POST",
|
|
22
|
+
body: JSON.stringify(values.data),
|
|
23
|
+
});
|
|
24
|
+
return await request.json();
|
|
25
|
+
}
|
|
26
|
+
async Put(values) {
|
|
27
|
+
const request = await this.CustomFetch(`${this._host}/${this._core ? this._core + "/" : ""}${values.input}`, {
|
|
28
|
+
headers: {
|
|
29
|
+
...this.HeaderProperties,
|
|
30
|
+
...values.headers,
|
|
31
|
+
},
|
|
32
|
+
method: "PUT",
|
|
33
|
+
body: JSON.stringify(values.data),
|
|
34
|
+
});
|
|
35
|
+
return await request.json();
|
|
36
|
+
}
|
|
37
|
+
async Delete(values) {
|
|
38
|
+
const request = await this.CustomFetch(`${this._host}/${this._core ? this._core + "/" : ""}${values.input}`, {
|
|
39
|
+
headers: {
|
|
40
|
+
...this.HeaderProperties,
|
|
41
|
+
...values.headers,
|
|
42
|
+
},
|
|
43
|
+
method: "DELETE",
|
|
44
|
+
});
|
|
45
|
+
return await request.json();
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Burada bir fetch işlemi gerçekleştirilmekte fakat farklı olarak burayı `interceptor` olarak kullanmaktayız.
|
|
49
|
+
* @param input
|
|
50
|
+
* @param init
|
|
51
|
+
* @returns
|
|
52
|
+
*/
|
|
53
|
+
async CustomFetch(input, init) {
|
|
54
|
+
try {
|
|
55
|
+
// # Request Interceptor
|
|
56
|
+
const request = await fetch(input, init);
|
|
57
|
+
// # Response Interceptor
|
|
58
|
+
// Error Handling
|
|
59
|
+
if (!request.ok) {
|
|
60
|
+
switch (request.status) {
|
|
61
|
+
case 400:
|
|
62
|
+
console.error("400");
|
|
63
|
+
break;
|
|
64
|
+
case 401:
|
|
65
|
+
console.error("401");
|
|
66
|
+
break;
|
|
67
|
+
case 404:
|
|
68
|
+
console.error("404");
|
|
69
|
+
break;
|
|
70
|
+
default:
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
// Return
|
|
75
|
+
return request;
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
throw error;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
HeaderProperties = {
|
|
82
|
+
Accept: "application/json",
|
|
83
|
+
"Content-Type": "application/json",
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
export default Api;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare class Service {
|
|
2
|
+
private _api;
|
|
3
|
+
private _endPoint;
|
|
4
|
+
constructor(values: {
|
|
5
|
+
host?: string;
|
|
6
|
+
core?: string;
|
|
7
|
+
endPoint: string;
|
|
8
|
+
});
|
|
9
|
+
Get<T>(values?: {
|
|
10
|
+
input?: string;
|
|
11
|
+
headers?: HeadersInit | undefined;
|
|
12
|
+
}): Promise<T>;
|
|
13
|
+
Post<T, TData>(values?: {
|
|
14
|
+
input?: RequestInfo;
|
|
15
|
+
data: TData;
|
|
16
|
+
headers?: HeadersInit;
|
|
17
|
+
}): Promise<T>;
|
|
18
|
+
Put<T, TData>(values?: {
|
|
19
|
+
input?: RequestInfo;
|
|
20
|
+
data?: TData;
|
|
21
|
+
headers?: HeadersInit;
|
|
22
|
+
}): Promise<T>;
|
|
23
|
+
Delete<T>(values?: {
|
|
24
|
+
input?: RequestInfo;
|
|
25
|
+
headers?: HeadersInit;
|
|
26
|
+
}): Promise<T>;
|
|
27
|
+
}
|
|
28
|
+
export default Service;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import Api from "./Api";
|
|
2
|
+
class Service {
|
|
3
|
+
_api;
|
|
4
|
+
_endPoint;
|
|
5
|
+
constructor(values) {
|
|
6
|
+
this._api = new Api({ host: values.host, core: values.core });
|
|
7
|
+
this._endPoint = values.endPoint;
|
|
8
|
+
}
|
|
9
|
+
async Get(values) {
|
|
10
|
+
let endPoint = `${this._endPoint}`;
|
|
11
|
+
if (values?.input)
|
|
12
|
+
endPoint += `/${values.input}`;
|
|
13
|
+
return await this._api.Get({
|
|
14
|
+
input: endPoint,
|
|
15
|
+
headers: values?.headers,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
async Post(values) {
|
|
19
|
+
let endPoint = `${this._endPoint}`;
|
|
20
|
+
if (values?.input)
|
|
21
|
+
endPoint += `/${values.input}`;
|
|
22
|
+
return await this._api.Post({
|
|
23
|
+
input: endPoint,
|
|
24
|
+
data: values?.data,
|
|
25
|
+
headers: values?.headers,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
async Put(values) {
|
|
29
|
+
let endPoint = `${this._endPoint}`;
|
|
30
|
+
if (values?.input)
|
|
31
|
+
endPoint += `/${values.input}`;
|
|
32
|
+
return await this._api.Put({
|
|
33
|
+
input: endPoint,
|
|
34
|
+
data: values?.data,
|
|
35
|
+
headers: values?.headers,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
async Delete(values) {
|
|
39
|
+
let endPoint = `${this._endPoint}`;
|
|
40
|
+
if (values?.input)
|
|
41
|
+
endPoint += `/${values.input}`;
|
|
42
|
+
return await this._api.Delete({
|
|
43
|
+
input: endPoint,
|
|
44
|
+
headers: values?.headers,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export default Service;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Border, Icon, Sizes, Status, Variants } from "../../types";
|
|
2
|
+
declare class Utils {
|
|
3
|
+
GetClassName: (variant?: Variants, status?: Status, border?: Border, size?: Sizes, icon?: Icon, className?: string) => string[];
|
|
4
|
+
}
|
|
5
|
+
declare const _default: Utils;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
class Utils {
|
|
2
|
+
GetClassName = (variant = "filled", status = "light", border = { radius: "sm" }, size = "normal", icon, className) => {
|
|
3
|
+
const classNames = [variant, status, `border-radius-${border.radius}`];
|
|
4
|
+
if (size)
|
|
5
|
+
classNames.push(size);
|
|
6
|
+
if (icon && icon.element) {
|
|
7
|
+
classNames.push("icon");
|
|
8
|
+
classNames.push(`icon-${icon.position || "start"}`);
|
|
9
|
+
}
|
|
10
|
+
if (className)
|
|
11
|
+
classNames.push(className);
|
|
12
|
+
return classNames;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export default new Utils();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Border, Icon, Sizes, Status, Variants } from ".";
|
|
2
2
|
/**
|
|
3
3
|
* Ortak olabilecek özellikler bu interface altına konumlandırıldı.
|
|
4
4
|
*/
|
|
@@ -57,9 +57,6 @@ export interface IGlobalProps {
|
|
|
57
57
|
* İkonun kendisini, yönünü ve pozisyonunu tanımlamak için kullanılır.
|
|
58
58
|
*
|
|
59
59
|
* - `element`: İkon olarak kullanılacak React JSX elemanı.
|
|
60
|
-
* - `direction` (isteğe bağlı): İkonun ve metnin hizalanma yönünü belirtir.
|
|
61
|
-
* - `row`: İkon ve metin yatay olarak hizalanır.
|
|
62
|
-
* - `column`: İkon ve metin dikey olarak hizalanır.
|
|
63
60
|
* - `position` (isteğe bağlı): İkonun metne göre konumunu belirtir.
|
|
64
61
|
* - `start`: İkon metnin başında yer alır.
|
|
65
62
|
* - `end`: İkon metnin sonunda yer alır.
|
|
@@ -78,11 +75,7 @@ export interface IGlobalProps {
|
|
|
78
75
|
* </Component>
|
|
79
76
|
* ```
|
|
80
77
|
*/
|
|
81
|
-
icon?:
|
|
82
|
-
element: React.JSX.Element;
|
|
83
|
-
direction?: "row" | "column";
|
|
84
|
-
position?: "start" | "end";
|
|
85
|
-
};
|
|
78
|
+
icon?: Icon;
|
|
86
79
|
/**
|
|
87
80
|
* Bileşenin çervesinde düzenleme yapılmasına olanak tanır.
|
|
88
81
|
* Kenarlığın stilini ve köşe yuvarlama derecesini tanımlamak için kullanılır.
|
|
@@ -99,13 +92,11 @@ export interface IGlobalProps {
|
|
|
99
92
|
*
|
|
100
93
|
* ```jsx
|
|
101
94
|
* <Component border={{ radius: "sm" }} >
|
|
102
|
-
*
|
|
95
|
+
* Example
|
|
103
96
|
* </Component>
|
|
104
97
|
* ```
|
|
105
98
|
*/
|
|
106
|
-
border?:
|
|
107
|
-
radius: BorderRadiuses;
|
|
108
|
-
};
|
|
99
|
+
border?: Border;
|
|
109
100
|
size?: Sizes;
|
|
110
101
|
/**
|
|
111
102
|
* Bileşendeki metni büyük harflere dönüştürüp dönüştürmeyeceğini belirtir.
|
|
@@ -119,3 +110,45 @@ export interface IGlobalProps {
|
|
|
119
110
|
upperCase?: boolean;
|
|
120
111
|
disabled?: boolean;
|
|
121
112
|
}
|
|
113
|
+
export interface IChildren {
|
|
114
|
+
/**
|
|
115
|
+
* Bileşenin içinde render edilecek içeriği belirtir.
|
|
116
|
+
* Bu içerik bir dize (string) veya bir React Elemanı olabilir.
|
|
117
|
+
*
|
|
118
|
+
* Örneğin;
|
|
119
|
+
* - Bir Dize: "Hello, World!"
|
|
120
|
+
* - Bir React Elemanı: <span>Hello, World!</span>
|
|
121
|
+
*
|
|
122
|
+
* ```jsx
|
|
123
|
+
* <Component>Hello, World!</Component>
|
|
124
|
+
*
|
|
125
|
+
* <Component>
|
|
126
|
+
* <span>Hello, World!</span>
|
|
127
|
+
* </Component>
|
|
128
|
+
*
|
|
129
|
+
* <Component>
|
|
130
|
+
* <span>Hello, World!</span>
|
|
131
|
+
* <span>Hello, World!</span>
|
|
132
|
+
* </Component>
|
|
133
|
+
* ```
|
|
134
|
+
*/
|
|
135
|
+
children?: React.ReactNode;
|
|
136
|
+
}
|
|
137
|
+
export interface ISizes {
|
|
138
|
+
/**
|
|
139
|
+
* Bileşenin boyutlarınu belirlemek için kullanılır.
|
|
140
|
+
*
|
|
141
|
+
* - `large`: Büyük boyut.
|
|
142
|
+
* - `normal (Varsayılan)`: Normal boyut.
|
|
143
|
+
* - `small`: Küçük boyut.
|
|
144
|
+
*
|
|
145
|
+
* Örneğin;
|
|
146
|
+
*
|
|
147
|
+
* ```jsx
|
|
148
|
+
* <Component size="large" >
|
|
149
|
+
* Example
|
|
150
|
+
* </Component>
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
size?: Sizes;
|
|
154
|
+
}
|
|
@@ -1,17 +1,37 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
export type Variants = "filled" | "outlined" | "dashed" | "borderless";
|
|
2
3
|
export type Status = "primary" | "secondary" | "success" | "danger" | "warning" | "information" | "dark" | "light";
|
|
3
4
|
export type ParagraphColors = "gray-100" | "gray-200" | "gray-300" | "gray-400" | "gray-500" | "gray-600" | "gray-700" | "gray-800" | "gray-900";
|
|
5
|
+
export type Border = {
|
|
6
|
+
radius: BorderRadiuses;
|
|
7
|
+
};
|
|
4
8
|
export type BorderRadiuses = "sm" | "lg" | "xl" | "xxl" | "pill" | "none";
|
|
9
|
+
export type Icon = {
|
|
10
|
+
element: React.JSX.Element;
|
|
11
|
+
position?: "start" | "end";
|
|
12
|
+
};
|
|
5
13
|
export type Sizes = "large" | "normal" | "small";
|
|
6
14
|
export type Option = {
|
|
7
15
|
value: string | number;
|
|
8
16
|
text: string;
|
|
9
17
|
};
|
|
10
|
-
export type MenuItemVariants = "vertical" | "horizontal";
|
|
11
|
-
export type MenuItemType = "group" | "divider";
|
|
12
18
|
export type MenuProps = {
|
|
13
19
|
render?: string | React.JSX.Element;
|
|
14
20
|
type?: MenuItemType;
|
|
15
21
|
icon?: React.JSX.Element;
|
|
16
22
|
submenu?: MenuProps[];
|
|
17
23
|
};
|
|
24
|
+
export type MenuItemVariants = "vertical" | "horizontal";
|
|
25
|
+
export type MenuItemType = "group" | "divider";
|
|
26
|
+
export type TableColumnType<T> = {
|
|
27
|
+
title: string;
|
|
28
|
+
key?: keyof T | {
|
|
29
|
+
field: keyof T;
|
|
30
|
+
nestedKey: string;
|
|
31
|
+
};
|
|
32
|
+
render?: (item: T) => React.ReactNode;
|
|
33
|
+
config?: {
|
|
34
|
+
alignContent?: "left" | "center" | "right";
|
|
35
|
+
sticky?: "left" | "right";
|
|
36
|
+
};
|
|
37
|
+
};
|
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ar-design",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.23",
|
|
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
|
+
"./@service": "./dist/libs/core/service/index.js",
|
|
10
|
+
"./@config": "./dist/libs/core/application/contexts/index.js",
|
|
9
11
|
"./@hooks": "./dist/libs/core/application/hooks/index.js",
|
|
10
12
|
"./@types": "./dist/libs/types/index.js",
|
|
11
13
|
"./@styles": "./dist/assets/css/core/ar-core.css"
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
type LayoutOptions = {
|
|
3
|
-
sider: {
|
|
4
|
-
left?: {
|
|
5
|
-
element?: React.ReactNode;
|
|
6
|
-
active: boolean;
|
|
7
|
-
};
|
|
8
|
-
right?: {
|
|
9
|
-
element?: React.ReactNode;
|
|
10
|
-
active: boolean;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
type LayoutContextProps = {
|
|
15
|
-
options: LayoutOptions;
|
|
16
|
-
setOptions: React.Dispatch<React.SetStateAction<LayoutOptions>>;
|
|
17
|
-
};
|
|
18
|
-
type LayoutProviderProps = {
|
|
19
|
-
children: React.ReactNode;
|
|
20
|
-
};
|
|
21
|
-
declare const LayoutContext: React.Context<LayoutContextProps>;
|
|
22
|
-
declare const LayoutProvider: ({ children }: LayoutProviderProps) => React.JSX.Element;
|
|
23
|
-
export { LayoutContext, LayoutProvider };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import React, { createContext, useState } from "react";
|
|
3
|
-
const defaultOptions = {
|
|
4
|
-
sider: {
|
|
5
|
-
left: { element: null, active: false },
|
|
6
|
-
right: { element: null, active: false },
|
|
7
|
-
},
|
|
8
|
-
};
|
|
9
|
-
const LayoutContext = createContext({
|
|
10
|
-
options: defaultOptions,
|
|
11
|
-
setOptions: () => { },
|
|
12
|
-
});
|
|
13
|
-
const LayoutProvider = ({ children }) => {
|
|
14
|
-
const [options, setOptions] = useState(defaultOptions);
|
|
15
|
-
return (React.createElement(LayoutContext.Provider, { value: { options, setOptions } }, children));
|
|
16
|
-
};
|
|
17
|
-
export { LayoutContext, LayoutProvider };
|
package/dist/libs/index.d.ts
DELETED
|
File without changes
|
package/dist/libs/index.js
DELETED