@ttdk-design-system/library-vue 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 (232) hide show
  1. package/AI_GUIDE.md +6518 -0
  2. package/llms.txt +6518 -0
  3. package/package.json +1096 -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.vue +432 -0
  16. package/src/web/accordion/accordion.vue.d.ts +227 -0
  17. package/src/web/accordion/index.ts +3 -0
  18. package/src/web/accordion/manifest.json +351 -0
  19. package/src/web/alert/AI_GUIDE.md +139 -0
  20. package/src/web/alert/alert.css +1 -0
  21. package/src/web/alert/alert.vue +290 -0
  22. package/src/web/alert/alert.vue.d.ts +154 -0
  23. package/src/web/alert/index.ts +3 -0
  24. package/src/web/alert/manifest.json +240 -0
  25. package/src/web/avatar/AI_GUIDE.md +118 -0
  26. package/src/web/avatar/avatar.css +1 -0
  27. package/src/web/avatar/avatar.vue +217 -0
  28. package/src/web/avatar/avatar.vue.d.ts +135 -0
  29. package/src/web/avatar/index.ts +3 -0
  30. package/src/web/avatar/manifest.json +195 -0
  31. package/src/web/badge/AI_GUIDE.md +94 -0
  32. package/src/web/badge/badge.css +1 -0
  33. package/src/web/badge/badge.vue +135 -0
  34. package/src/web/badge/badge.vue.d.ts +108 -0
  35. package/src/web/badge/index.ts +3 -0
  36. package/src/web/badge/manifest.json +141 -0
  37. package/src/web/banner/AI_GUIDE.md +130 -0
  38. package/src/web/banner/banner.css +1 -0
  39. package/src/web/banner/banner.vue +303 -0
  40. package/src/web/banner/banner.vue.d.ts +162 -0
  41. package/src/web/banner/index.ts +3 -0
  42. package/src/web/banner/manifest.json +240 -0
  43. package/src/web/breadcrumb/AI_GUIDE.md +120 -0
  44. package/src/web/breadcrumb/breadcrumb.css +1 -0
  45. package/src/web/breadcrumb/breadcrumb.vue +313 -0
  46. package/src/web/breadcrumb/breadcrumb.vue.d.ts +139 -0
  47. package/src/web/breadcrumb/index.ts +3 -0
  48. package/src/web/breadcrumb/manifest.json +225 -0
  49. package/src/web/button/AI_GUIDE.md +121 -0
  50. package/src/web/button/button.css +1 -0
  51. package/src/web/button/button.vue +283 -0
  52. package/src/web/button/button.vue.d.ts +147 -0
  53. package/src/web/button/index.ts +3 -0
  54. package/src/web/button/manifest.json +177 -0
  55. package/src/web/calendar/AI_GUIDE.md +151 -0
  56. package/src/web/calendar/calendar.css +1 -0
  57. package/src/web/calendar/calendar.vue +1536 -0
  58. package/src/web/calendar/calendar.vue.d.ts +261 -0
  59. package/src/web/calendar/index.ts +3 -0
  60. package/src/web/calendar/manifest.json +470 -0
  61. package/src/web/card/AI_GUIDE.md +133 -0
  62. package/src/web/card/card.css +1 -0
  63. package/src/web/card/card.vue +423 -0
  64. package/src/web/card/card.vue.d.ts +232 -0
  65. package/src/web/card/index.ts +3 -0
  66. package/src/web/card/manifest.json +357 -0
  67. package/src/web/checkbox/AI_GUIDE.md +146 -0
  68. package/src/web/checkbox/checkbox.css +1 -0
  69. package/src/web/checkbox/checkbox.vue +304 -0
  70. package/src/web/checkbox/checkbox.vue.d.ts +189 -0
  71. package/src/web/checkbox/index.ts +3 -0
  72. package/src/web/checkbox/manifest.json +294 -0
  73. package/src/web/chip/AI_GUIDE.md +186 -0
  74. package/src/web/chip/chip.css +1 -0
  75. package/src/web/chip/chip.vue +220 -0
  76. package/src/web/chip/chip.vue.d.ts +140 -0
  77. package/src/web/chip/index.ts +3 -0
  78. package/src/web/chip/manifest.json +186 -0
  79. package/src/web/dropdown/AI_GUIDE.md +167 -0
  80. package/src/web/dropdown/dropdown.css +1 -0
  81. package/src/web/dropdown/dropdown.vue +1257 -0
  82. package/src/web/dropdown/dropdown.vue.d.ts +381 -0
  83. package/src/web/dropdown/index.ts +3 -0
  84. package/src/web/dropdown/manifest.json +576 -0
  85. package/src/web/flex/AI_GUIDE.md +113 -0
  86. package/src/web/flex/flex-item.vue +94 -0
  87. package/src/web/flex/flex-item.vue.d.ts +84 -0
  88. package/src/web/flex/flex.css +1 -0
  89. package/src/web/flex/flex.vue +103 -0
  90. package/src/web/flex/flex.vue.d.ts +92 -0
  91. package/src/web/flex/index.ts +5 -0
  92. package/src/web/flex/manifest.json +162 -0
  93. package/src/web/form/index.ts +7 -0
  94. package/src/web/grid/AI_GUIDE.md +112 -0
  95. package/src/web/grid/grid-item.vue +109 -0
  96. package/src/web/grid/grid-item.vue.d.ts +99 -0
  97. package/src/web/grid/grid.css +1 -0
  98. package/src/web/grid/grid.vue +94 -0
  99. package/src/web/grid/grid.vue.d.ts +84 -0
  100. package/src/web/grid/index.ts +5 -0
  101. package/src/web/grid/manifest.json +153 -0
  102. package/src/web/index.ts +86 -0
  103. package/src/web/input/AI_GUIDE.md +159 -0
  104. package/src/web/input/index.ts +3 -0
  105. package/src/web/input/input.css +1 -0
  106. package/src/web/input/input.vue +521 -0
  107. package/src/web/input/input.vue.d.ts +274 -0
  108. package/src/web/input/manifest.json +465 -0
  109. package/src/web/input-number/AI_GUIDE.md +164 -0
  110. package/src/web/input-number/index.ts +3 -0
  111. package/src/web/input-number/input-number.css +1 -0
  112. package/src/web/input-number/input-number.vue +1153 -0
  113. package/src/web/input-number/input-number.vue.d.ts +343 -0
  114. package/src/web/input-number/manifest.json +575 -0
  115. package/src/web/modal/AI_GUIDE.md +171 -0
  116. package/src/web/modal/index.ts +3 -0
  117. package/src/web/modal/manifest.json +375 -0
  118. package/src/web/modal/modal.css +1 -0
  119. package/src/web/modal/modal.vue +344 -0
  120. package/src/web/modal/modal.vue.d.ts +64 -0
  121. package/src/web/pagination/AI_GUIDE.md +148 -0
  122. package/src/web/pagination/index.ts +21 -0
  123. package/src/web/pagination/manifest.json +432 -0
  124. package/src/web/pagination/pagination-content.vue +42 -0
  125. package/src/web/pagination/pagination-content.vue.d.ts +28 -0
  126. package/src/web/pagination/pagination-ellipsis.vue +55 -0
  127. package/src/web/pagination/pagination-ellipsis.vue.d.ts +28 -0
  128. package/src/web/pagination/pagination-first.vue +161 -0
  129. package/src/web/pagination/pagination-first.vue.d.ts +67 -0
  130. package/src/web/pagination/pagination-item.vue +42 -0
  131. package/src/web/pagination/pagination-item.vue.d.ts +28 -0
  132. package/src/web/pagination/pagination-last.vue +161 -0
  133. package/src/web/pagination/pagination-last.vue.d.ts +67 -0
  134. package/src/web/pagination/pagination-link.vue +118 -0
  135. package/src/web/pagination/pagination-link.vue.d.ts +61 -0
  136. package/src/web/pagination/pagination-next.vue +160 -0
  137. package/src/web/pagination/pagination-next.vue.d.ts +68 -0
  138. package/src/web/pagination/pagination-previous.vue +160 -0
  139. package/src/web/pagination/pagination-previous.vue.d.ts +68 -0
  140. package/src/web/pagination/pagination.css +1 -0
  141. package/src/web/pagination/pagination.vue +730 -0
  142. package/src/web/pagination/pagination.vue.d.ts +247 -0
  143. package/src/web/popover/AI_GUIDE.md +163 -0
  144. package/src/web/popover/index.ts +3 -0
  145. package/src/web/popover/manifest.json +396 -0
  146. package/src/web/popover/popover.css +1 -0
  147. package/src/web/popover/popover.vue +579 -0
  148. package/src/web/popover/popover.vue.d.ts +83 -0
  149. package/src/web/radio/AI_GUIDE.md +155 -0
  150. package/src/web/radio/index.ts +3 -0
  151. package/src/web/radio/manifest.json +294 -0
  152. package/src/web/radio/radio.css +1 -0
  153. package/src/web/radio/radio.vue +288 -0
  154. package/src/web/radio/radio.vue.d.ts +182 -0
  155. package/src/web/selectbox/AI_GUIDE.md +216 -0
  156. package/src/web/selectbox/index.ts +3 -0
  157. package/src/web/selectbox/manifest.json +477 -0
  158. package/src/web/selectbox/selectbox.css +1 -0
  159. package/src/web/selectbox/selectbox.vue +1024 -0
  160. package/src/web/selectbox/selectbox.vue.d.ts +300 -0
  161. package/src/web/sonner/AI_GUIDE.md +98 -0
  162. package/src/web/sonner/index.ts +114 -0
  163. package/src/web/sonner/manifest.json +132 -0
  164. package/src/web/sonner/sonner.css +1 -0
  165. package/src/web/sonner/sonner.vue +180 -0
  166. package/src/web/sonner/sonner.vue.d.ts +113 -0
  167. package/src/web/table/AI_GUIDE.md +145 -0
  168. package/src/web/table/index.ts +34 -0
  169. package/src/web/table/manifest.json +168 -0
  170. package/src/web/table/table-body.vue +42 -0
  171. package/src/web/table/table-body.vue.d.ts +28 -0
  172. package/src/web/table/table-caption.vue +42 -0
  173. package/src/web/table/table-caption.vue.d.ts +28 -0
  174. package/src/web/table/table-cell.vue +71 -0
  175. package/src/web/table/table-cell.vue.d.ts +49 -0
  176. package/src/web/table/table-empty.vue +105 -0
  177. package/src/web/table/table-empty.vue.d.ts +57 -0
  178. package/src/web/table/table-footer.vue +42 -0
  179. package/src/web/table/table-footer.vue.d.ts +28 -0
  180. package/src/web/table/table-head.vue +78 -0
  181. package/src/web/table/table-head.vue.d.ts +50 -0
  182. package/src/web/table/table-header.vue +42 -0
  183. package/src/web/table/table-header.vue.d.ts +28 -0
  184. package/src/web/table/table-row.vue +70 -0
  185. package/src/web/table/table-row.vue.d.ts +44 -0
  186. package/src/web/table/table.css +1 -0
  187. package/src/web/table/table.vue +298 -0
  188. package/src/web/table/table.vue.d.ts +119 -0
  189. package/src/web/tabs/AI_GUIDE.md +150 -0
  190. package/src/web/tabs/index.ts +2 -0
  191. package/src/web/tabs/manifest.json +315 -0
  192. package/src/web/tabs/tabs.css +1 -0
  193. package/src/web/tabs/tabs.vue +164 -0
  194. package/src/web/tabs/tabs.vue.d.ts +60 -0
  195. package/src/web/text/AI_GUIDE.md +129 -0
  196. package/src/web/text/index.ts +2 -0
  197. package/src/web/text/manifest.json +195 -0
  198. package/src/web/text/text.css +1 -0
  199. package/src/web/text/text.vue +195 -0
  200. package/src/web/text/text.vue.d.ts +161 -0
  201. package/src/web/textarea/AI_GUIDE.md +141 -0
  202. package/src/web/textarea/index.ts +3 -0
  203. package/src/web/textarea/manifest.json +438 -0
  204. package/src/web/textarea/textarea.css +1 -0
  205. package/src/web/textarea/textarea.vue +458 -0
  206. package/src/web/textarea/textarea.vue.d.ts +265 -0
  207. package/src/web/tooltip/AI_GUIDE.md +110 -0
  208. package/src/web/tooltip/index.ts +3 -0
  209. package/src/web/tooltip/manifest.json +222 -0
  210. package/src/web/tooltip/tooltip.css +1 -0
  211. package/src/web/tooltip/tooltip.vue +417 -0
  212. package/src/web/tooltip/tooltip.vue.d.ts +150 -0
  213. package/src/webview/bottomsheet/AI_GUIDE.md +141 -0
  214. package/src/webview/bottomsheet/bottomsheet.css +1 -0
  215. package/src/webview/bottomsheet/bottomsheet.vue +441 -0
  216. package/src/webview/bottomsheet/bottomsheet.vue.d.ts +178 -0
  217. package/src/webview/bottomsheet/index.ts +4 -0
  218. package/src/webview/bottomsheet/manifest.json +377 -0
  219. package/src/webview/button/AI_GUIDE.md +79 -0
  220. package/src/webview/button/button-ios.css +1 -0
  221. package/src/webview/button/button-ios.vue +138 -0
  222. package/src/webview/button/button-ios.vue.d.ts +102 -0
  223. package/src/webview/button/button-material.css +1 -0
  224. package/src/webview/button/button-material.vue +138 -0
  225. package/src/webview/button/button-material.vue.d.ts +102 -0
  226. package/src/webview/button/index.ts +7 -0
  227. package/src/webview/button/manifest.json +148 -0
  228. package/src/webview/index.ts +7 -0
  229. package/tailwind-preset.cjs +62 -0
  230. package/tailwind-preset.js +62 -0
  231. package/ttdk-manifest.json +10188 -0
  232. package/README.md +0 -3
@@ -0,0 +1,180 @@
1
+ <template>
2
+ <div
3
+ aria-hidden="true"
4
+ :class="`ttdk-sonner-wrapper ${className || ''}`"
5
+ :style="{
6
+ display: 'none',
7
+ ...(typeof style === 'object' ? style : {}),
8
+ }"
9
+ ></div>
10
+ </template>
11
+
12
+ <script setup lang="ts">
13
+ import { onMounted, watch } from "vue";
14
+ import toastModule from "sonner-js";
15
+
16
+ export type SonnerPosition =
17
+ | "top-left"
18
+ | "top-center"
19
+ | "top-right"
20
+ | "bottom-left"
21
+ | "bottom-center"
22
+ | "bottom-right";
23
+ export type SonnerTheme = "light" | "dark" | "system";
24
+ export interface SonnerProps {
25
+ /**
26
+ * Inline CSS style kustom.
27
+ */
28
+ style?: any;
29
+ /**
30
+ * Posisi penempatan toast pada layar.
31
+ * - 'top-left', 'top-center', 'top-right'
32
+ * - 'bottom-left', 'bottom-center', 'bottom-right'
33
+ *
34
+ * @default 'bottom-right'
35
+ */
36
+ position?:
37
+ | "top-left"
38
+ | "top-center"
39
+ | "top-right"
40
+ | "bottom-left"
41
+ | "bottom-center"
42
+ | "bottom-right";
43
+
44
+ /**
45
+ * Menampilkan warna semantik kaya (rich colors) untuk jenis status (sukses hijau, error merah, info biru, warning kuning).
46
+ *
47
+ * @default true
48
+ */
49
+ richColors?: boolean;
50
+
51
+ /**
52
+ * Menampilkan tombol silang penutup (close button) pada setiap kartu toast.
53
+ *
54
+ * @default true
55
+ */
56
+ closeButton?: boolean;
57
+
58
+ /**
59
+ * Menentukan tema visual kontainer toast ('light', 'dark', atau 'system').
60
+ *
61
+ * @default 'light'
62
+ */
63
+ theme?: "light" | "dark" | "system";
64
+
65
+ /**
66
+ * Membuka semua tumpukan toast secara melebar (expanded) secara default saat muncul.
67
+ *
68
+ * @default false
69
+ */
70
+ expand?: boolean;
71
+
72
+ /**
73
+ * Durasi tampilan toast dalam milidetik sebelum otomatis menghilang.
74
+ *
75
+ * @default 4000
76
+ */
77
+ duration?: number;
78
+
79
+ /**
80
+ * Jumlah maksimum kartu toast yang terlihat bertumpuk secara bersamaan di layar.
81
+ *
82
+ * @default 3
83
+ */
84
+ visibleToasts?: number;
85
+
86
+ /**
87
+ * Jarak vertikal antar kartu toast dalam piksel.
88
+ *
89
+ * @default 14
90
+ */
91
+ gap?: number;
92
+
93
+ /**
94
+ * Jarak offset tepi layar dalam piksel.
95
+ *
96
+ * @default 24
97
+ */
98
+ offset?: number;
99
+
100
+ /**
101
+ * Jarak offset pada perangkat seluler / mobile dalam piksel.
102
+ *
103
+ * @default 16
104
+ */
105
+ mobileOffset?: number;
106
+
107
+ /**
108
+ * Arah teks layout tata letak ('ltr' atau 'rtl').
109
+ *
110
+ * @default 'ltr'
111
+ */
112
+ dir?: "ltr" | "rtl";
113
+
114
+ /**
115
+ * Kelas CSS kustom tambahan untuk wadah toaster.
116
+ */
117
+ className?: string;
118
+ }
119
+
120
+ /**
121
+ * Komponen Sonner / Toaster untuk sistem notifikasi toast mengambang yang ringkas, kaya warna, dan responsif.
122
+ */
123
+ const props = defineProps<SonnerProps>();
124
+
125
+ function getToastInstance(): any {
126
+ const t = toastModule as any;
127
+ if (t && typeof t.default === "function") {
128
+ return t.default;
129
+ }
130
+ if (typeof t === "function") {
131
+ return t;
132
+ }
133
+ return t?.default || t;
134
+ }
135
+
136
+ function updateSonnerConfig() {
137
+ if (typeof window === "undefined" || typeof document === "undefined") return;
138
+ const instance = getToastInstance();
139
+ if (instance && typeof instance.config === "function") {
140
+ instance.config({
141
+ theme: props.theme === "dark" ? "dark" : "light",
142
+ expand: props.expand ?? false,
143
+ visibleToasts: props.visibleToasts ?? 3,
144
+ gap: props.gap ?? 14,
145
+ offset: props.offset ?? 24,
146
+ mobileOffset: props.mobileOffset ?? 16,
147
+ dir: props.dir ?? "ltr",
148
+ toastOptions: {
149
+ position: props.position ?? "bottom-right",
150
+ closeButton: props.closeButton ?? true,
151
+ richColors: props.richColors ?? true,
152
+ duration: props.duration ?? 4000,
153
+ },
154
+ });
155
+ }
156
+ }
157
+
158
+ onMounted(() => {
159
+ updateSonnerConfig();
160
+ });
161
+
162
+ watch(
163
+ () => [
164
+ props.position,
165
+ props.richColors,
166
+ props.closeButton,
167
+ props.theme,
168
+ props.expand,
169
+ props.duration,
170
+ props.visibleToasts,
171
+ props.gap,
172
+ props.offset,
173
+ props.mobileOffset,
174
+ props.dir,
175
+ ],
176
+ () => {
177
+ updateSonnerConfig();
178
+ }
179
+ );
180
+ </script>
@@ -0,0 +1,113 @@
1
+ /* eslint-disable */
2
+ // Auto-generated by TTDK Design System Vue Type Generator
3
+ import type { DefineComponent } from "vue";
4
+ import toastModule from "sonner-js";
5
+
6
+ export type SonnerPosition =
7
+ | "top-left"
8
+ | "top-center"
9
+ | "top-right"
10
+ | "bottom-left"
11
+ | "bottom-center"
12
+ | "bottom-right";
13
+
14
+ export type SonnerTheme = "light" | "dark" | "system";
15
+
16
+ export interface SonnerProps {
17
+ /**
18
+ * Inline CSS style kustom.
19
+ */
20
+ style?: any;
21
+ /**
22
+ * Posisi penempatan toast pada layar.
23
+ * - 'top-left', 'top-center', 'top-right'
24
+ * - 'bottom-left', 'bottom-center', 'bottom-right'
25
+ *
26
+ * @default 'bottom-right'
27
+ */
28
+ position?:
29
+ | "top-left"
30
+ | "top-center"
31
+ | "top-right"
32
+ | "bottom-left"
33
+ | "bottom-center"
34
+ | "bottom-right";
35
+
36
+ /**
37
+ * Menampilkan warna semantik kaya (rich colors) untuk jenis status (sukses hijau, error merah, info biru, warning kuning).
38
+ *
39
+ * @default true
40
+ */
41
+ richColors?: boolean;
42
+
43
+ /**
44
+ * Menampilkan tombol silang penutup (close button) pada setiap kartu toast.
45
+ *
46
+ * @default true
47
+ */
48
+ closeButton?: boolean;
49
+
50
+ /**
51
+ * Menentukan tema visual kontainer toast ('light', 'dark', atau 'system').
52
+ *
53
+ * @default 'light'
54
+ */
55
+ theme?: "light" | "dark" | "system";
56
+
57
+ /**
58
+ * Membuka semua tumpukan toast secara melebar (expanded) secara default saat muncul.
59
+ *
60
+ * @default false
61
+ */
62
+ expand?: boolean;
63
+
64
+ /**
65
+ * Durasi tampilan toast dalam milidetik sebelum otomatis menghilang.
66
+ *
67
+ * @default 4000
68
+ */
69
+ duration?: number;
70
+
71
+ /**
72
+ * Jumlah maksimum kartu toast yang terlihat bertumpuk secara bersamaan di layar.
73
+ *
74
+ * @default 3
75
+ */
76
+ visibleToasts?: number;
77
+
78
+ /**
79
+ * Jarak vertikal antar kartu toast dalam piksel.
80
+ *
81
+ * @default 14
82
+ */
83
+ gap?: number;
84
+
85
+ /**
86
+ * Jarak offset tepi layar dalam piksel.
87
+ *
88
+ * @default 24
89
+ */
90
+ offset?: number;
91
+
92
+ /**
93
+ * Jarak offset pada perangkat seluler / mobile dalam piksel.
94
+ *
95
+ * @default 16
96
+ */
97
+ mobileOffset?: number;
98
+
99
+ /**
100
+ * Arah teks layout tata letak ('ltr' atau 'rtl').
101
+ *
102
+ * @default 'ltr'
103
+ */
104
+ dir?: "ltr" | "rtl";
105
+
106
+ /**
107
+ * Kelas CSS kustom tambahan untuk wadah toaster.
108
+ */
109
+ className?: string;
110
+ }
111
+
112
+ declare const component: DefineComponent<SonnerProps>;
113
+ export default component;
@@ -0,0 +1,145 @@
1
+ # <Table /> — TTDK Component Reference
2
+
3
+ Komponen kontainer utama tabel (Compound Table ala Shadcn UI).
4
+
5
+ ## 1. Stylesheets & Theming (Pure CSS)
6
+ Import the corresponding stylesheet for the theme you wish to use:
7
+ - **COMMON Theme**: `import "@ttdk-design-system/library-<react|vue|svelte>/web/table/table.css";`
8
+
9
+ ## 2. Subpath Component Import
10
+ ```ts
11
+ // React
12
+ import Table from "@ttdk-design-system/library-react/web/table";
13
+
14
+ // Vue 3
15
+ import Table from "@ttdk-design-system/library-vue/web/table";
16
+
17
+ // Svelte
18
+ import Table from "@ttdk-design-system/library-svelte/web/table";
19
+ ```
20
+
21
+ ## 3. Props & API Reference
22
+
23
+ | Prop | Type | Default | Description |
24
+ | :--- | :--- | :--- | :--- |
25
+ | `variant?` | `'default' | 'striped' | 'clean'` | `default` | 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. |
26
+ | `size?` | `'sm' | 'md' | 'lg'` | `md` | Kerapatan / ukuran tinggi baris tabel. - `'sm'`: Kompak (padat). - `'md'`: Standar. - `'lg'`: Lega. |
27
+ | `rounded?` | `'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full' | (string & {}) | number` | `sm` | Sudut kelengkungan radius tabel. - Preset: `'none'` | `'xs'` | `'sm'` | `'md'` | `'lg'` | `'xl'` | `'full'` - Nilai custom: `'12px'`, `'1rem'`, atau angka `12` |
28
+ | `shadow?` | `'none' | 'sm' | 'md' | 'lg' | (string & {})` | `sm` | 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)'`) |
29
+ | `minWidth?` | `string | number` | `-` | Lebar minimum elemen table di dalam wrapper untuk menjaga susunan kolom dan memicu horizontal scroll. Contoh: `700`, `'700px'`, `'max-content'` |
30
+ | `maxHeight?` | `string | number` | `-` | Ketinggian maksimum kontainer tabel untuk memicu scroll vertikal internal (sangat direkomendasikan saat stickyHeader aktif). Contoh: `280`, `'280px'`, `'50vh'` |
31
+ | `hoverable?` | `boolean` | `true` | Efek hover saat kursor melayang di atas baris tabel. |
32
+ | `stickyHeader?` | `boolean` | `false` | Membuat header tabel menempel di atas (sticky) saat konten di-scroll. |
33
+ | `loading?` | `boolean` | `false` | Menampilkan spinner loading overlay di atas tabel. |
34
+ | `caption?` | `string` | `-` | Teks caption aksesibilitas untuk tabel (dirender sebagai elemen `<caption>`). |
35
+ | `style?` | `any` | `-` | Inline CSS style object native. |
36
+ | `ui?` | `UiProps` | `-` | Kustomisasi visual granular root kontainer wrapper (.ttdk-table-wrapper) melalui UiProps. |
37
+ | `tableStyle?` | `UiProps` | `-` | Style kustom untuk elemen table (table.ttdk-table) melalui UiProps. |
38
+ | `tableClass?` | `string` | `-` | Class CSS kustom untuk elemen table (table.ttdk-table). |
39
+ | `className?` | `string` | `-` | Class CSS kustom untuk kontainer wrapper luar. |
40
+ | `children?` | `any` | `-` | Konten anak (TableHeader, TableBody, TableFooter, TableCaption). |
41
+
42
+ ## 4. Usage Examples
43
+
44
+ ### React Example
45
+ ```tsx
46
+ import Table from "@ttdk-design-system/library-react/table";
47
+ import "@ttdk-design-system/library-react/table/table.css";
48
+
49
+ export function Example() {
50
+ return (
51
+ <Table variant="striped" size="md">
52
+ <thead>
53
+ <tr>
54
+ <th>Kode Faskes</th>
55
+ <th>Nama Fasilitas</th>
56
+ <th>Jenis</th>
57
+ <th>Status</th>
58
+ </tr>
59
+ </thead>
60
+ <tbody>
61
+ <tr>
62
+ <td>P320101</td>
63
+ <td>Puskesmas Cibinong</td>
64
+ <td>Puskesmas</td>
65
+ <td>Aktif</td>
66
+ </tr>
67
+ <tr>
68
+ <td>RS320102</td>
69
+ <td>RSUD Ciawi</td>
70
+ <td>Rumah Sakit</td>
71
+ <td>Aktif</td>
72
+ </tr>
73
+ </tbody>
74
+ </Table>
75
+ );
76
+ }
77
+ ```
78
+
79
+ ### Vue 3 Example
80
+ ```vue
81
+ <script setup lang="ts">
82
+ import Table from "@ttdk-design-system/library-vue/table";
83
+ import "@ttdk-design-system/library-vue/table/table.css";
84
+ </script>
85
+
86
+ <template>
87
+ <Table variant="striped" size="md">
88
+ <thead>
89
+ <tr>
90
+ <th>Kode Faskes</th>
91
+ <th>Nama Fasilitas</th>
92
+ <th>Jenis</th>
93
+ <th>Status</th>
94
+ </tr>
95
+ </thead>
96
+ <tbody>
97
+ <tr>
98
+ <td>P320101</td>
99
+ <td>Puskesmas Cibinong</td>
100
+ <td>Puskesmas</td>
101
+ <td>Aktif</td>
102
+ </tr>
103
+ <tr>
104
+ <td>RS320102</td>
105
+ <td>RSUD Ciawi</td>
106
+ <td>Rumah Sakit</td>
107
+ <td>Aktif</td>
108
+ </tr>
109
+ </tbody>
110
+ </Table>
111
+ </template>
112
+ ```
113
+
114
+ ### Svelte Example
115
+ ```svelte
116
+ <script lang="ts">
117
+ import Table from "@ttdk-design-system/library-svelte/table";
118
+ import "@ttdk-design-system/library-svelte/table/table.css";
119
+ </script>
120
+
121
+ <Table variant="striped" size="md">
122
+ <thead>
123
+ <tr>
124
+ <th>Kode Faskes</th>
125
+ <th>Nama Fasilitas</th>
126
+ <th>Jenis</th>
127
+ <th>Status</th>
128
+ </tr>
129
+ </thead>
130
+ <tbody>
131
+ <tr>
132
+ <td>P320101</td>
133
+ <td>Puskesmas Cibinong</td>
134
+ <td>Puskesmas</td>
135
+ <td>Aktif</td>
136
+ </tr>
137
+ <tr>
138
+ <td>RS320102</td>
139
+ <td>RSUD Ciawi</td>
140
+ <td>Rumah Sakit</td>
141
+ <td>Aktif</td>
142
+ </tr>
143
+ </tbody>
144
+ </Table>
145
+ ```
@@ -0,0 +1,34 @@
1
+ export { default as Table } from './table.vue';
2
+ export { default as TableHeader } from './table-header.vue';
3
+ export { default as TableBody } from './table-body.vue';
4
+ export { default as TableFooter } from './table-footer.vue';
5
+ export { default as TableRow } from './table-row.vue';
6
+ export { default as TableHead } from './table-head.vue';
7
+ export { default as TableCell } from './table-cell.vue';
8
+ export { default as TableCaption } from './table-caption.vue';
9
+ export { default as TableEmpty } from './table-empty.vue';
10
+
11
+ export * from './table.vue';
12
+ export * from './table-header.vue';
13
+ export * from './table-body.vue';
14
+ export * from './table-footer.vue';
15
+ export * from './table-row.vue';
16
+ export * from './table-head.vue';
17
+ export * from './table-cell.vue';
18
+ export * from './table-caption.vue';
19
+ export * from './table-empty.vue';
20
+
21
+ // Re-export TanStack VUE Table (All core + framework adapter hooks & renderers)
22
+ export {
23
+ useVueTable,
24
+ FlexRender,
25
+ createColumnHelper,
26
+ getCoreRowModel,
27
+ getSortedRowModel,
28
+ getPaginationRowModel,
29
+ getFilteredRowModel,
30
+ getExpandedRowModel,
31
+ getGroupedRowModel,
32
+ } from '@tanstack/vue-table';
33
+ export * from '@tanstack/vue-table';
34
+ export { default } from './table.vue';
@@ -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,42 @@
1
+ <template>
2
+ <tbody
3
+ :class="`ttdk-table-body ${className || ''}`.trim()"
4
+ :style="{
5
+ ...buildUiVars(ui),
6
+ ...(typeof style === 'object' ? style : {}),
7
+ }"
8
+ >
9
+ <slot />
10
+ </tbody>
11
+ </template>
12
+
13
+ <script setup lang="ts">
14
+ import { buildUiVars, UiProps } from "../../core/types";
15
+
16
+ export interface TableBodyProps {
17
+ /**
18
+ * Inline CSS style kustom.
19
+ */
20
+ style?: any;
21
+ /**
22
+ * Kustomisasi visual granular tbody (UiProps).
23
+ */
24
+ ui?: UiProps;
25
+
26
+ /**
27
+ * Class CSS kustom.
28
+ */
29
+ className?: string;
30
+
31
+ /**
32
+ * Konten baris data (TableRow).
33
+ */
34
+ children?: any;
35
+ }
36
+
37
+ /**
38
+ * Komponen badan tabel `<tbody>` (Compound TableBody).
39
+ */
40
+
41
+ const props = defineProps<TableBodyProps>();
42
+ </script>