ar-design 0.2.61 → 0.2.63

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 (36) hide show
  1. package/dist/components/data-display/card/IProps.d.ts +20 -3
  2. package/dist/components/data-display/chip/IProps.d.ts +11 -2
  3. package/dist/components/data-display/dnd/IProps.d.ts +32 -0
  4. package/dist/components/data-display/grid-system/column/IProps.d.ts +40 -0
  5. package/dist/components/data-display/grid-system/index.d.ts +1 -1
  6. package/dist/components/data-display/grid-system/row/IProps.d.ts +4 -0
  7. package/dist/components/data-display/grid-system/row/Row.d.ts +2 -2
  8. package/dist/components/data-display/table/IProps.d.ts +113 -0
  9. package/dist/components/data-display/tabs/IProps.d.ts +43 -4
  10. package/dist/components/data-display/typography/paragraph/IProps.d.ts +26 -2
  11. package/dist/components/data-display/typography/title/IProps.d.ts +48 -2
  12. package/dist/components/feedback/alert/IProps.d.ts +27 -2
  13. package/dist/components/feedback/modal/IProps.d.ts +29 -5
  14. package/dist/components/feedback/notification/IProps.d.ts +63 -2
  15. package/dist/components/feedback/popover/IProps.d.ts +68 -0
  16. package/dist/components/feedback/progress/IProps.d.ts +30 -0
  17. package/dist/components/feedback/tooltip/IProps.d.ts +25 -0
  18. package/dist/components/form/button/IProps.d.ts +55 -2
  19. package/dist/components/form/checkbox/IProps.d.ts +13 -3
  20. package/dist/components/form/date-picker/Props.d.ts +36 -3
  21. package/dist/components/form/input/IProps.d.ts +31 -4
  22. package/dist/components/form/input-tag/IProps.d.ts +2 -3
  23. package/dist/components/form/radio/IProps.d.ts +24 -3
  24. package/dist/components/form/select/Props.d.ts +118 -7
  25. package/dist/components/form/switch/IProps.d.ts +13 -2
  26. package/dist/components/form/text-editor/IProps.d.ts +85 -4
  27. package/dist/components/form/upload/Props.d.ts +96 -3
  28. package/dist/components/navigation/menu/IProps.d.ts +25 -0
  29. package/dist/components/navigation/pagination/IProps.d.ts +10 -3
  30. package/dist/components/navigation/steps/IProps.d.ts +12 -4
  31. package/dist/libs/types/IGlobalProps.d.ts +91 -45
  32. package/package.json +4 -12
  33. package/dist/components/data-display/grid-system/row/Types.d.ts +0 -4
  34. package/dist/components/data-display/table/_index.d.ts +0 -13
  35. package/dist/components/data-display/table/_index.js +0 -411
  36. /package/dist/components/data-display/grid-system/row/{Types.js → IProps.js} +0 -0
@@ -1,11 +1,79 @@
1
1
  import { IChildren } from "../../../libs/types/IGlobalProps";
2
2
  interface IProps extends IChildren {
3
+ /**
4
+ * Popover başlığı.
5
+ *
6
+ * Örneğin;
7
+ *
8
+ * ```jsx
9
+ * <Popover title="Onay Gerekiyor" />
10
+ * ```
11
+ */
3
12
  title?: string;
13
+ /**
14
+ * Popover içinde gösterilecek mesaj metni.
15
+ *
16
+ * Örneğin;
17
+ *
18
+ * ```jsx
19
+ * <Popover message="İşlemi onaylıyor musunuz?" />
20
+ * ```
21
+ */
4
22
  message?: string;
23
+ /**
24
+ * Popover içeriği olarak gösterilecek özel React JSX elementi.
25
+ *
26
+ * Örneğin;
27
+ *
28
+ * ```jsx
29
+ * <Popover content={<CustomContent />} />
30
+ * ```
31
+ */
5
32
  content?: React.JSX.Element;
33
+ /**
34
+ * Onay veya iptal durumunda tetiklenen geri çağırma fonksiyonu.
35
+ *
36
+ * @param confirm - Kullanıcı onay verdiyse true, iptal ettiyse false.
37
+ *
38
+ * Örneğin;
39
+ *
40
+ * ```jsx
41
+ * <Popover onConfirm={(confirm) => console.log(confirm)} />
42
+ * ```
43
+ */
6
44
  onConfirm?: (confirm: boolean) => void;
45
+ /**
46
+ * Popover açıkken sayfa dışında bir yere tıklandığında açık kalsın mı?
47
+ *
48
+ * Örneğin;
49
+ *
50
+ * ```jsx
51
+ * <Popover windowBlur={true} />
52
+ * ```
53
+ */
7
54
  windowBlur?: boolean;
55
+ /**
56
+ * Popover genişliği tam genişlikte mi olacak?
57
+ *
58
+ * Örneğin;
59
+ *
60
+ * ```jsx
61
+ * <Popover fullWidth={true} />
62
+ * ```
63
+ */
8
64
  fullWidth?: boolean;
65
+ /**
66
+ * Buton yapılandırmaları.
67
+ *
68
+ * - `okButton`: Onay butonunda gösterilecek metin.
69
+ * - `cancelButton`: (Opsiyonel) İptal butonunda gösterilecek metin.
70
+ *
71
+ * Örneğin;
72
+ *
73
+ * ```jsx
74
+ * <Popover config={{ buttons: { okButton: "...", cancelButton: "..." } }} />
75
+ * ```
76
+ */
9
77
  config?: {
10
78
  buttons: {
11
79
  okButton: string;
@@ -1,6 +1,36 @@
1
1
  interface IProps {
2
+ /**
3
+ * İlerleme çubuğunun mevcut değeri.
4
+ * Genellikle 0 ile 100 arasında bir sayı olmalıdır.
5
+ *
6
+ * Örneğin;
7
+ *
8
+ * ```jsx
9
+ * <Progress value={75} />
10
+ * ```
11
+ */
2
12
  value: number;
13
+ /**
14
+ * İlerleme çubuğunun ters yönde dolmasını sağlar.
15
+ * Varsayılan olarak false'tur.
16
+ *
17
+ * Örneğin;
18
+ *
19
+ * ```jsx
20
+ * <Progress value={50} reverse={true} />
21
+ * ```
22
+ */
3
23
  reverse?: boolean;
24
+ /**
25
+ * İlerleme değerinin görünür olup olmadığını belirler.
26
+ * Varsayılan olarak true olabilir.
27
+ *
28
+ * Örneğin;
29
+ *
30
+ * ```jsx
31
+ * <Progress value={30} isVisibleValue={false} />
32
+ * ```
33
+ */
4
34
  isVisibleValue?: boolean;
5
35
  }
6
36
  export default IProps;
@@ -1,6 +1,31 @@
1
1
  import { IChildren } from "../../../libs/types/IGlobalProps";
2
2
  interface IProps extends IChildren {
3
+ /**
4
+ * Gösterilecek metin veya metinler.
5
+ *
6
+ * Örneğin;
7
+ *
8
+ * ```jsx
9
+ * <Tooltip text="..."><Component>...</Component></Tooltip>
10
+ * <Tooltip text={["...", "..."]}><Component>...</Component></Tooltip>
11
+ * ```
12
+ */
3
13
  text: string | string[];
14
+ /**
15
+ * Tooltip'in hangi yönde görüneceği.
16
+ *
17
+ * Geçerli değerler:
18
+ * - `top`: Üstte
19
+ * - `right`: Sağda
20
+ * - `left`: Solda
21
+ * - `bottom`: Altta
22
+ *
23
+ * Örneğin;
24
+ *
25
+ * ```jsx
26
+ * <Tooltip text="Bilgi" direction="right"><Component>...</Component></Tooltip>
27
+ * ```
28
+ */
4
29
  direction?: "top" | "right" | "left" | "bottom";
5
30
  }
6
31
  export default IProps;
@@ -1,5 +1,5 @@
1
- import { IGlobalProps, ISizes } from "../../../libs/types/IGlobalProps";
2
- interface IProps extends Omit<IGlobalProps, "children" | "disabled">, ISizes, React.ButtonHTMLAttributes<HTMLButtonElement> {
1
+ import { IBorder, IIcon, ISize, IStatus, IUpperCase, IVariant } from "../../../libs/types/IGlobalProps";
2
+ interface IProps extends IVariant, IStatus, IBorder, IIcon, ISize, IUpperCase, 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".
@@ -16,14 +16,67 @@ interface IProps extends Omit<IGlobalProps, "children" | "disabled">, ISizes, Re
16
16
  * ```
17
17
  */
18
18
  shape?: "circle" | "square";
19
+ /**
20
+ * Bileşene açıklayıcı bir bilgi balonu (tooltip) eklemek için kullanılır.
21
+ *
22
+ * - `text`: Tooltip içerisinde gösterilecek açıklama metni.
23
+ * - `direction`: Tooltip’in hangi yönde görüneceğini belirtir. Varsayılan yön kullanılabilir.
24
+ * - `top`: Tooltip yukarıda görünür.
25
+ * - `right`: Tooltip sağda görünür.
26
+ * - `left`: Tooltip solda görünür.
27
+ * - `bottom`: Tooltip aşağıda görünür.
28
+ *
29
+ * Örneğin;
30
+ *
31
+ * ```jsx
32
+ * <Component
33
+ * tooltip={{
34
+ * text: "Bu bir açıklamadır.",
35
+ * direction: "top"
36
+ * }}
37
+ * />
38
+ * ```
39
+ */
19
40
  tooltip?: {
20
41
  text: string;
21
42
  direction?: "top" | "right" | "left" | "bottom";
22
43
  };
44
+ /**
45
+ * Bileşenin konumlandırmasını belirlemek için kullanılır.
46
+ *
47
+ * - `type`: CSS `position` özelliği.
48
+ * - `fixed`: Sayfa boyunca sabit konum.
49
+ * - `absolute`: Üst öğeye göre konumlandırma.
50
+ * - `inset`: Bileşenin konumlanacağı kenar(lar).
51
+ * - Örn: `["top", "left"]` => üstten ve soldan hizalanır.
52
+ *
53
+ * Örneğin;
54
+ *
55
+ * ```jsx
56
+ * <Component
57
+ * position={{
58
+ * type: "absolute",
59
+ * inset: ["top", "left"]
60
+ * }}
61
+ * />
62
+ * ```
63
+ */
23
64
  position?: {
24
65
  type: "fixed" | "absolute";
25
66
  inset: ("top" | "right" | "bottom" | "left")[];
26
67
  };
68
+ /**
69
+ * Bileşenin yatayda tam genişlikte olup olmayacağını belirtir.
70
+ *
71
+ * - `true`: Bileşen bulunduğu kapsayıcının tüm genişliğini kaplar.
72
+ * - `false` veya belirtilmemişse: İçeriğe göre genişlik alır.
73
+ *
74
+ * Örneğin;
75
+ *
76
+ * ```jsx
77
+ * <Component fullWidth />
78
+ * ```
79
+ */
27
80
  fullWidth?: boolean;
28
81
  }
29
82
  export default IProps;
@@ -1,6 +1,16 @@
1
- import React from "react";
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"> {
1
+ import { IBorder, ISize, IStatus, IUpperCase, IValidation, IVariant } from "../../../libs/types/IGlobalProps";
2
+ interface IProps extends IVariant, IStatus, IBorder, ISize, IUpperCase, IValidation, Omit<React.InputHTMLAttributes<HTMLInputElement>, "children" | "type" | "size"> {
3
+ /**
4
+ * Bileşenin başlığı veya etiket metnidir.
5
+ *
6
+ * Genellikle input, buton gibi öğelerin ne amaçla kullanıldığını belirtmek için görüntülenir.
7
+ *
8
+ * Örneğin;
9
+ *
10
+ * ```jsx
11
+ * <Checkbox label="Kullanıcı Adı" />
12
+ * ```
13
+ */
4
14
  label?: string;
5
15
  }
6
16
  export default IProps;
@@ -1,8 +1,41 @@
1
- import React from "react";
2
- import { IGlobalProps, IValidation } from "../../../libs/types/IGlobalProps";
1
+ import { IBorder, ISize, IStatus, IValidation, IVariant } from "../../../libs/types/IGlobalProps";
3
2
  type Props = {
3
+ /**
4
+ * Bileşenin başlığı veya etiket metnidir.
5
+ *
6
+ * Genellikle input, buton gibi öğelerin ne amaçla kullanıldığını belirtmek için görüntülenir.
7
+ *
8
+ * Örneğin;
9
+ *
10
+ * ```jsx
11
+ * <DatePicker label="Başlangıç Saati" />
12
+ * ```
13
+ */
4
14
  label?: string;
15
+ /**
16
+ * Bileşenin yanında bir saat (clock/time picker) bileşeni olup olmadığını belirtir.
17
+ *
18
+ * - `true`: Saat bileşeninide ekleyerek davranır.
19
+ * - `false` veya belirtilmemişse: Standart davranış sergiler.
20
+ *
21
+ * Örneğin;
22
+ *
23
+ * ```jsx
24
+ * <DatePicker isClock />
25
+ * ```
26
+ */
5
27
  isClock?: boolean;
28
+ /**
29
+ * Bileşenin değerinde bir değişiklik olduğunda tetiklenen olaydır.
30
+ *
31
+ * - `value`: Güncel değeri temsil eder. Genellikle string türündedir (örneğin tarih veya tarih, saat).
32
+ *
33
+ * Örneğin;
34
+ *
35
+ * ```jsx
36
+ * <DatePicker onChange={(value) => console.log(value)} />
37
+ * ```
38
+ */
6
39
  onChange: (value: string) => void;
7
- } & Omit<IGlobalProps, "children" | "icon" | "upperCase" | "disabled"> & Omit<React.InputHTMLAttributes<HTMLInputElement>, "children" | "onChange" | "size"> & IValidation;
40
+ } & IVariant & IStatus & IBorder & ISize & IValidation & Omit<React.InputHTMLAttributes<HTMLInputElement>, "children" | "onChange" | "size">;
8
41
  export default Props;
@@ -1,14 +1,41 @@
1
- import React from "react";
2
1
  import IButtonProps from "../button/IProps";
3
2
  import { Variants } from "../../../libs/types";
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 {
3
+ import { IBorder, IIcon, ISize, IStatus, IUpperCase, IValidation, IVariant } from "../../../libs/types/IGlobalProps";
4
+ interface IProps extends IVariant, IStatus, IBorder, IIcon, ISize, IUpperCase, IValidation, Omit<React.InputHTMLAttributes<HTMLInputElement>, "children" | "size"> {
5
+ /**
6
+ * Bileşene entegre bir buton özelliği eklemek için kullanılır.
7
+ *
8
+ * `IButtonProps` tipi ile tanımlanır ve butonun davranışlarını, metnini, tıklama olaylarını vs. içerir.
9
+ *
10
+ * Örneğin;
11
+ *
12
+ * ```jsx
13
+ * <Input
14
+ * button={{
15
+ * text: "Gönder",
16
+ * onClick: () => console.log("Tıklandı"),
17
+ * }}
18
+ * />
19
+ * ```
20
+ */
6
21
  button?: IButtonProps;
22
+ /**
23
+ * Bileşenin başına (`before`) veya sonuna (`after`) yardımcı içerikler (ek öğeler) eklemek için kullanılır.
24
+ *
25
+ * - `variant`: Stil türünü belirtir ("filled" | "outlined" | "dashed" | "borderless").
26
+ * - `before`: Bileşenin soluna içerik ekler (örneğin ₺, %, vb.).
27
+ * - `after`: Bileşenin sağına içerik ekler.
28
+ *
29
+ * Örneğin;
30
+ *
31
+ * ```jsx
32
+ * <Input addon={{ variant: "outlined", before: "₺", after: "KDV" }} />
33
+ * ```
34
+ */
7
35
  addon?: {
8
36
  variant?: Variants;
9
37
  before?: string | number;
10
38
  after?: string | number;
11
39
  };
12
- upperCase?: boolean;
13
40
  }
14
41
  export default IProps;
@@ -1,5 +1,4 @@
1
- import React from "react";
2
- import { IGlobalProps, ISizes, IValidation } from "../../../libs/types/IGlobalProps";
3
- interface IProps extends Omit<IGlobalProps, "children" | "disabled">, ISizes, Omit<React.InputHTMLAttributes<HTMLInputElement>, "children" | "size">, IValidation {
1
+ import { IBorder, IIcon, ISize, IStatus, IUpperCase, IValidation, IVariant } from "../../../libs/types/IGlobalProps";
2
+ interface IProps extends IVariant, IStatus, IBorder, IIcon, ISize, IUpperCase, IValidation, Omit<React.InputHTMLAttributes<HTMLInputElement>, "children" | "size"> {
4
3
  }
5
4
  export default IProps;
@@ -1,8 +1,29 @@
1
- import React from "react";
2
- import { IGlobalProps, ISizes } from "../../../libs/types/IGlobalProps";
1
+ import { IBorder, IIcon, ISize, IStatus, IUpperCase, IValidation, IVariant } from "../../../libs/types/IGlobalProps";
3
2
  import { Status } from "../../../libs/types";
4
- interface IProps extends Omit<IGlobalProps, "children">, ISizes, Omit<React.InputHTMLAttributes<HTMLInputElement>, "children" | "size"> {
3
+ interface IProps extends IVariant, IStatus, IBorder, IIcon, ISize, IUpperCase, IValidation, Omit<React.InputHTMLAttributes<HTMLInputElement>, "children" | "size"> {
4
+ /**
5
+ * Bileşenin başlığı veya etiket metnidir.
6
+ *
7
+ * Genellikle input, buton gibi öğelerin ne amaçla kullanıldığını belirtmek için görüntülenir.
8
+ *
9
+ * Örneğin;
10
+ *
11
+ * ```jsx
12
+ * <Radio label="Kullanıcı Adı" />
13
+ * ```
14
+ */
5
15
  label?: string;
16
+ /**
17
+ * Bileşenin izlenebilir bir durum göstergesi (trace) olup olmadığını belirtir.
18
+ *
19
+ * - `color`: İzleme durumunu belirtmek için kullanılır. `Status` tipiyle tanımlanır (örneğin "success", "error", "warning" gibi).
20
+ *
21
+ * Örneğin;
22
+ *
23
+ * ```jsx
24
+ * <Radio trace={{ color: "success" }} />
25
+ * ```
26
+ */
6
27
  trace?: {
7
28
  color: Status;
8
29
  };
@@ -1,6 +1,28 @@
1
1
  import { Variants, Option, Status } from "../../../libs/types";
2
- import { IGlobalProps, IValidation } from "../../../libs/types/IGlobalProps";
3
- interface IMultiple {
2
+ import { IBorder, IDisabled, IIcon, ISize, IStatus, IUpperCase, IValidation, IVariant } from "../../../libs/types/IGlobalProps";
3
+ export interface IMultiple {
4
+ /**
5
+ * Bileşenin durum (status) ayarlarını belirtir.
6
+ *
7
+ * - `color`: Genel durum rengini belirler. `Status` tipi ile tanımlanır (örneğin "success", "error" vb.).
8
+ * - `selected`: Seçili öğelerin görünümüyle ilgili ayarlar.
9
+ * - `variant`: Seçili öğenin stil varyantı (`Variants` tipi).
10
+ * - `color`: Seçili öğenin durumu için renk (`Status` tipi).
11
+ *
12
+ * Örneğin;
13
+ *
14
+ * ```jsx
15
+ * <Select
16
+ * status={{
17
+ * color: "warning",
18
+ * selected: {
19
+ * variant: "outlined",
20
+ * color: "success",
21
+ * },
22
+ * }}
23
+ * />
24
+ * ```
25
+ */
4
26
  status?: {
5
27
  color?: Status;
6
28
  selected?: {
@@ -8,23 +30,112 @@ interface IMultiple {
8
30
  color?: Status;
9
31
  };
10
32
  };
33
+ /**
34
+ * Bileşenin seçtiği değerlerin listesi.
35
+ *
36
+ * Çoklu seçim için `Option` tipinden bir dizi kullanılır.
37
+ */
11
38
  value: Option[];
39
+ /**
40
+ * Seçimler değiştiğinde çağrılan olaydır.
41
+ *
42
+ * Yeni seçili seçenekler `Option[]` olarak parametreye geçer.
43
+ */
12
44
  onChange: (option: Option[]) => void;
45
+ /**
46
+ * Bileşenin çoklu seçim modunda olduğunu belirtir.
47
+ *
48
+ * Sabit `true` değeri ile tanımlanır.
49
+ */
13
50
  multiple: true;
14
51
  }
15
- interface ISingle {
52
+ export interface ISingle {
53
+ /**
54
+ * Bileşenin durumunu belirtir.
55
+ *
56
+ * `Status` tipi ile tanımlanır (örneğin "success", "error", "warning" vb.).
57
+ *
58
+ * Örneğin;
59
+ *
60
+ * ```jsx
61
+ * <Select status="success" />
62
+ * ```
63
+ */
16
64
  status?: Status;
65
+ /**
66
+ * Bileşenin seçili değeri.
67
+ *
68
+ * Tekli seçimde, `Option` tipi ya da seçilmemişse `undefined` olabilir.
69
+ */
17
70
  value: Option | undefined;
71
+ /**
72
+ * Seçim değiştiğinde tetiklenen olaydır.
73
+ *
74
+ * Yeni seçilen değer `Option` tipi ya da seçilmemişse `undefined` olarak gelir.
75
+ */
18
76
  onChange: (option: Option | undefined) => void;
77
+ /**
78
+ * Bileşenin çoklu seçim modunda olmadığını belirtir.
79
+ *
80
+ * `false` veya belirtilmemiş olabilir.
81
+ */
19
82
  multiple?: false;
20
83
  }
21
84
  export type Props = {
85
+ /**
86
+ * Seçilebilir seçeneklerin listesi.
87
+ *
88
+ * `Option` tipi elemanlardan oluşan bir dizi olmalıdır.
89
+ *
90
+ * Örneğin;
91
+ *
92
+ * ```jsx
93
+ * <Select options={[{label: "...", value: "..."}]} />
94
+ * ```
95
+ */
22
96
  options: Option[];
97
+ /**
98
+ * Arama alanına bir metin girildiğinde tetiklenen olaydır.
99
+ *
100
+ * - `searchText`: Kullanıcının yazdığı arama metni.,
101
+ *
102
+ * Örneğin;
103
+ *
104
+ * ```jsx
105
+ * <Select onSearch={(searchText) => console.log(searchText)} />
106
+ * ```
107
+ */
23
108
  onSearch?: (searchText: string) => void;
109
+ /**
110
+ * Bileşen üzerine tıklandığında tetiklenen olaydır.
111
+ *
112
+ * Örneğin;
113
+ *
114
+ * ```jsx
115
+ * <Select onClick={() => {...}} />
116
+ * ```
117
+ */
24
118
  onClick?: () => void;
119
+ /**
120
+ * Yeni bir seçenek oluşturulduğunda tetiklenen olaydır.
121
+ *
122
+ * - `option`: Oluşturulan yeni `Option` nesnesi.
123
+ *
124
+ * Örneğin;
125
+ *
126
+ * ```jsx
127
+ * <Select onCreate={(option) => console.log(option)} />
128
+ * ```
129
+ */
25
130
  onCreate?: (option: Option) => void;
131
+ /**
132
+ * Bileşenin içinde gösterilecek yer tutucu (placeholder) metni.
133
+ *
134
+ * Örneğin;
135
+ *
136
+ * ```jsx
137
+ * <Select placeholder="..." />
138
+ * ```
139
+ */
26
140
  placeholder?: string;
27
- upperCase?: boolean;
28
- disabled?: boolean;
29
- } & (IMultiple | ISingle) & Omit<IGlobalProps, "status"> & IValidation;
30
- export {};
141
+ } & (IMultiple | ISingle) & IVariant & IStatus & IBorder & IIcon & ISize & IUpperCase & IValidation & IDisabled;
@@ -1,5 +1,16 @@
1
- import { IGlobalProps } from "../../../libs/types/IGlobalProps";
2
- interface IProps extends Omit<IGlobalProps, "children">, Omit<React.InputHTMLAttributes<HTMLInputElement>, "children" | "size"> {
1
+ import { IBorder, IDisabled, IIcon, ISize, IStatus, IUpperCase, IValidation, IVariant } from "../../../libs/types/IGlobalProps";
2
+ interface IProps extends IVariant, IStatus, IBorder, IIcon, ISize, IUpperCase, IValidation, IDisabled, Omit<React.InputHTMLAttributes<HTMLInputElement>, "children" | "size"> {
3
+ /**
4
+ * Bileşenin başlığı veya etiket metnidir.
5
+ *
6
+ * Genellikle input, buton gibi öğelerin ne amaçla kullanıldığını belirtmek için görüntülenir.
7
+ *
8
+ * Örneğin;
9
+ *
10
+ * ```jsx
11
+ * <Switch label="Kullanıcı Adı" />
12
+ * ```
13
+ */
3
14
  label?: string;
4
15
  }
5
16
  export default IProps;
@@ -1,18 +1,99 @@
1
1
  import { IValidation } from "../../../libs/types/IGlobalProps";
2
- interface IProps<T> extends IValidation {
2
+ export interface IProps<T> extends IValidation {
3
+ /**
4
+ * Bileşenin isim (name) değeridir.
5
+ *
6
+ * Formlarda veya bileşenlerde tanımlayıcı olarak kullanılır.
7
+ *
8
+ * Örneğin;
9
+ *
10
+ * ```jsx
11
+ * <TextEditor name="email" />
12
+ * ```
13
+ */
3
14
  name?: string;
15
+ /**
16
+ * Bileşenin mevcut değeridir.
17
+ */
4
18
  value?: string;
19
+ /**
20
+ * Değer değiştiğinde çağrılan fonksiyon.
21
+ *
22
+ * - `value`: Yeni değer. `string` veya `undefined` olabilir.
23
+ *
24
+ * Örneğin;
25
+ *
26
+ * ```jsx
27
+ * <TextEditor onChange={(value)=> console.log(value)} />
28
+ * ```
29
+ */
5
30
  onChange: (value?: string) => void;
31
+ /**
32
+ * Bileşenin yüksekliği (piksel cinsinden).
33
+ */
34
+ height?: number;
35
+ /**
36
+ * Dinamik liste özellikleri.
37
+ *
38
+ * - `render.display`: Listede gösterilecek `T` tipindeki nesnenin hangi alanının gösterileceği.
39
+ * - `render.items`: Gösterilecek öğeler dizisi.
40
+ * - `triggerKey`: (Opsiyonel) Dinamik listenin tetiklenmesini sağlayan tuş.
41
+ * - `onTagged`: (Opsiyonel) Etiketlenen öğeler seçildiğinde çağrılan fonksiyon.
42
+ *
43
+ * Örnek kullanım:
44
+ *
45
+ * ```tsx
46
+ * interface IUser {
47
+ * id: number;
48
+ * name: string;
49
+ * email: string;
50
+ * }
51
+ *
52
+ * const users: IUser[] = [
53
+ * { id: 1, name: "Kaan", email: "kaan@example.com" },
54
+ * ];
55
+ *
56
+ * function handleTagged(taggedItems: IUser[]) {
57
+ * console.log("Seçilen öğeler:", taggedItems);
58
+ * }
59
+ *
60
+ * const dynamicListProps = {
61
+ * render: {
62
+ * display: "name" as keyof IUser,
63
+ * items: users,
64
+ * },
65
+ * triggerKey: "@",
66
+ * onTagged: handleTagged,
67
+ * };
68
+ *
69
+ * <TextEditor dynamicList={dynamicListProps} />
70
+ * ```
71
+ *
72
+ * Açıklamalar:
73
+ *
74
+ * - `render.display`: Öğe listesinden kullanıcıya gösterilecek alanı belirtir.
75
+ * - `render.items`: Dinamik listede gösterilecek öğelerin dizisidir.
76
+ * - `triggerKey`: Bu karakter yazıldığında dinamik liste açılır.
77
+ * - `onTagged`: Kullanıcı bir öğeyi seçip etiketlediğinde çağrılır ve seçilen öğeleri parametre olarak alır.
78
+ */
6
79
  dynamicList?: {
7
80
  render: {
8
81
  display: keyof T;
9
82
  items: T[];
10
83
  };
11
84
  triggerKey?: string;
12
- onTagged?: (tagged: any[]) => void;
85
+ onTagged: (tagged: any[]) => void;
13
86
  };
14
- placeholder?: string;
15
- height?: number;
87
+ /**
88
+ * Çoklu dil desteğinin aktif olup olmadığını belirtir.
89
+ *
90
+ * - `true`: Çoklu dil desteği aktif.
91
+ * - `false` veya belirtilmemişse: Devre dışı.
92
+ */
16
93
  multilang?: boolean;
94
+ /**
95
+ * Bileşenin placeholder (yer tutucu) metnidir.
96
+ */
97
+ placeholder?: string;
17
98
  }
18
99
  export default IProps;