@svadmin/lite 0.7.0 → 0.8.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 (71) hide show
  1. package/dist/components/LiteActivityFeed.svelte +98 -0
  2. package/dist/components/LiteActivityFeed.svelte.d.ts +19 -0
  3. package/dist/components/LiteApprovalActionCard.svelte +75 -0
  4. package/dist/components/LiteApprovalActionCard.svelte.d.ts +10 -0
  5. package/dist/components/LiteCanvasAnnotation.svelte +136 -0
  6. package/dist/components/LiteCanvasAnnotation.svelte.d.ts +16 -0
  7. package/dist/components/LiteColumnHeaderFilter.svelte +38 -0
  8. package/dist/components/LiteColumnHeaderFilter.svelte.d.ts +8 -0
  9. package/dist/components/LiteColumnSettings.svelte +82 -0
  10. package/dist/components/LiteColumnSettings.svelte.d.ts +15 -0
  11. package/dist/components/LiteDecisionTable.svelte +178 -0
  12. package/dist/components/LiteDecisionTable.svelte.d.ts +21 -0
  13. package/dist/components/LiteDraggableRowTable.svelte +70 -0
  14. package/dist/components/LiteDraggableRowTable.svelte.d.ts +14 -0
  15. package/dist/components/LiteDrawerForm.svelte +85 -0
  16. package/dist/components/LiteDrawerForm.svelte.d.ts +13 -0
  17. package/dist/components/LiteEditableTable.svelte +84 -0
  18. package/dist/components/LiteEditableTable.svelte.d.ts +19 -0
  19. package/dist/components/LiteGanttChart.svelte +144 -0
  20. package/dist/components/LiteGanttChart.svelte.d.ts +17 -0
  21. package/dist/components/LiteImageCropper.svelte +81 -0
  22. package/dist/components/LiteImageCropper.svelte.d.ts +9 -0
  23. package/dist/components/LiteImportWizard.svelte +99 -0
  24. package/dist/components/LiteImportWizard.svelte.d.ts +11 -0
  25. package/dist/components/LiteJsonSchemaForm.svelte +102 -0
  26. package/dist/components/LiteJsonSchemaForm.svelte.d.ts +10 -0
  27. package/dist/components/LiteKanbanBoard.svelte +169 -0
  28. package/dist/components/LiteKanbanBoard.svelte.d.ts +21 -0
  29. package/dist/components/LiteMasterDetailView.svelte +113 -0
  30. package/dist/components/LiteMasterDetailView.svelte.d.ts +11 -0
  31. package/dist/components/LiteMediaLibraryModal.svelte +110 -0
  32. package/dist/components/LiteMediaLibraryModal.svelte.d.ts +17 -0
  33. package/dist/components/LiteMentionsInput.svelte +98 -0
  34. package/dist/components/LiteMentionsInput.svelte.d.ts +19 -0
  35. package/dist/components/LiteModalForm.svelte +84 -0
  36. package/dist/components/LiteModalForm.svelte.d.ts +13 -0
  37. package/dist/components/LiteMultiTabKeepAlive.svelte +79 -0
  38. package/dist/components/LiteMultiTabKeepAlive.svelte.d.ts +15 -0
  39. package/dist/components/LiteOfflineSyncBanner.svelte +75 -0
  40. package/dist/components/LiteOfflineSyncBanner.svelte.d.ts +15 -0
  41. package/dist/components/LitePdfDocumentViewer.svelte +138 -0
  42. package/dist/components/LitePdfDocumentViewer.svelte.d.ts +17 -0
  43. package/dist/components/LitePivotTable.svelte +163 -0
  44. package/dist/components/LitePivotTable.svelte.d.ts +15 -0
  45. package/dist/components/LitePresenceAvatarGroup.svelte +52 -0
  46. package/dist/components/LitePresenceAvatarGroup.svelte.d.ts +12 -0
  47. package/dist/components/LitePrintableBill.svelte +119 -0
  48. package/dist/components/LitePrintableBill.svelte.d.ts +19 -0
  49. package/dist/components/LiteSensitiveDataMask.svelte +35 -0
  50. package/dist/components/LiteSensitiveDataMask.svelte.d.ts +7 -0
  51. package/dist/components/LiteSignaturePad.svelte +99 -0
  52. package/dist/components/LiteSignaturePad.svelte.d.ts +11 -0
  53. package/dist/components/LiteSplitPaneLayout.svelte +66 -0
  54. package/dist/components/LiteSplitPaneLayout.svelte.d.ts +9 -0
  55. package/dist/components/LiteSpreadsheetView.svelte +148 -0
  56. package/dist/components/LiteSpreadsheetView.svelte.d.ts +16 -0
  57. package/dist/components/LiteStepForm.svelte +144 -0
  58. package/dist/components/LiteStepForm.svelte.d.ts +18 -0
  59. package/dist/components/LiteTableSummary.svelte +93 -0
  60. package/dist/components/LiteTableSummary.svelte.d.ts +17 -0
  61. package/dist/components/LiteTreeTable.svelte +85 -0
  62. package/dist/components/LiteTreeTable.svelte.d.ts +13 -0
  63. package/dist/components/LiteVersionDiffViewer.svelte +129 -0
  64. package/dist/components/LiteVersionDiffViewer.svelte.d.ts +10 -0
  65. package/dist/components/LiteVirtualTable.svelte +52 -0
  66. package/dist/components/LiteVirtualTable.svelte.d.ts +14 -0
  67. package/dist/components/LiteWatermark.svelte +35 -0
  68. package/dist/components/LiteWatermark.svelte.d.ts +11 -0
  69. package/dist/index.d.ts +35 -0
  70. package/dist/index.js +34 -0
  71. package/package.json +2 -2
@@ -0,0 +1,119 @@
1
+ <script lang="ts">
2
+ interface LiteBillItem {
3
+ name: string;
4
+ spec?: string;
5
+ quantity: number;
6
+ unitPrice: number;
7
+ total?: number;
8
+ }
9
+
10
+ interface Props {
11
+ title?: string;
12
+ billNumber: string;
13
+ date: string;
14
+ companyName?: string;
15
+ customerName: string;
16
+ items?: LiteBillItem[];
17
+ notes?: string;
18
+ }
19
+
20
+ let {
21
+ title = 'INVOICE / RECEIPT',
22
+ billNumber,
23
+ date,
24
+ companyName = 'Enterprise Admin',
25
+ customerName,
26
+ items = [],
27
+ notes,
28
+ }: Props = $props();
29
+
30
+ const total = $derived(
31
+ items.reduce((acc, item) => acc + (item.total ?? item.quantity * item.unitPrice), 0)
32
+ );
33
+ </script>
34
+
35
+ <div class="lite-bill-card">
36
+ <div class="lite-bill-header">
37
+ <div style="float: left;">
38
+ <h3 style="margin: 0;">{title}</h3>
39
+ <span style="color: #64748b; font-size: 11px;">No: {billNumber}</span>
40
+ </div>
41
+ <div style="float: right; text-align: right;">
42
+ <strong>{companyName}</strong>
43
+ <div style="color: #64748b; font-size: 11px;">Date: {date}</div>
44
+ </div>
45
+ <div style="clear: both;"></div>
46
+ </div>
47
+
48
+ <div class="lite-bill-customer">
49
+ <strong>Bill To:</strong> {customerName}
50
+ </div>
51
+
52
+ <table class="lite-table lite-bill-table">
53
+ <thead>
54
+ <tr>
55
+ <th style="width: 30px;">#</th>
56
+ <th>Item Description</th>
57
+ <th style="width: 50px; text-align: center;">Qty</th>
58
+ <th style="width: 80px; text-align: right;">Price</th>
59
+ <th style="width: 90px; text-align: right;">Total</th>
60
+ </tr>
61
+ </thead>
62
+ <tbody>
63
+ {#each items as item, index (index)}
64
+ {@const rowTotal = item.total ?? item.quantity * item.unitPrice}
65
+ <tr>
66
+ <td style="text-align: center;">{index + 1}</td>
67
+ <td>{item.name} {#if item.spec}({item.spec}){/if}</td>
68
+ <td style="text-align: center;">{item.quantity}</td>
69
+ <td style="text-align: right;">¥{item.unitPrice.toFixed(2)}</td>
70
+ <td style="text-align: right; font-weight: bold;">¥{rowTotal.toFixed(2)}</td>
71
+ </tr>
72
+ {/each}
73
+ </tbody>
74
+ <tfoot>
75
+ <tr>
76
+ <td colspan="4" style="text-align: right; font-weight: bold;">Grand Total:</td>
77
+ <td style="text-align: right; font-weight: bold; color: #2563eb;">¥{total.toFixed(2)}</td>
78
+ </tr>
79
+ </tfoot>
80
+ </table>
81
+
82
+ {#if notes}
83
+ <div class="lite-bill-notes">
84
+ <strong>Notes:</strong> {notes}
85
+ </div>
86
+ {/if}
87
+ </div>
88
+
89
+ <style>
90
+ .lite-bill-card {
91
+ background: #ffffff;
92
+ border: 1px solid #cbd5e1;
93
+ border-radius: 6px;
94
+ padding: 20px;
95
+ margin-bottom: 16px;
96
+ }
97
+ .lite-bill-header {
98
+ border-bottom: 2px solid #3b82f6;
99
+ padding-bottom: 12px;
100
+ margin-bottom: 12px;
101
+ }
102
+ .lite-bill-customer {
103
+ background: #f8fafc;
104
+ padding: 8px 12px;
105
+ border-radius: 4px;
106
+ margin-bottom: 16px;
107
+ font-size: 13px;
108
+ }
109
+ .lite-bill-table {
110
+ width: 100%;
111
+ margin-bottom: 12px;
112
+ }
113
+ .lite-bill-notes {
114
+ font-size: 12px;
115
+ color: #64748b;
116
+ border-top: 1px solid #e2e8f0;
117
+ padding-top: 8px;
118
+ }
119
+ </style>
@@ -0,0 +1,19 @@
1
+ interface LiteBillItem {
2
+ name: string;
3
+ spec?: string;
4
+ quantity: number;
5
+ unitPrice: number;
6
+ total?: number;
7
+ }
8
+ interface Props {
9
+ title?: string;
10
+ billNumber: string;
11
+ date: string;
12
+ companyName?: string;
13
+ customerName: string;
14
+ items?: LiteBillItem[];
15
+ notes?: string;
16
+ }
17
+ declare const LitePrintableBill: import("svelte").Component<Props, {}, "">;
18
+ type LitePrintableBill = ReturnType<typeof LitePrintableBill>;
19
+ export default LitePrintableBill;
@@ -0,0 +1,35 @@
1
+ <script lang="ts">
2
+ interface Props {
3
+ value?: string | number | null;
4
+ type?: 'phone' | 'id-card' | 'email' | 'bank-card' | 'secret' | 'custom';
5
+ }
6
+
7
+ let {
8
+ value = '',
9
+ type = 'phone',
10
+ }: Props = $props();
11
+
12
+ const rawString = $derived(String(value ?? ''));
13
+
14
+ function mask(val: string, maskType: string): string {
15
+ if (!val) return '—';
16
+ switch (maskType) {
17
+ case 'phone':
18
+ return val.length >= 7 ? `${val.slice(0, 3)}****${val.slice(-4)}` : '****';
19
+ case 'id-card':
20
+ return val.length >= 10 ? `${val.slice(0, 6)}********${val.slice(-4)}` : '********';
21
+ case 'email': {
22
+ const parts = val.split('@');
23
+ return parts.length === 2 ? `${parts[0].slice(0, 1)}***@${parts[1]}` : '***@***.***';
24
+ }
25
+ default:
26
+ return '••••••••';
27
+ }
28
+ }
29
+
30
+ const masked = $derived(mask(rawString, type));
31
+ </script>
32
+
33
+ <span class="lite-sensitive-mask" style="font-family: monospace; font-size: 12px;">
34
+ {masked}
35
+ </span>
@@ -0,0 +1,7 @@
1
+ interface Props {
2
+ value?: string | number | null;
3
+ type?: 'phone' | 'id-card' | 'email' | 'bank-card' | 'secret' | 'custom';
4
+ }
5
+ declare const LiteSensitiveDataMask: import("svelte").Component<Props, {}, "">;
6
+ type LiteSensitiveDataMask = ReturnType<typeof LiteSensitiveDataMask>;
7
+ export default LiteSensitiveDataMask;
@@ -0,0 +1,99 @@
1
+ <script lang="ts">
2
+ interface Props {
3
+ name?: string;
4
+ value?: string;
5
+ label?: string;
6
+ formAction?: string;
7
+ disabled?: boolean;
8
+ class?: string;
9
+ }
10
+
11
+ let {
12
+ name = 'signature',
13
+ value = '',
14
+ label = 'Electronic Signature',
15
+ formAction = '',
16
+ disabled = false,
17
+ class: className = '',
18
+ }: Props = $props();
19
+ </script>
20
+
21
+ <div class="sv-lite-signature-card {className}">
22
+ <div class="sv-lite-sig-header">
23
+ <strong>{label}</strong>
24
+ <span class="sv-lite-sig-sub">(Upload or review signed receipt)</span>
25
+ </div>
26
+
27
+ {#if value}
28
+ <div class="sv-lite-sig-preview">
29
+ <img src={value} alt="Signature Preview" class="sv-lite-sig-img" />
30
+ </div>
31
+ {:else}
32
+ <div class="sv-lite-sig-empty">
33
+ No signature registered
34
+ </div>
35
+ {/if}
36
+
37
+ <div class="sv-lite-sig-actions">
38
+ <form method="POST" action={formAction} enctype="multipart/form-data">
39
+ <input type="file" name={name} accept="image/*" {disabled} class="sv-lite-sig-file" />
40
+ <button type="submit" {disabled} class="sv-lite-sig-btn">Upload Signature</button>
41
+ </form>
42
+ </div>
43
+ </div>
44
+
45
+ <style>
46
+ .sv-lite-signature-card {
47
+ display: block;
48
+ border: 1px solid #e2e8f0;
49
+ border-radius: 6px;
50
+ padding: 12px;
51
+ background-color: #ffffff;
52
+ font-size: 12px;
53
+ }
54
+ .sv-lite-sig-header {
55
+ margin-bottom: 8px;
56
+ font-size: 13px;
57
+ color: #0f172a;
58
+ }
59
+ .sv-lite-sig-sub {
60
+ color: #64748b;
61
+ font-size: 11px;
62
+ margin-left: 6px;
63
+ }
64
+ .sv-lite-sig-preview {
65
+ border: 2px dashed #cbd5e1;
66
+ border-radius: 4px;
67
+ padding: 10px;
68
+ text-align: center;
69
+ background-color: #f8fafc;
70
+ margin-bottom: 10px;
71
+ }
72
+ .sv-lite-sig-img {
73
+ max-height: 80px;
74
+ max-width: 100%;
75
+ vertical-align: middle;
76
+ }
77
+ .sv-lite-sig-empty {
78
+ border: 2px dashed #cbd5e1;
79
+ border-radius: 4px;
80
+ padding: 24px;
81
+ text-align: center;
82
+ color: #94a3b8;
83
+ background-color: #f8fafc;
84
+ margin-bottom: 10px;
85
+ }
86
+ .sv-lite-sig-file {
87
+ font-size: 11px;
88
+ margin-right: 8px;
89
+ }
90
+ .sv-lite-sig-btn {
91
+ padding: 4px 10px;
92
+ font-size: 11px;
93
+ background-color: #4f46e5;
94
+ color: #ffffff;
95
+ border: none;
96
+ border-radius: 3px;
97
+ cursor: pointer;
98
+ }
99
+ </style>
@@ -0,0 +1,11 @@
1
+ interface Props {
2
+ name?: string;
3
+ value?: string;
4
+ label?: string;
5
+ formAction?: string;
6
+ disabled?: boolean;
7
+ class?: string;
8
+ }
9
+ declare const LiteSignaturePad: import("svelte").Component<Props, {}, "">;
10
+ type LiteSignaturePad = ReturnType<typeof LiteSignaturePad>;
11
+ export default LiteSignaturePad;
@@ -0,0 +1,66 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+
4
+ interface Props {
5
+ direction?: 'horizontal' | 'vertical';
6
+ pane1?: Snippet;
7
+ pane2?: Snippet;
8
+ }
9
+
10
+ let {
11
+ direction = 'horizontal',
12
+ pane1,
13
+ pane2,
14
+ }: Props = $props();
15
+ </script>
16
+
17
+ <div class="lite-split-layout lite-split-{direction}">
18
+ <div class="lite-split-pane-1">
19
+ {#if pane1}
20
+ {@render pane1()}
21
+ {/if}
22
+ </div>
23
+
24
+ <div class="lite-split-divider"></div>
25
+
26
+ <div class="lite-split-pane-2">
27
+ {#if pane2}
28
+ {@render pane2()}
29
+ {/if}
30
+ </div>
31
+ </div>
32
+
33
+ <style>
34
+ .lite-split-layout {
35
+ display: flex;
36
+ background: #ffffff;
37
+ border: 1px solid #cbd5e1;
38
+ border-radius: 6px;
39
+ margin-bottom: 16px;
40
+ min-height: 300px;
41
+ }
42
+ .lite-split-horizontal {
43
+ flex-direction: row;
44
+ }
45
+ .lite-split-vertical {
46
+ flex-direction: column;
47
+ }
48
+ .lite-split-pane-1 {
49
+ flex: 0 0 35%;
50
+ padding: 12px;
51
+ overflow-y: auto;
52
+ }
53
+ .lite-split-pane-2 {
54
+ flex: 1 1 auto;
55
+ padding: 12px;
56
+ overflow-y: auto;
57
+ }
58
+ .lite-split-divider {
59
+ background: #e2e8f0;
60
+ width: 2px;
61
+ }
62
+ .lite-split-vertical .lite-split-divider {
63
+ width: 100%;
64
+ height: 2px;
65
+ }
66
+ </style>
@@ -0,0 +1,9 @@
1
+ import type { Snippet } from 'svelte';
2
+ interface Props {
3
+ direction?: 'horizontal' | 'vertical';
4
+ pane1?: Snippet;
5
+ pane2?: Snippet;
6
+ }
7
+ declare const LiteSplitPaneLayout: import("svelte").Component<Props, {}, "">;
8
+ type LiteSplitPaneLayout = ReturnType<typeof LiteSplitPaneLayout>;
9
+ export default LiteSplitPaneLayout;
@@ -0,0 +1,148 @@
1
+ <script lang="ts">
2
+ export interface SheetData {
3
+ id: string;
4
+ name: string;
5
+ rows: number;
6
+ cols: number;
7
+ cells: Record<string, string>;
8
+ }
9
+
10
+ interface Props {
11
+ sheets?: SheetData[];
12
+ activeSheetId?: string;
13
+ formAction?: string;
14
+ class?: string;
15
+ }
16
+
17
+ let {
18
+ sheets = [
19
+ {
20
+ id: 'sheet1',
21
+ name: 'Summary',
22
+ rows: 5,
23
+ cols: 4,
24
+ cells: { A1: 'Item', B1: 'Amount', A2: 'Sales', B2: '1000' },
25
+ },
26
+ ],
27
+ activeSheetId = 'sheet1',
28
+ formAction = '',
29
+ class: className = '',
30
+ }: Props = $props();
31
+
32
+ const currentSheet = $derived(
33
+ sheets.find((s) => s.id === activeSheetId) ?? sheets[0]
34
+ );
35
+
36
+ function getColName(index: number): string {
37
+ return String.fromCharCode(index + 65);
38
+ }
39
+ </script>
40
+
41
+ <div class="sv-lite-sheet-container {className}">
42
+ <div class="sv-lite-sheet-header">
43
+ <strong>Spreadsheet: {currentSheet?.name ?? 'Sheet'}</strong>
44
+ </div>
45
+
46
+ {#if currentSheet}
47
+ <form method="POST" action={formAction}>
48
+ <table class="sv-lite-sheet-table">
49
+ <thead>
50
+ <tr>
51
+ <th class="sv-lite-sheet-th-num">#</th>
52
+ {#each Array.from({ length: currentSheet.cols }) as _, c (c)}
53
+ <th class="sv-lite-sheet-th">{getColName(c)}</th>
54
+ {/each}
55
+ </tr>
56
+ </thead>
57
+ <tbody>
58
+ {#each Array.from({ length: currentSheet.rows }) as _, r (r)}
59
+ {@const rowNum = r + 1}
60
+ <tr>
61
+ <td class="sv-lite-sheet-td-num">{rowNum}</td>
62
+ {#each Array.from({ length: currentSheet.cols }) as _, c (c)}
63
+ {@const key = `${getColName(c)}${rowNum}`}
64
+ <td class="sv-lite-sheet-td">
65
+ <input
66
+ type="text"
67
+ name={`cell_${key}`}
68
+ value={currentSheet.cells[key] ?? ''}
69
+ class="sv-lite-cell-input"
70
+ />
71
+ </td>
72
+ {/each}
73
+ </tr>
74
+ {/each}
75
+ </tbody>
76
+ </table>
77
+
78
+ {#if formAction}
79
+ <div class="sv-lite-sheet-footer">
80
+ <button type="submit" class="sv-lite-sheet-save">Save Spreadsheet</button>
81
+ </div>
82
+ {/if}
83
+ </form>
84
+ {/if}
85
+ </div>
86
+
87
+ <style>
88
+ .sv-lite-sheet-container {
89
+ display: block;
90
+ border: 1px solid #e2e8f0;
91
+ border-radius: 6px;
92
+ padding: 12px;
93
+ background-color: #ffffff;
94
+ font-size: 12px;
95
+ overflow-x: auto;
96
+ }
97
+ .sv-lite-sheet-header {
98
+ margin-bottom: 10px;
99
+ font-size: 13px;
100
+ color: #0f172a;
101
+ }
102
+ .sv-lite-sheet-table {
103
+ width: 100%;
104
+ border-collapse: collapse;
105
+ font-family: monospace;
106
+ }
107
+ .sv-lite-sheet-table th, .sv-lite-sheet-table td {
108
+ border: 1px solid #cbd5e1;
109
+ padding: 2px;
110
+ }
111
+ .sv-lite-sheet-th-num, .sv-lite-sheet-td-num {
112
+ background-color: #f1f5f9;
113
+ text-align: center;
114
+ width: 32px;
115
+ color: #64748b;
116
+ font-weight: bold;
117
+ font-size: 10px;
118
+ }
119
+ .sv-lite-sheet-th {
120
+ background-color: #f8fafc;
121
+ text-align: center;
122
+ font-weight: 600;
123
+ color: #1e293b;
124
+ min-width: 80px;
125
+ }
126
+ .sv-lite-cell-input {
127
+ width: 100%;
128
+ border: none;
129
+ padding: 4px;
130
+ font-size: 11px;
131
+ box-sizing: border-box;
132
+ font-family: inherit;
133
+ background: transparent;
134
+ }
135
+ .sv-lite-sheet-footer {
136
+ margin-top: 10px;
137
+ text-align: right;
138
+ }
139
+ .sv-lite-sheet-save {
140
+ padding: 5px 12px;
141
+ background-color: #4f46e5;
142
+ color: #ffffff;
143
+ border: none;
144
+ border-radius: 3px;
145
+ font-size: 11px;
146
+ cursor: pointer;
147
+ }
148
+ </style>
@@ -0,0 +1,16 @@
1
+ export interface SheetData {
2
+ id: string;
3
+ name: string;
4
+ rows: number;
5
+ cols: number;
6
+ cells: Record<string, string>;
7
+ }
8
+ interface Props {
9
+ sheets?: SheetData[];
10
+ activeSheetId?: string;
11
+ formAction?: string;
12
+ class?: string;
13
+ }
14
+ declare const LiteSpreadsheetView: import("svelte").Component<Props, {}, "">;
15
+ type LiteSpreadsheetView = ReturnType<typeof LiteSpreadsheetView>;
16
+ export default LiteSpreadsheetView;
@@ -0,0 +1,144 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+
4
+ export interface LiteFormStep {
5
+ title: string;
6
+ description?: string;
7
+ }
8
+
9
+ interface Props {
10
+ steps: LiteFormStep[];
11
+ currentStep?: number;
12
+ action?: string;
13
+ method?: "get" | "post" | "dialog" | "GET" | "POST" | "DIALOG" | null;
14
+ submitText?: string;
15
+ nextText?: string;
16
+ prevText?: string;
17
+ children?: Snippet;
18
+ }
19
+
20
+ let {
21
+ steps,
22
+ currentStep = 0,
23
+ action = '',
24
+ method = 'POST',
25
+ submitText = 'Submit',
26
+ nextText = 'Next Step',
27
+ prevText = 'Previous Step',
28
+ children,
29
+ }: Props = $props();
30
+ </script>
31
+
32
+ <div class="lite-step-form-card">
33
+ <!-- Step Indicators -->
34
+ <div class="lite-step-header">
35
+ {#each steps as step, index (index)}
36
+ {@const isCompleted = index < currentStep}
37
+ {@const isCurrent = index === currentStep}
38
+ <div class="lite-step-item {isCurrent ? 'lite-step-current' : isCompleted ? 'lite-step-completed' : ''}">
39
+ <span class="lite-step-circle">
40
+ {#if isCompleted}✔{:else}{index + 1}{/if}
41
+ </span>
42
+ <span class="lite-step-title">{step.title}</span>
43
+ </div>
44
+ {#if index < steps.length - 1}
45
+ <span class="lite-step-arrow">→</span>
46
+ {/if}
47
+ {/each}
48
+ </div>
49
+
50
+ <!-- Form Body -->
51
+ <form {action} {method} class="lite-step-body">
52
+ <input type="hidden" name="_step" value={currentStep} />
53
+
54
+ <div class="lite-step-content">
55
+ {#if children}
56
+ {@render children()}
57
+ {/if}
58
+ </div>
59
+
60
+ <!-- Actions -->
61
+ <div class="lite-step-actions">
62
+ {#if currentStep > 0}
63
+ <button type="submit" name="_step_action" value="prev" class="lite-btn lite-btn-outline lite-btn-sm">
64
+ ← {prevText}
65
+ </button>
66
+ {/if}
67
+ <div class="lite-step-right-action" style="margin-left: auto;">
68
+ {#if currentStep < steps.length - 1}
69
+ <button type="submit" name="_step_action" value="next" class="lite-btn lite-btn-primary lite-btn-sm">
70
+ {nextText} →
71
+ </button>
72
+ {:else}
73
+ <button type="submit" name="_step_action" value="finish" class="lite-btn lite-btn-primary lite-btn-sm">
74
+ {submitText}
75
+ </button>
76
+ {/if}
77
+ </div>
78
+ </div>
79
+ </form>
80
+ </div>
81
+
82
+ <style>
83
+ .lite-step-form-card {
84
+ padding: 16px;
85
+ background: #ffffff;
86
+ border: 1px solid #cbd5e1;
87
+ border-radius: 6px;
88
+ margin-bottom: 16px;
89
+ }
90
+ .lite-step-header {
91
+ display: flex;
92
+ align-items: center;
93
+ padding-bottom: 12px;
94
+ border-bottom: 1px solid #e2e8f0;
95
+ margin-bottom: 16px;
96
+ overflow-x: auto;
97
+ }
98
+ .lite-step-item {
99
+ display: flex;
100
+ align-items: center;
101
+ font-size: 12px;
102
+ color: #64748b;
103
+ }
104
+ .lite-step-item.lite-step-current {
105
+ color: #3b82f6;
106
+ font-weight: bold;
107
+ }
108
+ .lite-step-item.lite-step-completed {
109
+ color: #10b981;
110
+ }
111
+ .lite-step-circle {
112
+ display: inline-block;
113
+ width: 20px;
114
+ height: 20px;
115
+ line-height: 20px;
116
+ text-align: center;
117
+ border-radius: 50%;
118
+ background: #f1f5f9;
119
+ margin-right: 6px;
120
+ font-size: 11px;
121
+ }
122
+ .lite-step-current .lite-step-circle {
123
+ background: #3b82f6;
124
+ color: #ffffff;
125
+ }
126
+ .lite-step-completed .lite-step-circle {
127
+ background: #10b981;
128
+ color: #ffffff;
129
+ }
130
+ .lite-step-arrow {
131
+ margin: 0 10px;
132
+ color: #cbd5e1;
133
+ }
134
+ .lite-step-content {
135
+ min-height: 100px;
136
+ margin-bottom: 16px;
137
+ }
138
+ .lite-step-actions {
139
+ display: flex;
140
+ align-items: center;
141
+ padding-top: 12px;
142
+ border-top: 1px solid #e2e8f0;
143
+ }
144
+ </style>
@@ -0,0 +1,18 @@
1
+ import type { Snippet } from 'svelte';
2
+ export interface LiteFormStep {
3
+ title: string;
4
+ description?: string;
5
+ }
6
+ interface Props {
7
+ steps: LiteFormStep[];
8
+ currentStep?: number;
9
+ action?: string;
10
+ method?: "get" | "post" | "dialog" | "GET" | "POST" | "DIALOG" | null;
11
+ submitText?: string;
12
+ nextText?: string;
13
+ prevText?: string;
14
+ children?: Snippet;
15
+ }
16
+ declare const LiteStepForm: import("svelte").Component<Props, {}, "">;
17
+ type LiteStepForm = ReturnType<typeof LiteStepForm>;
18
+ export default LiteStepForm;