@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.
- package/AI_GUIDE.md +6518 -0
- package/llms.txt +6518 -0
- package/package.json +1096 -4
- package/src/core/index.ts +2 -0
- package/src/core/tailwind-preset.cjs +62 -0
- package/src/core/tailwind-preset.ts +85 -0
- package/src/core/theme/tokens.css +663 -0
- package/src/core/types.ts +836 -0
- package/src/index.ts +17 -0
- package/src/tailwind-preset.cjs +62 -0
- package/src/tailwind-preset.ts +85 -0
- package/src/types.ts +1 -0
- package/src/web/accordion/AI_GUIDE.md +149 -0
- package/src/web/accordion/accordion.css +1 -0
- package/src/web/accordion/accordion.vue +432 -0
- package/src/web/accordion/accordion.vue.d.ts +227 -0
- package/src/web/accordion/index.ts +3 -0
- package/src/web/accordion/manifest.json +351 -0
- package/src/web/alert/AI_GUIDE.md +139 -0
- package/src/web/alert/alert.css +1 -0
- package/src/web/alert/alert.vue +290 -0
- package/src/web/alert/alert.vue.d.ts +154 -0
- package/src/web/alert/index.ts +3 -0
- package/src/web/alert/manifest.json +240 -0
- package/src/web/avatar/AI_GUIDE.md +118 -0
- package/src/web/avatar/avatar.css +1 -0
- package/src/web/avatar/avatar.vue +217 -0
- package/src/web/avatar/avatar.vue.d.ts +135 -0
- package/src/web/avatar/index.ts +3 -0
- package/src/web/avatar/manifest.json +195 -0
- package/src/web/badge/AI_GUIDE.md +94 -0
- package/src/web/badge/badge.css +1 -0
- package/src/web/badge/badge.vue +135 -0
- package/src/web/badge/badge.vue.d.ts +108 -0
- package/src/web/badge/index.ts +3 -0
- package/src/web/badge/manifest.json +141 -0
- package/src/web/banner/AI_GUIDE.md +130 -0
- package/src/web/banner/banner.css +1 -0
- package/src/web/banner/banner.vue +303 -0
- package/src/web/banner/banner.vue.d.ts +162 -0
- package/src/web/banner/index.ts +3 -0
- package/src/web/banner/manifest.json +240 -0
- package/src/web/breadcrumb/AI_GUIDE.md +120 -0
- package/src/web/breadcrumb/breadcrumb.css +1 -0
- package/src/web/breadcrumb/breadcrumb.vue +313 -0
- package/src/web/breadcrumb/breadcrumb.vue.d.ts +139 -0
- package/src/web/breadcrumb/index.ts +3 -0
- package/src/web/breadcrumb/manifest.json +225 -0
- package/src/web/button/AI_GUIDE.md +121 -0
- package/src/web/button/button.css +1 -0
- package/src/web/button/button.vue +283 -0
- package/src/web/button/button.vue.d.ts +147 -0
- package/src/web/button/index.ts +3 -0
- package/src/web/button/manifest.json +177 -0
- package/src/web/calendar/AI_GUIDE.md +151 -0
- package/src/web/calendar/calendar.css +1 -0
- package/src/web/calendar/calendar.vue +1536 -0
- package/src/web/calendar/calendar.vue.d.ts +261 -0
- package/src/web/calendar/index.ts +3 -0
- package/src/web/calendar/manifest.json +470 -0
- package/src/web/card/AI_GUIDE.md +133 -0
- package/src/web/card/card.css +1 -0
- package/src/web/card/card.vue +423 -0
- package/src/web/card/card.vue.d.ts +232 -0
- package/src/web/card/index.ts +3 -0
- package/src/web/card/manifest.json +357 -0
- package/src/web/checkbox/AI_GUIDE.md +146 -0
- package/src/web/checkbox/checkbox.css +1 -0
- package/src/web/checkbox/checkbox.vue +304 -0
- package/src/web/checkbox/checkbox.vue.d.ts +189 -0
- package/src/web/checkbox/index.ts +3 -0
- package/src/web/checkbox/manifest.json +294 -0
- package/src/web/chip/AI_GUIDE.md +186 -0
- package/src/web/chip/chip.css +1 -0
- package/src/web/chip/chip.vue +220 -0
- package/src/web/chip/chip.vue.d.ts +140 -0
- package/src/web/chip/index.ts +3 -0
- package/src/web/chip/manifest.json +186 -0
- package/src/web/dropdown/AI_GUIDE.md +167 -0
- package/src/web/dropdown/dropdown.css +1 -0
- package/src/web/dropdown/dropdown.vue +1257 -0
- package/src/web/dropdown/dropdown.vue.d.ts +381 -0
- package/src/web/dropdown/index.ts +3 -0
- package/src/web/dropdown/manifest.json +576 -0
- package/src/web/flex/AI_GUIDE.md +113 -0
- package/src/web/flex/flex-item.vue +94 -0
- package/src/web/flex/flex-item.vue.d.ts +84 -0
- package/src/web/flex/flex.css +1 -0
- package/src/web/flex/flex.vue +103 -0
- package/src/web/flex/flex.vue.d.ts +92 -0
- package/src/web/flex/index.ts +5 -0
- package/src/web/flex/manifest.json +162 -0
- package/src/web/form/index.ts +7 -0
- package/src/web/grid/AI_GUIDE.md +112 -0
- package/src/web/grid/grid-item.vue +109 -0
- package/src/web/grid/grid-item.vue.d.ts +99 -0
- package/src/web/grid/grid.css +1 -0
- package/src/web/grid/grid.vue +94 -0
- package/src/web/grid/grid.vue.d.ts +84 -0
- package/src/web/grid/index.ts +5 -0
- package/src/web/grid/manifest.json +153 -0
- package/src/web/index.ts +86 -0
- package/src/web/input/AI_GUIDE.md +159 -0
- package/src/web/input/index.ts +3 -0
- package/src/web/input/input.css +1 -0
- package/src/web/input/input.vue +521 -0
- package/src/web/input/input.vue.d.ts +274 -0
- package/src/web/input/manifest.json +465 -0
- package/src/web/input-number/AI_GUIDE.md +164 -0
- package/src/web/input-number/index.ts +3 -0
- package/src/web/input-number/input-number.css +1 -0
- package/src/web/input-number/input-number.vue +1153 -0
- package/src/web/input-number/input-number.vue.d.ts +343 -0
- package/src/web/input-number/manifest.json +575 -0
- package/src/web/modal/AI_GUIDE.md +171 -0
- package/src/web/modal/index.ts +3 -0
- package/src/web/modal/manifest.json +375 -0
- package/src/web/modal/modal.css +1 -0
- package/src/web/modal/modal.vue +344 -0
- package/src/web/modal/modal.vue.d.ts +64 -0
- package/src/web/pagination/AI_GUIDE.md +148 -0
- package/src/web/pagination/index.ts +21 -0
- package/src/web/pagination/manifest.json +432 -0
- package/src/web/pagination/pagination-content.vue +42 -0
- package/src/web/pagination/pagination-content.vue.d.ts +28 -0
- package/src/web/pagination/pagination-ellipsis.vue +55 -0
- package/src/web/pagination/pagination-ellipsis.vue.d.ts +28 -0
- package/src/web/pagination/pagination-first.vue +161 -0
- package/src/web/pagination/pagination-first.vue.d.ts +67 -0
- package/src/web/pagination/pagination-item.vue +42 -0
- package/src/web/pagination/pagination-item.vue.d.ts +28 -0
- package/src/web/pagination/pagination-last.vue +161 -0
- package/src/web/pagination/pagination-last.vue.d.ts +67 -0
- package/src/web/pagination/pagination-link.vue +118 -0
- package/src/web/pagination/pagination-link.vue.d.ts +61 -0
- package/src/web/pagination/pagination-next.vue +160 -0
- package/src/web/pagination/pagination-next.vue.d.ts +68 -0
- package/src/web/pagination/pagination-previous.vue +160 -0
- package/src/web/pagination/pagination-previous.vue.d.ts +68 -0
- package/src/web/pagination/pagination.css +1 -0
- package/src/web/pagination/pagination.vue +730 -0
- package/src/web/pagination/pagination.vue.d.ts +247 -0
- package/src/web/popover/AI_GUIDE.md +163 -0
- package/src/web/popover/index.ts +3 -0
- package/src/web/popover/manifest.json +396 -0
- package/src/web/popover/popover.css +1 -0
- package/src/web/popover/popover.vue +579 -0
- package/src/web/popover/popover.vue.d.ts +83 -0
- package/src/web/radio/AI_GUIDE.md +155 -0
- package/src/web/radio/index.ts +3 -0
- package/src/web/radio/manifest.json +294 -0
- package/src/web/radio/radio.css +1 -0
- package/src/web/radio/radio.vue +288 -0
- package/src/web/radio/radio.vue.d.ts +182 -0
- package/src/web/selectbox/AI_GUIDE.md +216 -0
- package/src/web/selectbox/index.ts +3 -0
- package/src/web/selectbox/manifest.json +477 -0
- package/src/web/selectbox/selectbox.css +1 -0
- package/src/web/selectbox/selectbox.vue +1024 -0
- package/src/web/selectbox/selectbox.vue.d.ts +300 -0
- package/src/web/sonner/AI_GUIDE.md +98 -0
- package/src/web/sonner/index.ts +114 -0
- package/src/web/sonner/manifest.json +132 -0
- package/src/web/sonner/sonner.css +1 -0
- package/src/web/sonner/sonner.vue +180 -0
- package/src/web/sonner/sonner.vue.d.ts +113 -0
- package/src/web/table/AI_GUIDE.md +145 -0
- package/src/web/table/index.ts +34 -0
- package/src/web/table/manifest.json +168 -0
- package/src/web/table/table-body.vue +42 -0
- package/src/web/table/table-body.vue.d.ts +28 -0
- package/src/web/table/table-caption.vue +42 -0
- package/src/web/table/table-caption.vue.d.ts +28 -0
- package/src/web/table/table-cell.vue +71 -0
- package/src/web/table/table-cell.vue.d.ts +49 -0
- package/src/web/table/table-empty.vue +105 -0
- package/src/web/table/table-empty.vue.d.ts +57 -0
- package/src/web/table/table-footer.vue +42 -0
- package/src/web/table/table-footer.vue.d.ts +28 -0
- package/src/web/table/table-head.vue +78 -0
- package/src/web/table/table-head.vue.d.ts +50 -0
- package/src/web/table/table-header.vue +42 -0
- package/src/web/table/table-header.vue.d.ts +28 -0
- package/src/web/table/table-row.vue +70 -0
- package/src/web/table/table-row.vue.d.ts +44 -0
- package/src/web/table/table.css +1 -0
- package/src/web/table/table.vue +298 -0
- package/src/web/table/table.vue.d.ts +119 -0
- package/src/web/tabs/AI_GUIDE.md +150 -0
- package/src/web/tabs/index.ts +2 -0
- package/src/web/tabs/manifest.json +315 -0
- package/src/web/tabs/tabs.css +1 -0
- package/src/web/tabs/tabs.vue +164 -0
- package/src/web/tabs/tabs.vue.d.ts +60 -0
- package/src/web/text/AI_GUIDE.md +129 -0
- package/src/web/text/index.ts +2 -0
- package/src/web/text/manifest.json +195 -0
- package/src/web/text/text.css +1 -0
- package/src/web/text/text.vue +195 -0
- package/src/web/text/text.vue.d.ts +161 -0
- package/src/web/textarea/AI_GUIDE.md +141 -0
- package/src/web/textarea/index.ts +3 -0
- package/src/web/textarea/manifest.json +438 -0
- package/src/web/textarea/textarea.css +1 -0
- package/src/web/textarea/textarea.vue +458 -0
- package/src/web/textarea/textarea.vue.d.ts +265 -0
- package/src/web/tooltip/AI_GUIDE.md +110 -0
- package/src/web/tooltip/index.ts +3 -0
- package/src/web/tooltip/manifest.json +222 -0
- package/src/web/tooltip/tooltip.css +1 -0
- package/src/web/tooltip/tooltip.vue +417 -0
- package/src/web/tooltip/tooltip.vue.d.ts +150 -0
- package/src/webview/bottomsheet/AI_GUIDE.md +141 -0
- package/src/webview/bottomsheet/bottomsheet.css +1 -0
- package/src/webview/bottomsheet/bottomsheet.vue +441 -0
- package/src/webview/bottomsheet/bottomsheet.vue.d.ts +178 -0
- package/src/webview/bottomsheet/index.ts +4 -0
- package/src/webview/bottomsheet/manifest.json +377 -0
- package/src/webview/button/AI_GUIDE.md +79 -0
- package/src/webview/button/button-ios.css +1 -0
- package/src/webview/button/button-ios.vue +138 -0
- package/src/webview/button/button-ios.vue.d.ts +102 -0
- package/src/webview/button/button-material.css +1 -0
- package/src/webview/button/button-material.vue +138 -0
- package/src/webview/button/button-material.vue.d.ts +102 -0
- package/src/webview/button/index.ts +7 -0
- package/src/webview/button/manifest.json +148 -0
- package/src/webview/index.ts +7 -0
- package/tailwind-preset.cjs +62 -0
- package/tailwind-preset.js +62 -0
- package/ttdk-manifest.json +10188 -0
- package/README.md +0 -3
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ttdk-design-system/bottomsheet",
|
|
3
|
+
"component": "BottomSheet",
|
|
4
|
+
"folder": "bottomsheet",
|
|
5
|
+
"description": "BottomSheet — Komponen lembar geser bawah ramah sentuhan (touch-friendly) untuk in-app webview & mobile. Mendukung safe-area-inset perangkat mobile, gesture swipe-down to dismiss, header, footer, dan mode iOS / Material.",
|
|
6
|
+
"stylesheets": [
|
|
7
|
+
{
|
|
8
|
+
"theme": "common",
|
|
9
|
+
"file": "bottomsheet.css",
|
|
10
|
+
"importPath": "webview/bottomsheet/bottomsheet.css"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"props": {},
|
|
14
|
+
"subInterfaces": {
|
|
15
|
+
"BottomSheetProps": {
|
|
16
|
+
"open": {
|
|
17
|
+
"name": "open",
|
|
18
|
+
"type": "boolean",
|
|
19
|
+
"optional": true,
|
|
20
|
+
"default": null,
|
|
21
|
+
"description": "Status visibilitas bottom sheet (mode controlled). Mendukung `v-model:open` / `v-model` pada Vue dan controlled prop `open` pada React.",
|
|
22
|
+
"example": null,
|
|
23
|
+
"param": null
|
|
24
|
+
},
|
|
25
|
+
"defaultOpen": {
|
|
26
|
+
"name": "defaultOpen",
|
|
27
|
+
"type": "boolean",
|
|
28
|
+
"optional": true,
|
|
29
|
+
"default": "false",
|
|
30
|
+
"description": "Status visibilitas awal bottom sheet saat pertama kali dimuat (uncontrolled initial state).",
|
|
31
|
+
"example": null,
|
|
32
|
+
"param": null
|
|
33
|
+
},
|
|
34
|
+
"title": {
|
|
35
|
+
"name": "title",
|
|
36
|
+
"type": "string",
|
|
37
|
+
"optional": true,
|
|
38
|
+
"default": null,
|
|
39
|
+
"description": "Judul teks di bagian header bottom sheet.",
|
|
40
|
+
"example": null,
|
|
41
|
+
"param": null
|
|
42
|
+
},
|
|
43
|
+
"description": {
|
|
44
|
+
"name": "description",
|
|
45
|
+
"type": "string",
|
|
46
|
+
"optional": true,
|
|
47
|
+
"default": null,
|
|
48
|
+
"description": "Deskripsi penjelasan di bagian header di bawah judul.",
|
|
49
|
+
"example": null,
|
|
50
|
+
"param": null
|
|
51
|
+
},
|
|
52
|
+
"height": {
|
|
53
|
+
"name": "height",
|
|
54
|
+
"type": "BottomSheetHeight",
|
|
55
|
+
"optional": true,
|
|
56
|
+
"default": "auto",
|
|
57
|
+
"description": "Skala ukuran tinggi bottom sheet: - `'auto'`: Menyesuaikan tinggi isi konten (maksimal 90vh). - `'sm'`: Lembar ringkas (~35% tinggi layar). - `'md'`: Lembar proporsional standar (~55% tinggi layar). - `'lg'`: Lembar luas (~85% tinggi layar). - `'full'`: Tampilan penuh (100% tinggi layar).",
|
|
58
|
+
"example": null,
|
|
59
|
+
"param": null
|
|
60
|
+
},
|
|
61
|
+
"maxHeight": {
|
|
62
|
+
"name": "maxHeight",
|
|
63
|
+
"type": "string",
|
|
64
|
+
"optional": true,
|
|
65
|
+
"default": null,
|
|
66
|
+
"description": "Batas tinggi maksimum lembar sheet (contoh: '90vh', '600px').",
|
|
67
|
+
"example": null,
|
|
68
|
+
"param": null
|
|
69
|
+
},
|
|
70
|
+
"mode": {
|
|
71
|
+
"name": "mode",
|
|
72
|
+
"type": "BottomSheetMode",
|
|
73
|
+
"optional": true,
|
|
74
|
+
"default": "auto",
|
|
75
|
+
"description": "Cita rasa / gaya platform mobile: - `'auto'`: Desain netral adaptif khas TTDK Design System. - `'ios'`: Cita rasa Apple Human Interface (frosted glass, sudut kurva halus 20px). - `'material'`: Cita rasa Material Design 3 (sudut 28px, elevated shadow).",
|
|
76
|
+
"example": null,
|
|
77
|
+
"param": null
|
|
78
|
+
},
|
|
79
|
+
"handle": {
|
|
80
|
+
"name": "handle",
|
|
81
|
+
"type": "boolean",
|
|
82
|
+
"optional": true,
|
|
83
|
+
"default": "true",
|
|
84
|
+
"description": "Menampilkan bilah pegangan geser (drag handle indicator) di bagian atas lembar.",
|
|
85
|
+
"example": null,
|
|
86
|
+
"param": null
|
|
87
|
+
},
|
|
88
|
+
"swipeable": {
|
|
89
|
+
"name": "swipeable",
|
|
90
|
+
"type": "boolean",
|
|
91
|
+
"optional": true,
|
|
92
|
+
"default": "true",
|
|
93
|
+
"description": "Mengaktifkan gestur sentuh geser ke bawah (swipe-down) untuk menutup lembar.",
|
|
94
|
+
"example": null,
|
|
95
|
+
"param": null
|
|
96
|
+
},
|
|
97
|
+
"close": {
|
|
98
|
+
"name": "close",
|
|
99
|
+
"type": "boolean",
|
|
100
|
+
"optional": true,
|
|
101
|
+
"default": "false",
|
|
102
|
+
"description": "Menampilkan tombol tutup 'X' di pojok kanan atas header.",
|
|
103
|
+
"example": null,
|
|
104
|
+
"param": null
|
|
105
|
+
},
|
|
106
|
+
"closeIcon": {
|
|
107
|
+
"name": "closeIcon",
|
|
108
|
+
"type": "any",
|
|
109
|
+
"optional": true,
|
|
110
|
+
"default": null,
|
|
111
|
+
"description": "Ikon kustom untuk tombol tutup.",
|
|
112
|
+
"example": null,
|
|
113
|
+
"param": null
|
|
114
|
+
},
|
|
115
|
+
"dismissible": {
|
|
116
|
+
"name": "dismissible",
|
|
117
|
+
"type": "boolean",
|
|
118
|
+
"optional": true,
|
|
119
|
+
"default": "true",
|
|
120
|
+
"description": "Mengizinkan lembar ditutup saat pengguna mengeklik backdrop overlay atau menekan tombol Escape.",
|
|
121
|
+
"example": null,
|
|
122
|
+
"param": null
|
|
123
|
+
},
|
|
124
|
+
"preventClose": {
|
|
125
|
+
"name": "preventClose",
|
|
126
|
+
"type": "boolean",
|
|
127
|
+
"optional": true,
|
|
128
|
+
"default": "false",
|
|
129
|
+
"description": "Mencegah lembar ditutup saat klik di luar atau saat digeser (prevent close). Jika bernilai `true`, lembar hanya dapat ditutup via aksi eksplisit.",
|
|
130
|
+
"example": null,
|
|
131
|
+
"param": null
|
|
132
|
+
},
|
|
133
|
+
"overlay": {
|
|
134
|
+
"name": "overlay",
|
|
135
|
+
"type": "boolean",
|
|
136
|
+
"optional": true,
|
|
137
|
+
"default": "true",
|
|
138
|
+
"description": "Menampilkan lapisan latar belakang redup (backdrop overlay).",
|
|
139
|
+
"example": null,
|
|
140
|
+
"param": null
|
|
141
|
+
},
|
|
142
|
+
"preventScroll": {
|
|
143
|
+
"name": "preventScroll",
|
|
144
|
+
"type": "boolean",
|
|
145
|
+
"optional": true,
|
|
146
|
+
"default": "true",
|
|
147
|
+
"description": "Mengunci scrolling pada halaman web di latar belakang saat lembar terbuka (body scroll lock).",
|
|
148
|
+
"example": null,
|
|
149
|
+
"param": null
|
|
150
|
+
},
|
|
151
|
+
"header": {
|
|
152
|
+
"name": "header",
|
|
153
|
+
"type": "any",
|
|
154
|
+
"optional": true,
|
|
155
|
+
"default": null,
|
|
156
|
+
"description": "Konten kustom untuk bagian header lembar.",
|
|
157
|
+
"example": null,
|
|
158
|
+
"param": null
|
|
159
|
+
},
|
|
160
|
+
"body": {
|
|
161
|
+
"name": "body",
|
|
162
|
+
"type": "any",
|
|
163
|
+
"optional": true,
|
|
164
|
+
"default": null,
|
|
165
|
+
"description": "Konten kustom untuk bagian isi utama (body) lembar.",
|
|
166
|
+
"example": null,
|
|
167
|
+
"param": null
|
|
168
|
+
},
|
|
169
|
+
"footer": {
|
|
170
|
+
"name": "footer",
|
|
171
|
+
"type": "any",
|
|
172
|
+
"optional": true,
|
|
173
|
+
"default": null,
|
|
174
|
+
"description": "Konten kustom untuk bagian footer aksi di bawah lembar (misal: tombol konfirmasi / CTA).",
|
|
175
|
+
"example": null,
|
|
176
|
+
"param": null
|
|
177
|
+
},
|
|
178
|
+
"content": {
|
|
179
|
+
"name": "content",
|
|
180
|
+
"type": "any",
|
|
181
|
+
"optional": true,
|
|
182
|
+
"default": null,
|
|
183
|
+
"description": "Penggantian seluruh konten lembar (mengabaikan layout header, body, footer bawaan).",
|
|
184
|
+
"example": null,
|
|
185
|
+
"param": null
|
|
186
|
+
},
|
|
187
|
+
"children": {
|
|
188
|
+
"name": "children",
|
|
189
|
+
"type": "any",
|
|
190
|
+
"optional": true,
|
|
191
|
+
"default": null,
|
|
192
|
+
"description": "Konten utama lembar bottom sheet (body content).",
|
|
193
|
+
"example": null,
|
|
194
|
+
"param": null
|
|
195
|
+
},
|
|
196
|
+
"onOpenChange": {
|
|
197
|
+
"name": "onOpenChange",
|
|
198
|
+
"type": "(open: boolean) => void",
|
|
199
|
+
"optional": true,
|
|
200
|
+
"default": null,
|
|
201
|
+
"description": "Callback event saat status terbuka/tertutup berubah (standar React).",
|
|
202
|
+
"example": null,
|
|
203
|
+
"param": null
|
|
204
|
+
},
|
|
205
|
+
"onUpdateOpen": {
|
|
206
|
+
"name": "onUpdateOpen",
|
|
207
|
+
"type": "(open: boolean) => void",
|
|
208
|
+
"optional": true,
|
|
209
|
+
"default": null,
|
|
210
|
+
"description": "Callback event saat status terbuka/tertutup berubah untuk two-way binding `v-model:open` (Vue).",
|
|
211
|
+
"example": null,
|
|
212
|
+
"param": null
|
|
213
|
+
},
|
|
214
|
+
"onOpen": {
|
|
215
|
+
"name": "onOpen",
|
|
216
|
+
"type": "() => void",
|
|
217
|
+
"optional": true,
|
|
218
|
+
"default": null,
|
|
219
|
+
"description": "Callback event saat lembar bottom sheet terbuka.",
|
|
220
|
+
"example": null,
|
|
221
|
+
"param": null
|
|
222
|
+
},
|
|
223
|
+
"onClose": {
|
|
224
|
+
"name": "onClose",
|
|
225
|
+
"type": "() => void",
|
|
226
|
+
"optional": true,
|
|
227
|
+
"default": null,
|
|
228
|
+
"description": "Callback event saat lembar bottom sheet ditutup.",
|
|
229
|
+
"example": null,
|
|
230
|
+
"param": null
|
|
231
|
+
},
|
|
232
|
+
"onClosePrevent": {
|
|
233
|
+
"name": "onClosePrevent",
|
|
234
|
+
"type": "() => void",
|
|
235
|
+
"optional": true,
|
|
236
|
+
"default": null,
|
|
237
|
+
"description": "Callback event saat pengguna mencoba menutup lembar tetapi dicegah karena `preventClose={true}`.",
|
|
238
|
+
"example": null,
|
|
239
|
+
"param": null
|
|
240
|
+
},
|
|
241
|
+
"ui": {
|
|
242
|
+
"name": "ui",
|
|
243
|
+
"type": "BottomSheetUiProps",
|
|
244
|
+
"optional": true,
|
|
245
|
+
"default": null,
|
|
246
|
+
"description": "Kustomisasi visual granular pada elemen root melalui style-like object.",
|
|
247
|
+
"example": null,
|
|
248
|
+
"param": null
|
|
249
|
+
},
|
|
250
|
+
"className": {
|
|
251
|
+
"name": "className",
|
|
252
|
+
"type": "string",
|
|
253
|
+
"optional": true,
|
|
254
|
+
"default": null,
|
|
255
|
+
"description": "",
|
|
256
|
+
"example": null,
|
|
257
|
+
"param": null
|
|
258
|
+
},
|
|
259
|
+
"overlayClass": {
|
|
260
|
+
"name": "overlayClass",
|
|
261
|
+
"type": "string",
|
|
262
|
+
"optional": true,
|
|
263
|
+
"default": null,
|
|
264
|
+
"description": "",
|
|
265
|
+
"example": null,
|
|
266
|
+
"param": null
|
|
267
|
+
},
|
|
268
|
+
"overlayStyle": {
|
|
269
|
+
"name": "overlayStyle",
|
|
270
|
+
"type": "any",
|
|
271
|
+
"optional": true,
|
|
272
|
+
"default": null,
|
|
273
|
+
"description": "",
|
|
274
|
+
"example": null,
|
|
275
|
+
"param": null
|
|
276
|
+
},
|
|
277
|
+
"contentClass": {
|
|
278
|
+
"name": "contentClass",
|
|
279
|
+
"type": "string",
|
|
280
|
+
"optional": true,
|
|
281
|
+
"default": null,
|
|
282
|
+
"description": "",
|
|
283
|
+
"example": null,
|
|
284
|
+
"param": null
|
|
285
|
+
},
|
|
286
|
+
"contentStyle": {
|
|
287
|
+
"name": "contentStyle",
|
|
288
|
+
"type": "any",
|
|
289
|
+
"optional": true,
|
|
290
|
+
"default": null,
|
|
291
|
+
"description": "",
|
|
292
|
+
"example": null,
|
|
293
|
+
"param": null
|
|
294
|
+
},
|
|
295
|
+
"headerClass": {
|
|
296
|
+
"name": "headerClass",
|
|
297
|
+
"type": "string",
|
|
298
|
+
"optional": true,
|
|
299
|
+
"default": null,
|
|
300
|
+
"description": "",
|
|
301
|
+
"example": null,
|
|
302
|
+
"param": null
|
|
303
|
+
},
|
|
304
|
+
"headerStyle": {
|
|
305
|
+
"name": "headerStyle",
|
|
306
|
+
"type": "any",
|
|
307
|
+
"optional": true,
|
|
308
|
+
"default": null,
|
|
309
|
+
"description": "",
|
|
310
|
+
"example": null,
|
|
311
|
+
"param": null
|
|
312
|
+
},
|
|
313
|
+
"bodyClass": {
|
|
314
|
+
"name": "bodyClass",
|
|
315
|
+
"type": "string",
|
|
316
|
+
"optional": true,
|
|
317
|
+
"default": null,
|
|
318
|
+
"description": "",
|
|
319
|
+
"example": null,
|
|
320
|
+
"param": null
|
|
321
|
+
},
|
|
322
|
+
"bodyStyle": {
|
|
323
|
+
"name": "bodyStyle",
|
|
324
|
+
"type": "any",
|
|
325
|
+
"optional": true,
|
|
326
|
+
"default": null,
|
|
327
|
+
"description": "",
|
|
328
|
+
"example": null,
|
|
329
|
+
"param": null
|
|
330
|
+
},
|
|
331
|
+
"footerClass": {
|
|
332
|
+
"name": "footerClass",
|
|
333
|
+
"type": "string",
|
|
334
|
+
"optional": true,
|
|
335
|
+
"default": null,
|
|
336
|
+
"description": "",
|
|
337
|
+
"example": null,
|
|
338
|
+
"param": null
|
|
339
|
+
},
|
|
340
|
+
"footerStyle": {
|
|
341
|
+
"name": "footerStyle",
|
|
342
|
+
"type": "any",
|
|
343
|
+
"optional": true,
|
|
344
|
+
"default": null,
|
|
345
|
+
"description": "",
|
|
346
|
+
"example": null,
|
|
347
|
+
"param": null
|
|
348
|
+
},
|
|
349
|
+
"handleClass": {
|
|
350
|
+
"name": "handleClass",
|
|
351
|
+
"type": "string",
|
|
352
|
+
"optional": true,
|
|
353
|
+
"default": null,
|
|
354
|
+
"description": "",
|
|
355
|
+
"example": null,
|
|
356
|
+
"param": null
|
|
357
|
+
},
|
|
358
|
+
"handleStyle": {
|
|
359
|
+
"name": "handleStyle",
|
|
360
|
+
"type": "any",
|
|
361
|
+
"optional": true,
|
|
362
|
+
"default": null,
|
|
363
|
+
"description": "",
|
|
364
|
+
"example": null,
|
|
365
|
+
"param": null
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
},
|
|
369
|
+
"supportedFrameworks": [
|
|
370
|
+
"react",
|
|
371
|
+
"vue",
|
|
372
|
+
"svelte"
|
|
373
|
+
],
|
|
374
|
+
"themes": [
|
|
375
|
+
"tw"
|
|
376
|
+
]
|
|
377
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# <ButtonMaterial /> — TTDK Component Reference
|
|
2
|
+
|
|
3
|
+
TTDK ButtonMaterial 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>/webview/button/button-ios.css";`
|
|
8
|
+
- **COMMON Theme**: `import "@ttdk-design-system/library-<react|vue|svelte>/webview/button/button-material.css";`
|
|
9
|
+
|
|
10
|
+
## 2. Subpath Component Import
|
|
11
|
+
```ts
|
|
12
|
+
// React
|
|
13
|
+
import ButtonMaterial from "@ttdk-design-system/library-react/webview/button";
|
|
14
|
+
|
|
15
|
+
// Vue 3
|
|
16
|
+
import ButtonMaterial from "@ttdk-design-system/library-vue/webview/button";
|
|
17
|
+
|
|
18
|
+
// Svelte
|
|
19
|
+
import ButtonMaterial from "@ttdk-design-system/library-svelte/webview/button";
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## 3. Props & API Reference
|
|
23
|
+
|
|
24
|
+
| Prop | Type | Default | Description |
|
|
25
|
+
| :--- | :--- | :--- | :--- |
|
|
26
|
+
|
|
27
|
+
### Sub-interface: `ButtonMaterialProps`
|
|
28
|
+
|
|
29
|
+
| Field | Type | Default | Description |
|
|
30
|
+
| :--- | :--- | :--- | :--- |
|
|
31
|
+
| `style?` | `any` | `-` | Inline CSS style kustom. |
|
|
32
|
+
| `variant?` | `'filled' | 'elevated' | 'tonal' | 'outlined' | 'text'` | `filled` | 5 Tipe tombol resmi Material Design 3 (M3): - `'filled'`: Tombol kontainer warna primer pekat (high emphasis, default). - `'elevated'`: Tombol berlatar surface dengan bayangan elevasi level 1. - `'tonal'`: Tombol warna kontainer sekunder (medium-high emphasis). - `'outlined'`: Tombol bergaris tepi 1px dengan latar transparan. - `'text'`: Tombol teks tanpa latar dan border (low emphasis). |
|
|
33
|
+
| `color?` | `'primary' | 'secondary' | 'tertiary' | 'error'` | `primary` | Skema peran warna Material 3: - `'primary'`: Warna tema primer (M3 Primary). - `'secondary'`: Warna tema sekunder (M3 Secondary). - `'tertiary'`: Warna tema tersier (M3 Tertiary). - `'error'`: Warna peringatan / bahaya (M3 Error). |
|
|
34
|
+
| `size?` | `'sm' | 'md' | 'lg'` | `md` | Skala ukuran tombol M3: - `'sm'`: 32px (compact) - `'md'`: 40px (standar M3 spec) - `'lg'`: 48px (large touch target) |
|
|
35
|
+
| `shape?` | `'pill' | 'rounded'` | `pill` | Bentuk sudut kontainer: - `'pill'`: Full rounded pill khas Material 3 (border-radius: 9999px). - `'rounded'`: Sudut membulat medium (~12px). |
|
|
36
|
+
| `type?` | `'button' | 'submit' | 'reset'` | `button` | Tipe tombol HTML native. |
|
|
37
|
+
| `disabled?` | `boolean` | `false` | Kondisi non-aktif tombol. |
|
|
38
|
+
| `loading?` | `boolean` | `false` | Menampilkan spinner loading M3. |
|
|
39
|
+
| `block?` | `boolean` | `false` | Lebar penuh 100% mengikuti kontainer induk. |
|
|
40
|
+
| `id?` | `string` | `-` | ID unik elemen HTML. |
|
|
41
|
+
| `ui?` | `ButtonMaterialUiProps` | `-` | Konfigurasi styling kustom UI. |
|
|
42
|
+
| `onClick?` | `(event: any) => void` | `-` | Callback saat tombol ditekan / diklik. |
|
|
43
|
+
| `children?` | `any` | `-` | Konten label / elemen di dalam tombol. |
|
|
44
|
+
|
|
45
|
+
## 4. Usage Examples
|
|
46
|
+
|
|
47
|
+
### React Example
|
|
48
|
+
```tsx
|
|
49
|
+
import ButtonMaterial from "@ttdk-design-system/library-react/webview/button";
|
|
50
|
+
import "@ttdk-design-system/library-react/webview/button/button.css";
|
|
51
|
+
|
|
52
|
+
export function Example() {
|
|
53
|
+
return (
|
|
54
|
+
<ButtonMaterial />
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Vue 3 Example
|
|
60
|
+
```vue
|
|
61
|
+
<script setup lang="ts">
|
|
62
|
+
import ButtonMaterial from "@ttdk-design-system/library-vue/webview/button";
|
|
63
|
+
import "@ttdk-design-system/library-vue/webview/button/button.css";
|
|
64
|
+
</script>
|
|
65
|
+
|
|
66
|
+
<template>
|
|
67
|
+
<ButtonMaterial />
|
|
68
|
+
</template>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Svelte Example
|
|
72
|
+
```svelte
|
|
73
|
+
<script lang="ts">
|
|
74
|
+
import ButtonMaterial from "@ttdk-design-system/library-svelte/webview/button";
|
|
75
|
+
import "@ttdk-design-system/library-svelte/webview/button/button.css";
|
|
76
|
+
</script>
|
|
77
|
+
|
|
78
|
+
<ButtonMaterial />
|
|
79
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ttdk-btn-ios{box-sizing:border-box;text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;letter-spacing:-.015em;border:none;outline:none;justify-content:center;align-items:center;font-family:-apple-system,BlinkMacSystemFont,SF Pro Text,SF Pro Display,Helvetica Neue,sans-serif;font-weight:600;line-height:1.2;text-decoration:none;transition:opacity .15s cubic-bezier(.25,1,.5,1),transform .15s cubic-bezier(.25,1,.5,1),background-color .15s;display:inline-flex;position:relative}.ttdk-btn-ios:after{content:"";pointer-events:none;width:100%;min-width:44px;height:100%;min-height:44px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.ttdk-btn-ios:active:not(:disabled):not(.ttdk-btn-ios--loading){opacity:.62;transform:scale(.975)}.ttdk-btn-ios--block{width:100%;display:flex}.ttdk-btn-ios--sm{border-radius:8px;gap:6px;height:30px;padding:0 12px;font-size:13px}.ttdk-btn-ios--md{border-radius:12px;gap:8px;height:42px;padding:0 18px;font-size:15px}.ttdk-btn-ios--lg{border-radius:14px;gap:10px;height:50px;padding:0 24px;font-size:17px}.ttdk-btn-ios--capsule{border-radius:9999px!important}.ttdk-btn-ios--filled.ttdk-btn-ios--primary{background-color:var(--ttdk-ios-primary,#007aff);color:#fff}.ttdk-btn-ios--filled.ttdk-btn-ios--success{background-color:var(--ttdk-ios-success,#34c759);color:#fff}.ttdk-btn-ios--filled.ttdk-btn-ios--warning{background-color:var(--ttdk-ios-warning,#ff9500);color:#fff}.ttdk-btn-ios--filled.ttdk-btn-ios--danger{background-color:var(--ttdk-ios-danger,#ff3b30);color:#fff}.ttdk-btn-ios--filled.ttdk-btn-ios--neutral{background-color:var(--ttdk-ios-neutral,#8e8e93);color:#fff}.ttdk-btn-ios--tinted.ttdk-btn-ios--primary{color:#007aff;background-color:#007aff26}.ttdk-btn-ios--tinted.ttdk-btn-ios--success{color:#34c759;background-color:#34c75926}.ttdk-btn-ios--tinted.ttdk-btn-ios--warning{color:#ff9500;background-color:#ff950026}.ttdk-btn-ios--tinted.ttdk-btn-ios--danger{color:#ff3b30;background-color:#ff3b3026}.ttdk-btn-ios--tinted.ttdk-btn-ios--neutral{color:#636366;background-color:#8e8e9326}.ttdk-btn-ios--gray{color:#000;background-color:#78788029}.ttdk-btn-ios--gray.ttdk-btn-ios--primary{color:#007aff}.ttdk-btn-ios--gray.ttdk-btn-ios--success{color:#34c759}.ttdk-btn-ios--gray.ttdk-btn-ios--warning{color:#ff9500}.ttdk-btn-ios--gray.ttdk-btn-ios--danger{color:#ff3b30}.ttdk-btn-ios--plain{background-color:#0000;padding-left:4px;padding-right:4px}.ttdk-btn-ios--plain.ttdk-btn-ios--primary{color:#007aff}.ttdk-btn-ios--plain.ttdk-btn-ios--success{color:#34c759}.ttdk-btn-ios--plain.ttdk-btn-ios--warning{color:#ff9500}.ttdk-btn-ios--plain.ttdk-btn-ios--danger{color:#ff3b30}.ttdk-btn-ios--plain.ttdk-btn-ios--neutral{color:#8e8e93}.ttdk-btn-ios--plain:active:not(:disabled){opacity:.4;transform:none}.ttdk-btn-ios:disabled,.ttdk-btn-ios--disabled{opacity:.38!important;cursor:not-allowed!important;pointer-events:none!important;transform:none!important}.ttdk-btn-ios--loading{cursor:wait}.ttdk-btn-ios__spinner{border:2px solid;border-right-color:#0000;border-radius:50%;width:1.1em;height:1.1em;animation:.8s linear infinite ttdk-ios-spin;display:inline-block}@keyframes ttdk-ios-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<button
|
|
3
|
+
:id="id"
|
|
4
|
+
:type="type || 'button'"
|
|
5
|
+
:disabled="disabled || loading"
|
|
6
|
+
:class="
|
|
7
|
+
'ttdk-btn-ios' +
|
|
8
|
+
' ttdk-btn-ios--' +
|
|
9
|
+
(variant || 'filled') +
|
|
10
|
+
' ttdk-btn-ios--' +
|
|
11
|
+
(color || 'primary') +
|
|
12
|
+
' ttdk-btn-ios--' +
|
|
13
|
+
(size || 'md') +
|
|
14
|
+
(shape === 'capsule' ? ' ttdk-btn-ios--capsule' : '') +
|
|
15
|
+
(block ? ' ttdk-btn-ios--block' : '') +
|
|
16
|
+
(loading ? ' ttdk-btn-ios--loading' : '') +
|
|
17
|
+
(disabled ? ' ttdk-btn-ios--disabled' : '') +
|
|
18
|
+
(ui?.class ? ' ' + ui.class : '')
|
|
19
|
+
"
|
|
20
|
+
:style="{
|
|
21
|
+
...buildUiVars(ui?.style),
|
|
22
|
+
...(typeof style === 'object' ? style : {}),
|
|
23
|
+
}"
|
|
24
|
+
@click="
|
|
25
|
+
async (e) => {
|
|
26
|
+
if (!disabled && !loading && onClick) {
|
|
27
|
+
onClick(e);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
"
|
|
31
|
+
>
|
|
32
|
+
<template v-if="loading">
|
|
33
|
+
<span class="ttdk-btn-ios__spinner" aria-hidden="true"></span>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<slot />
|
|
37
|
+
</button>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script setup lang="ts">
|
|
41
|
+
import { buildUiVars, UiProps } from "../../core/types";
|
|
42
|
+
|
|
43
|
+
export type ButtonIosUiProps = UiProps;
|
|
44
|
+
export interface ButtonIosProps {
|
|
45
|
+
/**
|
|
46
|
+
* Inline CSS style kustom.
|
|
47
|
+
*/
|
|
48
|
+
style?: any;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Gaya varian tombol berdasarkan Apple Human Interface Guidelines:
|
|
52
|
+
* - `'filled'`: Tombol solid high-emphasis / prominent (default).
|
|
53
|
+
* - `'tinted'`: Tombol berlatar belakang transparan lembut dengan aksen warna.
|
|
54
|
+
* - `'gray'`: Tombol berlatar belakang abu-abu netral khas Apple (systemGray).
|
|
55
|
+
* - `'plain'`: Tombol teks tanpa latar dan border (link style).
|
|
56
|
+
*
|
|
57
|
+
* @default 'filled'
|
|
58
|
+
*/
|
|
59
|
+
variant?: "filled" | "tinted" | "gray" | "plain";
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Warna aksen semantik iOS:
|
|
63
|
+
* - `'primary'`: iOS System Blue (#007aff).
|
|
64
|
+
* - `'success'`: iOS System Green (#34c759).
|
|
65
|
+
* - `'warning'`: iOS System Orange (#ff9500).
|
|
66
|
+
* - `'danger'`: iOS System Red (#ff3b30).
|
|
67
|
+
* - `'neutral'`: iOS System Gray (#8e8e93).
|
|
68
|
+
*
|
|
69
|
+
* @default 'primary'
|
|
70
|
+
*/
|
|
71
|
+
color?: "primary" | "success" | "warning" | "danger" | "neutral";
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Skala ukuran tombol:
|
|
75
|
+
* - `'sm'`: 30px (compact)
|
|
76
|
+
* - `'md'`: 42px (standar iOS touch target)
|
|
77
|
+
* - `'lg'`: 50px (large CTA)
|
|
78
|
+
*
|
|
79
|
+
* @default 'md'
|
|
80
|
+
*/
|
|
81
|
+
size?: "sm" | "md" | "lg";
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Bentuk sudut tombol:
|
|
85
|
+
* - `'rounded'`: Continuous curve squircle khas iOS (~10-14px).
|
|
86
|
+
* - `'capsule'`: Full pill / capsule (border-radius: 9999px).
|
|
87
|
+
*
|
|
88
|
+
* @default 'rounded'
|
|
89
|
+
*/
|
|
90
|
+
shape?: "rounded" | "capsule";
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Tipe tombol HTML native.
|
|
94
|
+
* @default 'button'
|
|
95
|
+
*/
|
|
96
|
+
type?: "button" | "submit" | "reset";
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Kondisi non-aktif tombol.
|
|
100
|
+
* @default false
|
|
101
|
+
*/
|
|
102
|
+
disabled?: boolean;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Menampilkan iOS activity indicator / spinner.
|
|
106
|
+
* @default false
|
|
107
|
+
*/
|
|
108
|
+
loading?: boolean;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Lebar penuh 100% mengikuti kontainer induk.
|
|
112
|
+
* @default false
|
|
113
|
+
*/
|
|
114
|
+
block?: boolean;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* ID unik elemen HTML.
|
|
118
|
+
*/
|
|
119
|
+
id?: string;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Konfigurasi styling kustom UI.
|
|
123
|
+
*/
|
|
124
|
+
ui?: ButtonIosUiProps;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Callback saat tombol ditekan / diklik.
|
|
128
|
+
*/
|
|
129
|
+
onClick?: (event: any) => void;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Konten label / elemen di dalam tombol.
|
|
133
|
+
*/
|
|
134
|
+
children?: any;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const props = defineProps<ButtonIosProps>();
|
|
138
|
+
</script>
|