@ttdk-design-system/library-react 0.0.0-stage → 1.0.0

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 (184) hide show
  1. package/AI_GUIDE.md +6518 -0
  2. package/llms.txt +6518 -0
  3. package/package.json +1098 -4
  4. package/src/core/index.ts +2 -0
  5. package/src/core/tailwind-preset.cjs +62 -0
  6. package/src/core/tailwind-preset.ts +85 -0
  7. package/src/core/theme/tokens.css +663 -0
  8. package/src/core/types.ts +836 -0
  9. package/src/index.ts +17 -0
  10. package/src/tailwind-preset.cjs +62 -0
  11. package/src/tailwind-preset.ts +85 -0
  12. package/src/types.ts +1 -0
  13. package/src/web/accordion/AI_GUIDE.md +149 -0
  14. package/src/web/accordion/accordion.css +1 -0
  15. package/src/web/accordion/accordion.tsx +430 -0
  16. package/src/web/accordion/index.ts +3 -0
  17. package/src/web/accordion/manifest.json +351 -0
  18. package/src/web/alert/AI_GUIDE.md +139 -0
  19. package/src/web/alert/alert.css +1 -0
  20. package/src/web/alert/alert.tsx +318 -0
  21. package/src/web/alert/index.ts +3 -0
  22. package/src/web/alert/manifest.json +240 -0
  23. package/src/web/avatar/AI_GUIDE.md +118 -0
  24. package/src/web/avatar/avatar.css +1 -0
  25. package/src/web/avatar/avatar.tsx +233 -0
  26. package/src/web/avatar/index.ts +3 -0
  27. package/src/web/avatar/manifest.json +195 -0
  28. package/src/web/badge/AI_GUIDE.md +94 -0
  29. package/src/web/badge/badge.css +1 -0
  30. package/src/web/badge/badge.tsx +140 -0
  31. package/src/web/badge/index.ts +2 -0
  32. package/src/web/badge/manifest.json +141 -0
  33. package/src/web/banner/AI_GUIDE.md +130 -0
  34. package/src/web/banner/banner.css +1 -0
  35. package/src/web/banner/banner.tsx +334 -0
  36. package/src/web/banner/index.ts +3 -0
  37. package/src/web/banner/manifest.json +240 -0
  38. package/src/web/breadcrumb/AI_GUIDE.md +120 -0
  39. package/src/web/breadcrumb/breadcrumb.css +1 -0
  40. package/src/web/breadcrumb/breadcrumb.tsx +306 -0
  41. package/src/web/breadcrumb/index.ts +3 -0
  42. package/src/web/breadcrumb/manifest.json +225 -0
  43. package/src/web/button/AI_GUIDE.md +121 -0
  44. package/src/web/button/button.css +1 -0
  45. package/src/web/button/button.tsx +287 -0
  46. package/src/web/button/index.ts +2 -0
  47. package/src/web/button/manifest.json +177 -0
  48. package/src/web/calendar/AI_GUIDE.md +151 -0
  49. package/src/web/calendar/calendar.css +1 -0
  50. package/src/web/calendar/calendar.tsx +1611 -0
  51. package/src/web/calendar/index.ts +3 -0
  52. package/src/web/calendar/manifest.json +470 -0
  53. package/src/web/card/AI_GUIDE.md +133 -0
  54. package/src/web/card/card.css +1 -0
  55. package/src/web/card/card.tsx +408 -0
  56. package/src/web/card/index.ts +4 -0
  57. package/src/web/card/manifest.json +357 -0
  58. package/src/web/checkbox/AI_GUIDE.md +146 -0
  59. package/src/web/checkbox/checkbox.css +1 -0
  60. package/src/web/checkbox/checkbox.tsx +307 -0
  61. package/src/web/checkbox/index.ts +2 -0
  62. package/src/web/checkbox/manifest.json +294 -0
  63. package/src/web/chip/AI_GUIDE.md +186 -0
  64. package/src/web/chip/chip.css +1 -0
  65. package/src/web/chip/chip.tsx +230 -0
  66. package/src/web/chip/index.ts +2 -0
  67. package/src/web/chip/manifest.json +186 -0
  68. package/src/web/dropdown/AI_GUIDE.md +167 -0
  69. package/src/web/dropdown/dropdown.css +1 -0
  70. package/src/web/dropdown/dropdown.tsx +1274 -0
  71. package/src/web/dropdown/index.ts +3 -0
  72. package/src/web/dropdown/manifest.json +576 -0
  73. package/src/web/flex/AI_GUIDE.md +113 -0
  74. package/src/web/flex/flex-item.tsx +97 -0
  75. package/src/web/flex/flex.css +1 -0
  76. package/src/web/flex/flex.tsx +108 -0
  77. package/src/web/flex/index.ts +5 -0
  78. package/src/web/flex/manifest.json +162 -0
  79. package/src/web/form/index.ts +7 -0
  80. package/src/web/grid/AI_GUIDE.md +112 -0
  81. package/src/web/grid/grid-item.tsx +112 -0
  82. package/src/web/grid/grid.css +1 -0
  83. package/src/web/grid/grid.tsx +99 -0
  84. package/src/web/grid/index.ts +5 -0
  85. package/src/web/grid/manifest.json +153 -0
  86. package/src/web/index.ts +86 -0
  87. package/src/web/input/AI_GUIDE.md +159 -0
  88. package/src/web/input/index.ts +3 -0
  89. package/src/web/input/input.css +1 -0
  90. package/src/web/input/input.tsx +537 -0
  91. package/src/web/input/manifest.json +465 -0
  92. package/src/web/input-number/AI_GUIDE.md +164 -0
  93. package/src/web/input-number/index.ts +3 -0
  94. package/src/web/input-number/input-number.css +1 -0
  95. package/src/web/input-number/input-number.tsx +1193 -0
  96. package/src/web/input-number/manifest.json +575 -0
  97. package/src/web/modal/AI_GUIDE.md +171 -0
  98. package/src/web/modal/index.ts +3 -0
  99. package/src/web/modal/manifest.json +375 -0
  100. package/src/web/modal/modal.css +1 -0
  101. package/src/web/modal/modal.tsx +571 -0
  102. package/src/web/pagination/AI_GUIDE.md +148 -0
  103. package/src/web/pagination/index.ts +21 -0
  104. package/src/web/pagination/manifest.json +432 -0
  105. package/src/web/pagination/pagination-content.tsx +45 -0
  106. package/src/web/pagination/pagination-ellipsis.tsx +54 -0
  107. package/src/web/pagination/pagination-first.tsx +155 -0
  108. package/src/web/pagination/pagination-item.tsx +45 -0
  109. package/src/web/pagination/pagination-last.tsx +155 -0
  110. package/src/web/pagination/pagination-link.tsx +121 -0
  111. package/src/web/pagination/pagination-next.tsx +158 -0
  112. package/src/web/pagination/pagination-previous.tsx +158 -0
  113. package/src/web/pagination/pagination.css +1 -0
  114. package/src/web/pagination/pagination.tsx +687 -0
  115. package/src/web/popover/AI_GUIDE.md +163 -0
  116. package/src/web/popover/index.ts +3 -0
  117. package/src/web/popover/manifest.json +396 -0
  118. package/src/web/popover/popover.css +1 -0
  119. package/src/web/popover/popover.tsx +702 -0
  120. package/src/web/radio/AI_GUIDE.md +155 -0
  121. package/src/web/radio/index.ts +2 -0
  122. package/src/web/radio/manifest.json +294 -0
  123. package/src/web/radio/radio.css +1 -0
  124. package/src/web/radio/radio.tsx +290 -0
  125. package/src/web/selectbox/AI_GUIDE.md +216 -0
  126. package/src/web/selectbox/index.ts +3 -0
  127. package/src/web/selectbox/manifest.json +477 -0
  128. package/src/web/selectbox/selectbox.css +1 -0
  129. package/src/web/selectbox/selectbox.tsx +1048 -0
  130. package/src/web/sonner/AI_GUIDE.md +98 -0
  131. package/src/web/sonner/index.ts +114 -0
  132. package/src/web/sonner/manifest.json +132 -0
  133. package/src/web/sonner/sonner.css +1 -0
  134. package/src/web/sonner/sonner.tsx +177 -0
  135. package/src/web/table/AI_GUIDE.md +145 -0
  136. package/src/web/table/index.ts +35 -0
  137. package/src/web/table/manifest.json +168 -0
  138. package/src/web/table/table-body.tsx +45 -0
  139. package/src/web/table/table-caption.tsx +45 -0
  140. package/src/web/table/table-cell.tsx +74 -0
  141. package/src/web/table/table-empty.tsx +108 -0
  142. package/src/web/table/table-footer.tsx +45 -0
  143. package/src/web/table/table-head.tsx +80 -0
  144. package/src/web/table/table-header.tsx +45 -0
  145. package/src/web/table/table-row.tsx +69 -0
  146. package/src/web/table/table.css +1 -0
  147. package/src/web/table/table.tsx +305 -0
  148. package/src/web/tabs/AI_GUIDE.md +150 -0
  149. package/src/web/tabs/index.ts +3 -0
  150. package/src/web/tabs/manifest.json +315 -0
  151. package/src/web/tabs/tabs.css +1 -0
  152. package/src/web/tabs/tabs.tsx +332 -0
  153. package/src/web/text/AI_GUIDE.md +129 -0
  154. package/src/web/text/index.ts +3 -0
  155. package/src/web/text/manifest.json +195 -0
  156. package/src/web/text/text.css +1 -0
  157. package/src/web/text/text.tsx +689 -0
  158. package/src/web/textarea/AI_GUIDE.md +141 -0
  159. package/src/web/textarea/index.ts +3 -0
  160. package/src/web/textarea/manifest.json +438 -0
  161. package/src/web/textarea/textarea.css +1 -0
  162. package/src/web/textarea/textarea.tsx +467 -0
  163. package/src/web/tooltip/AI_GUIDE.md +110 -0
  164. package/src/web/tooltip/index.ts +3 -0
  165. package/src/web/tooltip/manifest.json +222 -0
  166. package/src/web/tooltip/tooltip.css +1 -0
  167. package/src/web/tooltip/tooltip.tsx +423 -0
  168. package/src/webview/bottomsheet/AI_GUIDE.md +141 -0
  169. package/src/webview/bottomsheet/bottomsheet.css +1 -0
  170. package/src/webview/bottomsheet/bottomsheet.tsx +603 -0
  171. package/src/webview/bottomsheet/index.ts +4 -0
  172. package/src/webview/bottomsheet/manifest.json +377 -0
  173. package/src/webview/button/AI_GUIDE.md +79 -0
  174. package/src/webview/button/button-ios.css +1 -0
  175. package/src/webview/button/button-ios.tsx +138 -0
  176. package/src/webview/button/button-material.css +1 -0
  177. package/src/webview/button/button-material.tsx +138 -0
  178. package/src/webview/button/index.ts +7 -0
  179. package/src/webview/button/manifest.json +148 -0
  180. package/src/webview/index.ts +7 -0
  181. package/tailwind-preset.cjs +62 -0
  182. package/tailwind-preset.js +62 -0
  183. package/ttdk-manifest.json +10188 -0
  184. package/README.md +0 -3
@@ -0,0 +1,35 @@
1
+ export { default as Table } from './table';
2
+ export { default as TableHeader } from './table-header';
3
+ export { default as TableBody } from './table-body';
4
+ export { default as TableFooter } from './table-footer';
5
+ export { default as TableRow } from './table-row';
6
+ export { default as TableHead } from './table-head';
7
+ export { default as TableCell } from './table-cell';
8
+ export { default as TableCaption } from './table-caption';
9
+ export { default as TableEmpty } from './table-empty';
10
+
11
+ export * from './table';
12
+ export * from './table-header';
13
+ export * from './table-body';
14
+ export * from './table-footer';
15
+ export * from './table-row';
16
+ export * from './table-head';
17
+ export * from './table-cell';
18
+ export * from './table-caption';
19
+ export * from './table-empty';
20
+
21
+ // Re-export TanStack REACT Table (All core + framework adapter hooks & renderers)
22
+ export {
23
+ useReactTable,
24
+ createTable,
25
+ flexRender,
26
+ createColumnHelper,
27
+ getCoreRowModel,
28
+ getSortedRowModel,
29
+ getPaginationRowModel,
30
+ getFilteredRowModel,
31
+ getExpandedRowModel,
32
+ getGroupedRowModel,
33
+ } from '@tanstack/react-table';
34
+ export * from '@tanstack/react-table';
35
+ export { default } from './table';
@@ -0,0 +1,168 @@
1
+ {
2
+ "name": "@ttdk-design-system/table",
3
+ "component": "Table",
4
+ "folder": "table",
5
+ "description": "Komponen kontainer utama tabel (Compound Table ala Shadcn UI).",
6
+ "stylesheets": [
7
+ {
8
+ "theme": "common",
9
+ "file": "table.css",
10
+ "importPath": "web/table/table.css"
11
+ }
12
+ ],
13
+ "props": {
14
+ "variant": {
15
+ "name": "variant",
16
+ "type": "'default' | 'striped' | 'clean'",
17
+ "optional": true,
18
+ "default": "default",
19
+ "description": "Varian tampilan visual tabel. - `'default'`: Tampilan standar dengan latar bersih dan bingkai kartu. - `'striped'`: Tampilan selang-seling (zebra). - `'clean'`: Tampilan minimalis tanpa border luar dan tanpa shadow.",
20
+ "example": null,
21
+ "param": null
22
+ },
23
+ "size": {
24
+ "name": "size",
25
+ "type": "'sm' | 'md' | 'lg'",
26
+ "optional": true,
27
+ "default": "md",
28
+ "description": "Kerapatan / ukuran tinggi baris tabel. - `'sm'`: Kompak (padat). - `'md'`: Standar. - `'lg'`: Lega.",
29
+ "example": null,
30
+ "param": null
31
+ },
32
+ "rounded": {
33
+ "name": "rounded",
34
+ "type": "'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full' | (string & {}) | number",
35
+ "optional": true,
36
+ "default": "sm",
37
+ "description": "Sudut kelengkungan radius tabel. - Preset: `'none'` | `'xs'` | `'sm'` | `'md'` | `'lg'` | `'xl'` | `'full'` - Nilai custom: `'12px'`, `'1rem'`, atau angka `12`",
38
+ "example": null,
39
+ "param": null
40
+ },
41
+ "shadow": {
42
+ "name": "shadow",
43
+ "type": "'none' | 'sm' | 'md' | 'lg' | (string & {})",
44
+ "optional": true,
45
+ "default": "sm",
46
+ "description": "Bayangan elevasi kontainer tabel. - Preset: `'none'` | `'sm'` | `'md'` | `'lg'` - Nilai custom: CSS box-shadow string (contoh: `'0 4px 20px rgba(0,0,0,0.1)'`)",
47
+ "example": null,
48
+ "param": null
49
+ },
50
+ "minWidth": {
51
+ "name": "minWidth",
52
+ "type": "string | number",
53
+ "optional": true,
54
+ "default": null,
55
+ "description": "Lebar minimum elemen table di dalam wrapper untuk menjaga susunan kolom dan memicu horizontal scroll. Contoh: `700`, `'700px'`, `'max-content'`",
56
+ "example": null,
57
+ "param": null
58
+ },
59
+ "maxHeight": {
60
+ "name": "maxHeight",
61
+ "type": "string | number",
62
+ "optional": true,
63
+ "default": null,
64
+ "description": "Ketinggian maksimum kontainer tabel untuk memicu scroll vertikal internal (sangat direkomendasikan saat stickyHeader aktif). Contoh: `280`, `'280px'`, `'50vh'`",
65
+ "example": null,
66
+ "param": null
67
+ },
68
+ "hoverable": {
69
+ "name": "hoverable",
70
+ "type": "boolean",
71
+ "optional": true,
72
+ "default": "true",
73
+ "description": "Efek hover saat kursor melayang di atas baris tabel.",
74
+ "example": null,
75
+ "param": null
76
+ },
77
+ "stickyHeader": {
78
+ "name": "stickyHeader",
79
+ "type": "boolean",
80
+ "optional": true,
81
+ "default": "false",
82
+ "description": "Membuat header tabel menempel di atas (sticky) saat konten di-scroll.",
83
+ "example": null,
84
+ "param": null
85
+ },
86
+ "loading": {
87
+ "name": "loading",
88
+ "type": "boolean",
89
+ "optional": true,
90
+ "default": "false",
91
+ "description": "Menampilkan spinner loading overlay di atas tabel.",
92
+ "example": null,
93
+ "param": null
94
+ },
95
+ "caption": {
96
+ "name": "caption",
97
+ "type": "string",
98
+ "optional": true,
99
+ "default": null,
100
+ "description": "Teks caption aksesibilitas untuk tabel (dirender sebagai elemen `<caption>`).",
101
+ "example": null,
102
+ "param": null
103
+ },
104
+ "style": {
105
+ "name": "style",
106
+ "type": "any",
107
+ "optional": true,
108
+ "default": null,
109
+ "description": "Inline CSS style object native.",
110
+ "example": null,
111
+ "param": null
112
+ },
113
+ "ui": {
114
+ "name": "ui",
115
+ "type": "UiProps",
116
+ "optional": true,
117
+ "default": null,
118
+ "description": "Kustomisasi visual granular root kontainer wrapper (.ttdk-table-wrapper) melalui UiProps.",
119
+ "example": null,
120
+ "param": null
121
+ },
122
+ "tableStyle": {
123
+ "name": "tableStyle",
124
+ "type": "UiProps",
125
+ "optional": true,
126
+ "default": null,
127
+ "description": "Style kustom untuk elemen table (table.ttdk-table) melalui UiProps.",
128
+ "example": null,
129
+ "param": null
130
+ },
131
+ "tableClass": {
132
+ "name": "tableClass",
133
+ "type": "string",
134
+ "optional": true,
135
+ "default": null,
136
+ "description": "Class CSS kustom untuk elemen table (table.ttdk-table).",
137
+ "example": null,
138
+ "param": null
139
+ },
140
+ "className": {
141
+ "name": "className",
142
+ "type": "string",
143
+ "optional": true,
144
+ "default": null,
145
+ "description": "Class CSS kustom untuk kontainer wrapper luar.",
146
+ "example": null,
147
+ "param": null
148
+ },
149
+ "children": {
150
+ "name": "children",
151
+ "type": "any",
152
+ "optional": true,
153
+ "default": null,
154
+ "description": "Konten anak (TableHeader, TableBody, TableFooter, TableCaption).",
155
+ "example": null,
156
+ "param": null
157
+ }
158
+ },
159
+ "subInterfaces": {},
160
+ "supportedFrameworks": [
161
+ "react",
162
+ "vue",
163
+ "svelte"
164
+ ],
165
+ "themes": [
166
+ "tw"
167
+ ]
168
+ }
@@ -0,0 +1,45 @@
1
+ import * as React from "react";
2
+
3
+ export interface TableBodyProps {
4
+ /**
5
+ * Inline CSS style kustom.
6
+ */
7
+ style?: React.CSSProperties;
8
+ /**
9
+ * Kustomisasi visual granular tbody (UiProps).
10
+ */
11
+ ui?: UiProps;
12
+
13
+ /**
14
+ * Class CSS kustom.
15
+ */
16
+ className?: string;
17
+
18
+ /**
19
+ * Konten baris data (TableRow).
20
+ */
21
+ children?: any;
22
+ }
23
+
24
+ /**
25
+ * Komponen badan tabel `<tbody>` (Compound TableBody).
26
+ */
27
+
28
+ import { buildUiVars, UiProps } from "../../core/types";
29
+
30
+ function TableBody(props: TableBodyProps) {
31
+ return (
32
+ <tbody
33
+ className={`ttdk-table-body ${props.className || ""}`.trim()}
34
+ style={{
35
+ ...buildUiVars(props.ui),
36
+ ...((props as any)["style"] || {}),
37
+ ...props.style,
38
+ }}
39
+ >
40
+ <>{props.children}</>
41
+ </tbody>
42
+ );
43
+ }
44
+
45
+ export default TableBody;
@@ -0,0 +1,45 @@
1
+ import * as React from "react";
2
+
3
+ export interface TableCaptionProps {
4
+ /**
5
+ * Inline CSS style kustom.
6
+ */
7
+ style?: React.CSSProperties;
8
+ /**
9
+ * Kustomisasi visual granular caption (UiProps).
10
+ */
11
+ ui?: UiProps;
12
+
13
+ /**
14
+ * Class CSS kustom.
15
+ */
16
+ className?: string;
17
+
18
+ /**
19
+ * Konten caption tabel.
20
+ */
21
+ children?: any;
22
+ }
23
+
24
+ /**
25
+ * Komponen caption tabel `<caption>` (Compound TableCaption).
26
+ */
27
+
28
+ import { buildUiVars, UiProps } from "../../core/types";
29
+
30
+ function TableCaption(props: TableCaptionProps) {
31
+ return (
32
+ <caption
33
+ className={`ttdk-table-caption ${props.className || ""}`.trim()}
34
+ style={{
35
+ ...buildUiVars(props.ui),
36
+ ...((props as any)["style"] || {}),
37
+ ...props.style,
38
+ }}
39
+ >
40
+ <>{props.children}</>
41
+ </caption>
42
+ );
43
+ }
44
+
45
+ export default TableCaption;
@@ -0,0 +1,74 @@
1
+ import * as React from "react";
2
+
3
+ export interface TableCellProps {
4
+ /**
5
+ * Inline CSS style kustom.
6
+ */
7
+ style?: React.CSSProperties;
8
+ /**
9
+ * Penyelarasan teks sel ('left' | 'center' | 'right').
10
+ * @default 'left'
11
+ */
12
+ align?: "left" | "center" | "right";
13
+
14
+ /**
15
+ * Lebar sel kustom.
16
+ */
17
+ width?: string;
18
+
19
+ /**
20
+ * Jumlah span kolom (colspan).
21
+ */
22
+ colSpan?: number;
23
+
24
+ /**
25
+ * Jumlah span baris (rowspan).
26
+ */
27
+ rowSpan?: number;
28
+
29
+ /**
30
+ * Kustomisasi visual granular td (UiProps).
31
+ */
32
+ ui?: UiProps;
33
+
34
+ /**
35
+ * Class CSS kustom.
36
+ */
37
+ className?: string;
38
+
39
+ /**
40
+ * Konten di dalam sel tabel.
41
+ */
42
+ children?: any;
43
+ }
44
+
45
+ /**
46
+ * Komponen sel data tabel `<td>` (Compound TableCell).
47
+ */
48
+
49
+ import { buildUiVars, UiProps } from "../../core/types";
50
+
51
+ function TableCell(props: TableCellProps) {
52
+ return (
53
+ <td
54
+ className={`ttdk-table-cell ${props.className || ""}`.trim()}
55
+ colSpan={props.colSpan}
56
+ rowSpan={props.rowSpan}
57
+ style={{
58
+ textAlign: props.align || "left",
59
+ ...(props.width
60
+ ? {
61
+ width: props.width,
62
+ }
63
+ : {}),
64
+ ...buildUiVars(props.ui),
65
+ ...((props as any)["style"] || {}),
66
+ ...props.style,
67
+ }}
68
+ >
69
+ <>{props.children}</>
70
+ </td>
71
+ );
72
+ }
73
+
74
+ export default TableCell;
@@ -0,0 +1,108 @@
1
+ "use client";
2
+ import * as React from "react";
3
+
4
+ export interface TableEmptyProps {
5
+ /**
6
+ * Inline CSS style kustom.
7
+ */
8
+ style?: React.CSSProperties;
9
+ /**
10
+ * Jumlah span kolom (colspan).
11
+ * @default 10
12
+ */
13
+ colSpan?: number;
14
+
15
+ /**
16
+ * Judul pesan data kosong.
17
+ * @default 'Tidak ada dataset yang cocok'
18
+ */
19
+ title?: string;
20
+
21
+ /**
22
+ * Deskripsi penjelasan data kosong.
23
+ * @default 'Atur ulang filter atau ubah kata kunci pencarian.'
24
+ */
25
+ description?: string;
26
+
27
+ /**
28
+ * Teks tombol aksi reset / refresh.
29
+ * @default 'Atur ulang'
30
+ */
31
+ actionLabel?: string;
32
+
33
+ /**
34
+ * Callback ketika tombol aksi diklik.
35
+ */
36
+ onAction?: () => void;
37
+
38
+ /**
39
+ * Kustomisasi visual granular wadah tr empty (UiProps).
40
+ */
41
+ ui?: UiProps;
42
+
43
+ /**
44
+ * Class CSS kustom.
45
+ */
46
+ className?: string;
47
+
48
+ /**
49
+ * Konten kustom di dalam wadah empty state.
50
+ */
51
+ children?: any;
52
+ }
53
+
54
+ /**
55
+ * Komponen status data kosong tabel (Compound TableEmpty).
56
+ */
57
+
58
+ import { buildUiVars, UiProps } from "../../core/types";
59
+
60
+ function TableEmpty(props: TableEmptyProps) {
61
+ return (
62
+ <tr
63
+ className={`ttdk-table-row ttdk-table-empty-row ${
64
+ props.className || ""
65
+ }`.trim()}
66
+ style={{
67
+ ...buildUiVars(props.ui),
68
+ ...((props as any)["style"] || {}),
69
+ ...props.style,
70
+ }}
71
+ >
72
+ <td className="ttdk-table-cell" colSpan={props.colSpan || 10}>
73
+ <div className="ttdk-table-empty-wrapper">
74
+ {props.title || props.description ? (
75
+ <>
76
+ <p className="ttdk-table-empty-title">
77
+ {props.title || "Tidak ada dataset yang cocok"}
78
+ </p>
79
+ {props.description ? (
80
+ <p className="ttdk-table-empty-desc">{props.description}</p>
81
+ ) : null}
82
+ {props.actionLabel ? (
83
+ <button
84
+ type="button"
85
+ className="ttdk-table-empty-action"
86
+ onClick={(event) => {
87
+ if (props.onAction) {
88
+ props.onAction();
89
+ }
90
+ }}
91
+ >
92
+ {props.actionLabel}
93
+ </button>
94
+ ) : null}
95
+ <>{props.children}</>
96
+ </>
97
+ ) : (
98
+ <>
99
+ <>{props.children}</>
100
+ </>
101
+ )}
102
+ </div>
103
+ </td>
104
+ </tr>
105
+ );
106
+ }
107
+
108
+ export default TableEmpty;
@@ -0,0 +1,45 @@
1
+ import * as React from "react";
2
+
3
+ export interface TableFooterProps {
4
+ /**
5
+ * Inline CSS style kustom.
6
+ */
7
+ style?: React.CSSProperties;
8
+ /**
9
+ * Kustomisasi visual granular tfoot (UiProps).
10
+ */
11
+ ui?: UiProps;
12
+
13
+ /**
14
+ * Class CSS kustom.
15
+ */
16
+ className?: string;
17
+
18
+ /**
19
+ * Konten baris footer (TableRow).
20
+ */
21
+ children?: any;
22
+ }
23
+
24
+ /**
25
+ * Komponen footer tabel `<tfoot>` (Compound TableFooter).
26
+ */
27
+
28
+ import { buildUiVars, UiProps } from "../../core/types";
29
+
30
+ function TableFooter(props: TableFooterProps) {
31
+ return (
32
+ <tfoot
33
+ className={`ttdk-table-footer ${props.className || ""}`.trim()}
34
+ style={{
35
+ ...buildUiVars(props.ui),
36
+ ...((props as any)["style"] || {}),
37
+ ...props.style,
38
+ }}
39
+ >
40
+ <>{props.children}</>
41
+ </tfoot>
42
+ );
43
+ }
44
+
45
+ export default TableFooter;
@@ -0,0 +1,80 @@
1
+ "use client";
2
+ import * as React from "react";
3
+
4
+ export interface TableHeadProps {
5
+ /**
6
+ * Inline CSS style kustom.
7
+ */
8
+ style?: React.CSSProperties;
9
+ /**
10
+ * Penyelarasan teks header ('left' | 'center' | 'right').
11
+ * @default 'left'
12
+ */
13
+ align?: "left" | "center" | "right";
14
+
15
+ /**
16
+ * Lebar kolom (misal: '120px', '25%').
17
+ */
18
+ width?: string;
19
+
20
+ /**
21
+ * Menandakan kolom dapat disortir secara interaktif.
22
+ * @default false
23
+ */
24
+ sortable?: boolean;
25
+
26
+ /**
27
+ * Kustomisasi visual granular th (UiProps).
28
+ */
29
+ ui?: UiProps;
30
+
31
+ /**
32
+ * Class CSS kustom.
33
+ */
34
+ className?: string;
35
+
36
+ /**
37
+ * Fungsi callback saat header kolom diklik.
38
+ */
39
+ onClick?: (event: any) => void;
40
+
41
+ /**
42
+ * Konten teks atau komponen di dalam header kolom.
43
+ */
44
+ children?: any;
45
+ }
46
+
47
+ /**
48
+ * Komponen sel header tabel `<th>` (Compound TableHead).
49
+ */
50
+
51
+ import { buildUiVars, UiProps } from "../../core/types";
52
+
53
+ function TableHead(props: TableHeadProps) {
54
+ return (
55
+ <th
56
+ className={`ttdk-table-head ${props.className || ""}`.trim()}
57
+ data-sortable={props.sortable ? "true" : "false"}
58
+ style={{
59
+ textAlign: props.align || "left",
60
+ ...(props.width
61
+ ? {
62
+ width: props.width,
63
+ }
64
+ : {}),
65
+ ...buildUiVars(props.ui),
66
+ ...((props as any)["style"] || {}),
67
+ ...props.style,
68
+ }}
69
+ onClick={(e) => {
70
+ if (props.onClick) {
71
+ props.onClick(e);
72
+ }
73
+ }}
74
+ >
75
+ <>{props.children}</>
76
+ </th>
77
+ );
78
+ }
79
+
80
+ export default TableHead;
@@ -0,0 +1,45 @@
1
+ import * as React from "react";
2
+
3
+ export interface TableHeaderProps {
4
+ /**
5
+ * Inline CSS style kustom.
6
+ */
7
+ style?: React.CSSProperties;
8
+ /**
9
+ * Kustomisasi visual granular thead (UiProps).
10
+ */
11
+ ui?: UiProps;
12
+
13
+ /**
14
+ * Class CSS kustom.
15
+ */
16
+ className?: string;
17
+
18
+ /**
19
+ * Konten baris header (TableRow).
20
+ */
21
+ children?: any;
22
+ }
23
+
24
+ /**
25
+ * Komponen header tabel `<thead>` (Compound TableHeader).
26
+ */
27
+
28
+ import { buildUiVars, UiProps } from "../../core/types";
29
+
30
+ function TableHeader(props: TableHeaderProps) {
31
+ return (
32
+ <thead
33
+ className={`ttdk-table-header ${props.className || ""}`.trim()}
34
+ style={{
35
+ ...buildUiVars(props.ui),
36
+ ...((props as any)["style"] || {}),
37
+ ...props.style,
38
+ }}
39
+ >
40
+ <>{props.children}</>
41
+ </thead>
42
+ );
43
+ }
44
+
45
+ export default TableHeader;