@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,220 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<button
|
|
3
|
+
type="button"
|
|
4
|
+
:class="`ttdk-chip ${className || ''}`.trim()"
|
|
5
|
+
:data-variant="variant || 'primary'"
|
|
6
|
+
:data-appearance="appearance || 'soft'"
|
|
7
|
+
:data-size="size || 'md'"
|
|
8
|
+
:data-rounded="rounded || 'full'"
|
|
9
|
+
:data-selected="
|
|
10
|
+
selected !== undefined ? (selected ? 'true' : 'false') : undefined
|
|
11
|
+
"
|
|
12
|
+
:data-disabled="disabled || variant === 'disabled' ? 'true' : 'false'"
|
|
13
|
+
:style="{
|
|
14
|
+
...buildUiVars(ui),
|
|
15
|
+
...(ui?.border
|
|
16
|
+
? {
|
|
17
|
+
border: ui.border,
|
|
18
|
+
}
|
|
19
|
+
: {}),
|
|
20
|
+
...(ui?.borderColor
|
|
21
|
+
? {
|
|
22
|
+
borderColor: ui.borderColor,
|
|
23
|
+
}
|
|
24
|
+
: {}),
|
|
25
|
+
...(ui?.borderWidth
|
|
26
|
+
? {
|
|
27
|
+
borderWidth: ui.borderWidth,
|
|
28
|
+
}
|
|
29
|
+
: {}),
|
|
30
|
+
...(ui?.borderStyle
|
|
31
|
+
? {
|
|
32
|
+
borderStyle: ui.borderStyle,
|
|
33
|
+
}
|
|
34
|
+
: {}),
|
|
35
|
+
...(ui?.borderRadius
|
|
36
|
+
? {
|
|
37
|
+
borderRadius: ui.borderRadius,
|
|
38
|
+
}
|
|
39
|
+
: {}),
|
|
40
|
+
...(typeof style === 'object' ? style : {}),
|
|
41
|
+
}"
|
|
42
|
+
@click="
|
|
43
|
+
async (event) => {
|
|
44
|
+
if (disabled || variant === 'disabled') return;
|
|
45
|
+
onClick?.(event);
|
|
46
|
+
}
|
|
47
|
+
"
|
|
48
|
+
>
|
|
49
|
+
<slot />
|
|
50
|
+
<template v-if="label">
|
|
51
|
+
<span
|
|
52
|
+
:class="`ttdk-chip-label ${labelClass || ''}`.trim()"
|
|
53
|
+
:style="{
|
|
54
|
+
...buildUiVars(labelStyle),
|
|
55
|
+
}"
|
|
56
|
+
>{{ label }}</span
|
|
57
|
+
>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<template v-if="closable">
|
|
61
|
+
<span
|
|
62
|
+
role="button"
|
|
63
|
+
aria-label="Hapus chip"
|
|
64
|
+
:tabIndex="0"
|
|
65
|
+
:class="`ttdk-chip-close ${closableClass || ''}`.trim()"
|
|
66
|
+
:style="{
|
|
67
|
+
...buildUiVars(closableStyle),
|
|
68
|
+
}"
|
|
69
|
+
@click="
|
|
70
|
+
async (event) => {
|
|
71
|
+
event.stopPropagation();
|
|
72
|
+
if (disabled) return;
|
|
73
|
+
onClose?.(event);
|
|
74
|
+
}
|
|
75
|
+
"
|
|
76
|
+
><svg viewBox="0 0 24 24">
|
|
77
|
+
<line x1="18" y1="6" x2="6" y2="18"></line>
|
|
78
|
+
<line x1="6" y1="6" x2="18" y2="18"></line></svg
|
|
79
|
+
></span>
|
|
80
|
+
</template>
|
|
81
|
+
</button>
|
|
82
|
+
</template>
|
|
83
|
+
|
|
84
|
+
<script setup lang="ts">
|
|
85
|
+
import { buildUiVars, UiProps } from "../../core/types";
|
|
86
|
+
|
|
87
|
+
export type ChipUiProps = UiProps;
|
|
88
|
+
export interface ChipProps {
|
|
89
|
+
/**
|
|
90
|
+
* Teks label yang ditampilkan pada chip.
|
|
91
|
+
*/
|
|
92
|
+
label?: string;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Status apakah chip sedang dalam kondisi terpilih (selected).
|
|
96
|
+
*
|
|
97
|
+
* @default false
|
|
98
|
+
*/
|
|
99
|
+
selected?: boolean;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Varian warna semantik tema chip:
|
|
103
|
+
* - `'primary'`: Brand Teal utama (#00B5AD).
|
|
104
|
+
* - `'success'`: Sukses hijau (#04B761).
|
|
105
|
+
* - `'info'`: Biru informasi (#2196F3).
|
|
106
|
+
* - `'warning'`: Peringatan kuning / amber (#F88000).
|
|
107
|
+
* - `'danger'`: Bahaya / merah (#D0021B).
|
|
108
|
+
* - `'neutral'`: Netral abu-abu.
|
|
109
|
+
* - `'disabled'`: Status nonaktif (disabled).
|
|
110
|
+
*
|
|
111
|
+
* @default 'primary'
|
|
112
|
+
*/
|
|
113
|
+
variant?:
|
|
114
|
+
| "primary"
|
|
115
|
+
| "success"
|
|
116
|
+
| "info"
|
|
117
|
+
| "warning"
|
|
118
|
+
| "danger"
|
|
119
|
+
| "neutral"
|
|
120
|
+
| "disabled";
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Tipe tampilan visual chip:
|
|
124
|
+
* - `'soft'`: Background warna transparan lembut (default).
|
|
125
|
+
* - `'solid'`: Background warna solid pekat.
|
|
126
|
+
* - `'outline'`: Border tipis dengan background transparan.
|
|
127
|
+
*
|
|
128
|
+
* @default 'soft'
|
|
129
|
+
*/
|
|
130
|
+
appearance?: "soft" | "solid" | "outline";
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Skala ukuran chip:
|
|
134
|
+
* - `'sm'`: Tinggi 28px, font 12px.
|
|
135
|
+
* - `'md'`: Tinggi 32px, font 13px (standar).
|
|
136
|
+
* - `'lg'`: Tinggi 38px, font 15px.
|
|
137
|
+
*
|
|
138
|
+
* @default 'md'
|
|
139
|
+
*/
|
|
140
|
+
size?: "sm" | "md" | "lg";
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Bentuk sudut kelengkungan:
|
|
144
|
+
* - `'full'`: Bentuk kapsul / pill 9999px (default).
|
|
145
|
+
* - `'none'`: Persegi lancip 0px.
|
|
146
|
+
* - `'sm'`: Sudut melengkung halus 4px.
|
|
147
|
+
* - `'md'`: Sudut melengkung sedang 6px.
|
|
148
|
+
* - `'lg'`: Sudut melengkung besar 8px.
|
|
149
|
+
*
|
|
150
|
+
* @default 'full'
|
|
151
|
+
*/
|
|
152
|
+
rounded?: "none" | "sm" | "md" | "lg" | "full";
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Menampilkan tombol silang (x) untuk menghapus / menutup chip.
|
|
156
|
+
*
|
|
157
|
+
* @default false
|
|
158
|
+
*/
|
|
159
|
+
closable?: boolean;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Menonaktifkan interaksi klik pada chip.
|
|
163
|
+
*
|
|
164
|
+
* @default false
|
|
165
|
+
*/
|
|
166
|
+
disabled?: boolean;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Kustomisasi visual granular melalui style-like object (+ support pseudo-class: hover, active).
|
|
170
|
+
*/
|
|
171
|
+
ui?: UiProps;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Inline CSS style object native.
|
|
175
|
+
*/
|
|
176
|
+
style?: any;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Style kustom untuk teks label chip (UiProps).
|
|
180
|
+
*/
|
|
181
|
+
labelStyle?: UiProps;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Class CSS kustom untuk teks label chip (Tailwind / class kustom).
|
|
185
|
+
*/
|
|
186
|
+
labelClass?: string;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Style kustom untuk tombol tutup chip (UiProps).
|
|
190
|
+
*/
|
|
191
|
+
closableStyle?: UiProps;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Class CSS kustom untuk tombol tutup chip (Tailwind / class kustom).
|
|
195
|
+
*/
|
|
196
|
+
closableClass?: string;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Event handler saat chip diklik (toggle select atau trigger aksi).
|
|
200
|
+
*/
|
|
201
|
+
onClick?: (event?: any) => void;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Event handler saat tombol close (x) diklik.
|
|
205
|
+
*/
|
|
206
|
+
onClose?: (event?: any) => void;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Class CSS kustom.
|
|
210
|
+
*/
|
|
211
|
+
className?: string;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Konten kustom / icon kustom yang disisipkan di dalam chip.
|
|
215
|
+
*/
|
|
216
|
+
children?: any;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
const props = defineProps<ChipProps>();
|
|
220
|
+
</script>
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// Auto-generated by TTDK Design System Vue Type Generator
|
|
3
|
+
import type { DefineComponent } from "vue";
|
|
4
|
+
import { buildUiVars, UiProps } from "../../core/types";
|
|
5
|
+
|
|
6
|
+
export type ChipUiProps = UiProps;
|
|
7
|
+
|
|
8
|
+
export interface ChipProps {
|
|
9
|
+
/**
|
|
10
|
+
* Teks label yang ditampilkan pada chip.
|
|
11
|
+
*/
|
|
12
|
+
label?: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Status apakah chip sedang dalam kondisi terpilih (selected).
|
|
16
|
+
*
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
selected?: boolean;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Varian warna semantik tema chip:
|
|
23
|
+
* - `'primary'`: Brand Teal utama (#00B5AD).
|
|
24
|
+
* - `'success'`: Sukses hijau (#04B761).
|
|
25
|
+
* - `'info'`: Biru informasi (#2196F3).
|
|
26
|
+
* - `'warning'`: Peringatan kuning / amber (#F88000).
|
|
27
|
+
* - `'danger'`: Bahaya / merah (#D0021B).
|
|
28
|
+
* - `'neutral'`: Netral abu-abu.
|
|
29
|
+
* - `'disabled'`: Status nonaktif (disabled).
|
|
30
|
+
*
|
|
31
|
+
* @default 'primary'
|
|
32
|
+
*/
|
|
33
|
+
variant?:
|
|
34
|
+
| "primary"
|
|
35
|
+
| "success"
|
|
36
|
+
| "info"
|
|
37
|
+
| "warning"
|
|
38
|
+
| "danger"
|
|
39
|
+
| "neutral"
|
|
40
|
+
| "disabled";
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Tipe tampilan visual chip:
|
|
44
|
+
* - `'soft'`: Background warna transparan lembut (default).
|
|
45
|
+
* - `'solid'`: Background warna solid pekat.
|
|
46
|
+
* - `'outline'`: Border tipis dengan background transparan.
|
|
47
|
+
*
|
|
48
|
+
* @default 'soft'
|
|
49
|
+
*/
|
|
50
|
+
appearance?: "soft" | "solid" | "outline";
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Skala ukuran chip:
|
|
54
|
+
* - `'sm'`: Tinggi 28px, font 12px.
|
|
55
|
+
* - `'md'`: Tinggi 32px, font 13px (standar).
|
|
56
|
+
* - `'lg'`: Tinggi 38px, font 15px.
|
|
57
|
+
*
|
|
58
|
+
* @default 'md'
|
|
59
|
+
*/
|
|
60
|
+
size?: "sm" | "md" | "lg";
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Bentuk sudut kelengkungan:
|
|
64
|
+
* - `'full'`: Bentuk kapsul / pill 9999px (default).
|
|
65
|
+
* - `'none'`: Persegi lancip 0px.
|
|
66
|
+
* - `'sm'`: Sudut melengkung halus 4px.
|
|
67
|
+
* - `'md'`: Sudut melengkung sedang 6px.
|
|
68
|
+
* - `'lg'`: Sudut melengkung besar 8px.
|
|
69
|
+
*
|
|
70
|
+
* @default 'full'
|
|
71
|
+
*/
|
|
72
|
+
rounded?: "none" | "sm" | "md" | "lg" | "full";
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Menampilkan tombol silang (x) untuk menghapus / menutup chip.
|
|
76
|
+
*
|
|
77
|
+
* @default false
|
|
78
|
+
*/
|
|
79
|
+
closable?: boolean;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Menonaktifkan interaksi klik pada chip.
|
|
83
|
+
*
|
|
84
|
+
* @default false
|
|
85
|
+
*/
|
|
86
|
+
disabled?: boolean;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Kustomisasi visual granular melalui style-like object (+ support pseudo-class: hover, active).
|
|
90
|
+
*/
|
|
91
|
+
ui?: UiProps;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Inline CSS style object native.
|
|
95
|
+
*/
|
|
96
|
+
style?: any;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Style kustom untuk teks label chip (UiProps).
|
|
100
|
+
*/
|
|
101
|
+
labelStyle?: UiProps;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Class CSS kustom untuk teks label chip (Tailwind / class kustom).
|
|
105
|
+
*/
|
|
106
|
+
labelClass?: string;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Style kustom untuk tombol tutup chip (UiProps).
|
|
110
|
+
*/
|
|
111
|
+
closableStyle?: UiProps;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Class CSS kustom untuk tombol tutup chip (Tailwind / class kustom).
|
|
115
|
+
*/
|
|
116
|
+
closableClass?: string;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Event handler saat chip diklik (toggle select atau trigger aksi).
|
|
120
|
+
*/
|
|
121
|
+
onClick?: (event?: any) => void;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Event handler saat tombol close (x) diklik.
|
|
125
|
+
*/
|
|
126
|
+
onClose?: (event?: any) => void;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Class CSS kustom.
|
|
130
|
+
*/
|
|
131
|
+
className?: string;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Konten kustom / icon kustom yang disisipkan di dalam chip.
|
|
135
|
+
*/
|
|
136
|
+
children?: any;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
declare const component: DefineComponent<ChipProps>;
|
|
140
|
+
export default component;
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ttdk-design-system/chip",
|
|
3
|
+
"component": "Chip",
|
|
4
|
+
"folder": "chip",
|
|
5
|
+
"description": "TTDK Chip component with multi-theme support.",
|
|
6
|
+
"stylesheets": [
|
|
7
|
+
{
|
|
8
|
+
"theme": "common",
|
|
9
|
+
"file": "chip.css",
|
|
10
|
+
"importPath": "web/chip/chip.css"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"props": {
|
|
14
|
+
"label": {
|
|
15
|
+
"name": "label",
|
|
16
|
+
"type": "string",
|
|
17
|
+
"optional": true,
|
|
18
|
+
"default": null,
|
|
19
|
+
"description": "Teks label yang ditampilkan pada chip.",
|
|
20
|
+
"example": null,
|
|
21
|
+
"param": null
|
|
22
|
+
},
|
|
23
|
+
"selected": {
|
|
24
|
+
"name": "selected",
|
|
25
|
+
"type": "boolean",
|
|
26
|
+
"optional": true,
|
|
27
|
+
"default": "false",
|
|
28
|
+
"description": "Status apakah chip sedang dalam kondisi terpilih (selected).",
|
|
29
|
+
"example": null,
|
|
30
|
+
"param": null
|
|
31
|
+
},
|
|
32
|
+
"variant": {
|
|
33
|
+
"name": "variant",
|
|
34
|
+
"type": "| 'primary'\n | 'success'\n | 'info'\n | 'warning'\n | 'danger'\n | 'neutral'\n | 'disabled'",
|
|
35
|
+
"optional": true,
|
|
36
|
+
"default": "primary",
|
|
37
|
+
"description": "Varian warna semantik tema chip: - `'primary'`: Brand Teal utama (#00B5AD). - `'success'`: Sukses hijau (#04B761). - `'info'`: Biru informasi (#2196F3). - `'warning'`: Peringatan kuning / amber (#F88000). - `'danger'`: Bahaya / merah (#D0021B). - `'neutral'`: Netral abu-abu. - `'disabled'`: Status nonaktif (disabled).",
|
|
38
|
+
"example": null,
|
|
39
|
+
"param": null
|
|
40
|
+
},
|
|
41
|
+
"appearance": {
|
|
42
|
+
"name": "appearance",
|
|
43
|
+
"type": "'soft' | 'solid' | 'outline'",
|
|
44
|
+
"optional": true,
|
|
45
|
+
"default": "soft",
|
|
46
|
+
"description": "Tipe tampilan visual chip: - `'soft'`: Background warna transparan lembut (default). - `'solid'`: Background warna solid pekat. - `'outline'`: Border tipis dengan background transparan.",
|
|
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 chip: - `'sm'`: Tinggi 28px, font 12px. - `'md'`: Tinggi 32px, font 13px (standar). - `'lg'`: Tinggi 38px, font 15px.",
|
|
56
|
+
"example": null,
|
|
57
|
+
"param": null
|
|
58
|
+
},
|
|
59
|
+
"rounded": {
|
|
60
|
+
"name": "rounded",
|
|
61
|
+
"type": "'none' | 'sm' | 'md' | 'lg' | 'full'",
|
|
62
|
+
"optional": true,
|
|
63
|
+
"default": "full",
|
|
64
|
+
"description": "Bentuk sudut kelengkungan: - `'full'`: Bentuk kapsul / pill 9999px (default). - `'none'`: Persegi lancip 0px. - `'sm'`: Sudut melengkung halus 4px. - `'md'`: Sudut melengkung sedang 6px. - `'lg'`: Sudut melengkung besar 8px.",
|
|
65
|
+
"example": null,
|
|
66
|
+
"param": null
|
|
67
|
+
},
|
|
68
|
+
"closable": {
|
|
69
|
+
"name": "closable",
|
|
70
|
+
"type": "boolean",
|
|
71
|
+
"optional": true,
|
|
72
|
+
"default": "false",
|
|
73
|
+
"description": "Menampilkan tombol silang (x) untuk menghapus / menutup chip.",
|
|
74
|
+
"example": null,
|
|
75
|
+
"param": null
|
|
76
|
+
},
|
|
77
|
+
"disabled": {
|
|
78
|
+
"name": "disabled",
|
|
79
|
+
"type": "boolean",
|
|
80
|
+
"optional": true,
|
|
81
|
+
"default": "false",
|
|
82
|
+
"description": "Menonaktifkan interaksi klik pada chip.",
|
|
83
|
+
"example": null,
|
|
84
|
+
"param": null
|
|
85
|
+
},
|
|
86
|
+
"ui": {
|
|
87
|
+
"name": "ui",
|
|
88
|
+
"type": "UiProps",
|
|
89
|
+
"optional": true,
|
|
90
|
+
"default": null,
|
|
91
|
+
"description": "Kustomisasi visual granular melalui style-like object (+ support pseudo-class: hover, active).",
|
|
92
|
+
"example": null,
|
|
93
|
+
"param": null
|
|
94
|
+
},
|
|
95
|
+
"style": {
|
|
96
|
+
"name": "style",
|
|
97
|
+
"type": "any",
|
|
98
|
+
"optional": true,
|
|
99
|
+
"default": null,
|
|
100
|
+
"description": "Inline CSS style object native.",
|
|
101
|
+
"example": null,
|
|
102
|
+
"param": null
|
|
103
|
+
},
|
|
104
|
+
"labelStyle": {
|
|
105
|
+
"name": "labelStyle",
|
|
106
|
+
"type": "UiProps",
|
|
107
|
+
"optional": true,
|
|
108
|
+
"default": null,
|
|
109
|
+
"description": "Style kustom untuk teks label chip (UiProps).",
|
|
110
|
+
"example": null,
|
|
111
|
+
"param": null
|
|
112
|
+
},
|
|
113
|
+
"labelClass": {
|
|
114
|
+
"name": "labelClass",
|
|
115
|
+
"type": "string",
|
|
116
|
+
"optional": true,
|
|
117
|
+
"default": null,
|
|
118
|
+
"description": "Class CSS kustom untuk teks label chip (Tailwind / class kustom).",
|
|
119
|
+
"example": null,
|
|
120
|
+
"param": null
|
|
121
|
+
},
|
|
122
|
+
"closableStyle": {
|
|
123
|
+
"name": "closableStyle",
|
|
124
|
+
"type": "UiProps",
|
|
125
|
+
"optional": true,
|
|
126
|
+
"default": null,
|
|
127
|
+
"description": "Style kustom untuk tombol tutup chip (UiProps).",
|
|
128
|
+
"example": null,
|
|
129
|
+
"param": null
|
|
130
|
+
},
|
|
131
|
+
"closableClass": {
|
|
132
|
+
"name": "closableClass",
|
|
133
|
+
"type": "string",
|
|
134
|
+
"optional": true,
|
|
135
|
+
"default": null,
|
|
136
|
+
"description": "Class CSS kustom untuk tombol tutup chip (Tailwind / class kustom).",
|
|
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 chip diklik (toggle select atau trigger aksi).",
|
|
146
|
+
"example": null,
|
|
147
|
+
"param": null
|
|
148
|
+
},
|
|
149
|
+
"onClose": {
|
|
150
|
+
"name": "onClose",
|
|
151
|
+
"type": "(event?: any) => void",
|
|
152
|
+
"optional": true,
|
|
153
|
+
"default": null,
|
|
154
|
+
"description": "Event handler saat tombol close (x) diklik.",
|
|
155
|
+
"example": null,
|
|
156
|
+
"param": null
|
|
157
|
+
},
|
|
158
|
+
"className": {
|
|
159
|
+
"name": "className",
|
|
160
|
+
"type": "string",
|
|
161
|
+
"optional": true,
|
|
162
|
+
"default": null,
|
|
163
|
+
"description": "Class CSS kustom.",
|
|
164
|
+
"example": null,
|
|
165
|
+
"param": null
|
|
166
|
+
},
|
|
167
|
+
"children": {
|
|
168
|
+
"name": "children",
|
|
169
|
+
"type": "any",
|
|
170
|
+
"optional": true,
|
|
171
|
+
"default": null,
|
|
172
|
+
"description": "Konten kustom / icon kustom yang disisipkan di dalam chip.",
|
|
173
|
+
"example": null,
|
|
174
|
+
"param": null
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
"subInterfaces": {},
|
|
178
|
+
"supportedFrameworks": [
|
|
179
|
+
"react",
|
|
180
|
+
"vue",
|
|
181
|
+
"svelte"
|
|
182
|
+
],
|
|
183
|
+
"themes": [
|
|
184
|
+
"tw"
|
|
185
|
+
]
|
|
186
|
+
}
|