@ttdk-design-system/library-svelte 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/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +2 -0
- package/dist/core/tailwind-preset.cjs +62 -0
- package/dist/core/tailwind-preset.d.cts +63 -0
- package/dist/core/tailwind-preset.d.ts +74 -0
- package/dist/core/tailwind-preset.js +79 -0
- package/dist/core/theme/tokens.css +663 -0
- package/dist/core/types.d.ts +152 -0
- package/dist/core/types.js +735 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +15 -0
- package/dist/tailwind-preset.cjs +62 -0
- package/dist/tailwind-preset.d.cts +63 -0
- package/dist/tailwind-preset.d.ts +74 -0
- package/dist/tailwind-preset.js +79 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.js +1 -0
- package/dist/web/accordion/AI_GUIDE.md +149 -0
- package/dist/web/accordion/accordion.css +1 -0
- package/dist/web/accordion/accordion.svelte +217 -0
- package/dist/web/accordion/accordion.svelte.d.ts +224 -0
- package/dist/web/accordion/index.d.ts +2 -0
- package/dist/web/accordion/index.js +2 -0
- package/dist/web/accordion/manifest.json +351 -0
- package/dist/web/alert/AI_GUIDE.md +139 -0
- package/dist/web/alert/alert.css +1 -0
- package/dist/web/alert/alert.svelte +175 -0
- package/dist/web/alert/alert.svelte.d.ts +165 -0
- package/dist/web/alert/index.d.ts +2 -0
- package/dist/web/alert/index.js +2 -0
- package/dist/web/alert/manifest.json +240 -0
- package/dist/web/avatar/AI_GUIDE.md +118 -0
- package/dist/web/avatar/avatar.css +1 -0
- package/dist/web/avatar/avatar.svelte +108 -0
- package/dist/web/avatar/avatar.svelte.d.ts +147 -0
- package/dist/web/avatar/index.d.ts +2 -0
- package/dist/web/avatar/index.js +2 -0
- package/dist/web/avatar/manifest.json +195 -0
- package/dist/web/badge/AI_GUIDE.md +94 -0
- package/dist/web/badge/badge.css +1 -0
- package/dist/web/badge/badge.svelte +50 -0
- package/dist/web/badge/badge.svelte.d.ts +111 -0
- package/dist/web/badge/index.d.ts +2 -0
- package/dist/web/badge/index.js +2 -0
- package/dist/web/badge/manifest.json +141 -0
- package/dist/web/banner/AI_GUIDE.md +130 -0
- package/dist/web/banner/banner.css +1 -0
- package/dist/web/banner/banner.svelte +180 -0
- package/dist/web/banner/banner.svelte.d.ts +172 -0
- package/dist/web/banner/index.d.ts +2 -0
- package/dist/web/banner/index.js +2 -0
- package/dist/web/banner/manifest.json +240 -0
- package/dist/web/breadcrumb/AI_GUIDE.md +120 -0
- package/dist/web/breadcrumb/breadcrumb.css +1 -0
- package/dist/web/breadcrumb/breadcrumb.svelte +168 -0
- package/dist/web/breadcrumb/breadcrumb.svelte.d.ts +141 -0
- package/dist/web/breadcrumb/index.d.ts +2 -0
- package/dist/web/breadcrumb/index.js +2 -0
- package/dist/web/breadcrumb/manifest.json +225 -0
- package/dist/web/button/AI_GUIDE.md +121 -0
- package/dist/web/button/button.css +1 -0
- package/dist/web/button/button.svelte +154 -0
- package/dist/web/button/button.svelte.d.ts +159 -0
- package/dist/web/button/index.d.ts +2 -0
- package/dist/web/button/index.js +2 -0
- package/dist/web/button/manifest.json +177 -0
- package/dist/web/calendar/AI_GUIDE.md +151 -0
- package/dist/web/calendar/calendar.css +1 -0
- package/dist/web/calendar/calendar.svelte +1091 -0
- package/dist/web/calendar/calendar.svelte.d.ts +268 -0
- package/dist/web/calendar/index.d.ts +2 -0
- package/dist/web/calendar/index.js +2 -0
- package/dist/web/calendar/manifest.json +470 -0
- package/dist/web/card/AI_GUIDE.md +133 -0
- package/dist/web/card/card.css +1 -0
- package/dist/web/card/card.svelte +217 -0
- package/dist/web/card/card.svelte.d.ts +242 -0
- package/dist/web/card/index.d.ts +2 -0
- package/dist/web/card/index.js +2 -0
- package/dist/web/card/manifest.json +357 -0
- package/dist/web/checkbox/AI_GUIDE.md +146 -0
- package/dist/web/checkbox/checkbox.css +1 -0
- package/dist/web/checkbox/checkbox.svelte +131 -0
- package/dist/web/checkbox/checkbox.svelte.d.ts +199 -0
- package/dist/web/checkbox/index.d.ts +2 -0
- package/dist/web/checkbox/index.js +2 -0
- package/dist/web/checkbox/manifest.json +294 -0
- package/dist/web/chip/AI_GUIDE.md +186 -0
- package/dist/web/chip/chip.css +1 -0
- package/dist/web/chip/chip.svelte +113 -0
- package/dist/web/chip/chip.svelte.d.ts +145 -0
- package/dist/web/chip/index.d.ts +2 -0
- package/dist/web/chip/index.js +2 -0
- package/dist/web/chip/manifest.json +186 -0
- package/dist/web/dropdown/AI_GUIDE.md +167 -0
- package/dist/web/dropdown/dropdown.css +1 -0
- package/dist/web/dropdown/dropdown.svelte +844 -0
- package/dist/web/dropdown/dropdown.svelte.d.ts +361 -0
- package/dist/web/dropdown/index.d.ts +2 -0
- package/dist/web/dropdown/index.js +2 -0
- package/dist/web/dropdown/manifest.json +576 -0
- package/dist/web/flex/AI_GUIDE.md +113 -0
- package/dist/web/flex/flex-item.svelte +37 -0
- package/dist/web/flex/flex-item.svelte.d.ts +96 -0
- package/dist/web/flex/flex.css +1 -0
- package/dist/web/flex/flex.svelte +39 -0
- package/dist/web/flex/flex.svelte.d.ts +104 -0
- package/dist/web/flex/index.d.ts +3 -0
- package/dist/web/flex/index.js +3 -0
- package/dist/web/flex/manifest.json +162 -0
- package/dist/web/form/index.d.ts +1 -0
- package/dist/web/form/index.js +2 -0
- package/dist/web/grid/AI_GUIDE.md +112 -0
- package/dist/web/grid/grid-item.svelte +41 -0
- package/dist/web/grid/grid-item.svelte.d.ts +112 -0
- package/dist/web/grid/grid.css +1 -0
- package/dist/web/grid/grid.svelte +37 -0
- package/dist/web/grid/grid.svelte.d.ts +96 -0
- package/dist/web/grid/index.d.ts +3 -0
- package/dist/web/grid/index.js +3 -0
- package/dist/web/grid/manifest.json +153 -0
- package/dist/web/index.d.ts +58 -0
- package/dist/web/index.js +57 -0
- package/dist/web/input/AI_GUIDE.md +159 -0
- package/dist/web/input/index.d.ts +2 -0
- package/dist/web/input/index.js +2 -0
- package/dist/web/input/input.css +1 -0
- package/dist/web/input/input.svelte +283 -0
- package/dist/web/input/input.svelte.d.ts +283 -0
- package/dist/web/input/manifest.json +465 -0
- package/dist/web/input-number/AI_GUIDE.md +164 -0
- package/dist/web/input-number/index.d.ts +2 -0
- package/dist/web/input-number/index.js +2 -0
- package/dist/web/input-number/input-number.css +1 -0
- package/dist/web/input-number/input-number.svelte +783 -0
- package/dist/web/input-number/input-number.svelte.d.ts +352 -0
- package/dist/web/input-number/manifest.json +575 -0
- package/dist/web/modal/AI_GUIDE.md +171 -0
- package/dist/web/modal/index.d.ts +2 -0
- package/dist/web/modal/index.js +2 -0
- package/dist/web/modal/manifest.json +375 -0
- package/dist/web/modal/modal.css +1 -0
- package/dist/web/modal/modal.svelte +333 -0
- package/dist/web/modal/modal.svelte.d.ts +231 -0
- package/dist/web/pagination/AI_GUIDE.md +148 -0
- package/dist/web/pagination/index.d.ts +19 -0
- package/dist/web/pagination/index.js +19 -0
- package/dist/web/pagination/manifest.json +432 -0
- package/dist/web/pagination/pagination-content.svelte +25 -0
- package/dist/web/pagination/pagination-content.svelte.d.ts +36 -0
- package/dist/web/pagination/pagination-ellipsis.svelte +38 -0
- package/dist/web/pagination/pagination-ellipsis.svelte.d.ts +35 -0
- package/dist/web/pagination/pagination-first.svelte +105 -0
- package/dist/web/pagination/pagination-first.svelte.d.ts +74 -0
- package/dist/web/pagination/pagination-item.svelte +25 -0
- package/dist/web/pagination/pagination-item.svelte.d.ts +36 -0
- package/dist/web/pagination/pagination-last.svelte +105 -0
- package/dist/web/pagination/pagination-last.svelte.d.ts +74 -0
- package/dist/web/pagination/pagination-link.svelte +67 -0
- package/dist/web/pagination/pagination-link.svelte.d.ts +69 -0
- package/dist/web/pagination/pagination-next.svelte +99 -0
- package/dist/web/pagination/pagination-next.svelte.d.ts +75 -0
- package/dist/web/pagination/pagination-previous.svelte +99 -0
- package/dist/web/pagination/pagination-previous.svelte.d.ts +75 -0
- package/dist/web/pagination/pagination.css +1 -0
- package/dist/web/pagination/pagination.svelte +471 -0
- package/dist/web/pagination/pagination.svelte.d.ts +256 -0
- package/dist/web/popover/AI_GUIDE.md +163 -0
- package/dist/web/popover/index.d.ts +3 -0
- package/dist/web/popover/index.js +3 -0
- package/dist/web/popover/manifest.json +396 -0
- package/dist/web/popover/popover.css +1 -0
- package/dist/web/popover/popover.svelte +497 -0
- package/dist/web/popover/popover.svelte.d.ts +116 -0
- package/dist/web/radio/AI_GUIDE.md +155 -0
- package/dist/web/radio/index.d.ts +2 -0
- package/dist/web/radio/index.js +2 -0
- package/dist/web/radio/manifest.json +294 -0
- package/dist/web/radio/radio.css +1 -0
- package/dist/web/radio/radio.svelte +123 -0
- package/dist/web/radio/radio.svelte.d.ts +192 -0
- package/dist/web/selectbox/AI_GUIDE.md +216 -0
- package/dist/web/selectbox/index.d.ts +2 -0
- package/dist/web/selectbox/index.js +2 -0
- package/dist/web/selectbox/manifest.json +477 -0
- package/dist/web/selectbox/selectbox.css +1 -0
- package/dist/web/selectbox/selectbox.svelte +704 -0
- package/dist/web/selectbox/selectbox.svelte.d.ts +296 -0
- package/dist/web/sonner/AI_GUIDE.md +98 -0
- package/dist/web/sonner/index.d.ts +46 -0
- package/dist/web/sonner/index.js +64 -0
- package/dist/web/sonner/manifest.json +132 -0
- package/dist/web/sonner/sonner.css +1 -0
- package/dist/web/sonner/sonner.svelte +85 -0
- package/dist/web/sonner/sonner.svelte.d.ts +105 -0
- package/dist/web/table/AI_GUIDE.md +145 -0
- package/dist/web/table/index.d.ts +21 -0
- package/dist/web/table/index.js +22 -0
- package/dist/web/table/manifest.json +168 -0
- package/dist/web/table/table-body.svelte +23 -0
- package/dist/web/table/table-body.svelte.d.ts +36 -0
- package/dist/web/table/table-caption.svelte +23 -0
- package/dist/web/table/table-caption.svelte.d.ts +36 -0
- package/dist/web/table/table-cell.svelte +35 -0
- package/dist/web/table/table-cell.svelte.d.ts +57 -0
- package/dist/web/table/table-empty.svelte +56 -0
- package/dist/web/table/table-empty.svelte.d.ts +65 -0
- package/dist/web/table/table-footer.svelte +23 -0
- package/dist/web/table/table-footer.svelte.d.ts +36 -0
- package/dist/web/table/table-head.svelte +39 -0
- package/dist/web/table/table-head.svelte.d.ts +58 -0
- package/dist/web/table/table-header.svelte +23 -0
- package/dist/web/table/table-header.svelte.d.ts +36 -0
- package/dist/web/table/table-row.svelte +33 -0
- package/dist/web/table/table-row.svelte.d.ts +52 -0
- package/dist/web/table/table.css +1 -0
- package/dist/web/table/table.svelte +178 -0
- package/dist/web/table/table.svelte.d.ts +120 -0
- package/dist/web/tabs/AI_GUIDE.md +150 -0
- package/dist/web/tabs/index.d.ts +2 -0
- package/dist/web/tabs/index.js +2 -0
- package/dist/web/tabs/manifest.json +315 -0
- package/dist/web/tabs/tabs.css +1 -0
- package/dist/web/tabs/tabs.svelte +138 -0
- package/dist/web/tabs/tabs.svelte.d.ts +204 -0
- package/dist/web/text/AI_GUIDE.md +129 -0
- package/dist/web/text/index.d.ts +2 -0
- package/dist/web/text/index.js +2 -0
- package/dist/web/text/manifest.json +195 -0
- package/dist/web/text/text.css +1 -0
- package/dist/web/text/text.svelte +515 -0
- package/dist/web/text/text.svelte.d.ts +168 -0
- package/dist/web/textarea/AI_GUIDE.md +141 -0
- package/dist/web/textarea/index.d.ts +2 -0
- package/dist/web/textarea/index.js +2 -0
- package/dist/web/textarea/manifest.json +438 -0
- package/dist/web/textarea/textarea.css +1 -0
- package/dist/web/textarea/textarea.svelte +224 -0
- package/dist/web/textarea/textarea.svelte.d.ts +274 -0
- package/dist/web/tooltip/AI_GUIDE.md +110 -0
- package/dist/web/tooltip/index.d.ts +2 -0
- package/dist/web/tooltip/index.js +2 -0
- package/dist/web/tooltip/manifest.json +222 -0
- package/dist/web/tooltip/tooltip.css +1 -0
- package/dist/web/tooltip/tooltip.svelte +292 -0
- package/dist/web/tooltip/tooltip.svelte.d.ts +140 -0
- package/dist/webview/bottomsheet/AI_GUIDE.md +141 -0
- package/dist/webview/bottomsheet/bottomsheet.css +1 -0
- package/dist/webview/bottomsheet/bottomsheet.svelte +462 -0
- package/dist/webview/bottomsheet/bottomsheet.svelte.d.ts +200 -0
- package/dist/webview/bottomsheet/index.d.ts +4 -0
- package/dist/webview/bottomsheet/index.js +3 -0
- package/dist/webview/bottomsheet/manifest.json +377 -0
- package/dist/webview/button/AI_GUIDE.md +79 -0
- package/dist/webview/button/button-ios.css +1 -0
- package/dist/webview/button/button-ios.svelte +58 -0
- package/dist/webview/button/button-ios.svelte.d.ts +114 -0
- package/dist/webview/button/button-material.css +1 -0
- package/dist/webview/button/button-material.svelte +58 -0
- package/dist/webview/button/button-material.svelte.d.ts +114 -0
- package/dist/webview/button/index.d.ts +6 -0
- package/dist/webview/button/index.js +4 -0
- package/dist/webview/button/manifest.json +148 -0
- package/dist/webview/index.d.ts +6 -0
- package/dist/webview/index.js +6 -0
- package/llms.txt +6518 -0
- package/package.json +709 -4
- package/ttdk-manifest.json +10188 -0
- package/README.md +0 -3
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
<script context="module"></script>
|
|
2
|
+
|
|
3
|
+
<script>import { buildUiVars, UiProps } from "../../core/types";
|
|
4
|
+
export let className = void 0;
|
|
5
|
+
export let variant = void 0;
|
|
6
|
+
export let size = void 0;
|
|
7
|
+
export let rounded = void 0;
|
|
8
|
+
export let cardWidth = void 0;
|
|
9
|
+
export let hoverable = void 0;
|
|
10
|
+
export let clickable = void 0;
|
|
11
|
+
export let onClick = void 0;
|
|
12
|
+
export let disabled = void 0;
|
|
13
|
+
export let loading = void 0;
|
|
14
|
+
export let ui = void 0;
|
|
15
|
+
export let cover = void 0;
|
|
16
|
+
export let coverPosition = void 0;
|
|
17
|
+
export let coverClass = void 0;
|
|
18
|
+
export let coverStyle = void 0;
|
|
19
|
+
export let coverAlt = void 0;
|
|
20
|
+
export let title = void 0;
|
|
21
|
+
export let subtitle = void 0;
|
|
22
|
+
export let extra = void 0;
|
|
23
|
+
export let headerBorder = void 0;
|
|
24
|
+
export let headerClass = void 0;
|
|
25
|
+
export let headerStyle = void 0;
|
|
26
|
+
export let titleClass = void 0;
|
|
27
|
+
export let titleStyle = void 0;
|
|
28
|
+
export let subtitleClass = void 0;
|
|
29
|
+
export let subtitleStyle = void 0;
|
|
30
|
+
export let extraClass = void 0;
|
|
31
|
+
export let extraStyle = void 0;
|
|
32
|
+
export let bodyClass = void 0;
|
|
33
|
+
export let bodyStyle = void 0;
|
|
34
|
+
export let footer = void 0;
|
|
35
|
+
export let actions = void 0;
|
|
36
|
+
export let footerBorder = void 0;
|
|
37
|
+
export let footerClass = void 0;
|
|
38
|
+
export let footerStyle = void 0;
|
|
39
|
+
function stringifyStyles(stylesObj) {
|
|
40
|
+
let styles = "";
|
|
41
|
+
for (let key in stylesObj) {
|
|
42
|
+
const dashedKey = key.replace(/[A-Z]/g, function(match) {
|
|
43
|
+
return "-" + match.toLowerCase();
|
|
44
|
+
});
|
|
45
|
+
styles += dashedKey + ":" + stylesObj[key] + ";";
|
|
46
|
+
}
|
|
47
|
+
return styles;
|
|
48
|
+
}
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<div
|
|
52
|
+
style={stringifyStyles({
|
|
53
|
+
...buildUiVars(ui),
|
|
54
|
+
})}
|
|
55
|
+
class={`ttdk-card ${className || ""}`.trim()}
|
|
56
|
+
data-variant={variant || "default"}
|
|
57
|
+
data-size={size || "md"}
|
|
58
|
+
data-rounded={rounded || "md"}
|
|
59
|
+
data-width={cardWidth || "auto"}
|
|
60
|
+
data-hoverable={hoverable ? "true" : "false"}
|
|
61
|
+
data-clickable={clickable || onClick ? "true" : "false"}
|
|
62
|
+
data-disabled={disabled ? "true" : "false"}
|
|
63
|
+
data-loading={loading ? "true" : "false"}
|
|
64
|
+
tabIndex={clickable || onClick ? 0 : undefined}
|
|
65
|
+
role={clickable || onClick ? "button" : undefined}
|
|
66
|
+
on:click={(event) => {
|
|
67
|
+
if (disabled || loading) return;
|
|
68
|
+
if (onClick) onClick(event);
|
|
69
|
+
}}
|
|
70
|
+
on:keydown={(event) => {
|
|
71
|
+
if (disabled || loading) return;
|
|
72
|
+
if (
|
|
73
|
+
(clickable || onClick) &&
|
|
74
|
+
(event.key === "Enter" || event.key === " ")
|
|
75
|
+
) {
|
|
76
|
+
event.preventDefault();
|
|
77
|
+
if (onClick) onClick(event);
|
|
78
|
+
}
|
|
79
|
+
}}
|
|
80
|
+
>
|
|
81
|
+
{#if cover && (!coverPosition || coverPosition === "top")}
|
|
82
|
+
<div
|
|
83
|
+
style={stringifyStyles({
|
|
84
|
+
...buildUiVars(coverStyle),
|
|
85
|
+
})}
|
|
86
|
+
class={`ttdk-card-cover ttdk-card-cover-top ${coverClass || ""}`.trim()}
|
|
87
|
+
>
|
|
88
|
+
{#if typeof cover === "string"}
|
|
89
|
+
<img src={cover} alt={coverAlt || ""} />
|
|
90
|
+
{/if}
|
|
91
|
+
{#if typeof cover !== "string"}
|
|
92
|
+
{cover}
|
|
93
|
+
{/if}
|
|
94
|
+
</div>
|
|
95
|
+
{/if}
|
|
96
|
+
{#if loading}
|
|
97
|
+
<div class="ttdk-card-skeleton">
|
|
98
|
+
<div class="ttdk-card-skeleton-header">
|
|
99
|
+
<div class="ttdk-card-skeleton-avatar" />
|
|
100
|
+
<div class="ttdk-card-skeleton-title-group">
|
|
101
|
+
<div class="ttdk-card-skeleton-line ttdk-card-skeleton-line-title" />
|
|
102
|
+
<div
|
|
103
|
+
class="ttdk-card-skeleton-line ttdk-card-skeleton-line-subtitle"
|
|
104
|
+
/>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
<div class="ttdk-card-skeleton-body">
|
|
108
|
+
<div
|
|
109
|
+
style={stringifyStyles({
|
|
110
|
+
width: "100%",
|
|
111
|
+
})}
|
|
112
|
+
class="ttdk-card-skeleton-line"
|
|
113
|
+
/>
|
|
114
|
+
<div
|
|
115
|
+
style={stringifyStyles({
|
|
116
|
+
width: "85%",
|
|
117
|
+
})}
|
|
118
|
+
class="ttdk-card-skeleton-line"
|
|
119
|
+
/>
|
|
120
|
+
<div
|
|
121
|
+
style={stringifyStyles({
|
|
122
|
+
width: "60%",
|
|
123
|
+
})}
|
|
124
|
+
class="ttdk-card-skeleton-line"
|
|
125
|
+
/>
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
{/if}
|
|
129
|
+
{#if !loading}
|
|
130
|
+
{#if title || subtitle || extra}
|
|
131
|
+
<div
|
|
132
|
+
style={stringifyStyles({
|
|
133
|
+
...buildUiVars(headerStyle),
|
|
134
|
+
})}
|
|
135
|
+
class={`ttdk-card-header ${
|
|
136
|
+
headerBorder !== false ? "ttdk-card-header-bordered" : ""
|
|
137
|
+
} ${headerClass || ""}`.trim()}
|
|
138
|
+
>
|
|
139
|
+
<div class="ttdk-card-header-main">
|
|
140
|
+
{#if title}
|
|
141
|
+
<div
|
|
142
|
+
style={stringifyStyles({
|
|
143
|
+
...buildUiVars(titleStyle),
|
|
144
|
+
})}
|
|
145
|
+
class={`ttdk-card-title ${titleClass || ""}`.trim()}
|
|
146
|
+
>
|
|
147
|
+
{title}
|
|
148
|
+
</div>
|
|
149
|
+
{/if}
|
|
150
|
+
{#if subtitle}
|
|
151
|
+
<div
|
|
152
|
+
style={stringifyStyles({
|
|
153
|
+
...buildUiVars(subtitleStyle),
|
|
154
|
+
})}
|
|
155
|
+
class={`ttdk-card-subtitle ${subtitleClass || ""}`.trim()}
|
|
156
|
+
>
|
|
157
|
+
{subtitle}
|
|
158
|
+
</div>
|
|
159
|
+
{/if}
|
|
160
|
+
</div>
|
|
161
|
+
{#if extra}
|
|
162
|
+
<div
|
|
163
|
+
style={stringifyStyles({
|
|
164
|
+
...buildUiVars(extraStyle),
|
|
165
|
+
})}
|
|
166
|
+
class={`ttdk-card-extra ${extraClass || ""}`.trim()}
|
|
167
|
+
>
|
|
168
|
+
{extra}
|
|
169
|
+
</div>
|
|
170
|
+
{/if}
|
|
171
|
+
</div>
|
|
172
|
+
{/if}
|
|
173
|
+
<div
|
|
174
|
+
style={stringifyStyles({
|
|
175
|
+
...buildUiVars(bodyStyle),
|
|
176
|
+
})}
|
|
177
|
+
class={`ttdk-card-body ${bodyClass || ""}`.trim()}
|
|
178
|
+
>
|
|
179
|
+
<slot />
|
|
180
|
+
</div>
|
|
181
|
+
|
|
182
|
+
{#if footer || actions}
|
|
183
|
+
<div
|
|
184
|
+
style={stringifyStyles({
|
|
185
|
+
...buildUiVars(footerStyle),
|
|
186
|
+
})}
|
|
187
|
+
class={`ttdk-card-footer ${
|
|
188
|
+
footerBorder !== false ? "ttdk-card-footer-bordered" : ""
|
|
189
|
+
} ${footerClass || ""}`.trim()}
|
|
190
|
+
>
|
|
191
|
+
{#if footer}
|
|
192
|
+
<div class="ttdk-card-footer-content">{footer}</div>
|
|
193
|
+
{/if}
|
|
194
|
+
{#if actions}
|
|
195
|
+
<div class="ttdk-card-actions">{actions}</div>
|
|
196
|
+
{/if}
|
|
197
|
+
</div>
|
|
198
|
+
{/if}
|
|
199
|
+
{/if}
|
|
200
|
+
{#if cover && coverPosition === "bottom"}
|
|
201
|
+
<div
|
|
202
|
+
style={stringifyStyles({
|
|
203
|
+
...buildUiVars(coverStyle),
|
|
204
|
+
})}
|
|
205
|
+
class={`ttdk-card-cover ttdk-card-cover-bottom ${
|
|
206
|
+
coverClass || ""
|
|
207
|
+
}`.trim()}
|
|
208
|
+
>
|
|
209
|
+
{#if typeof cover === "string"}
|
|
210
|
+
<img src={cover} alt={coverAlt || ""} />
|
|
211
|
+
{/if}
|
|
212
|
+
{#if typeof cover !== "string"}
|
|
213
|
+
{cover}
|
|
214
|
+
{/if}
|
|
215
|
+
</div>
|
|
216
|
+
{/if}
|
|
217
|
+
</div>
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
export type CardUiProps = UiProps;
|
|
3
|
+
export interface CardProps {
|
|
4
|
+
/**
|
|
5
|
+
* Gaya varian visual kartu.
|
|
6
|
+
* - 'bordered': Kartu dengan border halus dan background card standar.
|
|
7
|
+
* - 'elevated': Kartu dengan bayangan elevasi bertingkat (shadow).
|
|
8
|
+
* - 'flat': Kartu dengan latar netral subtle tanpa bayangan.
|
|
9
|
+
* - 'ghost': Kartu transparan minimalis tanpa border atau bayangan.
|
|
10
|
+
*
|
|
11
|
+
* @default 'default'
|
|
12
|
+
*/
|
|
13
|
+
variant?: "bordered" | "elevated" | "flat" | "ghost";
|
|
14
|
+
/**
|
|
15
|
+
* Kepadatan padding internal kartu.
|
|
16
|
+
* - 'sm': Padding kompak (12px / 16px).
|
|
17
|
+
* - 'md': Padding proporsional standar (20px / 24px).
|
|
18
|
+
* - 'lg': Padding lapang / hero (28px / 32px).
|
|
19
|
+
*
|
|
20
|
+
* @default 'md'
|
|
21
|
+
*/
|
|
22
|
+
size?: "sm" | "md" | "lg";
|
|
23
|
+
/**
|
|
24
|
+
* Preset batas lebar kartu sesuai standar token TTDK.
|
|
25
|
+
* - 'auto': Fleksibel mengikuti lebar kontainer parent.
|
|
26
|
+
* - 'full': Lebar penuh 100%.
|
|
27
|
+
* - '1-1': 1128px (Grid Desktop Maksimal).
|
|
28
|
+
* - '1-2': 552px (Grid 1/2).
|
|
29
|
+
* - '1-3': 360px (Grid 1/3).
|
|
30
|
+
* - '1-4': 264px (Grid 1/4).
|
|
31
|
+
* - 'mobile': 328px (Optimal Layar Seluler).
|
|
32
|
+
*
|
|
33
|
+
* @default 'auto'
|
|
34
|
+
*/
|
|
35
|
+
cardWidth?: "auto" | "full" | "1-1" | "1-2" | "1-3" | "1-4" | "mobile";
|
|
36
|
+
/**
|
|
37
|
+
* Sudut kelengkungan radius kartu.
|
|
38
|
+
*
|
|
39
|
+
* @default 'md'
|
|
40
|
+
*/
|
|
41
|
+
rounded?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "full";
|
|
42
|
+
/**
|
|
43
|
+
* Menambahkan efek hover interaktif (elevasi bayangan naik + border highlight + pointer kursor).
|
|
44
|
+
*
|
|
45
|
+
* @default false
|
|
46
|
+
*/
|
|
47
|
+
hoverable?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Menjadikan kartu sebagai elemen interaktif yang dapat diklik.
|
|
50
|
+
*
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
clickable?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Menampilkan efek placeholder shimmer / skeleton loader saat kartu dalam proses memuat data.
|
|
56
|
+
*
|
|
57
|
+
* @default false
|
|
58
|
+
*/
|
|
59
|
+
loading?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Menonaktifkan interaksi kartu dan meredupkan opacity.
|
|
62
|
+
*
|
|
63
|
+
* @default false
|
|
64
|
+
*/
|
|
65
|
+
disabled?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Judul kartu pada area header.
|
|
68
|
+
*/
|
|
69
|
+
title?: any;
|
|
70
|
+
/**
|
|
71
|
+
* Subjudul atau teks deskripsi singkat di bawah judul.
|
|
72
|
+
*/
|
|
73
|
+
subtitle?: any;
|
|
74
|
+
/**
|
|
75
|
+
* Konten pelengkap di sudut kanan atas header kartu (badge, menu tombol, link aksi).
|
|
76
|
+
*/
|
|
77
|
+
extra?: any;
|
|
78
|
+
/**
|
|
79
|
+
* Media gambar cover atau banner visual kartu (berupa URL string gambar atau elemen/node kustom).
|
|
80
|
+
*/
|
|
81
|
+
cover?: any;
|
|
82
|
+
/**
|
|
83
|
+
* Alt text untuk gambar cover jika `cover` berupa URL string.
|
|
84
|
+
*/
|
|
85
|
+
coverAlt?: string;
|
|
86
|
+
/**
|
|
87
|
+
* Posisi media cover pada kartu ('top' atau 'bottom').
|
|
88
|
+
*
|
|
89
|
+
* @default 'top'
|
|
90
|
+
*/
|
|
91
|
+
coverPosition?: "top" | "bottom";
|
|
92
|
+
/**
|
|
93
|
+
* Grup tombol aksi terstruktur di area footer kartu.
|
|
94
|
+
*/
|
|
95
|
+
actions?: any;
|
|
96
|
+
/**
|
|
97
|
+
* Konten kustom untuk area footer kartu.
|
|
98
|
+
*/
|
|
99
|
+
footer?: any;
|
|
100
|
+
/**
|
|
101
|
+
* Menampilkan garis pembatas divider di bawah header kartu.
|
|
102
|
+
*
|
|
103
|
+
* @default true
|
|
104
|
+
*/
|
|
105
|
+
headerBorder?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Menampilkan garis pembatas divider di atas footer kartu.
|
|
108
|
+
*
|
|
109
|
+
* @default true
|
|
110
|
+
*/
|
|
111
|
+
footerBorder?: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Callback event saat kartu diklik.
|
|
114
|
+
*/
|
|
115
|
+
onClick?: (event: any) => void;
|
|
116
|
+
/**
|
|
117
|
+
* Kustomisasi visual granular root kontainer kartu (UiProps).
|
|
118
|
+
*/
|
|
119
|
+
ui?: UiProps;
|
|
120
|
+
/**
|
|
121
|
+
* Inline CSS style object native.
|
|
122
|
+
*/
|
|
123
|
+
style?: any;
|
|
124
|
+
/**
|
|
125
|
+
* Class CSS kustom untuk root kontainer kartu.
|
|
126
|
+
*/
|
|
127
|
+
className?: string;
|
|
128
|
+
/**
|
|
129
|
+
* Style kustom untuk area header kartu (UiProps).
|
|
130
|
+
*/
|
|
131
|
+
headerStyle?: UiProps;
|
|
132
|
+
/**
|
|
133
|
+
* Class CSS kustom untuk area header kartu.
|
|
134
|
+
*/
|
|
135
|
+
headerClass?: string;
|
|
136
|
+
/**
|
|
137
|
+
* Style kustom untuk teks judul kartu (UiProps).
|
|
138
|
+
*/
|
|
139
|
+
titleStyle?: UiProps;
|
|
140
|
+
/**
|
|
141
|
+
* Class CSS kustom untuk teks judul kartu.
|
|
142
|
+
*/
|
|
143
|
+
titleClass?: string;
|
|
144
|
+
/**
|
|
145
|
+
* Style kustom untuk teks subjudul / deskripsi header (UiProps).
|
|
146
|
+
*/
|
|
147
|
+
subtitleStyle?: UiProps;
|
|
148
|
+
/**
|
|
149
|
+
* Class CSS kustom untuk teks subjudul / deskripsi header.
|
|
150
|
+
*/
|
|
151
|
+
subtitleClass?: string;
|
|
152
|
+
/**
|
|
153
|
+
* Style kustom untuk elemen extra di sudut kanan header (UiProps).
|
|
154
|
+
*/
|
|
155
|
+
extraStyle?: UiProps;
|
|
156
|
+
/**
|
|
157
|
+
* Class CSS kustom untuk elemen extra di sudut kanan header.
|
|
158
|
+
*/
|
|
159
|
+
extraClass?: string;
|
|
160
|
+
/**
|
|
161
|
+
* Style kustom untuk area body / konten utama kartu (UiProps).
|
|
162
|
+
*/
|
|
163
|
+
bodyStyle?: UiProps;
|
|
164
|
+
/**
|
|
165
|
+
* Class CSS kustom untuk area body / konten utama kartu.
|
|
166
|
+
*/
|
|
167
|
+
bodyClass?: string;
|
|
168
|
+
/**
|
|
169
|
+
* Style kustom untuk area footer kartu (UiProps).
|
|
170
|
+
*/
|
|
171
|
+
footerStyle?: UiProps;
|
|
172
|
+
/**
|
|
173
|
+
* Class CSS kustom untuk area footer kartu.
|
|
174
|
+
*/
|
|
175
|
+
footerClass?: string;
|
|
176
|
+
/**
|
|
177
|
+
* Style kustom untuk area media cover kartu (UiProps).
|
|
178
|
+
*/
|
|
179
|
+
coverStyle?: UiProps;
|
|
180
|
+
/**
|
|
181
|
+
* Class CSS kustom untuk area media cover kartu.
|
|
182
|
+
*/
|
|
183
|
+
coverClass?: string;
|
|
184
|
+
/**
|
|
185
|
+
* Konten anak atau slot kustom (children).
|
|
186
|
+
*/
|
|
187
|
+
children?: any;
|
|
188
|
+
}
|
|
189
|
+
import { UiProps } from "../../core/types";
|
|
190
|
+
declare const __propDef: {
|
|
191
|
+
props: {
|
|
192
|
+
className?: CardProps["className"];
|
|
193
|
+
variant?: CardProps["variant"];
|
|
194
|
+
size?: CardProps["size"];
|
|
195
|
+
rounded?: CardProps["rounded"];
|
|
196
|
+
cardWidth?: CardProps["cardWidth"];
|
|
197
|
+
hoverable?: CardProps["hoverable"];
|
|
198
|
+
clickable?: CardProps["clickable"];
|
|
199
|
+
onClick?: CardProps["onClick"];
|
|
200
|
+
disabled?: CardProps["disabled"];
|
|
201
|
+
loading?: CardProps["loading"];
|
|
202
|
+
ui?: CardProps["ui"];
|
|
203
|
+
cover?: CardProps["cover"];
|
|
204
|
+
coverPosition?: CardProps["coverPosition"];
|
|
205
|
+
coverClass?: CardProps["coverClass"];
|
|
206
|
+
coverStyle?: CardProps["coverStyle"];
|
|
207
|
+
coverAlt?: CardProps["coverAlt"];
|
|
208
|
+
title?: CardProps["title"];
|
|
209
|
+
subtitle?: CardProps["subtitle"];
|
|
210
|
+
extra?: CardProps["extra"];
|
|
211
|
+
headerBorder?: CardProps["headerBorder"];
|
|
212
|
+
headerClass?: CardProps["headerClass"];
|
|
213
|
+
headerStyle?: CardProps["headerStyle"];
|
|
214
|
+
titleClass?: CardProps["titleClass"];
|
|
215
|
+
titleStyle?: CardProps["titleStyle"];
|
|
216
|
+
subtitleClass?: CardProps["subtitleClass"];
|
|
217
|
+
subtitleStyle?: CardProps["subtitleStyle"];
|
|
218
|
+
extraClass?: CardProps["extraClass"];
|
|
219
|
+
extraStyle?: CardProps["extraStyle"];
|
|
220
|
+
bodyClass?: CardProps["bodyClass"];
|
|
221
|
+
bodyStyle?: CardProps["bodyStyle"];
|
|
222
|
+
footer?: CardProps["footer"];
|
|
223
|
+
actions?: CardProps["actions"];
|
|
224
|
+
footerBorder?: CardProps["footerBorder"];
|
|
225
|
+
footerClass?: CardProps["footerClass"];
|
|
226
|
+
footerStyle?: CardProps["footerStyle"];
|
|
227
|
+
};
|
|
228
|
+
events: {
|
|
229
|
+
[evt: string]: CustomEvent<any>;
|
|
230
|
+
};
|
|
231
|
+
slots: {
|
|
232
|
+
default: {};
|
|
233
|
+
};
|
|
234
|
+
exports?: {} | undefined;
|
|
235
|
+
bindings?: string | undefined;
|
|
236
|
+
};
|
|
237
|
+
type CardProps_ = typeof __propDef.props;
|
|
238
|
+
export type CardEvents = typeof __propDef.events;
|
|
239
|
+
export type CardSlots = typeof __propDef.slots;
|
|
240
|
+
export default class Card extends SvelteComponent<CardProps_, CardEvents, CardSlots> {
|
|
241
|
+
}
|
|
242
|
+
export {};
|