@makolabs/ripple 0.0.1-dev.3 → 0.0.1-dev.5
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/README.md +229 -96
- package/dist/button/Button.svelte +46 -0
- package/dist/button/Button.svelte.d.ts +4 -0
- package/dist/button/button.d.ts +136 -0
- package/dist/button/button.js +167 -0
- package/dist/button/index.d.ts +1 -0
- package/dist/button/index.js +1 -0
- package/dist/drawer/Drawer.svelte +213 -0
- package/dist/drawer/Drawer.svelte.d.ts +4 -0
- package/dist/drawer/drawer.d.ts +177 -0
- package/dist/drawer/drawer.js +80 -0
- package/dist/drawer/index.d.ts +2 -0
- package/dist/drawer/index.js +1 -0
- package/dist/elements/badge/Badge.svelte +35 -0
- package/dist/elements/badge/Badge.svelte.d.ts +4 -0
- package/dist/elements/badge/badge.d.ts +193 -0
- package/dist/elements/badge/badge.js +65 -0
- package/dist/elements/badge/index.d.ts +2 -0
- package/dist/elements/badge/index.js +2 -0
- package/dist/elements/dropdown/Dropdown.svelte +272 -0
- package/dist/elements/dropdown/Dropdown.svelte.d.ts +4 -0
- package/dist/elements/dropdown/Select.svelte +230 -0
- package/dist/elements/dropdown/Select.svelte.d.ts +4 -0
- package/dist/elements/dropdown/dropdown.d.ts +274 -0
- package/dist/elements/dropdown/dropdown.js +89 -0
- package/dist/elements/dropdown/index.d.ts +3 -0
- package/dist/elements/dropdown/index.js +2 -0
- package/dist/elements/dropdown/select.d.ts +220 -0
- package/dist/elements/dropdown/select.js +74 -0
- package/dist/header/Breadcrumbs.svelte +72 -0
- package/dist/header/Breadcrumbs.svelte.d.ts +4 -0
- package/dist/header/PageHeader.svelte +30 -0
- package/dist/header/PageHeader.svelte.d.ts +4 -0
- package/dist/header/breadcrumbs.d.ts +220 -0
- package/dist/header/breadcrumbs.js +81 -0
- package/dist/header/index.d.ts +4 -0
- package/dist/header/index.js +2 -0
- package/dist/header/pageheaders.d.ts +10 -0
- package/dist/header/pageheaders.js +1 -0
- package/dist/helper/cls.d.ts +1 -0
- package/dist/helper/cls.js +4 -0
- package/dist/helper/nav.svelte.d.ts +6 -0
- package/dist/helper/nav.svelte.js +23 -0
- package/dist/index.d.ts +10 -1
- package/dist/index.js +18 -1
- package/dist/layout/card/Card.svelte +44 -0
- package/dist/layout/card/Card.svelte.d.ts +4 -0
- package/dist/layout/card/StatsCard.svelte +236 -0
- package/dist/layout/card/StatsCard.svelte.d.ts +4 -0
- package/dist/layout/card/card.d.ts +139 -0
- package/dist/layout/card/card.js +50 -0
- package/dist/layout/card/index.d.ts +4 -0
- package/dist/layout/card/index.js +2 -0
- package/dist/layout/card/stats-card.d.ts +208 -0
- package/dist/layout/card/stats-card.js +73 -0
- package/dist/layout/index.d.ts +5 -1
- package/dist/layout/index.js +5 -1
- package/dist/layout/navbar/Navbar.svelte +206 -0
- package/dist/layout/navbar/Navbar.svelte.d.ts +4 -0
- package/dist/layout/navbar/index.d.ts +2 -0
- package/dist/layout/navbar/index.js +2 -0
- package/dist/layout/navbar/navbar.d.ts +228 -0
- package/dist/layout/navbar/navbar.js +98 -0
- package/dist/layout/sidebar/NavGroup.svelte +101 -0
- package/dist/layout/sidebar/NavGroup.svelte.d.ts +4 -0
- package/dist/layout/sidebar/NavItem.svelte +29 -0
- package/dist/layout/sidebar/NavItem.svelte.d.ts +4 -0
- package/dist/layout/sidebar/Sidebar.svelte +145 -0
- package/dist/layout/sidebar/Sidebar.svelte.d.ts +4 -0
- package/dist/layout/sidebar/index.d.ts +2 -0
- package/dist/layout/sidebar/index.js +1 -0
- package/dist/layout/sidebar/sidebar.d.ts +46 -0
- package/dist/layout/sidebar/sidebar.js +1 -0
- package/dist/layout/table/Cells.svelte +111 -0
- package/dist/layout/table/Cells.svelte.d.ts +27 -0
- package/dist/layout/table/Table.svelte +413 -0
- package/dist/layout/table/Table.svelte.d.ts +4 -0
- package/dist/layout/table/index.d.ts +3 -0
- package/dist/layout/table/index.js +2 -0
- package/dist/layout/table/table.d.ts +303 -0
- package/dist/layout/table/table.js +149 -0
- package/dist/layout/tabs/Tab.svelte +57 -0
- package/dist/layout/tabs/Tab.svelte.d.ts +4 -0
- package/dist/layout/tabs/TabContent.svelte +31 -0
- package/dist/layout/tabs/TabContent.svelte.d.ts +4 -0
- package/dist/layout/tabs/TabGroup.svelte +57 -0
- package/dist/layout/tabs/TabGroup.svelte.d.ts +4 -0
- package/dist/layout/tabs/index.d.ts +3 -0
- package/dist/layout/tabs/index.js +3 -0
- package/dist/layout/tabs/tabs.d.ts +155 -0
- package/dist/layout/tabs/tabs.js +156 -0
- package/dist/modal/Modal.svelte +206 -0
- package/dist/modal/Modal.svelte.d.ts +4 -0
- package/dist/modal/index.d.ts +1 -0
- package/dist/modal/index.js +1 -0
- package/dist/modal/modal.d.ts +234 -0
- package/dist/modal/modal.js +81 -0
- package/dist/types/variants.d.ts +21 -0
- package/dist/types/variants.js +19 -0
- package/package.json +100 -102
- package/dist/layout/Card.svelte +0 -179
- package/dist/layout/Card.svelte.d.ts +0 -208
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ClassValue } from 'tailwind-variants';
|
|
2
|
+
import type { BreadcrumbItem } from './breadcrumbs.js';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
export type PageHeaderProps = {
|
|
5
|
+
title: string;
|
|
6
|
+
breadcrumbs?: BreadcrumbItem[];
|
|
7
|
+
children?: Snippet;
|
|
8
|
+
class?: ClassValue;
|
|
9
|
+
titleclass?: ClassValue;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {} from 'tailwind-variants';
|
package/dist/helper/cls.d.ts
CHANGED
package/dist/helper/cls.js
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { page } from '$app/state';
|
|
2
|
+
/**
|
|
3
|
+
* Check if a URL matches the current route
|
|
4
|
+
* @param href - The URL to check
|
|
5
|
+
* @param exact - Whether to require an exact match
|
|
6
|
+
*/
|
|
7
|
+
export function isRouteActive(href, exact = false) {
|
|
8
|
+
const currentPath = page.url.pathname;
|
|
9
|
+
if (exact) {
|
|
10
|
+
return currentPath === href;
|
|
11
|
+
}
|
|
12
|
+
// Home page special case
|
|
13
|
+
if (href === '/' && currentPath === '/') {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
// Check if the current path starts with href, but ensure it's a complete segment
|
|
17
|
+
if (href !== '/' && currentPath.startsWith(href)) {
|
|
18
|
+
// Check if the next character after href is a slash or the end of the string
|
|
19
|
+
const nextChar = currentPath.charAt(href.length);
|
|
20
|
+
return nextChar === '' || nextChar === '/';
|
|
21
|
+
}
|
|
22
|
+
return false;
|
|
23
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './button/index.js';
|
|
2
|
+
export * from './modal/index.js';
|
|
3
|
+
export * from './drawer/index.js';
|
|
4
|
+
export * from './header/index.js';
|
|
5
|
+
export * from './layout/index.js';
|
|
6
|
+
export * from './elements/dropdown/index.js';
|
|
7
|
+
export * from './elements/badge/index.js';
|
|
8
|
+
export * from './types/variants.js';
|
|
9
|
+
export { tv, cn } from './helper/cls.js';
|
|
10
|
+
export * from './helper/nav.svelte.js';
|
package/dist/index.js
CHANGED
|
@@ -1 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
// Button components
|
|
2
|
+
export * from './button/index.js';
|
|
3
|
+
// Modal components
|
|
4
|
+
export * from './modal/index.js';
|
|
5
|
+
// Drawer components
|
|
6
|
+
export * from './drawer/index.js';
|
|
7
|
+
// Header components
|
|
8
|
+
export * from './header/index.js';
|
|
9
|
+
// Layout components
|
|
10
|
+
export * from './layout/index.js';
|
|
11
|
+
// Elements
|
|
12
|
+
export * from './elements/dropdown/index.js';
|
|
13
|
+
export * from './elements/badge/index.js';
|
|
14
|
+
// Types
|
|
15
|
+
export * from './types/variants.js';
|
|
16
|
+
// Helper utilities
|
|
17
|
+
export { tv, cn } from './helper/cls.js';
|
|
18
|
+
export * from './helper/nav.svelte.js';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from '../../helper/cls.js';
|
|
3
|
+
import { card, type CardProps } from './card.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
children,
|
|
7
|
+
custom,
|
|
8
|
+
title,
|
|
9
|
+
color = 'default',
|
|
10
|
+
class: className = '',
|
|
11
|
+
titleclass: titleClass = '',
|
|
12
|
+
bodyclass: bodyClass = ''
|
|
13
|
+
}: CardProps = $props();
|
|
14
|
+
|
|
15
|
+
// Get the slots from the card with fixed default settings
|
|
16
|
+
const {
|
|
17
|
+
base,
|
|
18
|
+
title: titleSlot,
|
|
19
|
+
body: bodySlot
|
|
20
|
+
} = $derived(
|
|
21
|
+
card({
|
|
22
|
+
color
|
|
23
|
+
})
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
const baseClass = $derived(cn(base(), className));
|
|
27
|
+
const titleClasses = $derived(cn(titleSlot(), titleClass));
|
|
28
|
+
const bodyClasses = $derived(cn(bodySlot(), bodyClass));
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<div class={baseClass}>
|
|
32
|
+
{#if custom}
|
|
33
|
+
{@render custom()}
|
|
34
|
+
{:else}
|
|
35
|
+
{#if title}
|
|
36
|
+
<h3 class={titleClasses}>{title}</h3>
|
|
37
|
+
{/if}
|
|
38
|
+
{#if children}
|
|
39
|
+
<div class={bodyClasses}>
|
|
40
|
+
{@render children()}
|
|
41
|
+
</div>
|
|
42
|
+
{/if}
|
|
43
|
+
{/if}
|
|
44
|
+
</div>
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from '../../helper/cls.js';
|
|
3
|
+
import { statsCard, type StatsCardProps } from './stats-card.js';
|
|
4
|
+
import { onMount } from 'svelte';
|
|
5
|
+
import * as echarts from 'echarts/core';
|
|
6
|
+
|
|
7
|
+
// @ts-expect-error - ECharts types are not available
|
|
8
|
+
import { LineChart } from 'echarts/charts';
|
|
9
|
+
|
|
10
|
+
// @ts-expect-error - ECharts types are not available
|
|
11
|
+
import { GridComponent } from 'echarts/components';
|
|
12
|
+
// @ts-expect-error - ECharts types are not available
|
|
13
|
+
import { SVGRenderer } from 'echarts/renderers';
|
|
14
|
+
|
|
15
|
+
// @ts-expect-error - ECharts types are not available
|
|
16
|
+
echarts.use([LineChart, GridComponent, SVGRenderer]);
|
|
17
|
+
|
|
18
|
+
let {
|
|
19
|
+
label,
|
|
20
|
+
value,
|
|
21
|
+
previousValue,
|
|
22
|
+
previousValuePrefix = 'from',
|
|
23
|
+
trend,
|
|
24
|
+
color = 'default',
|
|
25
|
+
chartData,
|
|
26
|
+
children,
|
|
27
|
+
class: className = '',
|
|
28
|
+
formatLargeNumbers = true,
|
|
29
|
+
}: StatsCardProps = $props();
|
|
30
|
+
|
|
31
|
+
// Chart container reference
|
|
32
|
+
let chartContainer: HTMLDivElement | undefined = $state();
|
|
33
|
+
// @ts-expect-error - ECharts types are not available
|
|
34
|
+
let chart: echarts.ECharts | undefined = $state();
|
|
35
|
+
|
|
36
|
+
function getTrendDirection(trendX?: number): 'up' | 'down' | 'neutral' {
|
|
37
|
+
if (trendX === undefined || trendX === null) return 'neutral';
|
|
38
|
+
if (trendX > 0) {
|
|
39
|
+
return 'up';
|
|
40
|
+
}
|
|
41
|
+
else if (trendX < 0) {
|
|
42
|
+
return 'down';
|
|
43
|
+
}
|
|
44
|
+
return 'neutral';
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function formatValue(val?: string | number): string {
|
|
48
|
+
if (val === undefined || val === null) return '';
|
|
49
|
+
if (typeof val === 'string') {
|
|
50
|
+
const cleanedStr = val.replace(/,/g, '');
|
|
51
|
+
if (/^-?\d+(\.\d+)?$/.test(cleanedStr)) {
|
|
52
|
+
const numValue = parseFloat(cleanedStr);
|
|
53
|
+
return formatValue(numValue);
|
|
54
|
+
}
|
|
55
|
+
return val;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (!formatLargeNumbers) return val.toString();
|
|
59
|
+
|
|
60
|
+
if (Math.abs(val) >= 1_000_000) {
|
|
61
|
+
return (val / 1_000_000).toFixed(1).replace(/\.0$/, '') + 'M';
|
|
62
|
+
} else if (Math.abs(val) >= 1_000) {
|
|
63
|
+
return (val / 1_000).toFixed(1).replace(/\.0$/, '') + 'K';
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return val.toString();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function getChartColor() {
|
|
70
|
+
switch (color) {
|
|
71
|
+
case 'primary':
|
|
72
|
+
return '#4F46E5';
|
|
73
|
+
case 'secondary':
|
|
74
|
+
return '#6B7280';
|
|
75
|
+
case 'info':
|
|
76
|
+
return '#3B82F6';
|
|
77
|
+
case 'success':
|
|
78
|
+
return '#10B981';
|
|
79
|
+
case 'warning':
|
|
80
|
+
return '#F59E0B';
|
|
81
|
+
case 'danger':
|
|
82
|
+
return '#EF4444';
|
|
83
|
+
default:
|
|
84
|
+
return '#6B7280';
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const trendDirection = $derived(getTrendDirection(trend));
|
|
89
|
+
const formattedValue = $derived(formatValue(value));
|
|
90
|
+
const formattedPreviousValue = $derived(previousValue !== undefined ? formatValue(previousValue) : undefined);
|
|
91
|
+
|
|
92
|
+
const {
|
|
93
|
+
base,
|
|
94
|
+
label: labelSlot,
|
|
95
|
+
value: valueSlot,
|
|
96
|
+
trend: trendSlot,
|
|
97
|
+
previousValue: previousValueSlot,
|
|
98
|
+
chartContainer: chartContainerSlot
|
|
99
|
+
} = $derived(
|
|
100
|
+
statsCard({
|
|
101
|
+
color,
|
|
102
|
+
trendDirection
|
|
103
|
+
})
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
const baseClass = $derived(cn(base(), 'flex flex-col p-6 rounded-lg border border-gray-200 bg-white shadow-sm', className));
|
|
107
|
+
const labelClasses = $derived(cn(labelSlot(), 'text-sm font-medium mb-1'));
|
|
108
|
+
const valueClasses = $derived(cn(valueSlot(), 'text-4xl font-bold'));
|
|
109
|
+
const trendClasses = $derived(cn(trendSlot(), 'text-sm font-medium ml-2'));
|
|
110
|
+
const previousValueClasses = $derived(cn(previousValueSlot(), 'text-sm text-gray-500 mt-1'));
|
|
111
|
+
const chartContainerClasses = $derived(cn(chartContainerSlot(), 'ml-auto h-10 w-32'));
|
|
112
|
+
|
|
113
|
+
const trendFormatted = $derived.by(() => {
|
|
114
|
+
if (trend === undefined || trend === null) return '';
|
|
115
|
+
const absValue = Math.abs(trend);
|
|
116
|
+
const formattedValue = absValue.toFixed(1).replace(/\.0$/, '');
|
|
117
|
+
return trend >= 0 ? `+${formattedValue}%` : `-${formattedValue}%`;
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
// Chart color based on card color
|
|
121
|
+
const chartColor = $derived(getChartColor());
|
|
122
|
+
|
|
123
|
+
onMount(() => {
|
|
124
|
+
if (!chartData || chartData.length < 2 || !chartContainer) return;
|
|
125
|
+
|
|
126
|
+
// @ts-expect-error - ECharts types are not available
|
|
127
|
+
chart = echarts.init(chartContainer);
|
|
128
|
+
|
|
129
|
+
// Set chart options
|
|
130
|
+
const options = {
|
|
131
|
+
grid: {
|
|
132
|
+
left: 0,
|
|
133
|
+
right: 0,
|
|
134
|
+
top: 0,
|
|
135
|
+
bottom: 0
|
|
136
|
+
},
|
|
137
|
+
xAxis: {
|
|
138
|
+
type: 'category',
|
|
139
|
+
show: false,
|
|
140
|
+
data: Array.from({ length: chartData.length }, (_, i) => i)
|
|
141
|
+
},
|
|
142
|
+
yAxis: {
|
|
143
|
+
type: 'value',
|
|
144
|
+
show: false
|
|
145
|
+
},
|
|
146
|
+
series: [{
|
|
147
|
+
data: chartData,
|
|
148
|
+
type: 'line',
|
|
149
|
+
symbol: 'none',
|
|
150
|
+
lineStyle: {
|
|
151
|
+
color: chartColor,
|
|
152
|
+
width: 2
|
|
153
|
+
},
|
|
154
|
+
areaStyle: {
|
|
155
|
+
color: {
|
|
156
|
+
type: 'linear',
|
|
157
|
+
x: 0,
|
|
158
|
+
y: 0,
|
|
159
|
+
x2: 0,
|
|
160
|
+
y2: 1,
|
|
161
|
+
colorStops: [
|
|
162
|
+
{
|
|
163
|
+
offset: 0,
|
|
164
|
+
color: chartColor + '40' // 25% opacity
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
offset: 1,
|
|
168
|
+
color: chartColor + '00' // 0% opacity
|
|
169
|
+
}
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
smooth: true
|
|
174
|
+
}],
|
|
175
|
+
animation: false
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
chart.setOption(options);
|
|
179
|
+
|
|
180
|
+
// Handle resize
|
|
181
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
182
|
+
chart && chart.resize();
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
resizeObserver.observe(chartContainer);
|
|
186
|
+
|
|
187
|
+
return () => {
|
|
188
|
+
resizeObserver.disconnect();
|
|
189
|
+
chart.dispose();
|
|
190
|
+
};
|
|
191
|
+
});
|
|
192
|
+
</script>
|
|
193
|
+
|
|
194
|
+
<div class={baseClass}>
|
|
195
|
+
<!-- Header with label and trend -->
|
|
196
|
+
<div class="flex justify-between items-center">
|
|
197
|
+
{#if label}
|
|
198
|
+
<dt class={labelClasses}>{label}</dt>
|
|
199
|
+
{/if}
|
|
200
|
+
{#if trend !== undefined && trend !== null}
|
|
201
|
+
<span class={trendClasses}>
|
|
202
|
+
{trendFormatted}
|
|
203
|
+
</span>
|
|
204
|
+
{/if}
|
|
205
|
+
</div>
|
|
206
|
+
|
|
207
|
+
<!-- Main content area with value and optional chart -->
|
|
208
|
+
<div class="flex items-center mt-1">
|
|
209
|
+
<!-- Value section -->
|
|
210
|
+
<div class="flex-grow">
|
|
211
|
+
{#if value !== undefined}
|
|
212
|
+
<dd class={valueClasses}>
|
|
213
|
+
{formattedValue}
|
|
214
|
+
</dd>
|
|
215
|
+
{/if}
|
|
216
|
+
|
|
217
|
+
<!-- Previous value or tagline underneath -->
|
|
218
|
+
{#if previousValue !== undefined}
|
|
219
|
+
<div class={previousValueClasses}>
|
|
220
|
+
{previousValuePrefix} {formattedPreviousValue}
|
|
221
|
+
</div>
|
|
222
|
+
{/if}
|
|
223
|
+
</div>
|
|
224
|
+
|
|
225
|
+
<!-- ECharts chart -->
|
|
226
|
+
{#if chartData && chartData.length > 1}
|
|
227
|
+
<div class={chartContainerClasses} bind:this={chartContainer}></div>
|
|
228
|
+
{/if}
|
|
229
|
+
</div>
|
|
230
|
+
|
|
231
|
+
{#if children}
|
|
232
|
+
<div class="mt-4">
|
|
233
|
+
{@render children()}
|
|
234
|
+
</div>
|
|
235
|
+
{/if}
|
|
236
|
+
</div>
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import type { ClassValue } from 'tailwind-variants';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { VariantColors } from '../../types/variants.js';
|
|
4
|
+
export declare const card: import("tailwind-variants").TVReturnType<{
|
|
5
|
+
color: {
|
|
6
|
+
default: {
|
|
7
|
+
base: string;
|
|
8
|
+
title: string;
|
|
9
|
+
body: string;
|
|
10
|
+
};
|
|
11
|
+
primary: {
|
|
12
|
+
base: string;
|
|
13
|
+
title: string;
|
|
14
|
+
body: string;
|
|
15
|
+
};
|
|
16
|
+
secondary: {
|
|
17
|
+
base: string;
|
|
18
|
+
title: string;
|
|
19
|
+
body: string;
|
|
20
|
+
};
|
|
21
|
+
info: {
|
|
22
|
+
base: string;
|
|
23
|
+
title: string;
|
|
24
|
+
body: string;
|
|
25
|
+
};
|
|
26
|
+
success: {
|
|
27
|
+
base: string;
|
|
28
|
+
title: string;
|
|
29
|
+
body: string;
|
|
30
|
+
};
|
|
31
|
+
warning: {
|
|
32
|
+
base: string;
|
|
33
|
+
title: string;
|
|
34
|
+
body: string;
|
|
35
|
+
};
|
|
36
|
+
danger: {
|
|
37
|
+
base: string;
|
|
38
|
+
title: string;
|
|
39
|
+
body: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
}, {
|
|
43
|
+
base: string;
|
|
44
|
+
title: string;
|
|
45
|
+
body: string;
|
|
46
|
+
}, undefined, {
|
|
47
|
+
color: {
|
|
48
|
+
default: {
|
|
49
|
+
base: string;
|
|
50
|
+
title: string;
|
|
51
|
+
body: string;
|
|
52
|
+
};
|
|
53
|
+
primary: {
|
|
54
|
+
base: string;
|
|
55
|
+
title: string;
|
|
56
|
+
body: string;
|
|
57
|
+
};
|
|
58
|
+
secondary: {
|
|
59
|
+
base: string;
|
|
60
|
+
title: string;
|
|
61
|
+
body: string;
|
|
62
|
+
};
|
|
63
|
+
info: {
|
|
64
|
+
base: string;
|
|
65
|
+
title: string;
|
|
66
|
+
body: string;
|
|
67
|
+
};
|
|
68
|
+
success: {
|
|
69
|
+
base: string;
|
|
70
|
+
title: string;
|
|
71
|
+
body: string;
|
|
72
|
+
};
|
|
73
|
+
warning: {
|
|
74
|
+
base: string;
|
|
75
|
+
title: string;
|
|
76
|
+
body: string;
|
|
77
|
+
};
|
|
78
|
+
danger: {
|
|
79
|
+
base: string;
|
|
80
|
+
title: string;
|
|
81
|
+
body: string;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
}, {
|
|
85
|
+
base: string;
|
|
86
|
+
title: string;
|
|
87
|
+
body: string;
|
|
88
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
89
|
+
color: {
|
|
90
|
+
default: {
|
|
91
|
+
base: string;
|
|
92
|
+
title: string;
|
|
93
|
+
body: string;
|
|
94
|
+
};
|
|
95
|
+
primary: {
|
|
96
|
+
base: string;
|
|
97
|
+
title: string;
|
|
98
|
+
body: string;
|
|
99
|
+
};
|
|
100
|
+
secondary: {
|
|
101
|
+
base: string;
|
|
102
|
+
title: string;
|
|
103
|
+
body: string;
|
|
104
|
+
};
|
|
105
|
+
info: {
|
|
106
|
+
base: string;
|
|
107
|
+
title: string;
|
|
108
|
+
body: string;
|
|
109
|
+
};
|
|
110
|
+
success: {
|
|
111
|
+
base: string;
|
|
112
|
+
title: string;
|
|
113
|
+
body: string;
|
|
114
|
+
};
|
|
115
|
+
warning: {
|
|
116
|
+
base: string;
|
|
117
|
+
title: string;
|
|
118
|
+
body: string;
|
|
119
|
+
};
|
|
120
|
+
danger: {
|
|
121
|
+
base: string;
|
|
122
|
+
title: string;
|
|
123
|
+
body: string;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
}, {
|
|
127
|
+
base: string;
|
|
128
|
+
title: string;
|
|
129
|
+
body: string;
|
|
130
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
131
|
+
export type CardProps = {
|
|
132
|
+
color?: VariantColors;
|
|
133
|
+
title?: string;
|
|
134
|
+
class?: ClassValue;
|
|
135
|
+
titleclass?: ClassValue;
|
|
136
|
+
bodyclass?: ClassValue;
|
|
137
|
+
children?: Snippet;
|
|
138
|
+
custom?: Snippet;
|
|
139
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
export const card = tv({
|
|
3
|
+
slots: {
|
|
4
|
+
base: 'flex flex-col p-4 gap-2 border rounded-md shadow-sm',
|
|
5
|
+
title: 'text-base font-semibold',
|
|
6
|
+
body: 'text-base'
|
|
7
|
+
},
|
|
8
|
+
variants: {
|
|
9
|
+
color: {
|
|
10
|
+
default: {
|
|
11
|
+
base: 'bg-default-50 border-default-200',
|
|
12
|
+
title: 'text-default-900',
|
|
13
|
+
body: 'text-default-700'
|
|
14
|
+
},
|
|
15
|
+
primary: {
|
|
16
|
+
base: 'bg-primary-50 border-primary-200',
|
|
17
|
+
title: 'text-primary-900',
|
|
18
|
+
body: 'text-primary-700'
|
|
19
|
+
},
|
|
20
|
+
secondary: {
|
|
21
|
+
base: 'bg-secondary-50 border-secondary-200',
|
|
22
|
+
title: 'text-secondary-900',
|
|
23
|
+
body: 'text-secondary-700'
|
|
24
|
+
},
|
|
25
|
+
info: {
|
|
26
|
+
base: 'bg-info-50 border-info-200',
|
|
27
|
+
title: 'text-info-900',
|
|
28
|
+
body: 'text-info-700'
|
|
29
|
+
},
|
|
30
|
+
success: {
|
|
31
|
+
base: 'bg-success-50 border-success-200',
|
|
32
|
+
title: 'text-success-900',
|
|
33
|
+
body: 'text-success-700'
|
|
34
|
+
},
|
|
35
|
+
warning: {
|
|
36
|
+
base: 'bg-warning-50 border-warning-200',
|
|
37
|
+
title: 'text-warning-900',
|
|
38
|
+
body: 'text-warning-700'
|
|
39
|
+
},
|
|
40
|
+
danger: {
|
|
41
|
+
base: 'bg-danger-50 border-danger-200',
|
|
42
|
+
title: 'text-danger-900',
|
|
43
|
+
body: 'text-danger-700'
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
defaultVariants: {
|
|
48
|
+
color: 'default'
|
|
49
|
+
}
|
|
50
|
+
});
|