@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,60 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// Auto-generated by TTDK Design System Vue Type Generator
|
|
3
|
+
import type { DefineComponent } from "vue";
|
|
4
|
+
import { buildResponsiveVars, type ResponsiveBreakpoints } from "../../core/types";
|
|
5
|
+
|
|
6
|
+
export interface TabItem {
|
|
7
|
+
label: string;
|
|
8
|
+
value: string;
|
|
9
|
+
icon?: any;
|
|
10
|
+
badge?: string | number;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
content?: any;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface TabsUiBaseProps {
|
|
16
|
+
activeColor?: string;
|
|
17
|
+
indicatorColor?: string;
|
|
18
|
+
inactiveColor?: string;
|
|
19
|
+
bg?: string;
|
|
20
|
+
borderColor?: string;
|
|
21
|
+
textSize?: string;
|
|
22
|
+
fontSize?: string;
|
|
23
|
+
padding?: string;
|
|
24
|
+
gap?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface TabsUiProps extends TabsUiBaseProps, ResponsiveBreakpoints<TabsUiBaseProps> {
|
|
28
|
+
sm?: Partial<TabsUiBaseProps>;
|
|
29
|
+
lt_sm?: Partial<TabsUiBaseProps>;
|
|
30
|
+
md?: Partial<TabsUiBaseProps>;
|
|
31
|
+
lt_md?: Partial<TabsUiBaseProps>;
|
|
32
|
+
lg?: Partial<TabsUiBaseProps>;
|
|
33
|
+
lt_lg?: Partial<TabsUiBaseProps>;
|
|
34
|
+
xl?: Partial<TabsUiBaseProps>;
|
|
35
|
+
lt_xl?: Partial<TabsUiBaseProps>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface TabsProps {
|
|
39
|
+
items: TabItem[];
|
|
40
|
+
modelValue?: string;
|
|
41
|
+
value?: string;
|
|
42
|
+
defaultValue?: string;
|
|
43
|
+
orientation?: "horizontal" | "vertical";
|
|
44
|
+
variant?: "line" | "pills";
|
|
45
|
+
size?: "sm" | "md" | "lg";
|
|
46
|
+
fitted?: boolean;
|
|
47
|
+
rounded?: "none" | "sm" | "md" | "lg" | "full";
|
|
48
|
+
ui?: TabsUiProps;
|
|
49
|
+
className?: string;
|
|
50
|
+
class?: string;
|
|
51
|
+
onChange?: (value: string) => void;
|
|
52
|
+
children?: any;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
declare const component: DefineComponent<TabsProps, {}, {}, {}, {}, {}, {}, {
|
|
56
|
+
(e: "update:modelValue", value: string): void;
|
|
57
|
+
(e: "update:value", value: string): void;
|
|
58
|
+
(e: "change", value: string): void;
|
|
59
|
+
}>;
|
|
60
|
+
export default component;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# <Text /> — TTDK Component Reference
|
|
2
|
+
|
|
3
|
+
TTDK Text 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/text/text.css";`
|
|
8
|
+
|
|
9
|
+
## 2. Subpath Component Import
|
|
10
|
+
```ts
|
|
11
|
+
// React
|
|
12
|
+
import Text from "@ttdk-design-system/library-react/web/text";
|
|
13
|
+
|
|
14
|
+
// Vue 3
|
|
15
|
+
import Text from "@ttdk-design-system/library-vue/web/text";
|
|
16
|
+
|
|
17
|
+
// Svelte
|
|
18
|
+
import Text from "@ttdk-design-system/library-svelte/web/text";
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## 3. Props & API Reference
|
|
22
|
+
|
|
23
|
+
| Prop | Type | Default | Description |
|
|
24
|
+
| :--- | :--- | :--- | :--- |
|
|
25
|
+
| `as?` | `| 'span'
|
|
26
|
+
| 'p'
|
|
27
|
+
| 'div'
|
|
28
|
+
| 'h1'
|
|
29
|
+
| 'h2'
|
|
30
|
+
| 'h3'
|
|
31
|
+
| 'h4'
|
|
32
|
+
| 'h5'
|
|
33
|
+
| 'h6'
|
|
34
|
+
| 'label'
|
|
35
|
+
| 'small'
|
|
36
|
+
| 'strong'
|
|
37
|
+
| 'em'
|
|
38
|
+
| 'code'
|
|
39
|
+
| 'blockquote'
|
|
40
|
+
| 'a'` | `span` | Tag elemen HTML semantik yang digunakan untuk me-render teks. - `'span'`: Inline span (default). - `'p'`: Paragraf teks. - `'div'`: Blok generik. - `'h1'` s/d `'h6'`: Heading level 1 sampai 6. - `'label'`: Elemen label formulir. - `'small'`: Teks berukuran kecil / disclaimer. - `'strong'`: Teks tebal berpenekanan penting. - `'em'`: Teks berpenekanan miring. - `'code'`: Format kode inline monospace. - `'blockquote'`: Kutipan blok. - `'a'`: Tautan / link teks. |
|
|
41
|
+
| `variant?` | `| 'primary'
|
|
42
|
+
| 'success'
|
|
43
|
+
| 'info'
|
|
44
|
+
| 'warning'
|
|
45
|
+
| 'danger'
|
|
46
|
+
| 'neutral'` | `neutral` | Varian warna semantik teks (disesuaikan dengan Chip / Badge TTDK). - `'primary'`: Warna utama tema penekanan aksi (brand teal). - `'success'`: Warna status sukses (hijau). - `'info'`: Warna status informasi (biru). - `'warning'`: Warna status peringatan (kuning). - `'danger'`: Warna status bahaya / kesalahan (merah). - `'neutral'`: Warna teks dasar foreground (standar). |
|
|
47
|
+
| `size?` | `'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl'` | `-` | Ukuran tipografi teks yang memengaruhi font-size dan line-height. - `'xs'`: 12px (line-height: 16px) - `'sm'`: 14px (line-height: 20px) - `'md'`: 16px (line-height: 24px) - `'lg'`: 18px (line-height: 28px) - `'xl'`: 20px (line-height: 28px) - `'2xl'`: 24px (line-height: 32px) - `'3xl'`: 30px (line-height: 36px) - `'4xl'`: 36px (line-height: 40px) - `'5xl'`: 48px (line-height: 1.1) - `'6xl'`: 60px (line-height: 1.05) |
|
|
48
|
+
| `weight?` | `'normal' | 'medium' | 'semibold' | 'bold' | 'extrabold'` | `-` | Ketebalan font teks. - `'normal'`: 400 - `'medium'`: 500 - `'semibold'`: 600 - `'bold'`: 700 - `'extrabold'`: 800 |
|
|
49
|
+
| `align?` | `'left' | 'center' | 'right' | 'justify'` | `-` | Perataan horizontal teks. - `'left'`: Rata kiri. - `'center'`: Rata tengah. - `'right'`: Rata kanan. - `'justify'`: Rata kiri-kanan. |
|
|
50
|
+
| `transform?` | `'uppercase' | 'lowercase' | 'capitalize' | 'normal'` | `-` | Transformasi huruf kapital/kecil pada teks. - `'uppercase'`: SEMUA HURUF BESAR. - `'lowercase'`: semua huruf kecil. - `'capitalize'`: Huruf Pertama Besar Setiap Kata. - `'normal'`: Normal sesuai aslinya. |
|
|
51
|
+
| `truncate?` | `boolean` | `false` | Memotong teks satu baris yang melebihi batas dengan elipsis (...). |
|
|
52
|
+
| `lineClamp?` | `'1' | '2' | '3' | '4' | '5' | '6' | 1 | 2 | 3 | 4 | 5 | 6` | `-` | Memotong teks multi-baris pada jumlah baris tertentu menggunakan CSS line-clamp. |
|
|
53
|
+
| `noWrap?` | `boolean` | `false` | Mencegah teks dari wrapping (white-space: nowrap). |
|
|
54
|
+
| `italic?` | `boolean` | `false` | Menampilkan teks dalam gaya miring (italic). |
|
|
55
|
+
| `underline?` | `boolean` | `false` | Menampilkan garis bawah pada teks (underline). |
|
|
56
|
+
| `margin?` | `string` | `-` | Margin kustom pada elemen teks (misal: '0 0 16px 0', '8px', '1rem'). |
|
|
57
|
+
| `padding?` | `string` | `-` | Padding kustom pada elemen teks (misal: '8px 12px', '4px 8px'). |
|
|
58
|
+
| `href?` | `string` | `-` | URL tujuan jika `as="a"`. |
|
|
59
|
+
| `target?` | `string` | `-` | Target link jika `as="a"`. |
|
|
60
|
+
| `className?` | `string` | `-` | Class CSS kustom. |
|
|
61
|
+
| `style?` | `any` | `-` | Inline CSS style object native. |
|
|
62
|
+
| `ui?` | `UiProps` | `-` | Kustomisasi visual granular ala Nuxt UI / Universal UI System (UiProps). |
|
|
63
|
+
| `children?` | `any` | `-` | Konten teks atau elemen anak di dalam komponen Text. |
|
|
64
|
+
|
|
65
|
+
## 4. Usage Examples
|
|
66
|
+
|
|
67
|
+
### React Example
|
|
68
|
+
```tsx
|
|
69
|
+
import Text from "@ttdk-design-system/library-react/web/text";
|
|
70
|
+
import "@ttdk-design-system/library-react/web/text/text.css";
|
|
71
|
+
|
|
72
|
+
export function Example() {
|
|
73
|
+
return (
|
|
74
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
|
|
75
|
+
<Text as="h1" size="3xl" weight="bold">
|
|
76
|
+
Judul Halaman Utama
|
|
77
|
+
</Text>
|
|
78
|
+
<Text as="p" size="md" variant="neutral">
|
|
79
|
+
Paragraf deskripsi dengan ukuran standar dan warna netral.
|
|
80
|
+
</Text>
|
|
81
|
+
<Text as="small" variant="neutral">
|
|
82
|
+
Terakhir diperbarui pada 04 September 2026.
|
|
83
|
+
</Text>
|
|
84
|
+
</div>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Vue 3 Example
|
|
90
|
+
```vue
|
|
91
|
+
<script setup lang="ts">
|
|
92
|
+
import Text from "@ttdk-design-system/library-vue/web/text";
|
|
93
|
+
import "@ttdk-design-system/library-vue/web/text/text.css";
|
|
94
|
+
</script>
|
|
95
|
+
|
|
96
|
+
<template>
|
|
97
|
+
<div style="display: flex; flex-direction: column; gap: 8px;">
|
|
98
|
+
<Text as="h1" size="3xl" weight="bold">
|
|
99
|
+
Judul Halaman Utama
|
|
100
|
+
</Text>
|
|
101
|
+
<Text as="p" size="md" variant="neutral">
|
|
102
|
+
Paragraf deskripsi dengan ukuran standar dan warna netral.
|
|
103
|
+
</Text>
|
|
104
|
+
<Text as="small" variant="neutral">
|
|
105
|
+
Terakhir diperbarui pada 04 September 2026.
|
|
106
|
+
</Text>
|
|
107
|
+
</div>
|
|
108
|
+
</template>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Svelte Example
|
|
112
|
+
```svelte
|
|
113
|
+
<script lang="ts">
|
|
114
|
+
import Text from "@ttdk-design-system/library-svelte/web/text";
|
|
115
|
+
import "@ttdk-design-system/library-svelte/web/text/text.css";
|
|
116
|
+
</script>
|
|
117
|
+
|
|
118
|
+
<div style="display: flex; flex-direction: column; gap: 8px;">
|
|
119
|
+
<Text as="h1" size="3xl" weight="bold">
|
|
120
|
+
Judul Halaman Utama
|
|
121
|
+
</Text>
|
|
122
|
+
<Text as="p" size="md" variant="neutral">
|
|
123
|
+
Paragraf deskripsi dengan ukuran standar dan warna netral.
|
|
124
|
+
</Text>
|
|
125
|
+
<Text as="small" variant="neutral">
|
|
126
|
+
Terakhir diperbarui pada 04 September 2026.
|
|
127
|
+
</Text>
|
|
128
|
+
</div>
|
|
129
|
+
```
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ttdk-design-system/text",
|
|
3
|
+
"component": "Text",
|
|
4
|
+
"folder": "text",
|
|
5
|
+
"description": "TTDK Text component with multi-theme support.",
|
|
6
|
+
"stylesheets": [
|
|
7
|
+
{
|
|
8
|
+
"theme": "common",
|
|
9
|
+
"file": "text.css",
|
|
10
|
+
"importPath": "web/text/text.css"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"props": {
|
|
14
|
+
"as": {
|
|
15
|
+
"name": "as",
|
|
16
|
+
"type": "| 'span'\n | 'p'\n | 'div'\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6'\n | 'label'\n | 'small'\n | 'strong'\n | 'em'\n | 'code'\n | 'blockquote'\n | 'a'",
|
|
17
|
+
"optional": true,
|
|
18
|
+
"default": "span",
|
|
19
|
+
"description": "Tag elemen HTML semantik yang digunakan untuk me-render teks. - `'span'`: Inline span (default). - `'p'`: Paragraf teks. - `'div'`: Blok generik. - `'h1'` s/d `'h6'`: Heading level 1 sampai 6. - `'label'`: Elemen label formulir. - `'small'`: Teks berukuran kecil / disclaimer. - `'strong'`: Teks tebal berpenekanan penting. - `'em'`: Teks berpenekanan miring. - `'code'`: Format kode inline monospace. - `'blockquote'`: Kutipan blok. - `'a'`: Tautan / link teks.",
|
|
20
|
+
"example": null,
|
|
21
|
+
"param": null
|
|
22
|
+
},
|
|
23
|
+
"variant": {
|
|
24
|
+
"name": "variant",
|
|
25
|
+
"type": "| 'primary'\n | 'success'\n | 'info'\n | 'warning'\n | 'danger'\n | 'neutral'",
|
|
26
|
+
"optional": true,
|
|
27
|
+
"default": "neutral",
|
|
28
|
+
"description": "Varian warna semantik teks (disesuaikan dengan Chip / Badge TTDK). - `'primary'`: Warna utama tema penekanan aksi (brand teal). - `'success'`: Warna status sukses (hijau). - `'info'`: Warna status informasi (biru). - `'warning'`: Warna status peringatan (kuning). - `'danger'`: Warna status bahaya / kesalahan (merah). - `'neutral'`: Warna teks dasar foreground (standar).",
|
|
29
|
+
"example": null,
|
|
30
|
+
"param": null
|
|
31
|
+
},
|
|
32
|
+
"size": {
|
|
33
|
+
"name": "size",
|
|
34
|
+
"type": "'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl'",
|
|
35
|
+
"optional": true,
|
|
36
|
+
"default": null,
|
|
37
|
+
"description": "Ukuran tipografi teks yang memengaruhi font-size dan line-height. - `'xs'`: 12px (line-height: 16px) - `'sm'`: 14px (line-height: 20px) - `'md'`: 16px (line-height: 24px) - `'lg'`: 18px (line-height: 28px) - `'xl'`: 20px (line-height: 28px) - `'2xl'`: 24px (line-height: 32px) - `'3xl'`: 30px (line-height: 36px) - `'4xl'`: 36px (line-height: 40px) - `'5xl'`: 48px (line-height: 1.1) - `'6xl'`: 60px (line-height: 1.05)",
|
|
38
|
+
"example": null,
|
|
39
|
+
"param": null
|
|
40
|
+
},
|
|
41
|
+
"weight": {
|
|
42
|
+
"name": "weight",
|
|
43
|
+
"type": "'normal' | 'medium' | 'semibold' | 'bold' | 'extrabold'",
|
|
44
|
+
"optional": true,
|
|
45
|
+
"default": null,
|
|
46
|
+
"description": "Ketebalan font teks. - `'normal'`: 400 - `'medium'`: 500 - `'semibold'`: 600 - `'bold'`: 700 - `'extrabold'`: 800",
|
|
47
|
+
"example": null,
|
|
48
|
+
"param": null
|
|
49
|
+
},
|
|
50
|
+
"align": {
|
|
51
|
+
"name": "align",
|
|
52
|
+
"type": "'left' | 'center' | 'right' | 'justify'",
|
|
53
|
+
"optional": true,
|
|
54
|
+
"default": null,
|
|
55
|
+
"description": "Perataan horizontal teks. - `'left'`: Rata kiri. - `'center'`: Rata tengah. - `'right'`: Rata kanan. - `'justify'`: Rata kiri-kanan.",
|
|
56
|
+
"example": null,
|
|
57
|
+
"param": null
|
|
58
|
+
},
|
|
59
|
+
"transform": {
|
|
60
|
+
"name": "transform",
|
|
61
|
+
"type": "'uppercase' | 'lowercase' | 'capitalize' | 'normal'",
|
|
62
|
+
"optional": true,
|
|
63
|
+
"default": null,
|
|
64
|
+
"description": "Transformasi huruf kapital/kecil pada teks. - `'uppercase'`: SEMUA HURUF BESAR. - `'lowercase'`: semua huruf kecil. - `'capitalize'`: Huruf Pertama Besar Setiap Kata. - `'normal'`: Normal sesuai aslinya.",
|
|
65
|
+
"example": null,
|
|
66
|
+
"param": null
|
|
67
|
+
},
|
|
68
|
+
"truncate": {
|
|
69
|
+
"name": "truncate",
|
|
70
|
+
"type": "boolean",
|
|
71
|
+
"optional": true,
|
|
72
|
+
"default": "false",
|
|
73
|
+
"description": "Memotong teks satu baris yang melebihi batas dengan elipsis (...).",
|
|
74
|
+
"example": null,
|
|
75
|
+
"param": null
|
|
76
|
+
},
|
|
77
|
+
"lineClamp": {
|
|
78
|
+
"name": "lineClamp",
|
|
79
|
+
"type": "'1' | '2' | '3' | '4' | '5' | '6' | 1 | 2 | 3 | 4 | 5 | 6",
|
|
80
|
+
"optional": true,
|
|
81
|
+
"default": null,
|
|
82
|
+
"description": "Memotong teks multi-baris pada jumlah baris tertentu menggunakan CSS line-clamp.",
|
|
83
|
+
"example": null,
|
|
84
|
+
"param": null
|
|
85
|
+
},
|
|
86
|
+
"noWrap": {
|
|
87
|
+
"name": "noWrap",
|
|
88
|
+
"type": "boolean",
|
|
89
|
+
"optional": true,
|
|
90
|
+
"default": "false",
|
|
91
|
+
"description": "Mencegah teks dari wrapping (white-space: nowrap).",
|
|
92
|
+
"example": null,
|
|
93
|
+
"param": null
|
|
94
|
+
},
|
|
95
|
+
"italic": {
|
|
96
|
+
"name": "italic",
|
|
97
|
+
"type": "boolean",
|
|
98
|
+
"optional": true,
|
|
99
|
+
"default": "false",
|
|
100
|
+
"description": "Menampilkan teks dalam gaya miring (italic).",
|
|
101
|
+
"example": null,
|
|
102
|
+
"param": null
|
|
103
|
+
},
|
|
104
|
+
"underline": {
|
|
105
|
+
"name": "underline",
|
|
106
|
+
"type": "boolean",
|
|
107
|
+
"optional": true,
|
|
108
|
+
"default": "false",
|
|
109
|
+
"description": "Menampilkan garis bawah pada teks (underline).",
|
|
110
|
+
"example": null,
|
|
111
|
+
"param": null
|
|
112
|
+
},
|
|
113
|
+
"margin": {
|
|
114
|
+
"name": "margin",
|
|
115
|
+
"type": "string",
|
|
116
|
+
"optional": true,
|
|
117
|
+
"default": null,
|
|
118
|
+
"description": "Margin kustom pada elemen teks (misal: '0 0 16px 0', '8px', '1rem').",
|
|
119
|
+
"example": null,
|
|
120
|
+
"param": null
|
|
121
|
+
},
|
|
122
|
+
"padding": {
|
|
123
|
+
"name": "padding",
|
|
124
|
+
"type": "string",
|
|
125
|
+
"optional": true,
|
|
126
|
+
"default": null,
|
|
127
|
+
"description": "Padding kustom pada elemen teks (misal: '8px 12px', '4px 8px').",
|
|
128
|
+
"example": null,
|
|
129
|
+
"param": null
|
|
130
|
+
},
|
|
131
|
+
"href": {
|
|
132
|
+
"name": "href",
|
|
133
|
+
"type": "string",
|
|
134
|
+
"optional": true,
|
|
135
|
+
"default": null,
|
|
136
|
+
"description": "URL tujuan jika `as=\"a\"`.",
|
|
137
|
+
"example": null,
|
|
138
|
+
"param": null
|
|
139
|
+
},
|
|
140
|
+
"target": {
|
|
141
|
+
"name": "target",
|
|
142
|
+
"type": "string",
|
|
143
|
+
"optional": true,
|
|
144
|
+
"default": null,
|
|
145
|
+
"description": "Target link jika `as=\"a\"`.",
|
|
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
|
+
"style": {
|
|
159
|
+
"name": "style",
|
|
160
|
+
"type": "any",
|
|
161
|
+
"optional": true,
|
|
162
|
+
"default": null,
|
|
163
|
+
"description": "Inline CSS style object native.",
|
|
164
|
+
"example": null,
|
|
165
|
+
"param": null
|
|
166
|
+
},
|
|
167
|
+
"ui": {
|
|
168
|
+
"name": "ui",
|
|
169
|
+
"type": "UiProps",
|
|
170
|
+
"optional": true,
|
|
171
|
+
"default": null,
|
|
172
|
+
"description": "Kustomisasi visual granular ala Nuxt UI / Universal UI System (UiProps).",
|
|
173
|
+
"example": null,
|
|
174
|
+
"param": null
|
|
175
|
+
},
|
|
176
|
+
"children": {
|
|
177
|
+
"name": "children",
|
|
178
|
+
"type": "any",
|
|
179
|
+
"optional": true,
|
|
180
|
+
"default": null,
|
|
181
|
+
"description": "Konten teks atau elemen anak di dalam komponen Text.",
|
|
182
|
+
"example": null,
|
|
183
|
+
"param": null
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
"subInterfaces": {},
|
|
187
|
+
"supportedFrameworks": [
|
|
188
|
+
"react",
|
|
189
|
+
"vue",
|
|
190
|
+
"svelte"
|
|
191
|
+
],
|
|
192
|
+
"themes": [
|
|
193
|
+
"tw"
|
|
194
|
+
]
|
|
195
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--ttdk-text-font-sans:var(--ttdk-font-sans);--ttdk-text-font-mono:var(--ttdk-font-mono);--ttdk-color-text-default:var(--ttdk-text-icon-primary);--ttdk-color-text-muted:var(--ttdk-text-icon-secondary);--ttdk-color-text-primary:var(--ttdk-brand-default);--ttdk-color-text-secondary:var(--ttdk-text-icon-secondary);--ttdk-color-text-accent:var(--ttdk-text-icon-status-info);--ttdk-color-text-danger:var(--ttdk-text-icon-status-error);--ttdk-color-text-success:var(--ttdk-text-icon-status-success);--ttdk-color-text-warning:var(--ttdk-text-icon-status-warning);--ttdk-color-text-info:var(--ttdk-text-icon-status-info);--ttdk-code-bg:var(--ttdk-bg-secondary-disabled);--ttdk-code-border:var(--ttdk-stroke-subtle);--ttdk-blockquote-border:var(--ttdk-stroke-divider)}.dark,:root.dark{--ttdk-color-text-default:var(--ttdk-text-icon-primary);--ttdk-color-text-muted:var(--ttdk-text-icon-secondary);--ttdk-color-text-primary:var(--ttdk-brand-default);--ttdk-color-text-secondary:var(--ttdk-text-icon-secondary);--ttdk-color-text-accent:var(--ttdk-text-icon-status-info);--ttdk-color-text-danger:var(--ttdk-text-icon-status-error);--ttdk-color-text-success:var(--ttdk-text-icon-status-success);--ttdk-color-text-warning:var(--ttdk-text-icon-status-warning);--ttdk-color-text-info:var(--ttdk-text-icon-status-info);--ttdk-code-bg:var(--ttdk-bg-secondary-disabled);--ttdk-code-border:var(--ttdk-stroke-subtle);--ttdk-blockquote-border:var(--ttdk-stroke-divider)}.ttdk-text{font-family:var(--ttdk-text-font-sans);color:var(--ttdk-ui-color,var(--ttdk-color-text-default));box-sizing:border-box;margin:0;padding:0;font-size:16px;font-weight:400;line-height:24px;transition:color .15s}h1.ttdk-text{letter-spacing:-.02em;font-size:36px;font-weight:700;line-height:40px}h2.ttdk-text{letter-spacing:-.015em;font-size:30px;font-weight:600;line-height:36px}h3.ttdk-text{letter-spacing:-.01em;font-size:24px;font-weight:600;line-height:32px}h4.ttdk-text{font-size:20px;font-weight:600;line-height:28px}h5.ttdk-text{font-size:18px;font-weight:500;line-height:28px}h6.ttdk-text{font-size:16px;font-weight:500;line-height:24px}p.ttdk-text{font-size:16px;line-height:24px}small.ttdk-text{color:var(--ttdk-color-text-muted);font-size:12px;line-height:16px}label.ttdk-text{font-size:14px;font-weight:500;line-height:20px}strong.ttdk-text{font-weight:700}.ttdk-text[data-variant=neutral]{color:var(--ttdk-color-text-default)}.ttdk-text[data-variant=primary]{color:var(--ttdk-color-text-primary)}.ttdk-text[data-variant=success]{color:var(--ttdk-color-text-success)}.ttdk-text[data-variant=info]{color:var(--ttdk-color-text-info)}.ttdk-text[data-variant=warning]{color:var(--ttdk-color-text-warning)}.ttdk-text[data-variant=danger]{color:var(--ttdk-color-text-danger)}.ttdk-text[data-variant=muted],.ttdk-text[data-variant=secondary]{color:var(--ttdk-color-text-secondary)}.ttdk-text[data-variant=accent]{color:var(--ttdk-color-text-accent)}.ttdk-text[data-size=xs]{font-size:12px;line-height:16px}.ttdk-text[data-size=sm]{font-size:14px;line-height:20px}.ttdk-text[data-size=md]{font-size:16px;line-height:24px}.ttdk-text[data-size=lg]{font-size:18px;line-height:28px}.ttdk-text[data-size=xl]{font-size:20px;line-height:28px}.ttdk-text[data-size="2xl"]{font-size:24px;line-height:32px}.ttdk-text[data-size="3xl"]{font-size:30px;line-height:36px}.ttdk-text[data-size="4xl"]{letter-spacing:-.02em;font-size:36px;line-height:40px}.ttdk-text[data-size="5xl"]{letter-spacing:-.025em;font-size:48px;line-height:1.1}.ttdk-text[data-size="6xl"]{letter-spacing:-.03em;font-size:60px;line-height:1.05}.ttdk-text[data-weight=normal]{font-weight:400}.ttdk-text[data-weight=medium]{font-weight:500}.ttdk-text[data-weight=semibold]{font-weight:600}.ttdk-text[data-weight=bold]{font-weight:700}.ttdk-text[data-weight=extrabold]{font-weight:800}.ttdk-text[data-align=left]{text-align:left}.ttdk-text[data-align=center]{text-align:center}.ttdk-text[data-align=right]{text-align:right}.ttdk-text[data-align=justify]{text-align:justify}.ttdk-text[data-transform=uppercase]{text-transform:uppercase}.ttdk-text[data-transform=lowercase]{text-transform:lowercase}.ttdk-text[data-transform=capitalize]{text-transform:capitalize}.ttdk-text[data-transform=normal]{text-transform:none}.ttdk-text[data-italic=true]{font-style:italic}.ttdk-text[data-underline=true]{text-underline-offset:3px;text-decoration:underline}.ttdk-text[data-truncate=true]{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.ttdk-text[data-line-clamp="1"]{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.ttdk-text[data-line-clamp="2"]{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.ttdk-text[data-line-clamp="3"]{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.ttdk-text[data-line-clamp="4"]{-webkit-line-clamp:4;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.ttdk-text[data-line-clamp="5"]{-webkit-line-clamp:5;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.ttdk-text[data-line-clamp="6"]{-webkit-line-clamp:6;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}code.ttdk-text{font-family:var(--ttdk-text-font-mono);background-color:var(--ttdk-code-bg);border:var(--ttdk-stroke-width-thin) solid var(--ttdk-code-border);border-radius:var(--ttdk-radius-input-sm);padding:2px 6px;font-size:.875em}blockquote.ttdk-text{border-left:var(--ttdk-stroke-width-thick) solid var(--ttdk-blockquote-border);padding-left:var(--ttdk-spacing-md);color:var(--ttdk-color-text-muted);font-style:italic}a.ttdk-text{color:var(--ttdk-color-text-accent);text-underline-offset:3px;cursor:pointer;text-decoration:underline}a.ttdk-text:hover{opacity:.85}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="asTag"
|
|
4
|
+
:class="['ttdk-text', className, $attrs.class]"
|
|
5
|
+
:data-variant="resolvedVariant"
|
|
6
|
+
:data-size="size"
|
|
7
|
+
:data-weight="weight === 'bold' ? 'bold' : weight"
|
|
8
|
+
:data-align="align"
|
|
9
|
+
:data-transform="transform"
|
|
10
|
+
:data-truncate="truncate"
|
|
11
|
+
:data-line-clamp="lineClamp"
|
|
12
|
+
:data-italic="italic || as === 'em' || as === 'blockquote'"
|
|
13
|
+
:data-underline="underline"
|
|
14
|
+
:href="as === 'a' ? href : undefined"
|
|
15
|
+
:target="as === 'a' ? target : undefined"
|
|
16
|
+
:style="{
|
|
17
|
+
...(margin ? { margin: margin } : {}),
|
|
18
|
+
...(padding ? { padding: padding } : {}),
|
|
19
|
+
...buildUiVars(ui),
|
|
20
|
+
...(typeof style === 'object' ? style : {}),
|
|
21
|
+
}"
|
|
22
|
+
>
|
|
23
|
+
<slot />
|
|
24
|
+
</component>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script setup lang="ts">
|
|
28
|
+
import { computed } from "vue";
|
|
29
|
+
import { buildUiVars, type UiProps } from "../../core/types";
|
|
30
|
+
|
|
31
|
+
export type TextUiProps = UiProps;
|
|
32
|
+
export type TextUiBaseProps = UiProps;
|
|
33
|
+
|
|
34
|
+
export interface TextProps {
|
|
35
|
+
/**
|
|
36
|
+
* Tag elemen HTML semantik yang digunakan untuk me-render teks.
|
|
37
|
+
* - 'span': Inline span (default).
|
|
38
|
+
* - 'p': Paragraf teks.
|
|
39
|
+
* - 'div': Blok generik.
|
|
40
|
+
* - 'h1' s/d 'h6': Heading level 1 sampai 6.
|
|
41
|
+
* - 'label': Elemen label formulir.
|
|
42
|
+
* - 'small': Teks berukuran kecil / disclaimer.
|
|
43
|
+
* - 'strong': Teks tebal berpenekanan penting.
|
|
44
|
+
* - 'em': Teks berpenekanan miring.
|
|
45
|
+
* - 'code': Format kode inline monospace.
|
|
46
|
+
* - 'blockquote': Kutipan blok.
|
|
47
|
+
* - 'a': Tautan / link teks.
|
|
48
|
+
*
|
|
49
|
+
* @default 'span'
|
|
50
|
+
*/
|
|
51
|
+
as?:
|
|
52
|
+
| "span"
|
|
53
|
+
| "p"
|
|
54
|
+
| "div"
|
|
55
|
+
| "h1"
|
|
56
|
+
| "h2"
|
|
57
|
+
| "h3"
|
|
58
|
+
| "h4"
|
|
59
|
+
| "h5"
|
|
60
|
+
| "h6"
|
|
61
|
+
| "label"
|
|
62
|
+
| "small"
|
|
63
|
+
| "strong"
|
|
64
|
+
| "em"
|
|
65
|
+
| "code"
|
|
66
|
+
| "blockquote"
|
|
67
|
+
| "a";
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Varian warna semantik teks (disesuaikan dengan Chip / Badge TTDK).
|
|
71
|
+
* - 'primary': Warna utama tema penekanan aksi (brand teal).
|
|
72
|
+
* - 'success': Warna status sukses (hijau).
|
|
73
|
+
* - 'info': Warna status informasi (biru).
|
|
74
|
+
* - 'warning': Warna status peringatan (kuning).
|
|
75
|
+
* - 'danger': Warna status bahaya / kesalahan (merah).
|
|
76
|
+
* - 'neutral': Warna teks dasar foreground (standar).
|
|
77
|
+
*
|
|
78
|
+
* @default 'neutral'
|
|
79
|
+
*/
|
|
80
|
+
variant?:
|
|
81
|
+
| "primary"
|
|
82
|
+
| "success"
|
|
83
|
+
| "info"
|
|
84
|
+
| "warning"
|
|
85
|
+
| "danger"
|
|
86
|
+
| "neutral";
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Ukuran tipografi teks (xs s/d 6xl).
|
|
90
|
+
*/
|
|
91
|
+
size?:
|
|
92
|
+
| "xs"
|
|
93
|
+
| "sm"
|
|
94
|
+
| "md"
|
|
95
|
+
| "lg"
|
|
96
|
+
| "xl"
|
|
97
|
+
| "2xl"
|
|
98
|
+
| "3xl"
|
|
99
|
+
| "4xl"
|
|
100
|
+
| "5xl"
|
|
101
|
+
| "6xl";
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Ketebalan font teks.
|
|
105
|
+
*/
|
|
106
|
+
weight?: "normal" | "medium" | "semibold" | "bold" | "extrabold";
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Perataan horizontal teks.
|
|
110
|
+
*/
|
|
111
|
+
align?: "left" | "center" | "right" | "justify";
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Transformasi huruf kapital/kecil pada teks.
|
|
115
|
+
*/
|
|
116
|
+
transform?: "uppercase" | "lowercase" | "capitalize" | "normal";
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Memotong teks satu baris yang melebihi batas dengan elipsis (...).
|
|
120
|
+
*/
|
|
121
|
+
truncate?: boolean;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Memotong teks beberapa baris dengan elipsis (...) sesuai jumlah baris.
|
|
125
|
+
*/
|
|
126
|
+
lineClamp?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Mengubah gaya teks menjadi miring (italic).
|
|
130
|
+
*/
|
|
131
|
+
italic?: boolean;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Menampilkan garis bawah pada teks (underline).
|
|
135
|
+
*/
|
|
136
|
+
underline?: boolean;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Margin kustom pada elemen teks (misal: '0 0 16px 0', '8px', '1rem').
|
|
140
|
+
*/
|
|
141
|
+
margin?: string;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Padding kustom pada elemen teks (misal: '8px 12px', '4px 8px').
|
|
145
|
+
*/
|
|
146
|
+
padding?: string;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* URL tujuan jika as='a'.
|
|
150
|
+
*/
|
|
151
|
+
href?: string;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Target link jika as='a'.
|
|
155
|
+
*/
|
|
156
|
+
target?: string;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Kustomisasi visual granular ala Nuxt UI (warna teks, ukuran font, ketebalan, line-height, margin, padding).
|
|
160
|
+
*/
|
|
161
|
+
ui?: TextUiProps;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Class CSS kustom.
|
|
165
|
+
*/
|
|
166
|
+
className?: string;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Class CSS kustom (alias untuk Vue/HTML).
|
|
170
|
+
*/
|
|
171
|
+
class?: string;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Inline CSS style kustom.
|
|
175
|
+
*/
|
|
176
|
+
style?: any;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Konten teks atau elemen anak di dalam komponen Text.
|
|
180
|
+
*/
|
|
181
|
+
children?: any;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const props = defineProps<TextProps>();
|
|
185
|
+
|
|
186
|
+
const asTag = computed(() => {
|
|
187
|
+
return props.as || "span";
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
const resolvedVariant = computed(() => {
|
|
191
|
+
if (props.variant) return props.variant;
|
|
192
|
+
if (props.as === "a") return "info";
|
|
193
|
+
return "neutral";
|
|
194
|
+
});
|
|
195
|
+
</script>
|