@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,102 @@
1
+ <script lang="ts">
2
+ interface Props {
3
+ schema: Record<string, unknown>;
4
+ value?: Record<string, unknown>;
5
+ action?: string;
6
+ method?: 'get' | 'post' | 'dialog' | 'GET' | 'POST' | 'DIALOG' | null;
7
+ submitText?: string;
8
+ }
9
+
10
+ let {
11
+ schema,
12
+ value = {},
13
+ action = '',
14
+ method = 'POST',
15
+ submitText = 'Submit Form',
16
+ }: Props = $props();
17
+
18
+ interface FieldMeta {
19
+ key: string;
20
+ title: string;
21
+ type: string;
22
+ enum?: Array<string | number>;
23
+ required?: boolean;
24
+ }
25
+
26
+ const properties = $derived.by<FieldMeta[]>(() => {
27
+ const propsObj = (schema.properties ?? {}) as Record<string, Record<string, unknown>>;
28
+ const requiredKeys = Array.isArray(schema.required) ? (schema.required as string[]) : [];
29
+
30
+ return Object.entries(propsObj).map(([key, propDef]) => ({
31
+ key,
32
+ title: String(propDef.title ?? key),
33
+ type: String(propDef.type ?? 'string'),
34
+ enum: Array.isArray(propDef.enum) ? (propDef.enum as Array<string | number>) : undefined,
35
+ required: requiredKeys.includes(key),
36
+ }));
37
+ });
38
+ </script>
39
+
40
+ <div class="lite-schema-form-card">
41
+ {#if schema.title}
42
+ <div class="lite-schema-form-header">
43
+ <strong>{schema.title}</strong>
44
+ </div>
45
+ {/if}
46
+
47
+ <form {action} {method} class="lite-schema-form">
48
+ {#each properties as field (field.key)}
49
+ <div class="lite-schema-field">
50
+ <label for="lite_json_{field.key}" class="lite-label">
51
+ {field.title} {#if field.required}<span style="color: #ef4444;">*</span>{/if}
52
+ </label>
53
+ {#if field.enum}
54
+ <select id="lite_json_{field.key}" name={field.key} class="lite-select" required={field.required}>
55
+ {#each field.enum as option (option)}
56
+ <option value={String(option)} selected={String(value[field.key]) === String(option)}>
57
+ {option}
58
+ </option>
59
+ {/each}
60
+ </select>
61
+ {:else if field.type === 'boolean'}
62
+ <input id="lite_json_{field.key}" type="checkbox" name={field.key} checked={Boolean(value[field.key])} />
63
+ {:else if field.type === 'number' || field.type === 'integer'}
64
+ <input id="lite_json_{field.key}" type="number" name={field.key} value={Number(value[field.key] ?? 0)} class="lite-input" required={field.required} />
65
+ {:else}
66
+ <input id="lite_json_{field.key}" type="text" name={field.key} value={String(value[field.key] ?? '')} class="lite-input" required={field.required} />
67
+ {/if}
68
+ </div>
69
+ {/each}
70
+
71
+ <div class="lite-schema-footer">
72
+ <button type="submit" class="lite-btn lite-btn-primary lite-btn-sm">
73
+ {submitText}
74
+ </button>
75
+ </div>
76
+ </form>
77
+ </div>
78
+
79
+ <style>
80
+ .lite-schema-form-card {
81
+ background: #ffffff;
82
+ border: 1px solid #cbd5e1;
83
+ border-radius: 6px;
84
+ padding: 16px;
85
+ margin-bottom: 16px;
86
+ }
87
+ .lite-schema-form-header {
88
+ padding-bottom: 8px;
89
+ border-bottom: 1px solid #e2e8f0;
90
+ margin-bottom: 12px;
91
+ font-size: 14px;
92
+ }
93
+ .lite-schema-field {
94
+ margin-bottom: 12px;
95
+ }
96
+ .lite-schema-footer {
97
+ display: flex;
98
+ justify-content: flex-end;
99
+ padding-top: 12px;
100
+ border-top: 1px solid #e2e8f0;
101
+ }
102
+ </style>
@@ -0,0 +1,10 @@
1
+ interface Props {
2
+ schema: Record<string, unknown>;
3
+ value?: Record<string, unknown>;
4
+ action?: string;
5
+ method?: 'get' | 'post' | 'dialog' | 'GET' | 'POST' | 'DIALOG' | null;
6
+ submitText?: string;
7
+ }
8
+ declare const LiteJsonSchemaForm: import("svelte").Component<Props, {}, "">;
9
+ type LiteJsonSchemaForm = ReturnType<typeof LiteJsonSchemaForm>;
10
+ export default LiteJsonSchemaForm;
@@ -0,0 +1,169 @@
1
+ <script lang="ts">
2
+ export interface KanbanCard {
3
+ id: string;
4
+ title: string;
5
+ description?: string;
6
+ columnId: string;
7
+ priority?: 'low' | 'medium' | 'high' | 'urgent';
8
+ tags?: string[];
9
+ }
10
+
11
+ export interface KanbanColumn {
12
+ id: string;
13
+ title: string;
14
+ }
15
+
16
+ interface Props {
17
+ columns: KanbanColumn[];
18
+ cards?: KanbanCard[];
19
+ formAction?: string;
20
+ class?: string;
21
+ }
22
+
23
+ let {
24
+ columns = [],
25
+ cards = [],
26
+ formAction = '',
27
+ class: className = '',
28
+ }: Props = $props();
29
+ </script>
30
+
31
+ <div class="sv-lite-kanban-board {className}">
32
+ {#each columns as col (col.id)}
33
+ {@const colCards = cards.filter((c) => c.columnId === col.id)}
34
+ <div class="sv-lite-kanban-column">
35
+ <div class="sv-lite-column-header">
36
+ <span class="sv-lite-column-title">{col.title}</span>
37
+ <span class="sv-lite-column-count">({colCards.length})</span>
38
+ </div>
39
+
40
+ <div class="sv-lite-column-cards">
41
+ {#each colCards as card (card.id)}
42
+ <div class="sv-lite-kanban-card">
43
+ <div class="sv-lite-card-title">{card.title}</div>
44
+ {#if card.description}
45
+ <div class="sv-lite-card-desc">{card.description}</div>
46
+ {/if}
47
+ <div class="sv-lite-card-meta">
48
+ {#if card.priority}
49
+ <span class="sv-lite-priority-badge sv-lite-{card.priority}">{card.priority}</span>
50
+ {/if}
51
+ {#each card.tags ?? [] as tag (tag)}
52
+ <span class="sv-lite-tag-badge">#{tag}</span>
53
+ {/each}
54
+ </div>
55
+ </div>
56
+ {/each}
57
+ </div>
58
+
59
+ {#if formAction}
60
+ <form method="POST" action={formAction} class="sv-lite-card-form">
61
+ <input type="hidden" name="columnId" value={col.id} />
62
+ <input type="text" name="title" placeholder="+ Add card..." class="sv-lite-card-input" />
63
+ <button type="submit" class="sv-lite-card-btn">Add</button>
64
+ </form>
65
+ {/if}
66
+ </div>
67
+ {/each}
68
+ </div>
69
+
70
+ <style>
71
+ .sv-lite-kanban-board {
72
+ display: block;
73
+ white-space: nowrap;
74
+ overflow-x: auto;
75
+ padding-bottom: 12px;
76
+ font-size: 12px;
77
+ }
78
+ .sv-lite-kanban-column {
79
+ display: inline-block;
80
+ vertical-align: top;
81
+ width: 260px;
82
+ margin-right: 12px;
83
+ background-color: #f8fafc;
84
+ border: 1px solid #e2e8f0;
85
+ border-radius: 6px;
86
+ padding: 10px;
87
+ white-space: normal;
88
+ box-sizing: border-box;
89
+ }
90
+ .sv-lite-column-header {
91
+ font-weight: bold;
92
+ padding-bottom: 8px;
93
+ border-bottom: 1px solid #cbd5e1;
94
+ color: #1e293b;
95
+ margin-bottom: 8px;
96
+ }
97
+ .sv-lite-column-count {
98
+ color: #64748b;
99
+ font-weight: normal;
100
+ font-size: 11px;
101
+ margin-left: 4px;
102
+ }
103
+ .sv-lite-kanban-card {
104
+ background-color: #ffffff;
105
+ border: 1px solid #cbd5e1;
106
+ border-radius: 4px;
107
+ padding: 8px;
108
+ margin-bottom: 8px;
109
+ }
110
+ .sv-lite-card-title {
111
+ font-weight: 600;
112
+ color: #0f172a;
113
+ margin-bottom: 4px;
114
+ }
115
+ .sv-lite-card-desc {
116
+ color: #64748b;
117
+ font-size: 11px;
118
+ margin-bottom: 6px;
119
+ }
120
+ .sv-lite-card-meta {
121
+ padding-top: 4px;
122
+ border-top: 1px solid #f1f5f9;
123
+ }
124
+ .sv-lite-priority-badge {
125
+ display: inline-block;
126
+ padding: 1px 4px;
127
+ font-size: 10px;
128
+ border-radius: 2px;
129
+ text-transform: uppercase;
130
+ margin-right: 4px;
131
+ }
132
+ .sv-lite-urgent, .sv-lite-high {
133
+ background-color: #fee2e2;
134
+ color: #991b1b;
135
+ }
136
+ .sv-lite-medium {
137
+ background-color: #e0e7ff;
138
+ color: #3730a3;
139
+ }
140
+ .sv-lite-low {
141
+ background-color: #f1f5f9;
142
+ color: #475569;
143
+ }
144
+ .sv-lite-tag-badge {
145
+ display: inline-block;
146
+ color: #64748b;
147
+ font-size: 10px;
148
+ margin-right: 4px;
149
+ }
150
+ .sv-lite-card-form {
151
+ margin-top: 6px;
152
+ }
153
+ .sv-lite-card-input {
154
+ width: 170px;
155
+ padding: 4px 6px;
156
+ font-size: 11px;
157
+ border: 1px solid #cbd5e1;
158
+ border-radius: 3px;
159
+ }
160
+ .sv-lite-card-btn {
161
+ padding: 4px 8px;
162
+ font-size: 11px;
163
+ background-color: #4f46e5;
164
+ color: #ffffff;
165
+ border: none;
166
+ border-radius: 3px;
167
+ cursor: pointer;
168
+ }
169
+ </style>
@@ -0,0 +1,21 @@
1
+ export interface KanbanCard {
2
+ id: string;
3
+ title: string;
4
+ description?: string;
5
+ columnId: string;
6
+ priority?: 'low' | 'medium' | 'high' | 'urgent';
7
+ tags?: string[];
8
+ }
9
+ export interface KanbanColumn {
10
+ id: string;
11
+ title: string;
12
+ }
13
+ interface Props {
14
+ columns: KanbanColumn[];
15
+ cards?: KanbanCard[];
16
+ formAction?: string;
17
+ class?: string;
18
+ }
19
+ declare const LiteKanbanBoard: import("svelte").Component<Props, {}, "">;
20
+ type LiteKanbanBoard = ReturnType<typeof LiteKanbanBoard>;
21
+ export default LiteKanbanBoard;
@@ -0,0 +1,113 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+
4
+ interface Props {
5
+ items?: Record<string, unknown>[];
6
+ selectedId?: string | number;
7
+ idKey?: string;
8
+ titleKey?: string;
9
+ detailSnippet?: Snippet<[Record<string, unknown>]>;
10
+ }
11
+
12
+ let {
13
+ items = [],
14
+ selectedId,
15
+ idKey = 'id',
16
+ titleKey = 'title',
17
+ detailSnippet,
18
+ }: Props = $props();
19
+
20
+ const activeItem = $derived(
21
+ items.find((i) => String(i[idKey]) === String(selectedId)) ?? items[0]
22
+ );
23
+ </script>
24
+
25
+ <div class="lite-master-detail-card">
26
+ <!-- Left Master List -->
27
+ <div class="lite-master-list">
28
+ <div class="lite-master-header">
29
+ <strong>Item Directory</strong>
30
+ </div>
31
+ <ul class="lite-master-items">
32
+ {#each items as item (item[idKey])}
33
+ {@const isSelected = String(item[idKey]) === String(activeItem?.[idKey])}
34
+ <li class="lite-master-item {isSelected ? 'lite-master-item-active' : ''}">
35
+ <a href="?selectedId={item[idKey]}" class="lite-master-link">
36
+ {item[titleKey] ?? item.name ?? `Item #${item[idKey]}`}
37
+ </a>
38
+ </li>
39
+ {/each}
40
+ </ul>
41
+ </div>
42
+
43
+ <!-- Right Detail View -->
44
+ <div class="lite-detail-pane">
45
+ {#if activeItem}
46
+ {#if detailSnippet}
47
+ {@render detailSnippet(activeItem)}
48
+ {:else}
49
+ <div class="lite-detail-content">
50
+ <h4 style="margin: 0 0 12px 0;">{activeItem[titleKey] ?? activeItem.name ?? `Item #${activeItem[idKey]}`}</h4>
51
+ <table class="lite-table">
52
+ <tbody>
53
+ {#each Object.entries(activeItem) as [k, v] (k)}
54
+ <tr>
55
+ <th style="width: 30%; text-align: left; background: #f8fafc;">{k}</th>
56
+ <td>{typeof v === 'object' ? JSON.stringify(v) : String(v ?? '—')}</td>
57
+ </tr>
58
+ {/each}
59
+ </tbody>
60
+ </table>
61
+ </div>
62
+ {/if}
63
+ {:else}
64
+ <div style="color: #94a3b8; padding: 24px; text-align: center;">
65
+ Select an item to view details
66
+ </div>
67
+ {/if}
68
+ </div>
69
+ </div>
70
+
71
+ <style>
72
+ .lite-master-detail-card {
73
+ display: flex;
74
+ background: #ffffff;
75
+ border: 1px solid #cbd5e1;
76
+ border-radius: 6px;
77
+ margin-bottom: 16px;
78
+ min-height: 320px;
79
+ }
80
+ .lite-master-list {
81
+ flex: 0 0 240px;
82
+ border-right: 1px solid #e2e8f0;
83
+ background: #f8fafc;
84
+ }
85
+ .lite-master-header {
86
+ padding: 10px 12px;
87
+ border-bottom: 1px solid #e2e8f0;
88
+ font-size: 12px;
89
+ }
90
+ .lite-master-items {
91
+ list-style: none;
92
+ padding: 0;
93
+ margin: 0;
94
+ }
95
+ .lite-master-item {
96
+ border-bottom: 1px solid #f1f5f9;
97
+ }
98
+ .lite-master-item-active {
99
+ background: #e0e7ff;
100
+ font-weight: bold;
101
+ }
102
+ .lite-master-link {
103
+ display: block;
104
+ padding: 8px 12px;
105
+ color: #1e293b;
106
+ text-decoration: none;
107
+ font-size: 12px;
108
+ }
109
+ .lite-detail-pane {
110
+ flex: 1 1 auto;
111
+ padding: 16px;
112
+ }
113
+ </style>
@@ -0,0 +1,11 @@
1
+ import type { Snippet } from 'svelte';
2
+ interface Props {
3
+ items?: Record<string, unknown>[];
4
+ selectedId?: string | number;
5
+ idKey?: string;
6
+ titleKey?: string;
7
+ detailSnippet?: Snippet<[Record<string, unknown>]>;
8
+ }
9
+ declare const LiteMasterDetailView: import("svelte").Component<Props, {}, "">;
10
+ type LiteMasterDetailView = ReturnType<typeof LiteMasterDetailView>;
11
+ export default LiteMasterDetailView;
@@ -0,0 +1,110 @@
1
+ <script lang="ts">
2
+ interface LiteMediaItem {
3
+ id: string;
4
+ name: string;
5
+ url: string;
6
+ size?: string;
7
+ category?: string;
8
+ }
9
+
10
+ interface Props {
11
+ title?: string;
12
+ multiple?: boolean;
13
+ mediaItems?: LiteMediaItem[];
14
+ action?: string;
15
+ method?: 'get' | 'post' | 'dialog' | 'GET' | 'POST' | 'DIALOG' | null;
16
+ }
17
+
18
+ let {
19
+ title = 'Media Library',
20
+ multiple = false,
21
+ mediaItems = [],
22
+ action = '',
23
+ method = 'POST',
24
+ }: Props = $props();
25
+ </script>
26
+
27
+ <div class="lite-media-library-card">
28
+ <div class="lite-media-header">
29
+ <strong>{title}</strong>
30
+ </div>
31
+
32
+ <form {action} {method} enctype="multipart/form-data">
33
+ <!-- Upload Section -->
34
+ <div class="lite-media-upload-row">
35
+ <label for="media_upload_input" class="lite-label">Upload New Media:</label>
36
+ <input id="media_upload_input" type="file" name="files" multiple={multiple} class="lite-file-input" />
37
+ <button type="submit" name="_media_action" value="upload" class="lite-btn lite-btn-sm lite-btn-outline" style="margin-left: 8px;">
38
+ Upload File
39
+ </button>
40
+ </div>
41
+
42
+ <!-- Media Table List -->
43
+ <table class="lite-table">
44
+ <thead>
45
+ <tr>
46
+ <th style="width: 40px;">Select</th>
47
+ <th>File Name</th>
48
+ <th>Category</th>
49
+ <th>Size</th>
50
+ <th>Preview</th>
51
+ </tr>
52
+ </thead>
53
+ <tbody>
54
+ {#each mediaItems as item (item.id)}
55
+ <tr>
56
+ <td style="text-align: center;">
57
+ {#if multiple}
58
+ <input type="checkbox" name="selectedUrls" value={item.url} />
59
+ {:else}
60
+ <input type="radio" name="selectedUrls" value={item.url} />
61
+ {/if}
62
+ </td>
63
+ <td><strong>{item.name}</strong></td>
64
+ <td>{item.category ?? 'General'}</td>
65
+ <td>{item.size ?? '—'}</td>
66
+ <td><a href={item.url} target="_blank" rel="noreferrer" class="lite-link">View</a></td>
67
+ </tr>
68
+ {/each}
69
+ {#if mediaItems.length === 0}
70
+ <tr>
71
+ <td colspan="5" style="text-align: center; color: #94a3b8; padding: 24px;">No media files available</td>
72
+ </tr>
73
+ {/if}
74
+ </tbody>
75
+ </table>
76
+
77
+ <div class="lite-media-footer">
78
+ <button type="submit" name="_media_action" value="select" class="lite-btn lite-btn-primary lite-btn-sm">
79
+ Confirm Selection
80
+ </button>
81
+ </div>
82
+ </form>
83
+ </div>
84
+
85
+ <style>
86
+ .lite-media-library-card {
87
+ background: #ffffff;
88
+ border: 1px solid #cbd5e1;
89
+ border-radius: 6px;
90
+ padding: 16px;
91
+ margin-bottom: 16px;
92
+ }
93
+ .lite-media-header {
94
+ padding-bottom: 10px;
95
+ border-bottom: 1px solid #e2e8f0;
96
+ margin-bottom: 12px;
97
+ font-size: 14px;
98
+ }
99
+ .lite-media-upload-row {
100
+ margin-bottom: 12px;
101
+ padding: 8px;
102
+ background: #f8fafc;
103
+ border-radius: 4px;
104
+ }
105
+ .lite-media-footer {
106
+ margin-top: 12px;
107
+ display: flex;
108
+ justify-content: flex-end;
109
+ }
110
+ </style>
@@ -0,0 +1,17 @@
1
+ interface LiteMediaItem {
2
+ id: string;
3
+ name: string;
4
+ url: string;
5
+ size?: string;
6
+ category?: string;
7
+ }
8
+ interface Props {
9
+ title?: string;
10
+ multiple?: boolean;
11
+ mediaItems?: LiteMediaItem[];
12
+ action?: string;
13
+ method?: 'get' | 'post' | 'dialog' | 'GET' | 'POST' | 'DIALOG' | null;
14
+ }
15
+ declare const LiteMediaLibraryModal: import("svelte").Component<Props, {}, "">;
16
+ type LiteMediaLibraryModal = ReturnType<typeof LiteMediaLibraryModal>;
17
+ export default LiteMediaLibraryModal;
@@ -0,0 +1,98 @@
1
+ <script lang="ts">
2
+ export interface MentionOption {
3
+ id: string;
4
+ label: string;
5
+ type?: 'user' | 'tag' | 'entity';
6
+ subtitle?: string;
7
+ }
8
+
9
+ interface Props {
10
+ name?: string;
11
+ value?: string;
12
+ placeholder?: string;
13
+ users?: MentionOption[];
14
+ tags?: MentionOption[];
15
+ rows?: number;
16
+ disabled?: boolean;
17
+ class?: string;
18
+ }
19
+
20
+ let {
21
+ name = 'content',
22
+ value = '',
23
+ placeholder = 'Type @ or # to mention...',
24
+ users = [],
25
+ tags = [],
26
+ rows = 3,
27
+ disabled = false,
28
+ class: className = '',
29
+ }: Props = $props();
30
+ </script>
31
+
32
+ <div class="sv-lite-mentions {className}">
33
+ <textarea
34
+ {name}
35
+ {value}
36
+ {placeholder}
37
+ {rows}
38
+ {disabled}
39
+ class="sv-lite-textarea"
40
+ ></textarea>
41
+
42
+ {#if users.length > 0 || tags.length > 0}
43
+ <div class="sv-lite-mentions-hints">
44
+ <span class="sv-lite-hints-title">Quick Mentions:</span>
45
+ {#each users as u (u.id)}
46
+ <span class="sv-lite-mention-badge">@{u.label}</span>
47
+ {/each}
48
+ {#each tags as t (t.id)}
49
+ <span class="sv-lite-mention-badge sv-lite-tag">#{t.label}</span>
50
+ {/each}
51
+ </div>
52
+ {/if}
53
+ </div>
54
+
55
+ <style>
56
+ .sv-lite-mentions {
57
+ display: block;
58
+ width: 100%;
59
+ font-size: 12px;
60
+ }
61
+ .sv-lite-textarea {
62
+ width: 100%;
63
+ padding: 8px;
64
+ border: 1px solid #cbd5e1;
65
+ border-radius: 4px;
66
+ font-size: 12px;
67
+ font-family: inherit;
68
+ box-sizing: border-box;
69
+ background-color: #ffffff;
70
+ color: #0f172a;
71
+ }
72
+ .sv-lite-mentions-hints {
73
+ margin-top: 6px;
74
+ padding: 4px 6px;
75
+ background-color: #f8fafc;
76
+ border: 1px solid #e2e8f0;
77
+ border-radius: 4px;
78
+ }
79
+ .sv-lite-hints-title {
80
+ font-weight: 600;
81
+ color: #64748b;
82
+ margin-right: 6px;
83
+ }
84
+ .sv-lite-mention-badge {
85
+ display: inline-block;
86
+ padding: 2px 6px;
87
+ margin-right: 4px;
88
+ margin-bottom: 2px;
89
+ background-color: #e0e7ff;
90
+ color: #4338ca;
91
+ border-radius: 3px;
92
+ font-size: 11px;
93
+ }
94
+ .sv-lite-tag {
95
+ background-color: #f1f5f9;
96
+ color: #475569;
97
+ }
98
+ </style>
@@ -0,0 +1,19 @@
1
+ export interface MentionOption {
2
+ id: string;
3
+ label: string;
4
+ type?: 'user' | 'tag' | 'entity';
5
+ subtitle?: string;
6
+ }
7
+ interface Props {
8
+ name?: string;
9
+ value?: string;
10
+ placeholder?: string;
11
+ users?: MentionOption[];
12
+ tags?: MentionOption[];
13
+ rows?: number;
14
+ disabled?: boolean;
15
+ class?: string;
16
+ }
17
+ declare const LiteMentionsInput: import("svelte").Component<Props, {}, "">;
18
+ type LiteMentionsInput = ReturnType<typeof LiteMentionsInput>;
19
+ export default LiteMentionsInput;