@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,177 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ttdk-design-system/button",
|
|
3
|
+
"component": "Button",
|
|
4
|
+
"folder": "button",
|
|
5
|
+
"description": "TTDK Button component with multi-theme support.",
|
|
6
|
+
"stylesheets": [
|
|
7
|
+
{
|
|
8
|
+
"theme": "common",
|
|
9
|
+
"file": "button.css",
|
|
10
|
+
"importPath": "web/button/button.css"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"props": {
|
|
14
|
+
"style": {
|
|
15
|
+
"name": "style",
|
|
16
|
+
"type": "any",
|
|
17
|
+
"optional": true,
|
|
18
|
+
"default": null,
|
|
19
|
+
"description": "Inline CSS style kustom.",
|
|
20
|
+
"example": null,
|
|
21
|
+
"param": null
|
|
22
|
+
},
|
|
23
|
+
"variant": {
|
|
24
|
+
"name": "variant",
|
|
25
|
+
"type": "| 'primary'\n | 'info'\n | 'warning'\n | 'danger'\n | 'neutral'\n | 'disabled'",
|
|
26
|
+
"optional": true,
|
|
27
|
+
"default": "primary",
|
|
28
|
+
"description": "Varian warna semantik tombol: - `'primary'`: Teal utama. - `'info'`: Biru informasi. - `'warning'`: Kuning peringatan. - `'danger'`: Merah bahaya. - `'neutral'`: Abu-abu netral. - `'disabled'`: Tombol non-aktif.",
|
|
29
|
+
"example": null,
|
|
30
|
+
"param": null
|
|
31
|
+
},
|
|
32
|
+
"appearance": {
|
|
33
|
+
"name": "appearance",
|
|
34
|
+
"type": "'solid' | 'soft' | 'outline' | 'link' | 'ghost'",
|
|
35
|
+
"optional": true,
|
|
36
|
+
"default": "solid",
|
|
37
|
+
"description": "Gaya tampilan visual tombol: - `'solid'`: Latar belakang warna solid pekat (default). - `'soft'`: Latar belakang warna transparan lembut. - `'outline'`: Garis tepi dengan latar belakang transparan. - `'link'`: Teks tautan tanpa border/latar, dengan garis bawah saat hover. - `'ghost'`: Transparan tanpa outline/border, dengan latar lembut saat hover.",
|
|
38
|
+
"example": null,
|
|
39
|
+
"param": null
|
|
40
|
+
},
|
|
41
|
+
"type": {
|
|
42
|
+
"name": "type",
|
|
43
|
+
"type": "'button' | 'submit' | 'reset'",
|
|
44
|
+
"optional": true,
|
|
45
|
+
"default": "button",
|
|
46
|
+
"description": "Tipe tombol HTML native.",
|
|
47
|
+
"example": null,
|
|
48
|
+
"param": null
|
|
49
|
+
},
|
|
50
|
+
"size": {
|
|
51
|
+
"name": "size",
|
|
52
|
+
"type": "'sm' | 'md' | 'lg'",
|
|
53
|
+
"optional": true,
|
|
54
|
+
"default": "md",
|
|
55
|
+
"description": "Skala ukuran tombol: - `'sm'`: 36px - `'md'`: 48px (standar) - `'lg'`: 56px",
|
|
56
|
+
"example": null,
|
|
57
|
+
"param": null
|
|
58
|
+
},
|
|
59
|
+
"negative": {
|
|
60
|
+
"name": "negative",
|
|
61
|
+
"type": "boolean",
|
|
62
|
+
"optional": true,
|
|
63
|
+
"default": "false",
|
|
64
|
+
"description": "Mode negatif — kontras tinggi di atas latar gelap.",
|
|
65
|
+
"example": null,
|
|
66
|
+
"param": null
|
|
67
|
+
},
|
|
68
|
+
"rounded": {
|
|
69
|
+
"name": "rounded",
|
|
70
|
+
"type": "'none' | 'sm' | 'md' | 'lg' | 'full'",
|
|
71
|
+
"optional": true,
|
|
72
|
+
"default": "md",
|
|
73
|
+
"description": "Radius sudut tombol. - `'none'`: 0px - `'sm'`: 4px - `'md'`: 8px (standar) - `'lg'`: 12px - `'full'`: 9999px (pill)",
|
|
74
|
+
"example": null,
|
|
75
|
+
"param": null
|
|
76
|
+
},
|
|
77
|
+
"iconOnly": {
|
|
78
|
+
"name": "iconOnly",
|
|
79
|
+
"type": "boolean",
|
|
80
|
+
"optional": true,
|
|
81
|
+
"default": "false",
|
|
82
|
+
"description": "Mode tombol ikon persegi (aspek rasio 1:1).",
|
|
83
|
+
"example": null,
|
|
84
|
+
"param": null
|
|
85
|
+
},
|
|
86
|
+
"block": {
|
|
87
|
+
"name": "block",
|
|
88
|
+
"type": "boolean",
|
|
89
|
+
"optional": true,
|
|
90
|
+
"default": "false",
|
|
91
|
+
"description": "Full-width — melebar 100% dari container.",
|
|
92
|
+
"example": null,
|
|
93
|
+
"param": null
|
|
94
|
+
},
|
|
95
|
+
"loading": {
|
|
96
|
+
"name": "loading",
|
|
97
|
+
"type": "boolean",
|
|
98
|
+
"optional": true,
|
|
99
|
+
"default": "false",
|
|
100
|
+
"description": "Tampilkan spinner & nonaktifkan tombol saat proses async.",
|
|
101
|
+
"example": null,
|
|
102
|
+
"param": null
|
|
103
|
+
},
|
|
104
|
+
"disabled": {
|
|
105
|
+
"name": "disabled",
|
|
106
|
+
"type": "boolean",
|
|
107
|
+
"optional": true,
|
|
108
|
+
"default": "false",
|
|
109
|
+
"description": "Nonaktifkan tombol dari interaksi pengguna.",
|
|
110
|
+
"example": null,
|
|
111
|
+
"param": null
|
|
112
|
+
},
|
|
113
|
+
"iconColor": {
|
|
114
|
+
"name": "iconColor",
|
|
115
|
+
"type": "string",
|
|
116
|
+
"optional": true,
|
|
117
|
+
"default": null,
|
|
118
|
+
"description": "Warna kustom untuk ikon di dalam tombol (misal: '#fff', '#0968F6').",
|
|
119
|
+
"example": null,
|
|
120
|
+
"param": null
|
|
121
|
+
},
|
|
122
|
+
"iconSize": {
|
|
123
|
+
"name": "iconSize",
|
|
124
|
+
"type": "string",
|
|
125
|
+
"optional": true,
|
|
126
|
+
"default": null,
|
|
127
|
+
"description": "Ukuran kustom untuk ikon di dalam tombol (misal: '16px', '20px').",
|
|
128
|
+
"example": null,
|
|
129
|
+
"param": null
|
|
130
|
+
},
|
|
131
|
+
"ui": {
|
|
132
|
+
"name": "ui",
|
|
133
|
+
"type": "UiProps",
|
|
134
|
+
"optional": true,
|
|
135
|
+
"default": null,
|
|
136
|
+
"description": "Kustomisasi visual — seperti style object tapi dengan support pseudo-class. ```tsx <Button ui={{ background: '#7c3aed', color: 'white', borderRadius: '99px', hover: { background: '#6d28d9', transform: 'scale(1.02)', }, active: { opacity: '0.9', } }} /> ```",
|
|
137
|
+
"example": null,
|
|
138
|
+
"param": null
|
|
139
|
+
},
|
|
140
|
+
"onClick": {
|
|
141
|
+
"name": "onClick",
|
|
142
|
+
"type": "(event?: any) => void",
|
|
143
|
+
"optional": true,
|
|
144
|
+
"default": null,
|
|
145
|
+
"description": "Event handler saat tombol diklik.",
|
|
146
|
+
"example": null,
|
|
147
|
+
"param": null
|
|
148
|
+
},
|
|
149
|
+
"className": {
|
|
150
|
+
"name": "className",
|
|
151
|
+
"type": "string",
|
|
152
|
+
"optional": true,
|
|
153
|
+
"default": null,
|
|
154
|
+
"description": "Class CSS kustom.",
|
|
155
|
+
"example": null,
|
|
156
|
+
"param": null
|
|
157
|
+
},
|
|
158
|
+
"children": {
|
|
159
|
+
"name": "children",
|
|
160
|
+
"type": "any",
|
|
161
|
+
"optional": true,
|
|
162
|
+
"default": null,
|
|
163
|
+
"description": "Konten tombol — teks, ikon, atau JSX.",
|
|
164
|
+
"example": null,
|
|
165
|
+
"param": null
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"subInterfaces": {},
|
|
169
|
+
"supportedFrameworks": [
|
|
170
|
+
"react",
|
|
171
|
+
"vue",
|
|
172
|
+
"svelte"
|
|
173
|
+
],
|
|
174
|
+
"themes": [
|
|
175
|
+
"tw"
|
|
176
|
+
]
|
|
177
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# <Calendar /> — TTDK Component Reference
|
|
2
|
+
|
|
3
|
+
TTDK Calendar 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/calendar/calendar.css";`
|
|
8
|
+
|
|
9
|
+
## 2. Subpath Component Import
|
|
10
|
+
```ts
|
|
11
|
+
// React
|
|
12
|
+
import Calendar from "@ttdk-design-system/library-react/web/calendar";
|
|
13
|
+
|
|
14
|
+
// Vue 3
|
|
15
|
+
import Calendar from "@ttdk-design-system/library-vue/web/calendar";
|
|
16
|
+
|
|
17
|
+
// Svelte
|
|
18
|
+
import Calendar from "@ttdk-design-system/library-svelte/web/calendar";
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## 3. Props & API Reference
|
|
22
|
+
|
|
23
|
+
| Prop | Type | Default | Description |
|
|
24
|
+
| :--- | :--- | :--- | :--- |
|
|
25
|
+
| `value?` | `any` | `-` | Nilai tanggal terpilih pada mode controlled. - Single: string ('YYYY-MM-DD') atau Date - Range: { start: string | Date | null, end: string | Date | null } - Multiple: string[] atau Date[] |
|
|
26
|
+
| `defaultValue?` | `any` | `-` | Nilai awal tanggal terpilih pada mode uncontrolled. |
|
|
27
|
+
| `id?` | `string` | `-` | Atribut ID unik untuk elemen root kalender. |
|
|
28
|
+
| `range?` | `boolean` | `false` | Mengaktifkan mode pemilihan rentang tanggal (start date - end date). |
|
|
29
|
+
| `multiple?` | `boolean` | `false` | Mengaktifkan mode pemilihan banyak tanggal sekaligus. |
|
|
30
|
+
| `min?` | `string | Date` | `-` | Batas tanggal paling awal yang dapat dipilih. |
|
|
31
|
+
| `minValue?` | `string | Date` | `-` | Alias untuk min (kompatibel Nuxt UI: min-value). |
|
|
32
|
+
| `max?` | `string | Date` | `-` | Batas tanggal paling akhir yang dapat dipilih. |
|
|
33
|
+
| `maxValue?` | `string | Date` | `-` | Alias untuk max (kompatibel Nuxt UI: max-value). |
|
|
34
|
+
| `isDateDisabled?` | `(date: Date) => boolean` | `-` | Fungsi untuk menonaktifkan tanggal tertentu secara spesifik (misal: hari libur / akhir pekan). |
|
|
35
|
+
| `isDateUnavailable?` | `(date: Date) => boolean` | `-` | Fungsi untuk menandai tanggal tidak tersedia (ditampilkan coret strikethrough). |
|
|
36
|
+
| `numberOfMonths?` | `number` | `1` | Jumlah bulan yang ditampilkan secara berdampingan. |
|
|
37
|
+
| `weekStartsOn?` | `0 | 1 | 2 | 3 | 4 | 5 | 6` | `1` | Hari awal dalam seminggu: - 0 = Minggu (Sunday) - 1 = Senin (Monday) |
|
|
38
|
+
| `locale?` | `string` | `id-ID` | Kode lokal bahasa kalender (misal: 'id-ID', 'en-US'). |
|
|
39
|
+
| `month?` | `number` | `-` | Bulan yang sedang ditampilkan (1 - 12) pada mode navigasi controlled. |
|
|
40
|
+
| `year?` | `number` | `-` | Tahun yang sedang ditampilkan (misal: 2026) pada mode navigasi controlled. |
|
|
41
|
+
| `defaultMonth?` | `number` | `-` | Bulan awal yang sedang ditampilkan (1 - 12). |
|
|
42
|
+
| `defaultYear?` | `number` | `-` | Tahun awal yang sedang ditampilkan. |
|
|
43
|
+
| `yearControls?` | `boolean` | `true` | Menampilkan tombol navigasi lompat tahun (<< dan >>). |
|
|
44
|
+
| `showOutsideDays?` | `boolean` | `true` | Menampilkan hari-hari redup di luar bulan yang aktif (leading & trailing days). |
|
|
45
|
+
| `fixedWeeks?` | `boolean` | `true` | Selalu merender 6 baris minggu agar tinggi kalender konsisten stabil antar bulan. |
|
|
46
|
+
| `dateMarkers?` | `DateMarker[]` | `-` | Daftar penanda agenda / jadwal faskes pada tanggal tertentu. |
|
|
47
|
+
| `size?` | `'sm' | 'md' | 'lg'` | `md` | Skala ukuran kalender (sm: kompak 32px, md: standar 38px, lg: besar 44px). |
|
|
48
|
+
| `rounded?` | `'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full'` | `md` | Radius sudut kelengkungan container kalender. |
|
|
49
|
+
| `variant?` | `'default' | 'bordered' | 'card' | 'flat'` | `bordered` | Varian visual tampilan kalender: - 'default': Bersih dengan background putih/gelap. - 'bordered': Dengan bingkai border solid luar. - 'card': Dengan elevasi bayangan halus kartu. - 'flat': Minimalis tanpa border dan tanpa shadow. |
|
|
50
|
+
| `disabled?` | `boolean` | `false` | Menonaktifkan seluruh kalender dari interaksi. |
|
|
51
|
+
| `readOnly?` | `boolean` | `false` | Mode hanya-baca (read-only). |
|
|
52
|
+
| `onValueChange?` | `(value: any) => void` | `-` | Callback event saat nilai tanggal berubah. |
|
|
53
|
+
| `onChange?` | `(event: any) => void` | `-` | Callback event native saat nilai berubah. |
|
|
54
|
+
| `onMonthChange?` | `(month: number, year: number) => void` | `-` | Callback saat navigasi bulan atau tahun berubah. |
|
|
55
|
+
| `onYearChange?` | `(month: number, year: number) => void` | `-` | Callback saat tahun tampilan kalender berubah. |
|
|
56
|
+
| `defaultViewMode?` | `'day' | 'month' | 'year'` | `day` | Mode tampilan awal kalender ('day', 'month', 'year'). |
|
|
57
|
+
| `viewMode?` | `'day' | 'month' | 'year'` | `-` | Mode tampilan kalender saat ini ('day', 'month', 'year') untuk mode controlled. |
|
|
58
|
+
| `onViewModeChange?` | `(mode: 'day' | 'month' | 'year') => void` | `-` | Callback saat mode tampilan kalender berubah ('day', 'month', 'year'). |
|
|
59
|
+
| `className?` | `string` | `-` | Class CSS kustom untuk container utama. |
|
|
60
|
+
| `style?` | `any` | `-` | Inline style CSS kustom untuk container utama. |
|
|
61
|
+
| `headerClass?` | `string` | `-` | Class CSS kustom untuk header kalender. |
|
|
62
|
+
| `headerStyle?` | `UiProps` | `-` | Inline style kustom untuk header kalender. |
|
|
63
|
+
| `navBtnClass?` | `string` | `-` | Class CSS kustom untuk tombol navigasi. |
|
|
64
|
+
| `navBtnStyle?` | `UiProps` | `-` | Inline style kustom untuk tombol navigasi. |
|
|
65
|
+
| `cellClass?` | `string` | `-` | Class CSS kustom untuk cell tanggal. |
|
|
66
|
+
| `cellStyle?` | `UiProps` | `-` | Inline style kustom untuk cell tanggal. |
|
|
67
|
+
| `ui?` | `UiProps` | `-` | Kustomisasi visual granular UiProps. |
|
|
68
|
+
|
|
69
|
+
### Sub-interface: `DateRange`
|
|
70
|
+
|
|
71
|
+
| Field | Type | Default | Description |
|
|
72
|
+
| :--- | :--- | :--- | :--- |
|
|
73
|
+
| `start` | `string | Date | null` | `-` | |
|
|
74
|
+
| `end` | `string | Date | null` | `-` | |
|
|
75
|
+
|
|
76
|
+
### Sub-interface: `DateMarker`
|
|
77
|
+
|
|
78
|
+
| Field | Type | Default | Description |
|
|
79
|
+
| :--- | :--- | :--- | :--- |
|
|
80
|
+
| `date` | `string` | `-` | |
|
|
81
|
+
| `color?` | `string` | `-` | |
|
|
82
|
+
| `tooltip?` | `string` | `-` | |
|
|
83
|
+
| `dot?` | `boolean` | `-` | |
|
|
84
|
+
|
|
85
|
+
## 4. Usage Examples
|
|
86
|
+
|
|
87
|
+
### React Example
|
|
88
|
+
```tsx
|
|
89
|
+
import { useState } from "react";
|
|
90
|
+
import Calendar from "@ttdk-design-system/library-react/web/calendar";
|
|
91
|
+
import "@ttdk-design-system/library-react/web/calendar/calendar.css";
|
|
92
|
+
|
|
93
|
+
export function Example() {
|
|
94
|
+
const [selectedDate, setSelectedDate] = useState("2026-10-13");
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<div style={{ maxWidth: '320px' }}>
|
|
98
|
+
<Calendar
|
|
99
|
+
value={selectedDate}
|
|
100
|
+
onChange={(date) => setSelectedDate(date)}
|
|
101
|
+
/>
|
|
102
|
+
<div style={{ marginTop: '12px', fontSize: '14px' }}>
|
|
103
|
+
Tanggal terpilih: <strong>{selectedDate}</strong>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Vue 3 Example
|
|
111
|
+
```vue
|
|
112
|
+
<script setup lang="ts">
|
|
113
|
+
import { ref } from "vue";
|
|
114
|
+
import Calendar from "@ttdk-design-system/library-vue/web/calendar";
|
|
115
|
+
import "@ttdk-design-system/library-vue/web/calendar/calendar.css";
|
|
116
|
+
|
|
117
|
+
const selectedDate = ref("2026-10-13");
|
|
118
|
+
</script>
|
|
119
|
+
|
|
120
|
+
<template>
|
|
121
|
+
<div style="max-width: 320px;">
|
|
122
|
+
<Calendar
|
|
123
|
+
:value="selectedDate"
|
|
124
|
+
@change="(date: any) => (selectedDate = date)"
|
|
125
|
+
/>
|
|
126
|
+
<div style="margin-top: 12px; font-size: 14px;">
|
|
127
|
+
Tanggal terpilih: <strong>{{ selectedDate }}</strong>
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
</template>
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Svelte Example
|
|
134
|
+
```svelte
|
|
135
|
+
<script lang="ts">
|
|
136
|
+
import Calendar from "@ttdk-design-system/library-svelte/web/calendar";
|
|
137
|
+
import "@ttdk-design-system/library-svelte/web/calendar/calendar.css";
|
|
138
|
+
|
|
139
|
+
let selectedDate = "2026-10-13";
|
|
140
|
+
</script>
|
|
141
|
+
|
|
142
|
+
<div style="max-width: 320px;">
|
|
143
|
+
<Calendar
|
|
144
|
+
value={selectedDate}
|
|
145
|
+
on:change={(e) => (selectedDate = e.detail)}
|
|
146
|
+
/>
|
|
147
|
+
<div style="margin-top: 12px; font-size: 14px;">
|
|
148
|
+
Tanggal terpilih: <strong>{selectedDate}</strong>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--ttdk-cal-font-family:var(--ttdk-font-sans);--ttdk-cal-bg:var(--ttdk-bg-base-primary);--ttdk-cal-border:var(--ttdk-stroke-subtle);--ttdk-cal-text-primary:var(--ttdk-text-icon-primary);--ttdk-cal-text-secondary:var(--ttdk-text-icon-secondary);--ttdk-cal-text-muted:var(--ttdk-text-icon-disabled);--ttdk-cal-brand:var(--ttdk-brand-default);--ttdk-cal-brand-hover:var(--ttdk-brand-strong);--ttdk-cal-brand-light:var(--ttdk-brand-subtle);--ttdk-cal-brand-range:color-mix(in srgb, var(--ttdk-brand-strong) 15%, transparent);--ttdk-cal-brand-text-inv:var(--ttdk-color-neutral-white);--ttdk-cal-today-border:var(--ttdk-stroke-border-focus);--ttdk-cal-hover-bg:var(--ttdk-bg-secondary-disabled);--ttdk-cal-radius:8px;--ttdk-cal-cell-size:38px;--ttdk-cal-font-size:14px}.dark,[data-theme=dark]{--ttdk-cal-bg:var(--ttdk-bg-base-primary);--ttdk-cal-border:var(--ttdk-stroke-subtle);--ttdk-cal-text-primary:var(--ttdk-text-icon-primary);--ttdk-cal-text-secondary:var(--ttdk-text-icon-secondary);--ttdk-cal-text-muted:var(--ttdk-text-icon-disabled);--ttdk-cal-brand:var(--ttdk-brand-default);--ttdk-cal-brand-hover:var(--ttdk-brand-strong);--ttdk-cal-brand-light:color-mix(in srgb, var(--ttdk-brand-strong) 20%, transparent);--ttdk-cal-brand-range:color-mix(in srgb, var(--ttdk-brand-strong) 25%, transparent);--ttdk-cal-brand-text-inv:var(--ttdk-bg-secondary-disabled);--ttdk-cal-today-border:var(--ttdk-stroke-border-focus);--ttdk-cal-hover-bg:var(--ttdk-bg-secondary-disabled)}.ttdk-calendar{background-color:var(--ttdk-cal-bg);border-radius:var(--ttdk-cal-radius);font-family:var(--ttdk-cal-font-family);font-size:var(--ttdk-cal-font-size);color:var(--ttdk-ui-color,var(--ttdk-cal-text-primary));user-select:none;box-sizing:border-box;flex-direction:column;width:fit-content;max-width:100%;padding:16px;transition:border-color .2s,box-shadow .2s;display:inline-flex}@media screen and (width<=600px){.ttdk-calendar{box-sizing:border-box;width:100%;max-width:100%;padding:12px 6px}}.ttdk-calendar *,.ttdk-calendar :before,.ttdk-calendar :after{box-sizing:border-box}.ttdk-calendar-bordered{border:1px solid var(--ttdk-cal-border)}.ttdk-calendar-card{border:1px solid var(--ttdk-cal-border);box-shadow:0 4px 6px -1px #0000000d,0 2px 4px -2px #0000000d}.ttdk-calendar-flat{box-shadow:none;background:0 0;border:none;padding:0}.ttdk-calendar-sm{--ttdk-cal-cell-size:32px;--ttdk-cal-font-size:12.5px;padding:12px}.ttdk-calendar-md{--ttdk-cal-cell-size:38px;--ttdk-cal-font-size:14px}.ttdk-calendar-lg{--ttdk-cal-cell-size:44px;--ttdk-cal-font-size:15.5px;padding:20px}.ttdk-calendar-rounded-none{--ttdk-cal-radius:0px}.ttdk-calendar-rounded-sm{--ttdk-cal-radius:4px}.ttdk-calendar-rounded-md{--ttdk-cal-radius:8px}.ttdk-calendar-rounded-lg{--ttdk-cal-radius:12px}.ttdk-calendar-rounded-xl{--ttdk-cal-radius:16px}.ttdk-calendar-rounded-full{--ttdk-cal-radius:20px}.ttdk-calendar-months{flex-flow:wrap;align-items:flex-start;gap:24px;width:100%;max-width:100%;display:flex}.ttdk-calendar-month{width:calc(var(--ttdk-cal-cell-size) * 7);box-sizing:border-box;flex-direction:column;flex:none;max-width:100%;display:flex}@media screen and (width<=600px){.ttdk-calendar-months{flex-direction:column;gap:20px;width:100%}.ttdk-calendar-month{width:100%;min-width:0;max-width:100%}.ttdk-calendar-header{gap:2px}.ttdk-calendar-nav-btn{width:24px;height:24px}.ttdk-calendar-nav-btn svg{width:14px;height:14px}.ttdk-calendar-title-btn{padding:3px 4px;font-size:.95em}.ttdk-calendar-cell{aspect-ratio:1;height:auto}.ttdk-calendar-day{aspect-ratio:1;width:calc(100% - 2px);height:calc(100% - 2px)}}.ttdk-calendar-header{justify-content:space-between;align-items:center;gap:0;margin-bottom:12px;display:flex;position:relative}.ttdk-calendar-title-group{flex:1;justify-content:center;align-items:center;gap:0;display:flex}.ttdk-calendar-title{color:var(--ttdk-cal-text-primary);cursor:default;background:0 0;border:none;border-radius:6px;align-items:center;gap:4px;padding:4px 8px;font-size:1em;font-weight:600;line-height:1.2;display:inline-flex}.ttdk-calendar-title-btn{color:var(--ttdk-cal-text-primary);cursor:pointer;background:0 0;border:1px solid #0000;border-radius:6px;align-items:center;gap:4px;padding:4px;font-family:inherit;font-size:1em;font-weight:600;line-height:1.2;transition:background-color .15s,color .15s,border-color .15s;display:inline-flex}.ttdk-calendar-title-btn:hover:not(:disabled){background-color:var(--ttdk-cal-hover-bg);color:var(--ttdk-cal-brand)}.ttdk-calendar-title-btn:focus-visible{outline:2px solid var(--ttdk-cal-brand);outline-offset:1px}.ttdk-calendar-title-btn:disabled{opacity:.5;cursor:not-allowed}.ttdk-calendar-nav-group{align-items:center;gap:4px;display:flex}.ttdk-calendar-nav-btn{width:28px;height:28px;color:var(--ttdk-cal-text-secondary);cursor:pointer;background:0 0;border:1px solid #0000;border-radius:6px;justify-content:center;align-items:center;padding:0;transition:background-color .15s,color .15s,border-color .15s;display:inline-flex}.ttdk-calendar-nav-btn:hover:not(:disabled){background-color:var(--ttdk-cal-hover-bg);color:var(--ttdk-cal-text-primary)}.ttdk-calendar-nav-btn:focus-visible{outline:2px solid var(--ttdk-cal-brand);outline-offset:1px}.ttdk-calendar-nav-btn:disabled{opacity:.35;cursor:not-allowed}.ttdk-calendar-nav-btn svg{stroke-width:2px;flex-shrink:0;width:16px;height:16px}.ttdk-calendar-month-picker-view,.ttdk-calendar-year-picker-view{width:100%;max-width:100%;min-width:calc(var(--ttdk-cal-cell-size) * 7);box-sizing:border-box;flex-direction:column;display:flex}@media screen and (width<=600px){.ttdk-calendar-month-picker-view,.ttdk-calendar-year-picker-view{min-width:0}}.ttdk-calendar-grid-picker{box-sizing:border-box;grid-template-columns:repeat(4,1fr);gap:10px 8px;width:100%;padding:12px 4px;display:grid}.ttdk-calendar-picker-item{min-height:38px;color:var(--ttdk-cal-text-primary);border-radius:var(--ttdk-cal-radius);cursor:pointer;user-select:none;box-sizing:border-box;background:0 0;border:1px solid #0000;justify-content:center;align-items:center;padding:10px 4px;font-family:inherit;font-size:.9em;font-weight:500;transition:all .15s;display:inline-flex}.ttdk-calendar-picker-item:hover:not(:disabled){background-color:var(--ttdk-cal-hover-bg);color:var(--ttdk-cal-text-primary)}.ttdk-calendar-picker-item:disabled{opacity:.35;cursor:not-allowed}.ttdk-calendar-picker-item-selected{font-weight:600;background-color:var(--ttdk-cal-brand)!important;color:var(--ttdk-cal-brand-text-inv)!important}.ttdk-calendar-picker-item-selected:hover:not(:disabled){background-color:var(--ttdk-cal-brand-hover)!important}.ttdk-calendar-picker-item-current:not(.ttdk-calendar-picker-item-selected){color:var(--ttdk-cal-brand);border-color:var(--ttdk-cal-brand);font-weight:700}.ttdk-calendar-picker-item:focus-visible{outline:2px solid var(--ttdk-cal-brand);outline-offset:1px}.ttdk-calendar-sm .ttdk-calendar-picker-item{min-height:32px;padding:6px 2px;font-size:.82em}.ttdk-calendar-lg .ttdk-calendar-picker-item{min-height:44px;padding:12px 6px;font-size:.95em}.ttdk-calendar-table{border-collapse:collapse;table-layout:fixed;border-spacing:0;width:100%}.ttdk-calendar-thead-row{grid-template-columns:repeat(7,1fr);margin-bottom:6px;display:grid}.ttdk-calendar-head-cell{text-transform:uppercase;letter-spacing:.04em;color:var(--ttdk-cal-text-muted);justify-content:center;align-items:center;height:28px;font-size:.8em;font-weight:600;display:flex}.ttdk-calendar-tbody{flex-direction:column;gap:4px;margin:0;padding:0;display:flex}.ttdk-calendar-row{grid-template-columns:repeat(7,1fr);width:100%;margin:0;padding:0;display:grid}.ttdk-calendar-cell{width:100%;height:var(--ttdk-cal-cell-size);justify-content:center;align-items:center;margin:0;padding:0;display:flex;position:relative}.ttdk-calendar-cell-range{background-color:var(--ttdk-cal-brand-range)}.ttdk-calendar-cell-range:first-child{border-top-left-radius:9999px;border-bottom-left-radius:9999px}.ttdk-calendar-cell-range:last-child{border-top-right-radius:9999px;border-bottom-right-radius:9999px}.ttdk-calendar-cell-range-start{background-color:var(--ttdk-cal-brand-range);border-top-left-radius:9999px;border-bottom-left-radius:9999px}.ttdk-calendar-cell-range-start:last-child{border-top-right-radius:9999px;border-bottom-right-radius:9999px}.ttdk-calendar-cell-range-end{background-color:var(--ttdk-cal-brand-range);border-top-right-radius:9999px;border-bottom-right-radius:9999px}.ttdk-calendar-cell-range-end:first-child{border-top-left-radius:9999px;border-bottom-left-radius:9999px}.ttdk-calendar-cell-range-single{background-color:#0000!important;border-radius:0!important}.ttdk-calendar-day{width:calc(var(--ttdk-cal-cell-size) - 4px);height:calc(var(--ttdk-cal-cell-size) - 4px);color:var(--ttdk-cal-text-primary);font-size:inherit;cursor:pointer;z-index:1;background:0 0;border:1px solid #0000;border-radius:9999px;outline:none;flex-direction:column;justify-content:center;align-items:center;font-weight:400;transition:background-color .15s,color .15s,border-color .15s,transform .1s;display:inline-flex;position:relative}.ttdk-calendar-day:hover:not(:disabled):not(.ttdk-calendar-day-selected):not(.ttdk-calendar-day-range-start):not(.ttdk-calendar-day-range-end){background-color:var(--ttdk-cal-hover-bg);color:var(--ttdk-cal-text-primary)}.ttdk-calendar-day:active:not(:disabled){transform:scale(.95)}.ttdk-calendar-day:focus-visible{outline:2px solid var(--ttdk-cal-brand);outline-offset:2px}.ttdk-calendar-day-today{border-color:var(--ttdk-cal-today-border);color:var(--ttdk-cal-brand);font-weight:600}.ttdk-calendar-day-selected,.ttdk-calendar-day-range-start,.ttdk-calendar-day-range-end{width:100%;height:100%;max-width:var(--ttdk-cal-cell-size);max-height:var(--ttdk-cal-cell-size);border-color:var(--ttdk-cal-brand);font-weight:600;box-shadow:0 1px 3px #00000026;background-color:var(--ttdk-cal-brand)!important;color:var(--ttdk-cal-brand-text-inv)!important}.ttdk-calendar-day-in-range{color:var(--ttdk-cal-brand);border-radius:100%;width:100%;height:100%;font-weight:500}.ttdk-calendar-day-outside{color:var(--ttdk-cal-text-muted);opacity:.45}.ttdk-calendar-day-outside:hover:not(:disabled){opacity:.8}.ttdk-calendar-day-disabled{opacity:.25;pointer-events:none;cursor:not-allowed!important}.ttdk-calendar-day-unavailable{color:var(--ttdk-cal-text-muted);opacity:.55;text-decoration:line-through;cursor:not-allowed!important}.ttdk-calendar-marker-dot{background-color:var(--ttdk-cal-brand);border-radius:50%;width:4px;height:4px;transition:transform .15s;position:absolute;bottom:3px}.ttdk-calendar-day-selected .ttdk-calendar-marker-dot,.ttdk-calendar-day-range-start .ttdk-calendar-marker-dot,.ttdk-calendar-day-range-end .ttdk-calendar-marker-dot{background-color:#fff}
|