@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,3 @@
1
+ export { default } from './dropdown';
2
+ export { default as Dropdown, default as DropdownMenu } from './dropdown';
3
+ export type { DropdownProps, DropdownMenuProps, DropdownOption, DropdownMenuItem, DropdownUiProps } from './dropdown'
@@ -0,0 +1,576 @@
1
+ {
2
+ "name": "@ttdk-design-system/dropdown",
3
+ "component": "Dropdown",
4
+ "folder": "dropdown",
5
+ "description": "Komponen Dropdown Menu TTDK sesuai spesifikasi Desain: - Selaras UI & Props dengan Selectbox: Label, Helper/Error text, Search bar, Floating popover - Mode Single Select / Menu Actions dengan Active Teal Checkmark (#00A3A6) - Mode Multi-Select dengan Checkbox list, Chip tags (Label ✕), dan Action footer (Reset & Terapkan) - Varian trigger fleksibel: 'select' (standar form), 'action' / 'primary' (tombol aksi), 'outline', 'ghost' - Dukungan Trigger Kustom melalui Slot / Children (misal: tombol kustom) - Dukungan item kaya: Icon, Deskripsi, Divider pemisah seksi, dan Danger item",
6
+ "stylesheets": [
7
+ {
8
+ "theme": "common",
9
+ "file": "dropdown.css",
10
+ "importPath": "web/dropdown/dropdown.css"
11
+ }
12
+ ],
13
+ "props": {
14
+ "label": {
15
+ "name": "label",
16
+ "type": "string",
17
+ "optional": true,
18
+ "default": null,
19
+ "description": "Teks label judul field yang ditampilkan di atas dropdown (14px Semibold, #141313).",
20
+ "example": null,
21
+ "param": null
22
+ },
23
+ "optional": {
24
+ "name": "optional",
25
+ "type": "boolean",
26
+ "optional": true,
27
+ "default": "false",
28
+ "description": "Menandai field sebagai opsi opsional dengan menambahkan teks '(Opsional)' (12px Regular, #9698A2).",
29
+ "example": null,
30
+ "param": null
31
+ },
32
+ "optionalText": {
33
+ "name": "optionalText",
34
+ "type": "string",
35
+ "optional": true,
36
+ "default": "(Opsional)",
37
+ "description": "Kustomisasi teks keterangan opsional.",
38
+ "example": null,
39
+ "param": null
40
+ },
41
+ "placeholder": {
42
+ "name": "placeholder",
43
+ "type": "string",
44
+ "optional": true,
45
+ "default": "Pilih dropdown menu",
46
+ "description": "Teks petunjuk saat belum ada opsi yang dipilih.",
47
+ "example": null,
48
+ "param": null
49
+ },
50
+ "value": {
51
+ "name": "value",
52
+ "type": "any",
53
+ "optional": true,
54
+ "default": null,
55
+ "description": "Nilai terpilih saat ini (single string/number atau array nilai untuk mode multiple).",
56
+ "example": null,
57
+ "param": null
58
+ },
59
+ "defaultValue": {
60
+ "name": "defaultValue",
61
+ "type": "any",
62
+ "optional": true,
63
+ "default": null,
64
+ "description": "Nilai awal tidak terkontrol (uncontrolled initial value).",
65
+ "example": null,
66
+ "param": null
67
+ },
68
+ "options": {
69
+ "name": "options",
70
+ "type": "Array<DropdownOption | string>",
71
+ "optional": true,
72
+ "default": null,
73
+ "description": "Daftar pilihan opsi dropdown menu. Dapat berupa array of object `{ label, value }` atau array of string.",
74
+ "example": null,
75
+ "param": null
76
+ },
77
+ "multiple": {
78
+ "name": "multiple",
79
+ "type": "boolean",
80
+ "optional": true,
81
+ "default": "false",
82
+ "description": "Mode pemilihan jamak (multi-select) dengan tampilan chips/tag dan daftar checkbox.",
83
+ "example": null,
84
+ "param": null
85
+ },
86
+ "searchable": {
87
+ "name": "searchable",
88
+ "type": "boolean",
89
+ "optional": true,
90
+ "default": "false",
91
+ "description": "Mengaktifkan kotak pencarian (search input) di dalam menu dropdown.",
92
+ "example": null,
93
+ "param": null
94
+ },
95
+ "searchPlaceholder": {
96
+ "name": "searchPlaceholder",
97
+ "type": "string",
98
+ "optional": true,
99
+ "default": "Cari",
100
+ "description": "Placeholder pada kotak pencarian di dalam dropdown.",
101
+ "example": null,
102
+ "param": null
103
+ },
104
+ "applyText": {
105
+ "name": "applyText",
106
+ "type": "string",
107
+ "optional": true,
108
+ "default": "Terapkan",
109
+ "description": "Teks tombol terapkan pada footer multi-select.",
110
+ "example": null,
111
+ "param": null
112
+ },
113
+ "resetText": {
114
+ "name": "resetText",
115
+ "type": "string",
116
+ "optional": true,
117
+ "default": "Reset",
118
+ "description": "Teks tombol reset pada footer multi-select.",
119
+ "example": null,
120
+ "param": null
121
+ },
122
+ "name": {
123
+ "name": "name",
124
+ "type": "string",
125
+ "optional": true,
126
+ "default": null,
127
+ "description": "Nama form field HTML.",
128
+ "example": null,
129
+ "param": null
130
+ },
131
+ "id": {
132
+ "name": "id",
133
+ "type": "string",
134
+ "optional": true,
135
+ "default": null,
136
+ "description": "Identifier unik elemen dropdown.",
137
+ "example": null,
138
+ "param": null
139
+ },
140
+ "error": {
141
+ "name": "error",
142
+ "type": "boolean",
143
+ "optional": true,
144
+ "default": "false",
145
+ "description": "Status apakah dropdown sedang dalam kondisi error / tidak valid.",
146
+ "example": null,
147
+ "param": null
148
+ },
149
+ "errorMessage": {
150
+ "name": "errorMessage",
151
+ "type": "string",
152
+ "optional": true,
153
+ "default": null,
154
+ "description": "Pesan teks penjelasan kesalahan validasi di bawah field.",
155
+ "example": null,
156
+ "param": null
157
+ },
158
+ "helperText": {
159
+ "name": "helperText",
160
+ "type": "string",
161
+ "optional": true,
162
+ "default": null,
163
+ "description": "Teks petunjuk atau keterangan bantuan di bawah field (12px Regular, #3C4245).",
164
+ "example": null,
165
+ "param": null
166
+ },
167
+ "helperTextPosition": {
168
+ "name": "helperTextPosition",
169
+ "type": "'top' | 'bottom'",
170
+ "optional": true,
171
+ "default": null,
172
+ "description": "Posisi teks helper",
173
+ "example": null,
174
+ "param": null
175
+ },
176
+ "size": {
177
+ "name": "size",
178
+ "type": "'sm' | 'md' | 'lg'",
179
+ "optional": true,
180
+ "default": "md",
181
+ "description": "Skala ukuran dropdown. - `'sm'`: 36px - `'md'`: 48px (standar desain) - `'lg'`: 56px",
182
+ "example": null,
183
+ "param": null
184
+ },
185
+ "rounded": {
186
+ "name": "rounded",
187
+ "type": "'none' | 'sm' | 'md' | 'lg' | 'full'",
188
+ "optional": true,
189
+ "default": "md",
190
+ "description": "Bentuk sudut kelengkungan dropdown. - `'none'`: 0px - `'sm'`: 4px - `'md'`: 8px (standar desain) - `'lg'`: 12px - `'full'`: 9999px (kapsul)",
191
+ "example": null,
192
+ "param": null
193
+ },
194
+ "placement": {
195
+ "name": "placement",
196
+ "type": "| 'bottom-start'\n | 'bottom-end'\n | 'bottom'\n | 'top-start'\n | 'top-end'\n | 'top'",
197
+ "optional": true,
198
+ "default": "bottom-start",
199
+ "description": "Posisi penempatan panel menu dropdown popover terhadap elemen trigger.",
200
+ "example": null,
201
+ "param": null
202
+ },
203
+ "arrow": {
204
+ "name": "arrow",
205
+ "type": "boolean",
206
+ "optional": true,
207
+ "default": "true",
208
+ "description": "Menampilkan panah chevron indikator buka/tutup pada trigger.",
209
+ "example": null,
210
+ "param": null
211
+ },
212
+ "icon": {
213
+ "name": "icon",
214
+ "type": "any",
215
+ "optional": true,
216
+ "default": null,
217
+ "description": "Ikon kustom di awal teks trigger (leading icon).",
218
+ "example": null,
219
+ "param": null
220
+ },
221
+ "closeOnSelect": {
222
+ "name": "closeOnSelect",
223
+ "type": "boolean",
224
+ "optional": true,
225
+ "default": "true",
226
+ "description": "Otomatis menutup menu popover setelah pengguna memilih opsi (pada single select).",
227
+ "example": null,
228
+ "param": null
229
+ },
230
+ "block": {
231
+ "name": "block",
232
+ "type": "boolean",
233
+ "optional": true,
234
+ "default": "false",
235
+ "description": "Menjadikan lebar field dropdown memenuhi kontainer penuh (full-width 100%).",
236
+ "example": null,
237
+ "param": null
238
+ },
239
+ "disabled": {
240
+ "name": "disabled",
241
+ "type": "boolean",
242
+ "optional": true,
243
+ "default": "false",
244
+ "description": "Status apakah dropdown dinonaktifkan (disabled).",
245
+ "example": null,
246
+ "param": null
247
+ },
248
+ "required": {
249
+ "name": "required",
250
+ "type": "boolean",
251
+ "optional": true,
252
+ "default": "false",
253
+ "description": "Menandai field sebagai input wajib diisi (menampilkan tanda bintang merah *).",
254
+ "example": null,
255
+ "param": null
256
+ },
257
+ "inputRef": {
258
+ "name": "inputRef",
259
+ "type": "any",
260
+ "optional": true,
261
+ "default": null,
262
+ "description": "Ref instance elemen control dropdown untuk akses DOM langsung.",
263
+ "example": null,
264
+ "param": null
265
+ },
266
+ "clearable": {
267
+ "name": "clearable",
268
+ "type": "boolean",
269
+ "optional": true,
270
+ "default": "false",
271
+ "description": "Menampilkan tombol × untuk menghapus pilihan yang sudah dipilih.",
272
+ "example": null,
273
+ "param": null
274
+ },
275
+ "loading": {
276
+ "name": "loading",
277
+ "type": "boolean",
278
+ "optional": true,
279
+ "default": "false",
280
+ "description": "Menampilkan spinner loading dan menonaktifkan interaksi dropdown.",
281
+ "example": null,
282
+ "param": null
283
+ },
284
+ "readOnly": {
285
+ "name": "readOnly",
286
+ "type": "boolean",
287
+ "optional": true,
288
+ "default": "false",
289
+ "description": "Menjadikan dropdown hanya-baca (tidak bisa dibuka/diubah).",
290
+ "example": null,
291
+ "param": null
292
+ },
293
+ "ui": {
294
+ "name": "ui",
295
+ "type": "DropdownUiProps",
296
+ "optional": true,
297
+ "default": null,
298
+ "description": "Kustomisasi visual granular wrapper utama (UiProps).",
299
+ "example": null,
300
+ "param": null
301
+ },
302
+ "style": {
303
+ "name": "style",
304
+ "type": "any",
305
+ "optional": true,
306
+ "default": null,
307
+ "description": "Style inline native untuk wrapper luar.",
308
+ "example": null,
309
+ "param": null
310
+ },
311
+ "labelStyle": {
312
+ "name": "labelStyle",
313
+ "type": "UiProps",
314
+ "optional": true,
315
+ "default": null,
316
+ "description": "Style kustom untuk elemen label (UiProps).",
317
+ "example": null,
318
+ "param": null
319
+ },
320
+ "labelClass": {
321
+ "name": "labelClass",
322
+ "type": "string",
323
+ "optional": true,
324
+ "default": null,
325
+ "description": "Class CSS kustom untuk elemen label (Tailwind / class kustom).",
326
+ "example": null,
327
+ "param": null
328
+ },
329
+ "controlStyle": {
330
+ "name": "controlStyle",
331
+ "type": "UiProps",
332
+ "optional": true,
333
+ "default": null,
334
+ "description": "Style kustom untuk elemen kotak pemicu (control trigger) (UiProps).",
335
+ "example": null,
336
+ "param": null
337
+ },
338
+ "controlClass": {
339
+ "name": "controlClass",
340
+ "type": "string",
341
+ "optional": true,
342
+ "default": null,
343
+ "description": "Class CSS kustom untuk elemen kotak pemicu (control trigger) (Tailwind / class kustom).",
344
+ "example": null,
345
+ "param": null
346
+ },
347
+ "listStyle": {
348
+ "name": "listStyle",
349
+ "type": "UiProps",
350
+ "optional": true,
351
+ "default": null,
352
+ "description": "Style kustom untuk panel popover / menu list opsi (UiProps).",
353
+ "example": null,
354
+ "param": null
355
+ },
356
+ "listClass": {
357
+ "name": "listClass",
358
+ "type": "string",
359
+ "optional": true,
360
+ "default": null,
361
+ "description": "Class CSS kustom untuk panel popover / menu list opsi (Tailwind / class kustom).",
362
+ "example": null,
363
+ "param": null
364
+ },
365
+ "errorMessageStyle": {
366
+ "name": "errorMessageStyle",
367
+ "type": "UiProps",
368
+ "optional": true,
369
+ "default": null,
370
+ "description": "Style kustom untuk pesan teks error validasi (UiProps).",
371
+ "example": null,
372
+ "param": null
373
+ },
374
+ "errorMessageClass": {
375
+ "name": "errorMessageClass",
376
+ "type": "string",
377
+ "optional": true,
378
+ "default": null,
379
+ "description": "Class CSS kustom untuk pesan teks error validasi (Tailwind / class kustom).",
380
+ "example": null,
381
+ "param": null
382
+ },
383
+ "helperTextStyle": {
384
+ "name": "helperTextStyle",
385
+ "type": "UiProps",
386
+ "optional": true,
387
+ "default": null,
388
+ "description": "Style kustom untuk teks petunjuk bantuan (UiProps).",
389
+ "example": null,
390
+ "param": null
391
+ },
392
+ "helperTextClass": {
393
+ "name": "helperTextClass",
394
+ "type": "string",
395
+ "optional": true,
396
+ "default": null,
397
+ "description": "Class CSS kustom untuk teks petunjuk bantuan (Tailwind / class kustom).",
398
+ "example": null,
399
+ "param": null
400
+ },
401
+ "onChange": {
402
+ "name": "onChange",
403
+ "type": "(value: any) => void",
404
+ "optional": true,
405
+ "default": null,
406
+ "description": "Callback event saat nilai pilihan berubah.",
407
+ "example": null,
408
+ "param": null
409
+ },
410
+ "onSelect": {
411
+ "name": "onSelect",
412
+ "type": "(option: DropdownOption) => void",
413
+ "optional": true,
414
+ "default": null,
415
+ "description": "Callback event saat sebuah opsi dipilih dari menu.",
416
+ "example": null,
417
+ "param": null
418
+ },
419
+ "onSearch": {
420
+ "name": "onSearch",
421
+ "type": "(query: string) => void",
422
+ "optional": true,
423
+ "default": null,
424
+ "description": "Callback event saat pengguna mengetik di kolom pencarian.",
425
+ "example": null,
426
+ "param": null
427
+ },
428
+ "onOpen": {
429
+ "name": "onOpen",
430
+ "type": "() => void",
431
+ "optional": true,
432
+ "default": null,
433
+ "description": "Callback event saat menu dropdown terbuka.",
434
+ "example": null,
435
+ "param": null
436
+ },
437
+ "onClose": {
438
+ "name": "onClose",
439
+ "type": "() => void",
440
+ "optional": true,
441
+ "default": null,
442
+ "description": "Callback event saat menu dropdown ditutup.",
443
+ "example": null,
444
+ "param": null
445
+ },
446
+ "disableShift": {
447
+ "name": "disableShift",
448
+ "type": "boolean",
449
+ "optional": true,
450
+ "default": "false",
451
+ "description": "Menonaktifkan middleware `shift` pada floating-ui sehingga posisi list popover tidak bergeser secara horizontal mengikuti tepi layar. Berguna saat ingin list tetap berada di tengah atau posisi placement yang ditentukan.",
452
+ "example": null,
453
+ "param": null
454
+ },
455
+ "className": {
456
+ "name": "className",
457
+ "type": "string",
458
+ "optional": true,
459
+ "default": null,
460
+ "description": "Class CSS kustom wrapper luar.",
461
+ "example": null,
462
+ "param": null
463
+ },
464
+ "children": {
465
+ "name": "children",
466
+ "type": "any",
467
+ "optional": true,
468
+ "default": null,
469
+ "description": "Elemen pemicu (trigger) kustom, tombol, ikon, atau komponen anak lainnya.",
470
+ "example": null,
471
+ "param": null
472
+ },
473
+ "panelContent": {
474
+ "name": "panelContent",
475
+ "type": "any",
476
+ "optional": true,
477
+ "default": null,
478
+ "description": "Konten kustom yang ditampilkan di dalam panel popover menggantikan list opsi standar. Berguna untuk menampilkan komponen seperti Calendar, Color Picker, dsb. di dalam Dropdown. Ketika prop ini di-set, `options` tidak akan dirender. Menerima ReactNode atau render function `({ close }) => ReactNode`.",
479
+ "example": null,
480
+ "param": null
481
+ },
482
+ "displayValue": {
483
+ "name": "displayValue",
484
+ "type": "string",
485
+ "optional": true,
486
+ "default": null,
487
+ "description": "Label atau teks kustom untuk ditampilkan pada trigger dropdown. Sangat berguna saat menggunakan `panelContent` seperti Date Picker di mana nilai trigger diformat secara kustom.",
488
+ "example": null,
489
+ "param": null
490
+ }
491
+ },
492
+ "subInterfaces": {
493
+ "DropdownOption": {
494
+ "label": {
495
+ "name": "label",
496
+ "type": "string",
497
+ "optional": false,
498
+ "default": null,
499
+ "description": "Teks label tampilan pilihan dropdown menu.",
500
+ "example": null,
501
+ "param": null
502
+ },
503
+ "value": {
504
+ "name": "value",
505
+ "type": "string | number",
506
+ "optional": false,
507
+ "default": null,
508
+ "description": "Nilai unik (value) dari item dropdown.",
509
+ "example": null,
510
+ "param": null
511
+ },
512
+ "disabled": {
513
+ "name": "disabled",
514
+ "type": "boolean",
515
+ "optional": true,
516
+ "default": "false",
517
+ "description": "Status apakah opsi ini dinonaktifkan dari pemilihan.",
518
+ "example": null,
519
+ "param": null
520
+ },
521
+ "icon": {
522
+ "name": "icon",
523
+ "type": "any",
524
+ "optional": true,
525
+ "default": null,
526
+ "description": "Ikon kustom di samping label item pilihan.",
527
+ "example": null,
528
+ "param": null
529
+ },
530
+ "description": {
531
+ "name": "description",
532
+ "type": "string",
533
+ "optional": true,
534
+ "default": null,
535
+ "description": "Deskripsi atau teks bantuan kecil di bawah label item pilihan.",
536
+ "example": null,
537
+ "param": null
538
+ },
539
+ "danger": {
540
+ "name": "danger",
541
+ "type": "boolean",
542
+ "optional": true,
543
+ "default": "false",
544
+ "description": "Menandai item sebagai aksi berbahaya/destruktif (misal: \"Hapus\"), ditampilkan dengan warna aksen merah.",
545
+ "example": null,
546
+ "param": null
547
+ },
548
+ "divider": {
549
+ "name": "divider",
550
+ "type": "boolean",
551
+ "optional": true,
552
+ "default": "false",
553
+ "description": "Menampilkan garis pemisah horizontal (divider) di atas item ini.",
554
+ "example": null,
555
+ "param": null
556
+ },
557
+ "onClick": {
558
+ "name": "onClick",
559
+ "type": "(option?: DropdownOption) => void",
560
+ "optional": true,
561
+ "default": null,
562
+ "description": "Callback event saat item ini diklik.",
563
+ "example": null,
564
+ "param": null
565
+ }
566
+ }
567
+ },
568
+ "supportedFrameworks": [
569
+ "react",
570
+ "vue",
571
+ "svelte"
572
+ ],
573
+ "themes": [
574
+ "tw"
575
+ ]
576
+ }
@@ -0,0 +1,113 @@
1
+ # <Flex /> — TTDK Component Reference
2
+
3
+ TTDK Flex component with multi-theme support.
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/flex/flex.css";`
8
+
9
+ ## 2. Subpath Component Import
10
+ ```ts
11
+ // React
12
+ import Flex from "@ttdk-design-system/library-react/web/flex";
13
+
14
+ // Vue 3
15
+ import Flex from "@ttdk-design-system/library-vue/web/flex";
16
+
17
+ // Svelte
18
+ import Flex from "@ttdk-design-system/library-svelte/web/flex";
19
+ ```
20
+
21
+ ## 3. Props & API Reference
22
+
23
+ | Prop | Type | Default | Description |
24
+ | :--- | :--- | :--- | :--- |
25
+ | `inline?` | `boolean` | `false` | Menggunakan display 'inline-flex' daripada 'flex'. |
26
+ | `sm?` | `FlexBreakpointProps` | `-` | Override pada breakpoint sm (min-width: 640px). |
27
+ | `md?` | `FlexBreakpointProps` | `-` | Override pada breakpoint md (min-width: 768px). |
28
+ | `lg?` | `FlexBreakpointProps` | `-` | Override pada breakpoint lg (min-width: 1024px). |
29
+ | `xl?` | `FlexBreakpointProps` | `-` | Override pada breakpoint xl (min-width: 1280px). |
30
+ | `xxl?` | `FlexBreakpointProps` | `-` | Override pada breakpoint xxl / 2xl (min-width: 1536px). |
31
+ | `ui?` | `UiProps` | `-` | Kustomisasi visual granular root kontainer (UiProps). |
32
+ | `className?` | `string` | `-` | Class CSS kustom. |
33
+ | `style?` | `any` | `-` | Style kustom inline. |
34
+ | `children?` | `any` | `-` | Konten anak di dalam Flex. |
35
+
36
+ ### Sub-interface: `FlexBreakpointProps`
37
+
38
+ | Field | Type | Default | Description |
39
+ | :--- | :--- | :--- | :--- |
40
+ | `direction?` | `'row' | 'column' | 'row-reverse' | 'column-reverse'` | `row` | Arah susunan elemen anak (flex-direction). |
41
+ | `justifyContent?` | `'start' | 'center' | 'end' | 'around' | 'between' | 'evenly'` | `start` | Distribusi ruang antar elemen anak pada sumbu utama (justify-content). |
42
+ | `alignItems?` | `'start' | 'center' | 'end' | 'stretch'` | `stretch` | Perataan elemen anak pada sumbu silang (align-items). |
43
+ | `gap?` | `string | number` | `-` | Jarak celah antar elemen anak (gap). Nilai dapat berupa angka pixel atau string unit CSS (misal: 12, "16px", "var(--ttdk-spacing-16)"). |
44
+ | `wrap?` | `'nowrap' | 'wrap' | 'wrap-reverse'` | `nowrap` | Membungkus elemen anak jika melebihi lebar kontainer (flex-wrap). |
45
+
46
+ ## 4. Usage Examples
47
+
48
+ ### React Example
49
+ ```tsx
50
+ import { Flex, FlexItem } from "@ttdk-design-system/library-react/flex";
51
+ import "@ttdk-design-system/library-react/flex/flex.css";
52
+
53
+ export function Example() {
54
+ return (
55
+ <Flex
56
+ direction="column"
57
+ gap="16px"
58
+ md={{ direction: "row", gap: "24px", justifyContent: "between" }}
59
+ >
60
+ <FlexItem grow>
61
+ <div style={{ background: '#f4f4f5', padding: '16px' }}>Sisi Kiri</div>
62
+ </FlexItem>
63
+ <FlexItem>
64
+ <div style={{ background: '#e4e4e7', padding: '16px' }}>Sisi Kanan</div>
65
+ </FlexItem>
66
+ </Flex>
67
+ );
68
+ }
69
+ ```
70
+
71
+ ### Vue 3 Example
72
+ ```vue
73
+ <script setup lang="ts">
74
+ import { Flex, FlexItem } from "@ttdk-design-system/library-vue/flex";
75
+ import "@ttdk-design-system/library-vue/flex/flex.css";
76
+ </script>
77
+
78
+ <template>
79
+ <Flex
80
+ direction="column"
81
+ gap="16px"
82
+ :md="{ direction: 'row', gap: '24px', justifyContent: 'between' }"
83
+ >
84
+ <FlexItem :grow="true">
85
+ <div style="background: #f4f4f5; padding: 16px;">Sisi Kiri</div>
86
+ </FlexItem>
87
+ <FlexItem>
88
+ <div style="background: #e4e4e7; padding: 16px;">Sisi Kanan</div>
89
+ </FlexItem>
90
+ </Flex>
91
+ </template>
92
+ ```
93
+
94
+ ### Svelte Example
95
+ ```svelte
96
+ <script lang="ts">
97
+ import { Flex, FlexItem } from "@ttdk-design-system/library-svelte/flex";
98
+ import "@ttdk-design-system/library-svelte/flex/flex.css";
99
+ </script>
100
+
101
+ <Flex
102
+ direction="column"
103
+ gap="16px"
104
+ md={{ direction: "row", gap: "24px", justifyContent: "between" }}
105
+ >
106
+ <FlexItem grow>
107
+ <div style="background: #f4f4f5; padding: 16px;">Sisi Kiri</div>
108
+ </FlexItem>
109
+ <FlexItem>
110
+ <div style="background: #e4e4e7; padding: 16px;">Sisi Kanan</div>
111
+ </FlexItem>
112
+ </Flex>
113
+ ```