@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,290 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<template v-if="isVisible">
|
|
3
|
+
<div
|
|
4
|
+
role="alert"
|
|
5
|
+
:class="`ttdk-alert ${className || ''}`.trim()"
|
|
6
|
+
:data-variant="variant || 'neutral'"
|
|
7
|
+
:data-appearance="appearance || 'soft'"
|
|
8
|
+
:data-rounded="rounded || 'md'"
|
|
9
|
+
:data-block="block ? 'true' : 'false'"
|
|
10
|
+
:style="{
|
|
11
|
+
...buildUiVars(ui),
|
|
12
|
+
...(iconColor
|
|
13
|
+
? {
|
|
14
|
+
'--ttdk-ui-icon-color': iconColor,
|
|
15
|
+
}
|
|
16
|
+
: {}),
|
|
17
|
+
...(iconSize
|
|
18
|
+
? {
|
|
19
|
+
'--ttdk-ui-icon-size': iconSize,
|
|
20
|
+
}
|
|
21
|
+
: {}),
|
|
22
|
+
...(typeof style === 'object' ? style : {}),
|
|
23
|
+
}"
|
|
24
|
+
>
|
|
25
|
+
<template v-if="!hideIcon && icon !== false">
|
|
26
|
+
<div
|
|
27
|
+
:class="`ttdk-alert-icon-wrapper ${iconClass || ''}`.trim()"
|
|
28
|
+
:style="{
|
|
29
|
+
...buildUiVars(iconStyle),
|
|
30
|
+
}"
|
|
31
|
+
>
|
|
32
|
+
<template v-if="icon && typeof icon !== 'boolean'">
|
|
33
|
+
<span class="ttdk-alert-icon">{{ icon }}</span>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<template v-if="!icon || icon === true">
|
|
37
|
+
<template v-if="variant === 'success'">
|
|
38
|
+
<svg class="ttdk-alert-icon" viewBox="0 0 24 24" fill="none">
|
|
39
|
+
<circle cx="12" cy="12" r="10"></circle>
|
|
40
|
+
<polyline points="9 12 11 14 15 10"></polyline>
|
|
41
|
+
</svg>
|
|
42
|
+
</template>
|
|
43
|
+
|
|
44
|
+
<template v-if="variant === 'warning'">
|
|
45
|
+
<svg class="ttdk-alert-icon" viewBox="0 0 24 24" fill="none">
|
|
46
|
+
<path
|
|
47
|
+
d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"
|
|
48
|
+
></path>
|
|
49
|
+
<line x1="12" y1="9" x2="12" y2="13"></line>
|
|
50
|
+
<line x1="12" y1="17" x2="12.01" y2="17"></line>
|
|
51
|
+
</svg>
|
|
52
|
+
</template>
|
|
53
|
+
|
|
54
|
+
<template v-if="variant === 'danger'">
|
|
55
|
+
<svg class="ttdk-alert-icon" viewBox="0 0 24 24" fill="none">
|
|
56
|
+
<circle cx="12" cy="12" r="10"></circle>
|
|
57
|
+
<line x1="12" y1="8" x2="12" y2="12"></line>
|
|
58
|
+
<line x1="12" y1="16" x2="12.01" y2="16"></line>
|
|
59
|
+
</svg>
|
|
60
|
+
</template>
|
|
61
|
+
|
|
62
|
+
<template v-if="variant === 'info'">
|
|
63
|
+
<svg class="ttdk-alert-icon" viewBox="0 0 24 24" fill="none">
|
|
64
|
+
<circle cx="12" cy="12" r="10"></circle>
|
|
65
|
+
<line x1="12" y1="16" x2="12" y2="12"></line>
|
|
66
|
+
<line x1="12" y1="8" x2="12.01" y2="8"></line>
|
|
67
|
+
</svg>
|
|
68
|
+
</template>
|
|
69
|
+
|
|
70
|
+
<template v-if="!variant || variant === 'neutral'">
|
|
71
|
+
<svg class="ttdk-alert-icon" viewBox="0 0 24 24" fill="none">
|
|
72
|
+
<path
|
|
73
|
+
d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"
|
|
74
|
+
></path>
|
|
75
|
+
</svg>
|
|
76
|
+
</template>
|
|
77
|
+
</template>
|
|
78
|
+
</div>
|
|
79
|
+
</template>
|
|
80
|
+
|
|
81
|
+
<div class="ttdk-alert-content">
|
|
82
|
+
<template v-if="title">
|
|
83
|
+
<div
|
|
84
|
+
:class="`ttdk-alert-title ${titleClass || ''}`.trim()"
|
|
85
|
+
:style="{
|
|
86
|
+
...buildUiVars(titleStyle),
|
|
87
|
+
}"
|
|
88
|
+
>
|
|
89
|
+
{{ title }}
|
|
90
|
+
</div>
|
|
91
|
+
</template>
|
|
92
|
+
|
|
93
|
+
<template v-if="description">
|
|
94
|
+
<div
|
|
95
|
+
:class="`ttdk-alert-description ${descClass || ''}`.trim()"
|
|
96
|
+
:style="{
|
|
97
|
+
...buildUiVars(descStyle),
|
|
98
|
+
}"
|
|
99
|
+
>
|
|
100
|
+
{{ description }}
|
|
101
|
+
</div>
|
|
102
|
+
</template>
|
|
103
|
+
|
|
104
|
+
<slot />
|
|
105
|
+
</div>
|
|
106
|
+
<template v-if="closable">
|
|
107
|
+
<button
|
|
108
|
+
type="button"
|
|
109
|
+
aria-label="Tutup notifikasi"
|
|
110
|
+
:class="`ttdk-alert-close-btn ${closableClass || ''}`.trim()"
|
|
111
|
+
:style="{
|
|
112
|
+
...buildUiVars(closableStyle),
|
|
113
|
+
}"
|
|
114
|
+
@click="async (event) => handleDismiss(event)"
|
|
115
|
+
>
|
|
116
|
+
<svg viewBox="0 0 24 24" fill="none">
|
|
117
|
+
<line x1="18" y1="6" x2="6" y2="18"></line>
|
|
118
|
+
<line x1="6" y1="6" x2="18" y2="18"></line>
|
|
119
|
+
</svg>
|
|
120
|
+
</button>
|
|
121
|
+
</template>
|
|
122
|
+
</div>
|
|
123
|
+
</template>
|
|
124
|
+
</template>
|
|
125
|
+
|
|
126
|
+
<script setup lang="ts">
|
|
127
|
+
import { ref } from "vue";
|
|
128
|
+
|
|
129
|
+
import { buildUiVars, UiProps } from "../../core/types";
|
|
130
|
+
|
|
131
|
+
export type AlertUiProps = UiProps;
|
|
132
|
+
export interface AlertProps {
|
|
133
|
+
/**
|
|
134
|
+
* Inline CSS style kustom.
|
|
135
|
+
*/
|
|
136
|
+
style?: any;
|
|
137
|
+
/**
|
|
138
|
+
* Judul utama alert.
|
|
139
|
+
*/
|
|
140
|
+
title?: string;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Deskripsi atau pesan teks penjelasan alert.
|
|
144
|
+
*/
|
|
145
|
+
description?: string;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Varian warna semantik alert:
|
|
149
|
+
* - `'neutral'`: Netral (border hitam/putih, background base).
|
|
150
|
+
* - `'info'`: Biru informasi (#2196F3).
|
|
151
|
+
* - `'success'`: Hijau konfirmasi keberhasilan (#04B761).
|
|
152
|
+
* - `'warning'`: Kuning / amber peringatan (#F88000).
|
|
153
|
+
* - `'danger'`: Merah kesalahan / bahaya (#D0021B).
|
|
154
|
+
*
|
|
155
|
+
* @default 'neutral'
|
|
156
|
+
*/
|
|
157
|
+
variant?: "neutral" | "info" | "success" | "warning" | "danger";
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Gaya tampilan visual alert:
|
|
161
|
+
* - `'soft'`: Latar belakang warna transparan lembut (standar).
|
|
162
|
+
* - `'solid'`: Latar belakang warna solid pekat dengan teks putih.
|
|
163
|
+
* - `'outline'`: Garis tepi dengan latar belakang transparan.
|
|
164
|
+
* - `'subtle'`: Latar belakang abu netral dengan aksen border tipis.
|
|
165
|
+
*
|
|
166
|
+
* @default 'soft'
|
|
167
|
+
*/
|
|
168
|
+
appearance?: "soft" | "solid" | "outline" | "subtle";
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Sudut kelengkungan alert:
|
|
172
|
+
* - `'none'`: Sudut tajam 0px.
|
|
173
|
+
* - `'sm'`: Radius halus 4px.
|
|
174
|
+
* - `'md'`: Radius sedang 8px (standar).
|
|
175
|
+
* - `'lg'`: Radius melengkung 12px.
|
|
176
|
+
* - `'full'`: Lingkaran penuh 9999px.
|
|
177
|
+
*
|
|
178
|
+
* @default 'md'
|
|
179
|
+
*/
|
|
180
|
+
rounded?: "none" | "sm" | "md" | "lg" | "full";
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Ikon SVG kustom yang menggantikan ikon bawaan, atau boolean untuk menampilkan/menyembunyikan ikon.
|
|
184
|
+
* @default true
|
|
185
|
+
*/
|
|
186
|
+
icon?: any;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Warna ikon kustom secara langsung.
|
|
190
|
+
*/
|
|
191
|
+
iconColor?: string;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Ukuran ikon kustom secara langsung (misal: '20px', '1.5rem').
|
|
195
|
+
*/
|
|
196
|
+
iconSize?: string;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Menyembunyikan ikon pada alert.
|
|
200
|
+
* @default false
|
|
201
|
+
*/
|
|
202
|
+
hideIcon?: boolean;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Menampilkan tombol tutup (silang) untuk menutup alert secara interaktif.
|
|
206
|
+
* @default false
|
|
207
|
+
*/
|
|
208
|
+
closable?: boolean;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Callback saat tombol tutup diklik.
|
|
212
|
+
*/
|
|
213
|
+
onClose?: (event: any) => void;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Membuat alert memenuhi lebar kontainer (100%).
|
|
217
|
+
* @default false
|
|
218
|
+
*/
|
|
219
|
+
block?: boolean;
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Style kustom untuk judul alert (UiProps / style object + pseudo support).
|
|
223
|
+
*/
|
|
224
|
+
titleStyle?: UiProps;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Class CSS kustom untuk judul alert.
|
|
228
|
+
*/
|
|
229
|
+
titleClass?: string;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Style kustom untuk deskripsi alert (UiProps / style object + pseudo support).
|
|
233
|
+
*/
|
|
234
|
+
descStyle?: UiProps;
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Class CSS kustom untuk deskripsi alert.
|
|
238
|
+
*/
|
|
239
|
+
descClass?: string;
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Style kustom untuk ikon alert (UiProps / style object + pseudo support).
|
|
243
|
+
*/
|
|
244
|
+
iconStyle?: UiProps;
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Class CSS kustom untuk ikon alert.
|
|
248
|
+
*/
|
|
249
|
+
iconClass?: string;
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Style kustom untuk tombol tutup alert (UiProps / style object + pseudo support).
|
|
253
|
+
*/
|
|
254
|
+
closableStyle?: UiProps;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Class CSS kustom untuk tombol tutup alert.
|
|
258
|
+
*/
|
|
259
|
+
closableClass?: string;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Kustomisasi visual granular melalui style-like object (+ support pseudo-class: hover, active).
|
|
263
|
+
*/
|
|
264
|
+
ui?: UiProps;
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Class CSS kustom.
|
|
268
|
+
*/
|
|
269
|
+
className?: string;
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Konten kustom tambahan di dalam alert.
|
|
273
|
+
*/
|
|
274
|
+
children?: any;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Komponen Alert untuk menampilkan pesan umpan balik kontekstual statis, instruksi peringatan, atau status penting pada halaman.
|
|
279
|
+
*/
|
|
280
|
+
|
|
281
|
+
const props = defineProps<AlertProps>();
|
|
282
|
+
const isVisible = ref(true);
|
|
283
|
+
|
|
284
|
+
function handleDismiss(event: any) {
|
|
285
|
+
isVisible.value = false;
|
|
286
|
+
if (props.onClose) {
|
|
287
|
+
props.onClose(event);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
</script>
|
|
@@ -0,0 +1,154 @@
|
|
|
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 AlertUiProps = UiProps;
|
|
7
|
+
|
|
8
|
+
export interface AlertProps {
|
|
9
|
+
/**
|
|
10
|
+
* Inline CSS style kustom.
|
|
11
|
+
*/
|
|
12
|
+
style?: any;
|
|
13
|
+
/**
|
|
14
|
+
* Judul utama alert.
|
|
15
|
+
*/
|
|
16
|
+
title?: string;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Deskripsi atau pesan teks penjelasan alert.
|
|
20
|
+
*/
|
|
21
|
+
description?: string;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Varian warna semantik alert:
|
|
25
|
+
* - `'neutral'`: Netral (border hitam/putih, background base).
|
|
26
|
+
* - `'info'`: Biru informasi (#2196F3).
|
|
27
|
+
* - `'success'`: Hijau konfirmasi keberhasilan (#04B761).
|
|
28
|
+
* - `'warning'`: Kuning / amber peringatan (#F88000).
|
|
29
|
+
* - `'danger'`: Merah kesalahan / bahaya (#D0021B).
|
|
30
|
+
*
|
|
31
|
+
* @default 'neutral'
|
|
32
|
+
*/
|
|
33
|
+
variant?: "neutral" | "info" | "success" | "warning" | "danger";
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Gaya tampilan visual alert:
|
|
37
|
+
* - `'soft'`: Latar belakang warna transparan lembut (standar).
|
|
38
|
+
* - `'solid'`: Latar belakang warna solid pekat dengan teks putih.
|
|
39
|
+
* - `'outline'`: Garis tepi dengan latar belakang transparan.
|
|
40
|
+
* - `'subtle'`: Latar belakang abu netral dengan aksen border tipis.
|
|
41
|
+
*
|
|
42
|
+
* @default 'soft'
|
|
43
|
+
*/
|
|
44
|
+
appearance?: "soft" | "solid" | "outline" | "subtle";
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Sudut kelengkungan alert:
|
|
48
|
+
* - `'none'`: Sudut tajam 0px.
|
|
49
|
+
* - `'sm'`: Radius halus 4px.
|
|
50
|
+
* - `'md'`: Radius sedang 8px (standar).
|
|
51
|
+
* - `'lg'`: Radius melengkung 12px.
|
|
52
|
+
* - `'full'`: Lingkaran penuh 9999px.
|
|
53
|
+
*
|
|
54
|
+
* @default 'md'
|
|
55
|
+
*/
|
|
56
|
+
rounded?: "none" | "sm" | "md" | "lg" | "full";
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Ikon SVG kustom yang menggantikan ikon bawaan, atau boolean untuk menampilkan/menyembunyikan ikon.
|
|
60
|
+
* @default true
|
|
61
|
+
*/
|
|
62
|
+
icon?: any;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Warna ikon kustom secara langsung.
|
|
66
|
+
*/
|
|
67
|
+
iconColor?: string;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Ukuran ikon kustom secara langsung (misal: '20px', '1.5rem').
|
|
71
|
+
*/
|
|
72
|
+
iconSize?: string;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Menyembunyikan ikon pada alert.
|
|
76
|
+
* @default false
|
|
77
|
+
*/
|
|
78
|
+
hideIcon?: boolean;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Menampilkan tombol tutup (silang) untuk menutup alert secara interaktif.
|
|
82
|
+
* @default false
|
|
83
|
+
*/
|
|
84
|
+
closable?: boolean;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Callback saat tombol tutup diklik.
|
|
88
|
+
*/
|
|
89
|
+
onClose?: (event: any) => void;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Membuat alert memenuhi lebar kontainer (100%).
|
|
93
|
+
* @default false
|
|
94
|
+
*/
|
|
95
|
+
block?: boolean;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Style kustom untuk judul alert (UiProps / style object + pseudo support).
|
|
99
|
+
*/
|
|
100
|
+
titleStyle?: UiProps;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Class CSS kustom untuk judul alert.
|
|
104
|
+
*/
|
|
105
|
+
titleClass?: string;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Style kustom untuk deskripsi alert (UiProps / style object + pseudo support).
|
|
109
|
+
*/
|
|
110
|
+
descStyle?: UiProps;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Class CSS kustom untuk deskripsi alert.
|
|
114
|
+
*/
|
|
115
|
+
descClass?: string;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Style kustom untuk ikon alert (UiProps / style object + pseudo support).
|
|
119
|
+
*/
|
|
120
|
+
iconStyle?: UiProps;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Class CSS kustom untuk ikon alert.
|
|
124
|
+
*/
|
|
125
|
+
iconClass?: string;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Style kustom untuk tombol tutup alert (UiProps / style object + pseudo support).
|
|
129
|
+
*/
|
|
130
|
+
closableStyle?: UiProps;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Class CSS kustom untuk tombol tutup alert.
|
|
134
|
+
*/
|
|
135
|
+
closableClass?: string;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Kustomisasi visual granular melalui style-like object (+ support pseudo-class: hover, active).
|
|
139
|
+
*/
|
|
140
|
+
ui?: UiProps;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Class CSS kustom.
|
|
144
|
+
*/
|
|
145
|
+
className?: string;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Konten kustom tambahan di dalam alert.
|
|
149
|
+
*/
|
|
150
|
+
children?: any;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
declare const component: DefineComponent<AlertProps>;
|
|
154
|
+
export default component;
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ttdk-design-system/alert",
|
|
3
|
+
"component": "Alert",
|
|
4
|
+
"folder": "alert",
|
|
5
|
+
"description": "Komponen Alert untuk menampilkan pesan umpan balik kontekstual statis, instruksi peringatan, atau status penting pada halaman.",
|
|
6
|
+
"stylesheets": [
|
|
7
|
+
{
|
|
8
|
+
"theme": "common",
|
|
9
|
+
"file": "alert.css",
|
|
10
|
+
"importPath": "web/alert/alert.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
|
+
"title": {
|
|
24
|
+
"name": "title",
|
|
25
|
+
"type": "string",
|
|
26
|
+
"optional": true,
|
|
27
|
+
"default": null,
|
|
28
|
+
"description": "Judul utama alert.",
|
|
29
|
+
"example": null,
|
|
30
|
+
"param": null
|
|
31
|
+
},
|
|
32
|
+
"description": {
|
|
33
|
+
"name": "description",
|
|
34
|
+
"type": "string",
|
|
35
|
+
"optional": true,
|
|
36
|
+
"default": null,
|
|
37
|
+
"description": "Deskripsi atau pesan teks penjelasan alert.",
|
|
38
|
+
"example": null,
|
|
39
|
+
"param": null
|
|
40
|
+
},
|
|
41
|
+
"variant": {
|
|
42
|
+
"name": "variant",
|
|
43
|
+
"type": "| 'neutral'\n | 'info'\n | 'success'\n | 'warning'\n | 'danger'",
|
|
44
|
+
"optional": true,
|
|
45
|
+
"default": "neutral",
|
|
46
|
+
"description": "Varian warna semantik alert: - `'neutral'`: Netral (border hitam/putih, background base). - `'info'`: Biru informasi (#2196F3). - `'success'`: Hijau konfirmasi keberhasilan (#04B761). - `'warning'`: Kuning / amber peringatan (#F88000). - `'danger'`: Merah kesalahan / bahaya (#D0021B).",
|
|
47
|
+
"example": null,
|
|
48
|
+
"param": null
|
|
49
|
+
},
|
|
50
|
+
"appearance": {
|
|
51
|
+
"name": "appearance",
|
|
52
|
+
"type": "'soft' | 'solid' | 'outline' | 'subtle'",
|
|
53
|
+
"optional": true,
|
|
54
|
+
"default": "soft",
|
|
55
|
+
"description": "Gaya tampilan visual alert: - `'soft'`: Latar belakang warna transparan lembut (standar). - `'solid'`: Latar belakang warna solid pekat dengan teks putih. - `'outline'`: Garis tepi dengan latar belakang transparan. - `'subtle'`: Latar belakang abu netral dengan aksen border tipis.",
|
|
56
|
+
"example": null,
|
|
57
|
+
"param": null
|
|
58
|
+
},
|
|
59
|
+
"rounded": {
|
|
60
|
+
"name": "rounded",
|
|
61
|
+
"type": "'none' | 'sm' | 'md' | 'lg' | 'full'",
|
|
62
|
+
"optional": true,
|
|
63
|
+
"default": "md",
|
|
64
|
+
"description": "Sudut kelengkungan alert: - `'none'`: Sudut tajam 0px. - `'sm'`: Radius halus 4px. - `'md'`: Radius sedang 8px (standar). - `'lg'`: Radius melengkung 12px. - `'full'`: Lingkaran penuh 9999px.",
|
|
65
|
+
"example": null,
|
|
66
|
+
"param": null
|
|
67
|
+
},
|
|
68
|
+
"icon": {
|
|
69
|
+
"name": "icon",
|
|
70
|
+
"type": "any",
|
|
71
|
+
"optional": true,
|
|
72
|
+
"default": "true",
|
|
73
|
+
"description": "Ikon SVG kustom yang menggantikan ikon bawaan, atau boolean untuk menampilkan/menyembunyikan ikon.",
|
|
74
|
+
"example": null,
|
|
75
|
+
"param": null
|
|
76
|
+
},
|
|
77
|
+
"iconColor": {
|
|
78
|
+
"name": "iconColor",
|
|
79
|
+
"type": "string",
|
|
80
|
+
"optional": true,
|
|
81
|
+
"default": null,
|
|
82
|
+
"description": "Warna ikon kustom secara langsung.",
|
|
83
|
+
"example": null,
|
|
84
|
+
"param": null
|
|
85
|
+
},
|
|
86
|
+
"iconSize": {
|
|
87
|
+
"name": "iconSize",
|
|
88
|
+
"type": "string",
|
|
89
|
+
"optional": true,
|
|
90
|
+
"default": null,
|
|
91
|
+
"description": "Ukuran ikon kustom secara langsung (misal: '20px', '1.5rem').",
|
|
92
|
+
"example": null,
|
|
93
|
+
"param": null
|
|
94
|
+
},
|
|
95
|
+
"hideIcon": {
|
|
96
|
+
"name": "hideIcon",
|
|
97
|
+
"type": "boolean",
|
|
98
|
+
"optional": true,
|
|
99
|
+
"default": "false",
|
|
100
|
+
"description": "Menyembunyikan ikon pada alert.",
|
|
101
|
+
"example": null,
|
|
102
|
+
"param": null
|
|
103
|
+
},
|
|
104
|
+
"closable": {
|
|
105
|
+
"name": "closable",
|
|
106
|
+
"type": "boolean",
|
|
107
|
+
"optional": true,
|
|
108
|
+
"default": "false",
|
|
109
|
+
"description": "Menampilkan tombol tutup (silang) untuk menutup alert secara interaktif.",
|
|
110
|
+
"example": null,
|
|
111
|
+
"param": null
|
|
112
|
+
},
|
|
113
|
+
"onClose": {
|
|
114
|
+
"name": "onClose",
|
|
115
|
+
"type": "(event: any) => void",
|
|
116
|
+
"optional": true,
|
|
117
|
+
"default": null,
|
|
118
|
+
"description": "Callback saat tombol tutup diklik.",
|
|
119
|
+
"example": null,
|
|
120
|
+
"param": null
|
|
121
|
+
},
|
|
122
|
+
"block": {
|
|
123
|
+
"name": "block",
|
|
124
|
+
"type": "boolean",
|
|
125
|
+
"optional": true,
|
|
126
|
+
"default": "false",
|
|
127
|
+
"description": "Membuat alert memenuhi lebar kontainer (100%).",
|
|
128
|
+
"example": null,
|
|
129
|
+
"param": null
|
|
130
|
+
},
|
|
131
|
+
"titleStyle": {
|
|
132
|
+
"name": "titleStyle",
|
|
133
|
+
"type": "UiProps",
|
|
134
|
+
"optional": true,
|
|
135
|
+
"default": null,
|
|
136
|
+
"description": "Style kustom untuk judul alert (UiProps / style object + pseudo support).",
|
|
137
|
+
"example": null,
|
|
138
|
+
"param": null
|
|
139
|
+
},
|
|
140
|
+
"titleClass": {
|
|
141
|
+
"name": "titleClass",
|
|
142
|
+
"type": "string",
|
|
143
|
+
"optional": true,
|
|
144
|
+
"default": null,
|
|
145
|
+
"description": "Class CSS kustom untuk judul alert.",
|
|
146
|
+
"example": null,
|
|
147
|
+
"param": null
|
|
148
|
+
},
|
|
149
|
+
"descStyle": {
|
|
150
|
+
"name": "descStyle",
|
|
151
|
+
"type": "UiProps",
|
|
152
|
+
"optional": true,
|
|
153
|
+
"default": null,
|
|
154
|
+
"description": "Style kustom untuk deskripsi alert (UiProps / style object + pseudo support).",
|
|
155
|
+
"example": null,
|
|
156
|
+
"param": null
|
|
157
|
+
},
|
|
158
|
+
"descClass": {
|
|
159
|
+
"name": "descClass",
|
|
160
|
+
"type": "string",
|
|
161
|
+
"optional": true,
|
|
162
|
+
"default": null,
|
|
163
|
+
"description": "Class CSS kustom untuk deskripsi alert.",
|
|
164
|
+
"example": null,
|
|
165
|
+
"param": null
|
|
166
|
+
},
|
|
167
|
+
"iconStyle": {
|
|
168
|
+
"name": "iconStyle",
|
|
169
|
+
"type": "UiProps",
|
|
170
|
+
"optional": true,
|
|
171
|
+
"default": null,
|
|
172
|
+
"description": "Style kustom untuk ikon alert (UiProps / style object + pseudo support).",
|
|
173
|
+
"example": null,
|
|
174
|
+
"param": null
|
|
175
|
+
},
|
|
176
|
+
"iconClass": {
|
|
177
|
+
"name": "iconClass",
|
|
178
|
+
"type": "string",
|
|
179
|
+
"optional": true,
|
|
180
|
+
"default": null,
|
|
181
|
+
"description": "Class CSS kustom untuk ikon alert.",
|
|
182
|
+
"example": null,
|
|
183
|
+
"param": null
|
|
184
|
+
},
|
|
185
|
+
"closableStyle": {
|
|
186
|
+
"name": "closableStyle",
|
|
187
|
+
"type": "UiProps",
|
|
188
|
+
"optional": true,
|
|
189
|
+
"default": null,
|
|
190
|
+
"description": "Style kustom untuk tombol tutup alert (UiProps / style object + pseudo support).",
|
|
191
|
+
"example": null,
|
|
192
|
+
"param": null
|
|
193
|
+
},
|
|
194
|
+
"closableClass": {
|
|
195
|
+
"name": "closableClass",
|
|
196
|
+
"type": "string",
|
|
197
|
+
"optional": true,
|
|
198
|
+
"default": null,
|
|
199
|
+
"description": "Class CSS kustom untuk tombol tutup alert.",
|
|
200
|
+
"example": null,
|
|
201
|
+
"param": null
|
|
202
|
+
},
|
|
203
|
+
"ui": {
|
|
204
|
+
"name": "ui",
|
|
205
|
+
"type": "UiProps",
|
|
206
|
+
"optional": true,
|
|
207
|
+
"default": null,
|
|
208
|
+
"description": "Kustomisasi visual granular melalui style-like object (+ support pseudo-class: hover, active).",
|
|
209
|
+
"example": null,
|
|
210
|
+
"param": null
|
|
211
|
+
},
|
|
212
|
+
"className": {
|
|
213
|
+
"name": "className",
|
|
214
|
+
"type": "string",
|
|
215
|
+
"optional": true,
|
|
216
|
+
"default": null,
|
|
217
|
+
"description": "Class CSS kustom.",
|
|
218
|
+
"example": null,
|
|
219
|
+
"param": null
|
|
220
|
+
},
|
|
221
|
+
"children": {
|
|
222
|
+
"name": "children",
|
|
223
|
+
"type": "any",
|
|
224
|
+
"optional": true,
|
|
225
|
+
"default": null,
|
|
226
|
+
"description": "Konten kustom tambahan di dalam alert.",
|
|
227
|
+
"example": null,
|
|
228
|
+
"param": null
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
"subInterfaces": {},
|
|
232
|
+
"supportedFrameworks": [
|
|
233
|
+
"react",
|
|
234
|
+
"vue",
|
|
235
|
+
"svelte"
|
|
236
|
+
],
|
|
237
|
+
"themes": [
|
|
238
|
+
"tw"
|
|
239
|
+
]
|
|
240
|
+
}
|