@svadmin/ui 0.116.0 → 0.118.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.
Files changed (61) hide show
  1. package/dist/app.css +320 -26
  2. package/dist/app.theme.css +320 -26
  3. package/dist/components/AboutSettings.svelte +1 -1
  4. package/dist/components/ApprovalTimeline.svelte +170 -0
  5. package/dist/components/ApprovalTimeline.svelte.d.ts +26 -0
  6. package/dist/components/CopyableText.svelte +90 -0
  7. package/dist/components/CopyableText.svelte.d.ts +13 -0
  8. package/dist/components/Divider.svelte +89 -0
  9. package/dist/components/Divider.svelte.d.ts +19 -0
  10. package/dist/components/EllipsisText.svelte +78 -0
  11. package/dist/components/EllipsisText.svelte.d.ts +15 -0
  12. package/dist/components/ExcelExportButton.svelte +142 -0
  13. package/dist/components/ExcelExportButton.svelte.d.ts +21 -0
  14. package/dist/components/ExcelImportWizard.svelte +571 -0
  15. package/dist/components/ExcelImportWizard.svelte.d.ts +26 -0
  16. package/dist/components/FloatButtonGroup.svelte +162 -0
  17. package/dist/components/FloatButtonGroup.svelte.d.ts +34 -0
  18. package/dist/components/FullscreenButton.svelte +88 -0
  19. package/dist/components/FullscreenButton.svelte.d.ts +10 -0
  20. package/dist/components/GlobalShortcuts.svelte +229 -0
  21. package/dist/components/GlobalShortcuts.svelte.d.ts +18 -0
  22. package/dist/components/Header.svelte +17 -1
  23. package/dist/components/Header.svelte.d.ts +3 -0
  24. package/dist/components/Layout.svelte +3 -0
  25. package/dist/components/Layout.svelte.d.ts +1 -0
  26. package/dist/components/LightFilter.svelte +281 -0
  27. package/dist/components/LightFilter.svelte.d.ts +36 -0
  28. package/dist/components/LockScreen.svelte +295 -0
  29. package/dist/components/LockScreen.svelte.d.ts +21 -0
  30. package/dist/components/OrgTreePicker.svelte +325 -0
  31. package/dist/components/OrgTreePicker.svelte.d.ts +32 -0
  32. package/dist/components/PivotDrilldownModal.svelte +228 -0
  33. package/dist/components/PivotDrilldownModal.svelte.d.ts +22 -0
  34. package/dist/components/PricingCard.svelte +12 -12
  35. package/dist/components/PricingCard.svelte.d.ts +12 -12
  36. package/dist/components/PricingTable.svelte +185 -0
  37. package/dist/components/PricingTable.svelte.d.ts +40 -0
  38. package/dist/components/ProCard.svelte +267 -0
  39. package/dist/components/ProCard.svelte.d.ts +56 -0
  40. package/dist/components/ProSkeleton.svelte +186 -0
  41. package/dist/components/ProSkeleton.svelte.d.ts +20 -0
  42. package/dist/components/QuotaProgressBar.svelte +8 -8
  43. package/dist/components/QuotaProgressBar.svelte.d.ts +8 -8
  44. package/dist/components/Ribbon.svelte +97 -0
  45. package/dist/components/Ribbon.svelte.d.ts +19 -0
  46. package/dist/components/TreeTransfer.svelte +288 -0
  47. package/dist/components/TreeTransfer.svelte.d.ts +25 -0
  48. package/dist/components/TypographyEllipsis.svelte +12 -9
  49. package/dist/components/TypographyEllipsis.svelte.d.ts +9 -8
  50. package/dist/components/TypographyText.svelte +41 -3
  51. package/dist/components/TypographyText.svelte.d.ts +10 -2
  52. package/dist/components/UsageCard.svelte +97 -0
  53. package/dist/components/UsageCard.svelte.d.ts +26 -0
  54. package/dist/components/WorkflowProcessCard.svelte +93 -0
  55. package/dist/components/WorkflowProcessCard.svelte.d.ts +21 -0
  56. package/dist/components/ui/badge/badge.svelte +156 -12
  57. package/dist/components/ui/badge/badge.svelte.d.ts +9 -0
  58. package/dist/components/ui/badge/index.d.ts +1 -1
  59. package/dist/index.d.ts +44 -3
  60. package/dist/index.js +28 -2
  61. package/package.json +5 -5
@@ -11,31 +11,31 @@ export interface PricingCardProps {
11
11
  /** Tier name, e.g., 'Starter', 'Professional', 'Enterprise' */
12
12
  title: string;
13
13
  /** Short summary or audience description */
14
- description?: string;
14
+ description?: string | undefined;
15
15
  /** Display price, e.g. '$29' or 29 */
16
16
  price: string | number;
17
17
  /** Billing interval suffix, e.g. '/month', '/yr' or 'per seat' */
18
- interval?: string;
18
+ interval?: string | undefined;
19
19
  /** Optional tag/badge text, e.g. 'Recommended', 'Most Popular' */
20
- badge?: string;
20
+ badge?: string | undefined;
21
21
  /** Whether this card is highlighted as the primary tier */
22
- highlighted?: boolean;
22
+ highlighted?: boolean | undefined;
23
23
  /** List of features for this tier */
24
- features?: (PricingFeature | string)[];
24
+ features?: (PricingFeature | string)[] | undefined;
25
25
  /** Primary CTA button label */
26
- buttonText?: string;
26
+ buttonText?: string | undefined;
27
27
  /** Primary CTA button disabled state */
28
- disabled?: boolean;
28
+ disabled?: boolean | undefined;
29
29
  /** CTA variant style */
30
- buttonVariant?: 'default' | 'outline' | 'secondary';
30
+ buttonVariant?: 'default' | 'outline' | 'secondary' | undefined;
31
31
  /** Custom CTA snippet slot */
32
- action?: Snippet;
32
+ action?: Snippet | undefined;
33
33
  /** Custom header or badge slot */
34
- headerExtra?: Snippet;
34
+ headerExtra?: Snippet | undefined;
35
35
  /** Click callback when CTA is activated */
36
- onselect?: () => void;
36
+ onselect?: (() => void) | undefined;
37
37
  /** Additional CSS classes */
38
- class?: string;
38
+ class?: string | undefined;
39
39
  }
40
40
  declare const PricingCard: import("svelte").Component<PricingCardProps, {}, "">;
41
41
  type PricingCard = ReturnType<typeof PricingCard>;
@@ -0,0 +1,185 @@
1
+ <script lang="ts">
2
+ import { cn } from '../utils.js';
3
+ import PricingCard, { type PricingFeature } from './PricingCard.svelte';
4
+ import { Check, X } from '@lucide/svelte';
5
+
6
+ export interface PricingPlan {
7
+ key: string;
8
+ title: string;
9
+ description?: string;
10
+ monthlyPrice: string | number;
11
+ yearlyPrice?: string | number;
12
+ badge?: string;
13
+ highlighted?: boolean;
14
+ buttonText?: string;
15
+ buttonVariant?: 'default' | 'outline' | 'secondary';
16
+ features?: (PricingFeature | string)[];
17
+ }
18
+
19
+ export interface FeatureComparisonRow {
20
+ name: string;
21
+ hint?: string;
22
+ /** Map plan key to value (boolean or string) */
23
+ values: Record<string, boolean | string>;
24
+ }
25
+
26
+ export interface FeatureComparisonGroup {
27
+ category: string;
28
+ rows: FeatureComparisonRow[];
29
+ }
30
+
31
+ export interface PricingTableProps {
32
+ /** Available subscription plans */
33
+ plans: PricingPlan[];
34
+ /** Current billing cycle (can be bound with bind:cycle) */
35
+ cycle?: 'monthly' | 'yearly';
36
+ /** Badge or highlight on the yearly toggle */
37
+ yearlyDiscountBadge?: string;
38
+ /** Optional detailed feature comparison matrix */
39
+ comparisonGroups?: FeatureComparisonGroup[];
40
+ /** Callback when a plan CTA is clicked */
41
+ onselectplan?: (plan: PricingPlan, cycle: 'monthly' | 'yearly') => void;
42
+ /** Additional CSS classes */
43
+ class?: string;
44
+ }
45
+
46
+ let {
47
+ plans = [],
48
+ cycle = $bindable<'monthly' | 'yearly'>('monthly'),
49
+ yearlyDiscountBadge = 'Save 20%',
50
+ comparisonGroups = [],
51
+ onselectplan,
52
+ class: className = '',
53
+ }: PricingTableProps = $props();
54
+ </script>
55
+
56
+ <div
57
+ class={cn('w-full space-y-10', className)}
58
+ data-svadmin-component="PricingTable"
59
+ data-cycle={cycle}
60
+ >
61
+ <!-- Cycle toggle -->
62
+ <div class="flex items-center justify-center gap-3">
63
+ <div class="inline-flex items-center rounded-lg border border-border bg-muted/60 p-1 text-sm font-medium">
64
+ <button
65
+ type="button"
66
+ onclick={() => (cycle = 'monthly')}
67
+ class={cn(
68
+ 'rounded-md px-4 py-1.5 transition-all',
69
+ cycle === 'monthly'
70
+ ? 'bg-background text-foreground shadow-sm'
71
+ : 'text-muted-foreground hover:text-foreground',
72
+ )}
73
+ >
74
+ Monthly
75
+ </button>
76
+ <button
77
+ type="button"
78
+ onclick={() => (cycle = 'yearly')}
79
+ class={cn(
80
+ 'relative inline-flex items-center gap-1.5 rounded-md px-4 py-1.5 transition-all',
81
+ cycle === 'yearly'
82
+ ? 'bg-background text-foreground shadow-sm'
83
+ : 'text-muted-foreground hover:text-foreground',
84
+ )}
85
+ >
86
+ <span>Yearly</span>
87
+ {#if yearlyDiscountBadge}
88
+ <span class="rounded-full bg-primary/10 px-2 py-0.5 text-[11px] font-semibold text-primary">
89
+ {yearlyDiscountBadge}
90
+ </span>
91
+ {/if}
92
+ </button>
93
+ </div>
94
+ </div>
95
+
96
+ <!-- Pricing Cards Grid -->
97
+ <div
98
+ class={cn(
99
+ 'grid gap-6',
100
+ plans.length === 1 && 'max-w-md mx-auto',
101
+ plans.length === 2 && 'grid-cols-1 md:grid-cols-2 max-w-4xl mx-auto',
102
+ plans.length >= 3 && 'grid-cols-1 md:grid-cols-3',
103
+ plans.length >= 4 && 'lg:grid-cols-4',
104
+ )}
105
+ >
106
+ {#each plans as plan (plan.key)}
107
+ <PricingCard
108
+ title={plan.title}
109
+ description={plan.description}
110
+ price={cycle === 'yearly' ? (plan.yearlyPrice ?? plan.monthlyPrice) : plan.monthlyPrice}
111
+ interval={cycle === 'yearly' ? '/yr' : '/mo'}
112
+ badge={plan.badge}
113
+ highlighted={plan.highlighted}
114
+ buttonText={plan.buttonText ?? 'Choose Plan'}
115
+ buttonVariant={plan.buttonVariant}
116
+ features={plan.features}
117
+ onselect={() => onselectplan?.(plan, cycle)}
118
+ />
119
+ {/each}
120
+ </div>
121
+
122
+ <!-- Detailed Feature Comparison Table (Optional) -->
123
+ {#if comparisonGroups.length > 0}
124
+ <div class="overflow-x-auto rounded-xl border border-border bg-card p-6 shadow-sm">
125
+ <div class="mb-6">
126
+ <h3 class="text-lg font-bold tracking-tight text-foreground">Feature Comparison</h3>
127
+ <p class="text-sm text-muted-foreground">Compare features across all subscription plans</p>
128
+ </div>
129
+
130
+ <table class="w-full text-left text-sm">
131
+ <thead>
132
+ <tr class="border-b border-border text-muted-foreground">
133
+ <th class="py-3 pr-4 font-medium">Features</th>
134
+ {#each plans as plan (plan.key)}
135
+ <th class="px-4 py-3 text-center font-medium">
136
+ <span class={plan.highlighted ? 'font-bold text-primary' : 'text-foreground'}>
137
+ {plan.title}
138
+ </span>
139
+ </th>
140
+ {/each}
141
+ </tr>
142
+ </thead>
143
+ <tbody class="divide-y divide-border/60">
144
+ {#each comparisonGroups as group, gIdx (group.category || gIdx)}
145
+ <tr class="bg-muted/40 font-semibold text-foreground">
146
+ <td colspan={plans.length + 1} class="py-2.5 pl-2 text-xs tracking-wide uppercase">
147
+ {group.category}
148
+ </td>
149
+ </tr>
150
+ {#each group.rows as row (row.name)}
151
+ <tr class="hover:bg-muted/20">
152
+ <td class="py-3 pr-4">
153
+ <div class="font-medium text-foreground">{row.name}</div>
154
+ {#if row.hint}
155
+ <div class="text-xs text-muted-foreground">{row.hint}</div>
156
+ {/if}
157
+ </td>
158
+ {#each plans as plan (plan.key)}
159
+ {@const val = row.values[plan.key]}
160
+ <td class="px-4 py-3 text-center">
161
+ {#if typeof val === 'boolean'}
162
+ {#if val}
163
+ <span class="inline-flex h-5 w-5 items-center justify-center rounded-full bg-primary/10 text-primary">
164
+ <Check class="h-3.5 w-3.5 stroke-[2.5]" />
165
+ </span>
166
+ {:else}
167
+ <span class="inline-flex h-5 w-5 items-center justify-center rounded-full bg-muted text-muted-foreground">
168
+ <X class="h-3.5 w-3.5 stroke-[2.5]" />
169
+ </span>
170
+ {/if}
171
+ {:else if val}
172
+ <span class="font-medium text-foreground">{val}</span>
173
+ {:else}
174
+ <span class="text-muted-foreground">—</span>
175
+ {/if}
176
+ </td>
177
+ {/each}
178
+ </tr>
179
+ {/each}
180
+ {/each}
181
+ </tbody>
182
+ </table>
183
+ </div>
184
+ {/if}
185
+ </div>
@@ -0,0 +1,40 @@
1
+ import { type PricingFeature } from './PricingCard.svelte';
2
+ export interface PricingPlan {
3
+ key: string;
4
+ title: string;
5
+ description?: string;
6
+ monthlyPrice: string | number;
7
+ yearlyPrice?: string | number;
8
+ badge?: string;
9
+ highlighted?: boolean;
10
+ buttonText?: string;
11
+ buttonVariant?: 'default' | 'outline' | 'secondary';
12
+ features?: (PricingFeature | string)[];
13
+ }
14
+ export interface FeatureComparisonRow {
15
+ name: string;
16
+ hint?: string;
17
+ /** Map plan key to value (boolean or string) */
18
+ values: Record<string, boolean | string>;
19
+ }
20
+ export interface FeatureComparisonGroup {
21
+ category: string;
22
+ rows: FeatureComparisonRow[];
23
+ }
24
+ export interface PricingTableProps {
25
+ /** Available subscription plans */
26
+ plans: PricingPlan[];
27
+ /** Current billing cycle (can be bound with bind:cycle) */
28
+ cycle?: 'monthly' | 'yearly';
29
+ /** Badge or highlight on the yearly toggle */
30
+ yearlyDiscountBadge?: string;
31
+ /** Optional detailed feature comparison matrix */
32
+ comparisonGroups?: FeatureComparisonGroup[];
33
+ /** Callback when a plan CTA is clicked */
34
+ onselectplan?: (plan: PricingPlan, cycle: 'monthly' | 'yearly') => void;
35
+ /** Additional CSS classes */
36
+ class?: string;
37
+ }
38
+ declare const PricingTable: import("svelte").Component<PricingTableProps, {}, "cycle">;
39
+ type PricingTable = ReturnType<typeof PricingTable>;
40
+ export default PricingTable;
@@ -0,0 +1,267 @@
1
+ <script lang="ts">
2
+ import { untrack, type Snippet } from 'svelte';
3
+ import { ChevronRight, HelpCircle, Loader2 } from '@lucide/svelte';
4
+ import { cn } from '../utils.js';
5
+
6
+ export interface ProCardTab {
7
+ key: string;
8
+ label: string;
9
+ disabled?: boolean;
10
+ }
11
+
12
+ export interface ProCardProps {
13
+ /** Title of the card header */
14
+ title?: string | Snippet;
15
+ /** Subtitle or secondary description */
16
+ subTitle?: string | Snippet;
17
+ /** Information tooltip description displayed next to the title */
18
+ tooltip?: string;
19
+ /** Extra actions or elements in the top right of the header */
20
+ extra?: Snippet;
21
+ /** Bottom actions slot */
22
+ actions?: Snippet;
23
+ /** Whether the card has an outer border */
24
+ bordered?: boolean;
25
+ /** Whether the card elevates on hover */
26
+ hoverable?: boolean;
27
+ /** Ghost mode: removes background, border, and padding for seamless grid nesting */
28
+ ghost?: boolean;
29
+ /** Whether the card can be collapsed */
30
+ collapsible?: boolean;
31
+ /** Controlled collapsed state */
32
+ collapsed?: boolean;
33
+ /** Initial default collapsed state */
34
+ defaultCollapsed?: boolean;
35
+ /** Callback when collapsed state toggles */
36
+ oncollapse?: (collapsed: boolean) => void;
37
+ /** Split layout for child elements */
38
+ split?: 'vertical' | 'horizontal';
39
+ /** Tab items displayed in the card header */
40
+ tabs?: ProCardTab[];
41
+ /** Controlled active tab key */
42
+ activeTabKey?: string;
43
+ /** Callback when active tab changes */
44
+ ontabchange?: (key: string) => void;
45
+ /** Size tier of the card */
46
+ size?: 'default' | 'small';
47
+ /** Loading indicator */
48
+ loading?: boolean;
49
+ /** Additional class names for header */
50
+ headerClass?: string;
51
+ /** Additional class names for card body */
52
+ bodyClass?: string;
53
+ /** Additional root class names */
54
+ class?: string;
55
+ /** Body content slot */
56
+ children?: Snippet;
57
+ [key: string]: unknown;
58
+ }
59
+
60
+ let {
61
+ title,
62
+ subTitle,
63
+ tooltip,
64
+ extra,
65
+ actions,
66
+ bordered = true,
67
+ hoverable = false,
68
+ ghost = false,
69
+ collapsible = false,
70
+ collapsed,
71
+ defaultCollapsed = false,
72
+ oncollapse,
73
+ split,
74
+ tabs,
75
+ activeTabKey = $bindable(),
76
+ ontabchange,
77
+ size = 'default',
78
+ loading = false,
79
+ headerClass = '',
80
+ bodyClass = '',
81
+ class: className = '',
82
+ children,
83
+ ...restProps
84
+ }: ProCardProps = $props();
85
+
86
+ let internalCollapsed = $state(untrack(() => defaultCollapsed));
87
+ const isCollapsed = $derived(collapsed !== undefined ? collapsed : internalCollapsed);
88
+
89
+ let internalActiveTab = $state(untrack(() => activeTabKey ?? tabs?.[0]?.key));
90
+ const currentTab = $derived(activeTabKey !== undefined ? activeTabKey : internalActiveTab);
91
+
92
+ function toggleCollapse() {
93
+ if (!collapsible) return;
94
+ const next = !isCollapsed;
95
+ if (collapsed === undefined) {
96
+ internalCollapsed = next;
97
+ }
98
+ oncollapse?.(next);
99
+ }
100
+
101
+ function handleTabSelect(key: string, disabled?: boolean) {
102
+ if (disabled) return;
103
+ if (activeTabKey === undefined) {
104
+ internalActiveTab = key;
105
+ }
106
+ activeTabKey = key;
107
+ ontabchange?.(key);
108
+ }
109
+
110
+ const hasHeader = $derived(
111
+ Boolean(title || subTitle || tooltip || extra || collapsible || (tabs && tabs.length > 0))
112
+ );
113
+ </script>
114
+
115
+ <div
116
+ data-svadmin-component="ProCard"
117
+ data-ghost={ghost}
118
+ data-collapsed={isCollapsed}
119
+ data-size={size}
120
+ class={cn(
121
+ 'relative flex flex-col transition-all duration-200',
122
+ ghost
123
+ ? 'bg-transparent border-0 shadow-none'
124
+ : cn(
125
+ 'bg-card text-card-foreground rounded-[4px]',
126
+ bordered && 'border border-border',
127
+ hoverable && 'hover:shadow-md hover:border-primary/40 cursor-pointer'
128
+ ),
129
+ className
130
+ )}
131
+ {...restProps}
132
+ >
133
+ {#if loading}
134
+ <div
135
+ role="status"
136
+ aria-label="Loading"
137
+ class="absolute inset-0 z-20 flex items-center justify-center bg-card/60 backdrop-blur-[1px] rounded-[4px]"
138
+ >
139
+ <Loader2 class="h-6 w-6 animate-spin text-primary" />
140
+ </div>
141
+ {/if}
142
+
143
+ {#if hasHeader}
144
+ <!-- svelte-ignore a11y_no_noninteractive_tabindex -->
145
+ <div
146
+ class={cn(
147
+ 'flex items-center justify-between border-b border-border/60 transition-colors',
148
+ size === 'small' ? 'px-3 py-2' : 'px-4 py-3',
149
+ collapsible && 'cursor-pointer select-none hover:bg-muted/40',
150
+ isCollapsed && 'border-b-0',
151
+ headerClass
152
+ )}
153
+ onclick={collapsible ? toggleCollapse : undefined}
154
+ onkeydown={(e) => {
155
+ if (collapsible && (e.key === 'Enter' || e.key === ' ')) {
156
+ e.preventDefault();
157
+ toggleCollapse();
158
+ }
159
+ }}
160
+ role={collapsible ? 'button' : undefined}
161
+ tabindex={collapsible ? 0 : undefined}
162
+ aria-expanded={collapsible ? !isCollapsed : undefined}
163
+ >
164
+ <!-- Title & Subtitle Section -->
165
+ <div class="flex items-center gap-2 min-w-0">
166
+ {#if collapsible}
167
+ <ChevronRight
168
+ class={cn(
169
+ 'h-4 w-4 text-muted-foreground transition-transform duration-200 shrink-0',
170
+ !isCollapsed && 'rotate-90'
171
+ )}
172
+ />
173
+ {/if}
174
+
175
+ <div class="flex items-center gap-1.5 flex-wrap">
176
+ {#if title}
177
+ <span class={cn('font-semibold text-foreground truncate', size === 'small' ? 'text-xs' : 'text-sm')}>
178
+ {#if typeof title === 'string'}
179
+ {title}
180
+ {:else}
181
+ {@render title()}
182
+ {/if}
183
+ </span>
184
+ {/if}
185
+
186
+ {#if subTitle}
187
+ <span class="text-xs text-muted-foreground font-normal truncate">
188
+ {#if typeof subTitle === 'string'}
189
+ {subTitle}
190
+ {:else}
191
+ {@render subTitle()}
192
+ {/if}
193
+ </span>
194
+ {/if}
195
+
196
+ {#if tooltip}
197
+ <span title={tooltip} class="inline-flex text-muted-foreground hover:text-foreground cursor-help">
198
+ <HelpCircle class="h-3.5 w-3.5" />
199
+ </span>
200
+ {/if}
201
+ </div>
202
+ </div>
203
+
204
+ <!-- Tabs or Extra Section -->
205
+ <div class="flex items-center gap-2 shrink-0">
206
+ {#if tabs && tabs.length > 0}
207
+ <div class="flex items-center gap-1 bg-muted/60 p-0.5 rounded-[4px] border border-border/40">
208
+ {#each tabs as tab (tab.key)}
209
+ {@const active = currentTab === tab.key}
210
+ <button
211
+ type="button"
212
+ disabled={tab.disabled}
213
+ class={cn(
214
+ 'px-2.5 py-1 text-xs font-medium rounded-[2px] transition-colors',
215
+ active
216
+ ? 'bg-background text-foreground shadow-xs'
217
+ : 'text-muted-foreground hover:text-foreground',
218
+ tab.disabled && 'opacity-50 cursor-not-allowed'
219
+ )}
220
+ onclick={(e) => {
221
+ e.stopPropagation();
222
+ handleTabSelect(tab.key, tab.disabled);
223
+ }}
224
+ >
225
+ {tab.label}
226
+ </button>
227
+ {/each}
228
+ </div>
229
+ {/if}
230
+
231
+ {#if extra}
232
+ <div class="flex items-center gap-1.5 text-xs text-muted-foreground" onclick={(e) => e.stopPropagation()} role="none">
233
+ {@render extra()}
234
+ </div>
235
+ {/if}
236
+ </div>
237
+ </div>
238
+ {/if}
239
+
240
+ <!-- Body Content -->
241
+ {#if !isCollapsed}
242
+ <div
243
+ class={cn(
244
+ 'flex-1',
245
+ ghost ? '' : (size === 'small' ? 'p-3' : 'p-4'),
246
+ split === 'vertical' && 'flex flex-row divide-x divide-border',
247
+ split === 'horizontal' && 'flex flex-col divide-y divide-border',
248
+ bodyClass
249
+ )}
250
+ >
251
+ {#if children}
252
+ {@render children()}
253
+ {/if}
254
+ </div>
255
+
256
+ {#if actions}
257
+ <div
258
+ class={cn(
259
+ 'border-t border-border/60 bg-muted/20 flex items-center justify-end gap-2',
260
+ size === 'small' ? 'px-3 py-2' : 'px-4 py-2.5'
261
+ )}
262
+ >
263
+ {@render actions()}
264
+ </div>
265
+ {/if}
266
+ {/if}
267
+ </div>
@@ -0,0 +1,56 @@
1
+ import { type Snippet } from 'svelte';
2
+ export interface ProCardTab {
3
+ key: string;
4
+ label: string;
5
+ disabled?: boolean;
6
+ }
7
+ export interface ProCardProps {
8
+ /** Title of the card header */
9
+ title?: string | Snippet;
10
+ /** Subtitle or secondary description */
11
+ subTitle?: string | Snippet;
12
+ /** Information tooltip description displayed next to the title */
13
+ tooltip?: string;
14
+ /** Extra actions or elements in the top right of the header */
15
+ extra?: Snippet;
16
+ /** Bottom actions slot */
17
+ actions?: Snippet;
18
+ /** Whether the card has an outer border */
19
+ bordered?: boolean;
20
+ /** Whether the card elevates on hover */
21
+ hoverable?: boolean;
22
+ /** Ghost mode: removes background, border, and padding for seamless grid nesting */
23
+ ghost?: boolean;
24
+ /** Whether the card can be collapsed */
25
+ collapsible?: boolean;
26
+ /** Controlled collapsed state */
27
+ collapsed?: boolean;
28
+ /** Initial default collapsed state */
29
+ defaultCollapsed?: boolean;
30
+ /** Callback when collapsed state toggles */
31
+ oncollapse?: (collapsed: boolean) => void;
32
+ /** Split layout for child elements */
33
+ split?: 'vertical' | 'horizontal';
34
+ /** Tab items displayed in the card header */
35
+ tabs?: ProCardTab[];
36
+ /** Controlled active tab key */
37
+ activeTabKey?: string;
38
+ /** Callback when active tab changes */
39
+ ontabchange?: (key: string) => void;
40
+ /** Size tier of the card */
41
+ size?: 'default' | 'small';
42
+ /** Loading indicator */
43
+ loading?: boolean;
44
+ /** Additional class names for header */
45
+ headerClass?: string;
46
+ /** Additional class names for card body */
47
+ bodyClass?: string;
48
+ /** Additional root class names */
49
+ class?: string;
50
+ /** Body content slot */
51
+ children?: Snippet;
52
+ [key: string]: unknown;
53
+ }
54
+ declare const ProCard: import("svelte").Component<ProCardProps, {}, "activeTabKey">;
55
+ type ProCard = ReturnType<typeof ProCard>;
56
+ export default ProCard;