@svadmin/lite 0.16.11 → 0.22.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/README.md +71 -2
- package/dist/components/LiteActivityFeed.svelte +31 -9
- package/dist/components/LiteActivityFeed.svelte.d.ts +6 -0
- package/dist/components/LiteAffix.svelte +29 -0
- package/dist/components/LiteAffix.svelte.d.ts +13 -0
- package/dist/components/LiteAnchor.svelte +38 -0
- package/dist/components/LiteAnchor.svelte.d.ts +14 -0
- package/dist/components/LiteApprovalActionCard.svelte +8 -5
- package/dist/components/LiteApprovalActionCard.svelte.d.ts +2 -0
- package/dist/components/LiteAuditLog.svelte +9 -9
- package/dist/components/LiteAutoComplete.svelte +41 -0
- package/dist/components/LiteAutoComplete.svelte.d.ts +13 -0
- package/dist/components/LiteBackTop.svelte +16 -0
- package/dist/components/LiteBackTop.svelte.d.ts +8 -0
- package/dist/components/LiteBreadcrumbs.svelte +4 -1
- package/dist/components/LiteBreadcrumbs.svelte.d.ts +2 -0
- package/dist/components/LiteCalendar.svelte +124 -0
- package/dist/components/LiteCalendar.svelte.d.ts +20 -0
- package/dist/components/LiteCanvasAnnotation.svelte +13 -13
- package/dist/components/LiteCarousel.svelte +72 -0
- package/dist/components/LiteCarousel.svelte.d.ts +14 -0
- package/dist/components/LiteChatDialog.svelte +8 -8
- package/dist/components/LiteCollapse.svelte +49 -0
- package/dist/components/LiteCollapse.svelte.d.ts +15 -0
- package/dist/components/LiteColumnHeaderFilter.svelte +4 -1
- package/dist/components/LiteColumnHeaderFilter.svelte.d.ts +2 -0
- package/dist/components/LiteColumnSettings.svelte +7 -4
- package/dist/components/LiteColumnSettings.svelte.d.ts +2 -0
- package/dist/components/LiteCommentThread.svelte +113 -0
- package/dist/components/LiteCommentThread.svelte.d.ts +26 -0
- package/dist/components/LiteConfirmDialog.svelte +2 -2
- package/dist/components/LiteCountdown.svelte +49 -0
- package/dist/components/LiteCountdown.svelte.d.ts +10 -0
- package/dist/components/LiteDecisionTable.svelte +14 -14
- package/dist/components/LiteDetailDrawer.svelte +45 -0
- package/dist/components/LiteDetailDrawer.svelte.d.ts +14 -0
- package/dist/components/LiteDraggableRowTable.svelte +5 -2
- package/dist/components/LiteDraggableRowTable.svelte.d.ts +2 -0
- package/dist/components/LiteDrawerForm.svelte +11 -8
- package/dist/components/LiteDrawerForm.svelte.d.ts +2 -0
- package/dist/components/LiteDynamicFormList.svelte +5 -5
- package/dist/components/LiteEditableTable.svelte +5 -2
- package/dist/components/LiteEditableTable.svelte.d.ts +2 -0
- package/dist/components/LiteEmptyState.svelte +11 -4
- package/dist/components/LiteEmptyState.svelte.d.ts +3 -0
- package/dist/components/LiteFilterBuilder.svelte +8 -5
- package/dist/components/LiteFilterBuilder.svelte.d.ts +2 -0
- package/dist/components/LiteFloatButton.svelte +54 -0
- package/dist/components/LiteFloatButton.svelte.d.ts +15 -0
- package/dist/components/LiteGanttChart.svelte +20 -20
- package/dist/components/LiteGrid.svelte +34 -0
- package/dist/components/LiteGrid.svelte.d.ts +11 -0
- package/dist/components/LiteImage.svelte +54 -0
- package/dist/components/LiteImage.svelte.d.ts +14 -0
- package/dist/components/LiteImageCropper.svelte +7 -4
- package/dist/components/LiteImageCropper.svelte.d.ts +2 -0
- package/dist/components/LiteImagePreview.svelte +36 -0
- package/dist/components/LiteImagePreview.svelte.d.ts +13 -0
- package/dist/components/LiteImportWizard.svelte +7 -7
- package/dist/components/LiteItemList.svelte +50 -0
- package/dist/components/LiteItemList.svelte.d.ts +15 -0
- package/dist/components/LiteJsonSchemaForm.svelte +10 -7
- package/dist/components/LiteJsonSchemaForm.svelte.d.ts +2 -0
- package/dist/components/LiteKanbanBoard.svelte +19 -19
- package/dist/components/LiteLayout.svelte +18 -6
- package/dist/components/LiteLayout.svelte.d.ts +8 -0
- package/dist/components/LiteLink.svelte +32 -0
- package/dist/components/LiteLink.svelte.d.ts +11 -0
- package/dist/components/LiteLogin.svelte +9 -2
- package/dist/components/LiteLogin.svelte.d.ts +2 -0
- package/dist/components/LiteMasterDetailView.svelte +13 -10
- package/dist/components/LiteMasterDetailView.svelte.d.ts +2 -0
- package/dist/components/LiteMediaLibraryModal.svelte +8 -5
- package/dist/components/LiteMediaLibraryModal.svelte.d.ts +2 -0
- package/dist/components/LiteMediaThumbnail.svelte +3 -3
- package/dist/components/LiteMentionsInput.svelte +9 -9
- package/dist/components/LiteMenu.svelte +22 -0
- package/dist/components/LiteMenu.svelte.d.ts +12 -0
- package/dist/components/LiteMenuList.svelte +55 -0
- package/dist/components/LiteMenuList.svelte.d.ts +17 -0
- package/dist/components/LiteModalForm.svelte +9 -6
- package/dist/components/LiteModalForm.svelte.d.ts +2 -0
- package/dist/components/LiteMultiTabKeepAlive.svelte +6 -6
- package/dist/components/LiteNotificationCenter.svelte +85 -0
- package/dist/components/LiteNotificationCenter.svelte.d.ts +22 -0
- package/dist/components/LiteOfflineSyncBanner.svelte +6 -6
- package/dist/components/LiteOtpInput.svelte +50 -0
- package/dist/components/LiteOtpInput.svelte.d.ts +15 -0
- package/dist/components/LitePageHeader.svelte +34 -0
- package/dist/components/LitePageHeader.svelte.d.ts +13 -0
- package/dist/components/LitePagination.svelte +10 -2
- package/dist/components/LitePagination.svelte.d.ts +2 -0
- package/dist/components/LitePdfDocumentViewer.svelte +14 -14
- package/dist/components/LitePermissionMatrix.svelte +8 -8
- package/dist/components/LitePivotTable.svelte +11 -11
- package/dist/components/LitePopconfirm.svelte +49 -0
- package/dist/components/LitePopconfirm.svelte.d.ts +14 -0
- package/dist/components/LitePresenceAvatarGroup.svelte +8 -5
- package/dist/components/LitePresenceAvatarGroup.svelte.d.ts +2 -0
- package/dist/components/LitePrintableBill.svelte +12 -9
- package/dist/components/LitePrintableBill.svelte.d.ts +2 -0
- package/dist/components/LiteProgress.svelte +46 -0
- package/dist/components/LiteProgress.svelte.d.ts +12 -0
- package/dist/components/LiteQRCode.svelte +62 -0
- package/dist/components/LiteQRCode.svelte.d.ts +14 -0
- package/dist/components/LiteResizeBox.svelte +34 -0
- package/dist/components/LiteResizeBox.svelte.d.ts +12 -0
- package/dist/components/LiteResult.svelte +52 -0
- package/dist/components/LiteResult.svelte.d.ts +14 -0
- package/dist/components/LiteRowActions.svelte +36 -0
- package/dist/components/LiteRowActions.svelte.d.ts +17 -0
- package/dist/components/LiteSensitiveDataMask.svelte +4 -1
- package/dist/components/LiteSensitiveDataMask.svelte.d.ts +2 -0
- package/dist/components/LiteShow.svelte +1 -1
- package/dist/components/LiteShowField.svelte +2 -2
- package/dist/components/LiteSignaturePad.svelte +9 -9
- package/dist/components/LiteSkeleton.svelte +100 -0
- package/dist/components/LiteSkeleton.svelte.d.ts +19 -0
- package/dist/components/LiteSpace.svelte +31 -0
- package/dist/components/LiteSpace.svelte.d.ts +12 -0
- package/dist/components/LiteSpin.svelte +27 -0
- package/dist/components/LiteSpin.svelte.d.ts +10 -0
- package/dist/components/LiteSplitPaneLayout.svelte +18 -6
- package/dist/components/LiteSplitPaneLayout.svelte.d.ts +8 -0
- package/dist/components/LiteSpreadsheetView.svelte +8 -8
- package/dist/components/LiteStatistic.svelte +63 -0
- package/dist/components/LiteStatistic.svelte.d.ts +15 -0
- package/dist/components/LiteStatsCard.svelte +5 -2
- package/dist/components/LiteStatsCard.svelte.d.ts +2 -0
- package/dist/components/LiteStatusBadge.svelte +33 -0
- package/dist/components/LiteStatusBadge.svelte.d.ts +12 -0
- package/dist/components/LiteStatusTabs.svelte +35 -0
- package/dist/components/LiteStatusTabs.svelte.d.ts +14 -0
- package/dist/components/LiteStepForm.svelte +14 -11
- package/dist/components/LiteStepForm.svelte.d.ts +2 -0
- package/dist/components/LiteSteps.svelte +64 -0
- package/dist/components/LiteSteps.svelte.d.ts +18 -0
- package/dist/components/LiteTable.svelte +5 -2
- package/dist/components/LiteTable.svelte.d.ts +2 -0
- package/dist/components/LiteTableSummary.svelte +8 -5
- package/dist/components/LiteTableSummary.svelte.d.ts +2 -0
- package/dist/components/LiteTabs.svelte +30 -20
- package/dist/components/LiteTabs.svelte.d.ts +11 -2
- package/dist/components/LiteTag.svelte +31 -0
- package/dist/components/LiteTag.svelte.d.ts +13 -0
- package/dist/components/LiteTimeline.svelte +48 -0
- package/dist/components/LiteTimeline.svelte.d.ts +17 -0
- package/dist/components/LiteTour.svelte +54 -0
- package/dist/components/LiteTour.svelte.d.ts +15 -0
- package/dist/components/LiteTransfer.svelte +9 -6
- package/dist/components/LiteTransfer.svelte.d.ts +2 -0
- package/dist/components/LiteTree.svelte +48 -0
- package/dist/components/LiteTree.svelte.d.ts +17 -0
- package/dist/components/LiteTreeTable.svelte +1 -1
- package/dist/components/LiteTwoFactorStepper.svelte +53 -0
- package/dist/components/LiteTwoFactorStepper.svelte.d.ts +16 -0
- package/dist/components/LiteVersionDiffViewer.svelte +16 -13
- package/dist/components/LiteVersionDiffViewer.svelte.d.ts +2 -0
- package/dist/components/LiteVideoPlayer.svelte +67 -0
- package/dist/components/LiteVideoPlayer.svelte.d.ts +22 -0
- package/dist/components/LiteVirtualTable.svelte +1 -1
- package/dist/components/advanced/LiteAutoSaveIndicator.svelte +42 -13
- package/dist/components/advanced/LiteAutoSaveIndicator.svelte.d.ts +10 -4
- package/dist/components/advanced/LiteDraggableHeader.svelte +2 -2
- package/dist/components/advanced/LiteDrawerForm.svelte +4 -1
- package/dist/components/advanced/LiteDrawerForm.svelte.d.ts +2 -0
- package/dist/components/advanced/LiteInlineEdit.svelte +1 -1
- package/dist/components/advanced/LiteModalForm.svelte +4 -1
- package/dist/components/advanced/LiteModalForm.svelte.d.ts +2 -0
- package/dist/components/advanced/LiteToast.svelte +3 -3
- package/dist/components/advanced/LiteUndoableNotification.svelte +1 -1
- package/dist/components/compatibility/LiteRealtimeStatus.svelte +41 -2
- package/dist/components/compatibility/LiteRealtimeStatus.svelte.d.ts +15 -0
- package/dist/components/fields/LiteBooleanField.svelte +4 -2
- package/dist/components/fields/LiteBooleanField.svelte.d.ts +2 -0
- package/dist/components/fields/LiteCascader.svelte +5 -2
- package/dist/components/fields/LiteCascader.svelte.d.ts +2 -0
- package/dist/components/fields/LiteDateField.svelte +39 -9
- package/dist/components/fields/LiteDateField.svelte.d.ts +2 -0
- package/dist/components/fields/LiteDateRangeField.svelte +1 -1
- package/dist/components/fields/LiteImageField.svelte +6 -2
- package/dist/components/fields/LiteImageField.svelte.d.ts +2 -0
- package/dist/components/fields/LiteJsonField.svelte +1 -1
- package/dist/components/fields/LiteMarkdownField.svelte +49 -3
- package/dist/components/fields/LiteMarkdownField.svelte.d.ts +5 -0
- package/dist/components/fields/LiteNumberField.svelte +5 -3
- package/dist/components/fields/LiteNumberField.svelte.d.ts +2 -0
- package/dist/components/fields/LiteRichTextField.svelte +49 -12
- package/dist/components/fields/LiteRichTextField.svelte.d.ts +3 -0
- package/dist/components/fields/LiteSelectField.svelte +5 -3
- package/dist/components/fields/LiteSelectField.svelte.d.ts +2 -0
- package/dist/components/fields/LiteTagField.svelte +38 -15
- package/dist/components/fields/LiteTagField.svelte.d.ts +2 -0
- package/dist/components/fields/LiteTextField.svelte +26 -5
- package/dist/components/fields/LiteTextField.svelte.d.ts +2 -0
- package/dist/components/fields/LiteTreeSelect.svelte +5 -2
- package/dist/components/fields/LiteTreeSelect.svelte.d.ts +2 -0
- package/dist/components/fields/LiteUrlField.svelte +5 -3
- package/dist/components/fields/LiteUrlField.svelte.d.ts +2 -0
- package/dist/components/layout/LiteAuthenticated.svelte +2 -2
- package/dist/components/layout/LiteCanAccess.svelte +1 -1
- package/dist/components/layout/LiteErrorComponent.svelte +4 -4
- package/dist/components/layout/LiteHeader.svelte +2 -2
- package/dist/components/layout/LiteSidebar.svelte +6 -3
- package/dist/components/layout/LiteSidebar.svelte.d.ts +2 -0
- package/dist/components/pages/LiteCreatePage.svelte +4 -1
- package/dist/components/pages/LiteCreatePage.svelte.d.ts +2 -0
- package/dist/components/pages/LiteEditPage.svelte +4 -1
- package/dist/components/pages/LiteEditPage.svelte.d.ts +2 -0
- package/dist/components/pages/LiteForgotPasswordPage.svelte +7 -7
- package/dist/components/pages/LiteListPage.svelte +6 -3
- package/dist/components/pages/LiteListPage.svelte.d.ts +2 -0
- package/dist/components/pages/LiteProfilePage.svelte +2 -2
- package/dist/components/pages/LiteRegisterPage.svelte +6 -6
- package/dist/components/pages/LiteShowPage.svelte +6 -3
- package/dist/components/pages/LiteShowPage.svelte.d.ts +2 -0
- package/dist/components/pages/LiteUpdatePasswordPage.svelte +4 -4
- package/dist/components/widgets/LiteAnomalyBadge.svelte +6 -3
- package/dist/components/widgets/LiteAnomalyBadge.svelte.d.ts +2 -0
- package/dist/components/widgets/LiteAreaChart.svelte +20 -0
- package/dist/components/widgets/LiteAreaChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteBarChart.svelte +6 -6
- package/dist/components/widgets/LiteChartSvg.svelte +102 -0
- package/dist/components/widgets/LiteChartSvg.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteChartTable.svelte +44 -0
- package/dist/components/widgets/LiteChartTable.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteDonutChart.svelte +20 -0
- package/dist/components/widgets/LiteDonutChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteFunnelChart.svelte +20 -0
- package/dist/components/widgets/LiteFunnelChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteGaugeChart.svelte +20 -0
- package/dist/components/widgets/LiteGaugeChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteHeatmapChart.svelte +20 -0
- package/dist/components/widgets/LiteHeatmapChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteInsightCard.svelte +35 -13
- package/dist/components/widgets/LiteInsightCard.svelte.d.ts +7 -4
- package/dist/components/widgets/LiteLineChart.svelte +13 -10
- package/dist/components/widgets/LiteLineChart.svelte.d.ts +0 -5
- package/dist/components/widgets/LitePieChart.svelte +11 -9
- package/dist/components/widgets/LitePieChart.svelte.d.ts +0 -5
- package/dist/components/widgets/LiteRadarChart.svelte +20 -0
- package/dist/components/widgets/LiteRadarChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteRoseChart.svelte +20 -0
- package/dist/components/widgets/LiteRoseChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteScatterChart.svelte +20 -0
- package/dist/components/widgets/LiteScatterChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteWaterfallChart.svelte +20 -0
- package/dist/components/widgets/LiteWaterfallChart.svelte.d.ts +10 -0
- package/dist/components/widgets/chart-geometry.d.ts +65 -0
- package/dist/components/widgets/chart-geometry.js +229 -0
- package/dist/components/widgets/index.d.ts +10 -0
- package/dist/components/widgets/index.js +10 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.js +47 -0
- package/dist/lite-code-theme.css +139 -0
- package/dist/lite.css +234 -127
- package/dist/rich-content.d.ts +47 -0
- package/dist/rich-content.js +498 -0
- package/dist/schema-generator.js +3 -1
- package/dist/server-adapter.js +6 -11
- package/dist/value-normalization.d.ts +4 -0
- package/dist/value-normalization.js +13 -0
- package/package.json +18 -4
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
icon?: string;
|
|
21
21
|
/** Link to detail page */
|
|
22
22
|
href?: string;
|
|
23
|
+
/** Caller class merged with the built-in class list. */
|
|
24
|
+
class?: string;
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
let {
|
|
@@ -30,11 +32,12 @@
|
|
|
30
32
|
trendValue,
|
|
31
33
|
icon,
|
|
32
34
|
href,
|
|
35
|
+
class: className = '',
|
|
33
36
|
}: Props = $props();
|
|
34
37
|
</script>
|
|
35
38
|
|
|
36
39
|
{#if href}
|
|
37
|
-
<a href={href} class="lite-stats-card lite-card" style="text-decoration:none;display:block;">
|
|
40
|
+
<a href={href} class="lite-stats-card lite-card {className}" style="text-decoration:none;display:block;">
|
|
38
41
|
{#if icon}
|
|
39
42
|
<div class="lite-stats-icon">{icon}</div>
|
|
40
43
|
{/if}
|
|
@@ -51,7 +54,7 @@
|
|
|
51
54
|
{/if}
|
|
52
55
|
</a>
|
|
53
56
|
{:else}
|
|
54
|
-
<div class="lite-stats-card lite-card">
|
|
57
|
+
<div class="lite-stats-card lite-card {className}">
|
|
55
58
|
{#if icon}
|
|
56
59
|
<div class="lite-stats-icon">{icon}</div>
|
|
57
60
|
{/if}
|
|
@@ -18,6 +18,8 @@ interface Props {
|
|
|
18
18
|
icon?: string;
|
|
19
19
|
/** Link to detail page */
|
|
20
20
|
href?: string;
|
|
21
|
+
/** Caller class merged with the built-in class list. */
|
|
22
|
+
class?: string;
|
|
21
23
|
}
|
|
22
24
|
declare const LiteStatsCard: import("svelte").Component<Props, {}, "">;
|
|
23
25
|
type LiteStatsCard = ReturnType<typeof LiteStatsCard>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import LiteBadge, { type LiteBadgeVariant } from './LiteBadge.svelte';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
status: string;
|
|
6
|
+
tone?: LiteBadgeVariant;
|
|
7
|
+
label?: string;
|
|
8
|
+
href?: string;
|
|
9
|
+
/** Caller class merged with the built-in class list. */
|
|
10
|
+
class?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let { status, tone, label, href, class: className = '' }: Props = $props();
|
|
14
|
+
|
|
15
|
+
const normalized = $derived(status.toLowerCase().replace(/[\s_]+/g, '-'));
|
|
16
|
+
const resolvedTone = $derived(tone ?? (
|
|
17
|
+
['active', 'success', 'completed', 'approved', 'online', 'enabled'].includes(normalized) ? 'success'
|
|
18
|
+
: ['error', 'failed', 'rejected', 'danger', 'offline', 'disabled'].includes(normalized) ? 'destructive'
|
|
19
|
+
: ['warning', 'pending', 'review', 'processing'].includes(normalized) ? 'warning'
|
|
20
|
+
: ['info', 'new', 'draft'].includes(normalized) ? 'info'
|
|
21
|
+
: 'secondary'
|
|
22
|
+
));
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
{#if href}
|
|
26
|
+
<a href={href} class="lite-status-badge {className}"><LiteBadge variant={resolvedTone}>{label ?? status}</LiteBadge></a>
|
|
27
|
+
{:else}
|
|
28
|
+
<span class="lite-status-badge {className}"><LiteBadge variant={resolvedTone}>{label ?? status}</LiteBadge></span>
|
|
29
|
+
{/if}
|
|
30
|
+
|
|
31
|
+
<style>
|
|
32
|
+
.lite-status-badge { display: inline-flex; text-decoration: none; }
|
|
33
|
+
</style>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type LiteBadgeVariant } from './LiteBadge.svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
status: string;
|
|
4
|
+
tone?: LiteBadgeVariant;
|
|
5
|
+
label?: string;
|
|
6
|
+
href?: string;
|
|
7
|
+
/** Caller class merged with the built-in class list. */
|
|
8
|
+
class?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const LiteStatusBadge: import("svelte").Component<Props, {}, "">;
|
|
11
|
+
type LiteStatusBadge = ReturnType<typeof LiteStatusBadge>;
|
|
12
|
+
export default LiteStatusBadge;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
interface StatusTab {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
count?: number;
|
|
6
|
+
href: string;
|
|
7
|
+
active?: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface Props {
|
|
11
|
+
tabs: StatusTab[];
|
|
12
|
+
label?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
let { tabs, label = 'Status tabs' }: Props = $props();
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<nav class="lite-status-tabs" aria-label={label}>
|
|
19
|
+
{#each tabs as tab (tab.id)}
|
|
20
|
+
<a href={tab.href} class:active={tab.active} aria-current={tab.active ? 'page' : undefined}>
|
|
21
|
+
{tab.label}
|
|
22
|
+
{#if tab.count !== undefined}<span class="lite-badge lite-badge-secondary">{tab.count}</span>{/if}
|
|
23
|
+
</a>
|
|
24
|
+
{/each}
|
|
25
|
+
</nav>
|
|
26
|
+
|
|
27
|
+
<style>
|
|
28
|
+
.lite-status-tabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid #E5E6EB; }
|
|
29
|
+
.lite-status-tabs a { display: inline-flex; align-items: center; padding: 8px 12px; border-bottom: 2px solid transparent; color: #4E5969; font-size: 13px; text-decoration: none; }
|
|
30
|
+
.lite-status-tabs a:hover { color: #165DFF; text-decoration: none; }
|
|
31
|
+
.lite-status-tabs a.active { border-bottom-color: #165DFF; color: #165DFF; font-weight: 600; }
|
|
32
|
+
|
|
33
|
+
.lite-status-tabs a + a { margin-left: 4px; }
|
|
34
|
+
.lite-status-tabs a > * + * { margin-left: 6px; }
|
|
35
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface StatusTab {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
count?: number;
|
|
5
|
+
href: string;
|
|
6
|
+
active?: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface Props {
|
|
9
|
+
tabs: StatusTab[];
|
|
10
|
+
label?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const LiteStatusTabs: import("svelte").Component<Props, {}, "">;
|
|
13
|
+
type LiteStatusTabs = ReturnType<typeof LiteStatusTabs>;
|
|
14
|
+
export default LiteStatusTabs;
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
nextText?: string;
|
|
16
16
|
prevText?: string;
|
|
17
17
|
children?: Snippet;
|
|
18
|
+
/** Caller class merged with the built-in class list. */
|
|
19
|
+
class?: string;
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
let {
|
|
@@ -26,10 +28,11 @@
|
|
|
26
28
|
nextText = 'Next Step',
|
|
27
29
|
prevText = 'Previous Step',
|
|
28
30
|
children,
|
|
31
|
+
class: className = '',
|
|
29
32
|
}: Props = $props();
|
|
30
33
|
</script>
|
|
31
34
|
|
|
32
|
-
<div class="lite-step-form-card">
|
|
35
|
+
<div class="lite-step-form-card {className}">
|
|
33
36
|
<!-- Step Indicators -->
|
|
34
37
|
<div class="lite-step-header">
|
|
35
38
|
{#each steps as step, index (index)}
|
|
@@ -83,7 +86,7 @@
|
|
|
83
86
|
.lite-step-form-card {
|
|
84
87
|
padding: 16px;
|
|
85
88
|
background: #ffffff;
|
|
86
|
-
border: 1px solid #
|
|
89
|
+
border: 1px solid #E5E6EB;
|
|
87
90
|
border-radius: 6px;
|
|
88
91
|
margin-bottom: 16px;
|
|
89
92
|
}
|
|
@@ -91,7 +94,7 @@
|
|
|
91
94
|
display: flex;
|
|
92
95
|
align-items: center;
|
|
93
96
|
padding-bottom: 12px;
|
|
94
|
-
border-bottom: 1px solid #
|
|
97
|
+
border-bottom: 1px solid #E5E6EB;
|
|
95
98
|
margin-bottom: 16px;
|
|
96
99
|
overflow-x: auto;
|
|
97
100
|
}
|
|
@@ -99,14 +102,14 @@
|
|
|
99
102
|
display: flex;
|
|
100
103
|
align-items: center;
|
|
101
104
|
font-size: 12px;
|
|
102
|
-
color: #
|
|
105
|
+
color: #4E5969;
|
|
103
106
|
}
|
|
104
107
|
.lite-step-item.lite-step-current {
|
|
105
|
-
color: #
|
|
108
|
+
color: #165DFF;
|
|
106
109
|
font-weight: bold;
|
|
107
110
|
}
|
|
108
111
|
.lite-step-item.lite-step-completed {
|
|
109
|
-
color: #
|
|
112
|
+
color: #00B42A;
|
|
110
113
|
}
|
|
111
114
|
.lite-step-circle {
|
|
112
115
|
display: inline-block;
|
|
@@ -115,21 +118,21 @@
|
|
|
115
118
|
line-height: 20px;
|
|
116
119
|
text-align: center;
|
|
117
120
|
border-radius: 50%;
|
|
118
|
-
background: #
|
|
121
|
+
background: #F2F3F5;
|
|
119
122
|
margin-right: 6px;
|
|
120
123
|
font-size: 11px;
|
|
121
124
|
}
|
|
122
125
|
.lite-step-current .lite-step-circle {
|
|
123
|
-
background: #
|
|
126
|
+
background: #165DFF;
|
|
124
127
|
color: #ffffff;
|
|
125
128
|
}
|
|
126
129
|
.lite-step-completed .lite-step-circle {
|
|
127
|
-
background: #
|
|
130
|
+
background: #00B42A;
|
|
128
131
|
color: #ffffff;
|
|
129
132
|
}
|
|
130
133
|
.lite-step-arrow {
|
|
131
134
|
margin: 0 10px;
|
|
132
|
-
color: #
|
|
135
|
+
color: #E5E6EB;
|
|
133
136
|
}
|
|
134
137
|
.lite-step-content {
|
|
135
138
|
min-height: 100px;
|
|
@@ -139,6 +142,6 @@
|
|
|
139
142
|
display: flex;
|
|
140
143
|
align-items: center;
|
|
141
144
|
padding-top: 12px;
|
|
142
|
-
border-top: 1px solid #
|
|
145
|
+
border-top: 1px solid #E5E6EB;
|
|
143
146
|
}
|
|
144
147
|
</style>
|
|
@@ -12,6 +12,8 @@ interface Props {
|
|
|
12
12
|
nextText?: string;
|
|
13
13
|
prevText?: string;
|
|
14
14
|
children?: Snippet;
|
|
15
|
+
/** Caller class merged with the built-in class list. */
|
|
16
|
+
class?: string;
|
|
15
17
|
}
|
|
16
18
|
declare const LiteStepForm: import("svelte").Component<Props, {}, "">;
|
|
17
19
|
type LiteStepForm = ReturnType<typeof LiteStepForm>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
interface StepItem {
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
href?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
items: StepItem[];
|
|
11
|
+
current?: number;
|
|
12
|
+
status?: 'wait' | 'process' | 'finish' | 'error';
|
|
13
|
+
direction?: 'horizontal' | 'vertical';
|
|
14
|
+
label?: string;
|
|
15
|
+
/** Caller class merged with the built-in class list. */
|
|
16
|
+
class?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let {
|
|
20
|
+
items,
|
|
21
|
+
current = 0,
|
|
22
|
+
status = 'process',
|
|
23
|
+
direction = 'horizontal',
|
|
24
|
+
label = 'Steps',
|
|
25
|
+
class: className = '',
|
|
26
|
+
}: Props = $props();
|
|
27
|
+
|
|
28
|
+
function state(index: number): string {
|
|
29
|
+
if (index < current) return 'finish';
|
|
30
|
+
if (index === current) return status === 'error' ? 'error' : status === 'finish' ? 'finish' : 'process';
|
|
31
|
+
return 'wait';
|
|
32
|
+
}
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<ol class="lite-steps {className}" data-direction={direction} aria-label={label}>
|
|
36
|
+
{#each items as item, index (item.title)}
|
|
37
|
+
{@const stateValue = state(index)}
|
|
38
|
+
<li class="lite-steps__item" data-status={stateValue} data-disabled={item.disabled || undefined}>
|
|
39
|
+
<span class="lite-steps__indicator" aria-hidden="true">{stateValue === 'finish' ? '✓' : stateValue === 'error' ? '!' : index + 1}</span>
|
|
40
|
+
<span class="lite-steps__text">
|
|
41
|
+
{#if item.href && !item.disabled}<a href={item.href}>{item.title}</a>{:else}<strong>{item.title}</strong>{/if}
|
|
42
|
+
{#if item.description}<small>{item.description}</small>{/if}
|
|
43
|
+
</span>
|
|
44
|
+
</li>
|
|
45
|
+
{/each}
|
|
46
|
+
</ol>
|
|
47
|
+
|
|
48
|
+
<style>
|
|
49
|
+
.lite-steps { display: flex; margin: 0; padding: 0; list-style: none; }
|
|
50
|
+
.lite-steps[data-direction='vertical'] { flex-direction: column; }
|
|
51
|
+
.lite-steps__item { display: flex; flex: 1; align-items: flex-start; min-width: 0; }
|
|
52
|
+
.lite-steps__indicator { display: inline-grid; flex: 0 0 26px; place-items: center; width: 26px; height: 26px; border: 1px solid #C9CDD4; border-radius: 999px; background: #fff; color: #86909C; font-size: 12px; font-weight: 600; }
|
|
53
|
+
.lite-steps__item[data-status='finish'] .lite-steps__indicator { border-color: #00B42A; background: #E8FFEA; color: #009A29; }
|
|
54
|
+
.lite-steps__item[data-status='process'] .lite-steps__indicator { border-color: #165DFF; background: #E8F3FF; color: #165DFF; }
|
|
55
|
+
.lite-steps__item[data-status='error'] .lite-steps__indicator { border-color: #F53F3F; background: #FFECE8; color: #F53F3F; }
|
|
56
|
+
.lite-steps__item[data-disabled] { opacity: 0.55; }
|
|
57
|
+
.lite-steps__text { display: block; min-width: 0; color: #1D2129; font-size: 13px; }
|
|
58
|
+
.lite-steps__text a { color: #165DFF; }
|
|
59
|
+
.lite-steps__text small { color: #86909C; font-size: 12px; }
|
|
60
|
+
|
|
61
|
+
.lite-steps > .lite-steps__item + .lite-steps__item { margin-left: 12px; }
|
|
62
|
+
.lite-steps__indicator { margin-right: 8px; }
|
|
63
|
+
.lite-steps__text > * + * { margin-top: 2px; }
|
|
64
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface StepItem {
|
|
2
|
+
title: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
href?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
interface Props {
|
|
8
|
+
items: StepItem[];
|
|
9
|
+
current?: number;
|
|
10
|
+
status?: 'wait' | 'process' | 'finish' | 'error';
|
|
11
|
+
direction?: 'horizontal' | 'vertical';
|
|
12
|
+
label?: string;
|
|
13
|
+
/** Caller class merged with the built-in class list. */
|
|
14
|
+
class?: string;
|
|
15
|
+
}
|
|
16
|
+
declare const LiteSteps: import("svelte").Component<Props, {}, "">;
|
|
17
|
+
type LiteSteps = ReturnType<typeof LiteSteps>;
|
|
18
|
+
export default LiteSteps;
|
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
stickyColumns?: { left?: string; right?: string };
|
|
25
25
|
/** Pin actions on the right; this takes precedence over stickyColumns.right. */
|
|
26
26
|
stickyActions?: boolean;
|
|
27
|
+
/** Caller class merged with the built-in class list. */
|
|
28
|
+
class?: string;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
let {
|
|
@@ -39,6 +41,7 @@
|
|
|
39
41
|
enableBatch = false,
|
|
40
42
|
stickyColumns = {},
|
|
41
43
|
stickyActions = false,
|
|
44
|
+
class: className = ''
|
|
42
45
|
}: Props = $props();
|
|
43
46
|
|
|
44
47
|
const tableId = $props.id();
|
|
@@ -98,7 +101,7 @@
|
|
|
98
101
|
<form id={"batch-delete-" + tableId} method="POST" action="?/batchDelete" style="display:none;"></form>
|
|
99
102
|
{/if}
|
|
100
103
|
|
|
101
|
-
<table class="lite-table">
|
|
104
|
+
<table class="lite-table {className}">
|
|
102
105
|
<thead>
|
|
103
106
|
<tr>
|
|
104
107
|
{#if showBatch}
|
|
@@ -199,7 +202,7 @@
|
|
|
199
202
|
|
|
200
203
|
{#if showBatch && records.length > 0}
|
|
201
204
|
<div class="lite-batch-bar">
|
|
202
|
-
<span style="font-size: 13px; color: #
|
|
205
|
+
<span style="font-size: 13px; color: #4E5969;">
|
|
203
206
|
Select items above to perform batch actions
|
|
204
207
|
</span>
|
|
205
208
|
<button
|
|
@@ -22,6 +22,8 @@ interface Props {
|
|
|
22
22
|
};
|
|
23
23
|
/** Pin actions on the right; this takes precedence over stickyColumns.right. */
|
|
24
24
|
stickyActions?: boolean;
|
|
25
|
+
/** Caller class merged with the built-in class list. */
|
|
26
|
+
class?: string;
|
|
25
27
|
}
|
|
26
28
|
declare const LiteTable: import("svelte").Component<Props, {}, "">;
|
|
27
29
|
type LiteTable = ReturnType<typeof LiteTable>;
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
titleColumnKey?: string;
|
|
14
14
|
prefix?: Record<string, string>;
|
|
15
15
|
suffix?: Record<string, string>;
|
|
16
|
+
/** Caller class merged with the built-in class list. */
|
|
17
|
+
class?: string;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
let {
|
|
@@ -23,6 +25,7 @@
|
|
|
23
25
|
titleColumnKey,
|
|
24
26
|
prefix = {},
|
|
25
27
|
suffix = {},
|
|
28
|
+
class: className = '',
|
|
26
29
|
}: Props = $props();
|
|
27
30
|
|
|
28
31
|
const titleKey = $derived(titleColumnKey || (columns[0]?.key ?? ''));
|
|
@@ -50,7 +53,7 @@
|
|
|
50
53
|
}
|
|
51
54
|
</script>
|
|
52
55
|
|
|
53
|
-
<div class="lite-table-summary-container">
|
|
56
|
+
<div class="lite-table-summary-container {className}">
|
|
54
57
|
<table class="lite-table lite-summary-table">
|
|
55
58
|
<tbody>
|
|
56
59
|
<tr>
|
|
@@ -65,7 +68,7 @@
|
|
|
65
68
|
{#if prefix[col.key]}{prefix[col.key]}{/if}{calculate(col.key, aggType)}{#if suffix[col.key]}{suffix[col.key]}{/if}
|
|
66
69
|
</span>
|
|
67
70
|
{:else}
|
|
68
|
-
<span style="color: #
|
|
71
|
+
<span style="color: #86909C;">—</span>
|
|
69
72
|
{/if}
|
|
70
73
|
</td>
|
|
71
74
|
{/each}
|
|
@@ -78,8 +81,8 @@
|
|
|
78
81
|
.lite-table-summary-container {
|
|
79
82
|
width: 100%;
|
|
80
83
|
overflow-x: auto;
|
|
81
|
-
background: #
|
|
82
|
-
border-top: 2px solid #
|
|
84
|
+
background: #F7F8FA;
|
|
85
|
+
border-top: 2px solid #E5E6EB;
|
|
83
86
|
}
|
|
84
87
|
.lite-summary-table {
|
|
85
88
|
width: 100%;
|
|
@@ -88,6 +91,6 @@
|
|
|
88
91
|
.lite-summary-table td {
|
|
89
92
|
padding: 8px 12px;
|
|
90
93
|
font-size: 12px;
|
|
91
|
-
color: #
|
|
94
|
+
color: #1D2129;
|
|
92
95
|
}
|
|
93
96
|
</style>
|
|
@@ -11,6 +11,8 @@ interface Props {
|
|
|
11
11
|
titleColumnKey?: string;
|
|
12
12
|
prefix?: Record<string, string>;
|
|
13
13
|
suffix?: Record<string, string>;
|
|
14
|
+
/** Caller class merged with the built-in class list. */
|
|
15
|
+
class?: string;
|
|
14
16
|
}
|
|
15
17
|
declare const LiteTableSummary: import("svelte").Component<Props, {}, "">;
|
|
16
18
|
type LiteTableSummary = ReturnType<typeof LiteTableSummary>;
|
|
@@ -1,36 +1,53 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
/**
|
|
3
|
-
* LiteTabs — SSR-compatible tab navigation.
|
|
4
|
-
*
|
|
3
|
+
* LiteTabs — SSR-compatible tab/segmented navigation.
|
|
4
|
+
*
|
|
5
|
+
* Selection is URL driven: each option is a link and the active one carries
|
|
6
|
+
* `aria-current="page"`. Disabled options render as plain text so they cannot be
|
|
7
|
+
* focused or navigated to, matching the reference `disabled` contract without
|
|
8
|
+
* needing client state.
|
|
5
9
|
*/
|
|
6
10
|
|
|
7
11
|
interface TabItem {
|
|
8
12
|
label: string;
|
|
9
13
|
value: string;
|
|
10
14
|
href: string;
|
|
15
|
+
disabled?: boolean;
|
|
11
16
|
}
|
|
12
17
|
|
|
13
18
|
interface Props {
|
|
14
19
|
items: TabItem[];
|
|
15
20
|
activeValue: string;
|
|
21
|
+
/** Accessible name for the tab list. */
|
|
22
|
+
label?: string;
|
|
23
|
+
/** Caller class merged with the built-in class list. */
|
|
24
|
+
class?: string;
|
|
16
25
|
}
|
|
17
26
|
|
|
18
|
-
let { items, activeValue }: Props = $props();
|
|
27
|
+
let { items, activeValue, label, class: className = '' }: Props = $props();
|
|
19
28
|
</script>
|
|
20
29
|
|
|
21
|
-
<
|
|
30
|
+
<nav class={`lite-tabs ${className}`.trim()} aria-label={label}>
|
|
22
31
|
{#each items as item, _i (_i)}
|
|
23
|
-
|
|
24
|
-
{item.label}
|
|
25
|
-
|
|
32
|
+
{#if item.disabled}
|
|
33
|
+
<span class="lite-tab" aria-disabled="true">{item.label}</span>
|
|
34
|
+
{:else}
|
|
35
|
+
<a
|
|
36
|
+
href={item.href}
|
|
37
|
+
class="lite-tab {activeValue === item.value ? 'active' : ''}"
|
|
38
|
+
aria-current={activeValue === item.value ? 'page' : undefined}
|
|
39
|
+
>
|
|
40
|
+
{item.label}
|
|
41
|
+
</a>
|
|
42
|
+
{/if}
|
|
26
43
|
{/each}
|
|
27
|
-
</
|
|
44
|
+
</nav>
|
|
28
45
|
|
|
29
46
|
<style>
|
|
30
47
|
.lite-tabs {
|
|
31
48
|
display: flex;
|
|
32
49
|
flex-wrap: wrap;
|
|
33
|
-
border-bottom: 2px solid #
|
|
50
|
+
border-bottom: 2px solid #E5E6EB;
|
|
34
51
|
margin-bottom: 24px;
|
|
35
52
|
padding-bottom: 0;
|
|
36
53
|
}
|
|
@@ -39,19 +56,12 @@
|
|
|
39
56
|
margin-right: 4px;
|
|
40
57
|
font-size: 14px;
|
|
41
58
|
font-weight: 500;
|
|
42
|
-
color: #
|
|
59
|
+
color: #4E5969;
|
|
43
60
|
border-bottom: 2px solid transparent;
|
|
44
61
|
margin-bottom: -2px;
|
|
45
62
|
text-decoration: none;
|
|
46
|
-
transition: color 0.15s ease, border-color 0.15s ease;
|
|
47
|
-
}
|
|
48
|
-
.lite-tab:hover {
|
|
49
|
-
color: #0f172a;
|
|
50
|
-
text-decoration: none;
|
|
51
|
-
}
|
|
52
|
-
.lite-tab.active {
|
|
53
|
-
color: #4f46e5;
|
|
54
|
-
border-bottom-color: #4f46e5;
|
|
55
|
-
font-weight: 600;
|
|
56
63
|
}
|
|
64
|
+
.lite-tab:hover { color: #165DFF; text-decoration: none; }
|
|
65
|
+
.lite-tab.active { color: #165DFF; border-bottom-color: #165DFF; }
|
|
66
|
+
.lite-tab[aria-disabled='true'] { color: #C9CDD4; cursor: not-allowed; }
|
|
57
67
|
</style>
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* LiteTabs — SSR-compatible tab navigation.
|
|
3
|
-
*
|
|
2
|
+
* LiteTabs — SSR-compatible tab/segmented navigation.
|
|
3
|
+
*
|
|
4
|
+
* Selection is URL driven: each option is a link and the active one carries
|
|
5
|
+
* `aria-current="page"`. Disabled options render as plain text so they cannot be
|
|
6
|
+
* focused or navigated to, matching the reference `disabled` contract without
|
|
7
|
+
* needing client state.
|
|
4
8
|
*/
|
|
5
9
|
interface TabItem {
|
|
6
10
|
label: string;
|
|
7
11
|
value: string;
|
|
8
12
|
href: string;
|
|
13
|
+
disabled?: boolean;
|
|
9
14
|
}
|
|
10
15
|
interface Props {
|
|
11
16
|
items: TabItem[];
|
|
12
17
|
activeValue: string;
|
|
18
|
+
/** Accessible name for the tab list. */
|
|
19
|
+
label?: string;
|
|
20
|
+
/** Caller class merged with the built-in class list. */
|
|
21
|
+
class?: string;
|
|
13
22
|
}
|
|
14
23
|
declare const LiteTabs: import("svelte").Component<Props, {}, "">;
|
|
15
24
|
type LiteTabs = ReturnType<typeof LiteTabs>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import LiteBadge, { type LiteBadgeVariant } from './LiteBadge.svelte';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
variant?: LiteBadgeVariant;
|
|
7
|
+
label?: string;
|
|
8
|
+
closable?: boolean;
|
|
9
|
+
removeHref?: string;
|
|
10
|
+
removeLabel?: string;
|
|
11
|
+
children?: Snippet;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
let {
|
|
15
|
+
variant = 'secondary',
|
|
16
|
+
label = '',
|
|
17
|
+
closable = false,
|
|
18
|
+
removeHref,
|
|
19
|
+
removeLabel = 'Remove tag',
|
|
20
|
+
children,
|
|
21
|
+
}: Props = $props();
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<span class="lite-tag">
|
|
25
|
+
<LiteBadge {variant}>
|
|
26
|
+
{#if children}{@render children()}{:else}{label}{/if}
|
|
27
|
+
</LiteBadge>
|
|
28
|
+
{#if closable && removeHref}
|
|
29
|
+
<a class="lite-tag-close" href={removeHref} aria-label={removeLabel}>×</a>
|
|
30
|
+
{/if}
|
|
31
|
+
</span>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import { type LiteBadgeVariant } from './LiteBadge.svelte';
|
|
3
|
+
interface Props {
|
|
4
|
+
variant?: LiteBadgeVariant;
|
|
5
|
+
label?: string;
|
|
6
|
+
closable?: boolean;
|
|
7
|
+
removeHref?: string;
|
|
8
|
+
removeLabel?: string;
|
|
9
|
+
children?: Snippet;
|
|
10
|
+
}
|
|
11
|
+
declare const LiteTag: import("svelte").Component<Props, {}, "">;
|
|
12
|
+
type LiteTag = ReturnType<typeof LiteTag>;
|
|
13
|
+
export default LiteTag;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
interface TimelineEntry {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
time?: string;
|
|
7
|
+
tone?: 'neutral' | 'info' | 'success' | 'warning' | 'danger';
|
|
8
|
+
active?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface Props {
|
|
12
|
+
items: TimelineEntry[];
|
|
13
|
+
label?: string;
|
|
14
|
+
/** Caller class merged with the built-in class list. */
|
|
15
|
+
class?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
let { items, label = 'Timeline', class: className = '' }: Props = $props();
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<ol class="lite-timeline {className}" aria-label={label}>
|
|
22
|
+
{#each items as item (item.id)}
|
|
23
|
+
<li class="lite-timeline__item" data-tone={item.tone ?? 'neutral'} data-active={item.active || undefined}>
|
|
24
|
+
<span class="lite-timeline__marker" aria-hidden="true"></span>
|
|
25
|
+
<div>
|
|
26
|
+
{#if item.time}<time>{item.time}</time>{/if}
|
|
27
|
+
<p>{item.title}</p>
|
|
28
|
+
{#if item.description}<small>{item.description}</small>{/if}
|
|
29
|
+
</div>
|
|
30
|
+
</li>
|
|
31
|
+
{/each}
|
|
32
|
+
</ol>
|
|
33
|
+
|
|
34
|
+
<style>
|
|
35
|
+
.lite-timeline { display: block; margin: 0; padding: 0; list-style: none; }
|
|
36
|
+
.lite-timeline__item { position: relative; padding-left: 24px; }
|
|
37
|
+
.lite-timeline__item + .lite-timeline__item { margin-top: 16px; }
|
|
38
|
+
.lite-timeline__item:not(:last-child)::before { position: absolute; top: 16px; bottom: -16px; left: 5px; width: 1px; background: #E5E6EB; content: ''; }
|
|
39
|
+
.lite-timeline__marker { position: absolute; top: 5px; left: 0; width: 11px; height: 11px; border: 2px solid #C9CDD4; border-radius: 999px; background: #fff; }
|
|
40
|
+
.lite-timeline__item[data-tone='info'] .lite-timeline__marker { border-color: #165DFF; }
|
|
41
|
+
.lite-timeline__item[data-tone='success'] .lite-timeline__marker { border-color: #00B42A; }
|
|
42
|
+
.lite-timeline__item[data-tone='warning'] .lite-timeline__marker { border-color: #FF7D00; }
|
|
43
|
+
.lite-timeline__item[data-tone='danger'] .lite-timeline__marker { border-color: #F53F3F; }
|
|
44
|
+
.lite-timeline__item[data-active] .lite-timeline__marker { background: #165DFF; border-color: #165DFF; }
|
|
45
|
+
.lite-timeline__item time { color: #86909C; font-size: 12px; }
|
|
46
|
+
.lite-timeline__item p { margin: 0; color: #1D2129; font-size: 14px; font-weight: 600; }
|
|
47
|
+
.lite-timeline__item small { display: block; margin-top: 4px; color: #4E5969; font-size: 13px; line-height: 1.6; }
|
|
48
|
+
</style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface TimelineEntry {
|
|
2
|
+
id: string;
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
time?: string;
|
|
6
|
+
tone?: 'neutral' | 'info' | 'success' | 'warning' | 'danger';
|
|
7
|
+
active?: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface Props {
|
|
10
|
+
items: TimelineEntry[];
|
|
11
|
+
label?: string;
|
|
12
|
+
/** Caller class merged with the built-in class list. */
|
|
13
|
+
class?: string;
|
|
14
|
+
}
|
|
15
|
+
declare const LiteTimeline: import("svelte").Component<Props, {}, "">;
|
|
16
|
+
type LiteTimeline = ReturnType<typeof LiteTimeline>;
|
|
17
|
+
export default LiteTimeline;
|