@svadmin/lite 0.17.0 → 0.22.1

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 (226) hide show
  1. package/README.md +71 -2
  2. package/dist/components/LiteActivityFeed.svelte +24 -2
  3. package/dist/components/LiteActivityFeed.svelte.d.ts +6 -0
  4. package/dist/components/LiteAffix.svelte +29 -0
  5. package/dist/components/LiteAffix.svelte.d.ts +13 -0
  6. package/dist/components/LiteAnchor.svelte +38 -0
  7. package/dist/components/LiteAnchor.svelte.d.ts +14 -0
  8. package/dist/components/LiteApprovalActionCard.svelte +4 -1
  9. package/dist/components/LiteApprovalActionCard.svelte.d.ts +2 -0
  10. package/dist/components/LiteAutoComplete.svelte +41 -0
  11. package/dist/components/LiteAutoComplete.svelte.d.ts +13 -0
  12. package/dist/components/LiteBackTop.svelte +16 -0
  13. package/dist/components/LiteBackTop.svelte.d.ts +8 -0
  14. package/dist/components/LiteBreadcrumbs.svelte +4 -1
  15. package/dist/components/LiteBreadcrumbs.svelte.d.ts +2 -0
  16. package/dist/components/LiteCalendar.svelte +124 -0
  17. package/dist/components/LiteCalendar.svelte.d.ts +20 -0
  18. package/dist/components/LiteCarousel.svelte +72 -0
  19. package/dist/components/LiteCarousel.svelte.d.ts +14 -0
  20. package/dist/components/LiteCollapse.svelte +49 -0
  21. package/dist/components/LiteCollapse.svelte.d.ts +15 -0
  22. package/dist/components/LiteColumnHeaderFilter.svelte +4 -1
  23. package/dist/components/LiteColumnHeaderFilter.svelte.d.ts +2 -0
  24. package/dist/components/LiteColumnSettings.svelte +4 -1
  25. package/dist/components/LiteColumnSettings.svelte.d.ts +2 -0
  26. package/dist/components/LiteCommentThread.svelte +113 -0
  27. package/dist/components/LiteCommentThread.svelte.d.ts +26 -0
  28. package/dist/components/LiteCountdown.svelte +49 -0
  29. package/dist/components/LiteCountdown.svelte.d.ts +10 -0
  30. package/dist/components/LiteDetailDrawer.svelte +45 -0
  31. package/dist/components/LiteDetailDrawer.svelte.d.ts +14 -0
  32. package/dist/components/LiteDraggableRowTable.svelte +4 -1
  33. package/dist/components/LiteDraggableRowTable.svelte.d.ts +2 -0
  34. package/dist/components/LiteDrawerForm.svelte +4 -1
  35. package/dist/components/LiteDrawerForm.svelte.d.ts +2 -0
  36. package/dist/components/LiteEditableTable.svelte +4 -1
  37. package/dist/components/LiteEditableTable.svelte.d.ts +2 -0
  38. package/dist/components/LiteEmptyState.svelte +8 -1
  39. package/dist/components/LiteEmptyState.svelte.d.ts +3 -0
  40. package/dist/components/LiteFilterBuilder.svelte +4 -1
  41. package/dist/components/LiteFilterBuilder.svelte.d.ts +2 -0
  42. package/dist/components/LiteFloatButton.svelte +54 -0
  43. package/dist/components/LiteFloatButton.svelte.d.ts +15 -0
  44. package/dist/components/LiteGrid.svelte +34 -0
  45. package/dist/components/LiteGrid.svelte.d.ts +11 -0
  46. package/dist/components/LiteImage.svelte +54 -0
  47. package/dist/components/LiteImage.svelte.d.ts +14 -0
  48. package/dist/components/LiteImageCropper.svelte +4 -1
  49. package/dist/components/LiteImageCropper.svelte.d.ts +2 -0
  50. package/dist/components/LiteImagePreview.svelte +36 -0
  51. package/dist/components/LiteImagePreview.svelte.d.ts +13 -0
  52. package/dist/components/LiteItemList.svelte +50 -0
  53. package/dist/components/LiteItemList.svelte.d.ts +15 -0
  54. package/dist/components/LiteJsonSchemaForm.svelte +4 -1
  55. package/dist/components/LiteJsonSchemaForm.svelte.d.ts +2 -0
  56. package/dist/components/LiteLayout.svelte +16 -4
  57. package/dist/components/LiteLayout.svelte.d.ts +8 -0
  58. package/dist/components/LiteLink.svelte +32 -0
  59. package/dist/components/LiteLink.svelte.d.ts +11 -0
  60. package/dist/components/LiteLogin.svelte +9 -2
  61. package/dist/components/LiteLogin.svelte.d.ts +2 -0
  62. package/dist/components/LiteMasterDetailView.svelte +4 -1
  63. package/dist/components/LiteMasterDetailView.svelte.d.ts +2 -0
  64. package/dist/components/LiteMediaLibraryModal.svelte +4 -1
  65. package/dist/components/LiteMediaLibraryModal.svelte.d.ts +2 -0
  66. package/dist/components/LiteMenu.svelte +22 -0
  67. package/dist/components/LiteMenu.svelte.d.ts +12 -0
  68. package/dist/components/LiteMenuList.svelte +55 -0
  69. package/dist/components/LiteMenuList.svelte.d.ts +17 -0
  70. package/dist/components/LiteModalForm.svelte +4 -1
  71. package/dist/components/LiteModalForm.svelte.d.ts +2 -0
  72. package/dist/components/LiteNotificationCenter.svelte +85 -0
  73. package/dist/components/LiteNotificationCenter.svelte.d.ts +22 -0
  74. package/dist/components/LiteOtpInput.svelte +50 -0
  75. package/dist/components/LiteOtpInput.svelte.d.ts +15 -0
  76. package/dist/components/LitePageHeader.svelte +34 -0
  77. package/dist/components/LitePageHeader.svelte.d.ts +13 -0
  78. package/dist/components/LitePagination.svelte +10 -2
  79. package/dist/components/LitePagination.svelte.d.ts +2 -0
  80. package/dist/components/LitePopconfirm.svelte +49 -0
  81. package/dist/components/LitePopconfirm.svelte.d.ts +14 -0
  82. package/dist/components/LitePresenceAvatarGroup.svelte +4 -1
  83. package/dist/components/LitePresenceAvatarGroup.svelte.d.ts +2 -0
  84. package/dist/components/LitePrintableBill.svelte +4 -1
  85. package/dist/components/LitePrintableBill.svelte.d.ts +2 -0
  86. package/dist/components/LiteProgress.svelte +46 -0
  87. package/dist/components/LiteProgress.svelte.d.ts +12 -0
  88. package/dist/components/LiteQRCode.svelte +62 -0
  89. package/dist/components/LiteQRCode.svelte.d.ts +14 -0
  90. package/dist/components/LiteResizeBox.svelte +34 -0
  91. package/dist/components/LiteResizeBox.svelte.d.ts +12 -0
  92. package/dist/components/LiteResult.svelte +52 -0
  93. package/dist/components/LiteResult.svelte.d.ts +14 -0
  94. package/dist/components/LiteRowActions.svelte +36 -0
  95. package/dist/components/LiteRowActions.svelte.d.ts +17 -0
  96. package/dist/components/LiteSensitiveDataMask.svelte +4 -1
  97. package/dist/components/LiteSensitiveDataMask.svelte.d.ts +2 -0
  98. package/dist/components/LiteSkeleton.svelte +100 -0
  99. package/dist/components/LiteSkeleton.svelte.d.ts +19 -0
  100. package/dist/components/LiteSpace.svelte +31 -0
  101. package/dist/components/LiteSpace.svelte.d.ts +12 -0
  102. package/dist/components/LiteSpin.svelte +27 -0
  103. package/dist/components/LiteSpin.svelte.d.ts +10 -0
  104. package/dist/components/LiteSplitPaneLayout.svelte +16 -4
  105. package/dist/components/LiteSplitPaneLayout.svelte.d.ts +8 -0
  106. package/dist/components/LiteStatistic.svelte +63 -0
  107. package/dist/components/LiteStatistic.svelte.d.ts +15 -0
  108. package/dist/components/LiteStatsCard.svelte +5 -2
  109. package/dist/components/LiteStatsCard.svelte.d.ts +2 -0
  110. package/dist/components/LiteStatusBadge.svelte +33 -0
  111. package/dist/components/LiteStatusBadge.svelte.d.ts +12 -0
  112. package/dist/components/LiteStatusTabs.svelte +35 -0
  113. package/dist/components/LiteStatusTabs.svelte.d.ts +14 -0
  114. package/dist/components/LiteStepForm.svelte +4 -1
  115. package/dist/components/LiteStepForm.svelte.d.ts +2 -0
  116. package/dist/components/LiteSteps.svelte +64 -0
  117. package/dist/components/LiteSteps.svelte.d.ts +18 -0
  118. package/dist/components/LiteTable.svelte +4 -1
  119. package/dist/components/LiteTable.svelte.d.ts +2 -0
  120. package/dist/components/LiteTableSummary.svelte +4 -1
  121. package/dist/components/LiteTableSummary.svelte.d.ts +2 -0
  122. package/dist/components/LiteTabs.svelte +28 -18
  123. package/dist/components/LiteTabs.svelte.d.ts +11 -2
  124. package/dist/components/LiteTag.svelte +31 -0
  125. package/dist/components/LiteTag.svelte.d.ts +13 -0
  126. package/dist/components/LiteTimeline.svelte +48 -0
  127. package/dist/components/LiteTimeline.svelte.d.ts +17 -0
  128. package/dist/components/LiteTour.svelte +54 -0
  129. package/dist/components/LiteTour.svelte.d.ts +15 -0
  130. package/dist/components/LiteTransfer.svelte +4 -1
  131. package/dist/components/LiteTransfer.svelte.d.ts +2 -0
  132. package/dist/components/LiteTree.svelte +48 -0
  133. package/dist/components/LiteTree.svelte.d.ts +17 -0
  134. package/dist/components/LiteTwoFactorStepper.svelte +53 -0
  135. package/dist/components/LiteTwoFactorStepper.svelte.d.ts +16 -0
  136. package/dist/components/LiteVersionDiffViewer.svelte +4 -1
  137. package/dist/components/LiteVersionDiffViewer.svelte.d.ts +2 -0
  138. package/dist/components/LiteVideoPlayer.svelte +67 -0
  139. package/dist/components/LiteVideoPlayer.svelte.d.ts +22 -0
  140. package/dist/components/advanced/LiteAutoSaveIndicator.svelte +42 -13
  141. package/dist/components/advanced/LiteAutoSaveIndicator.svelte.d.ts +10 -4
  142. package/dist/components/advanced/LiteDrawerForm.svelte +4 -1
  143. package/dist/components/advanced/LiteDrawerForm.svelte.d.ts +2 -0
  144. package/dist/components/advanced/LiteModalForm.svelte +4 -1
  145. package/dist/components/advanced/LiteModalForm.svelte.d.ts +2 -0
  146. package/dist/components/compatibility/LiteRealtimeStatus.svelte +41 -2
  147. package/dist/components/compatibility/LiteRealtimeStatus.svelte.d.ts +15 -0
  148. package/dist/components/fields/LiteBooleanField.svelte +4 -2
  149. package/dist/components/fields/LiteBooleanField.svelte.d.ts +2 -0
  150. package/dist/components/fields/LiteCascader.svelte +5 -2
  151. package/dist/components/fields/LiteCascader.svelte.d.ts +2 -0
  152. package/dist/components/fields/LiteDateField.svelte +39 -9
  153. package/dist/components/fields/LiteDateField.svelte.d.ts +2 -0
  154. package/dist/components/fields/LiteImageField.svelte +6 -2
  155. package/dist/components/fields/LiteImageField.svelte.d.ts +2 -0
  156. package/dist/components/fields/LiteMarkdownField.svelte +49 -3
  157. package/dist/components/fields/LiteMarkdownField.svelte.d.ts +5 -0
  158. package/dist/components/fields/LiteNumberField.svelte +5 -3
  159. package/dist/components/fields/LiteNumberField.svelte.d.ts +2 -0
  160. package/dist/components/fields/LiteRichTextField.svelte +45 -8
  161. package/dist/components/fields/LiteRichTextField.svelte.d.ts +3 -0
  162. package/dist/components/fields/LiteSelectField.svelte +5 -3
  163. package/dist/components/fields/LiteSelectField.svelte.d.ts +2 -0
  164. package/dist/components/fields/LiteTagField.svelte +38 -15
  165. package/dist/components/fields/LiteTagField.svelte.d.ts +2 -0
  166. package/dist/components/fields/LiteTextField.svelte +26 -5
  167. package/dist/components/fields/LiteTextField.svelte.d.ts +2 -0
  168. package/dist/components/fields/LiteTreeSelect.svelte +5 -2
  169. package/dist/components/fields/LiteTreeSelect.svelte.d.ts +2 -0
  170. package/dist/components/fields/LiteUrlField.svelte +5 -3
  171. package/dist/components/fields/LiteUrlField.svelte.d.ts +2 -0
  172. package/dist/components/layout/LiteSidebar.svelte +4 -1
  173. package/dist/components/layout/LiteSidebar.svelte.d.ts +2 -0
  174. package/dist/components/pages/LiteCreatePage.svelte +4 -1
  175. package/dist/components/pages/LiteCreatePage.svelte.d.ts +2 -0
  176. package/dist/components/pages/LiteEditPage.svelte +4 -1
  177. package/dist/components/pages/LiteEditPage.svelte.d.ts +2 -0
  178. package/dist/components/pages/LiteListPage.svelte +4 -1
  179. package/dist/components/pages/LiteListPage.svelte.d.ts +2 -0
  180. package/dist/components/pages/LiteShowPage.svelte +4 -1
  181. package/dist/components/pages/LiteShowPage.svelte.d.ts +2 -0
  182. package/dist/components/widgets/LiteAnomalyBadge.svelte +5 -2
  183. package/dist/components/widgets/LiteAnomalyBadge.svelte.d.ts +2 -0
  184. package/dist/components/widgets/LiteAreaChart.svelte +20 -0
  185. package/dist/components/widgets/LiteAreaChart.svelte.d.ts +10 -0
  186. package/dist/components/widgets/LiteChartSvg.svelte +102 -0
  187. package/dist/components/widgets/LiteChartSvg.svelte.d.ts +10 -0
  188. package/dist/components/widgets/LiteChartTable.svelte +44 -0
  189. package/dist/components/widgets/LiteChartTable.svelte.d.ts +10 -0
  190. package/dist/components/widgets/LiteDonutChart.svelte +20 -0
  191. package/dist/components/widgets/LiteDonutChart.svelte.d.ts +10 -0
  192. package/dist/components/widgets/LiteFunnelChart.svelte +20 -0
  193. package/dist/components/widgets/LiteFunnelChart.svelte.d.ts +10 -0
  194. package/dist/components/widgets/LiteGaugeChart.svelte +20 -0
  195. package/dist/components/widgets/LiteGaugeChart.svelte.d.ts +10 -0
  196. package/dist/components/widgets/LiteHeatmapChart.svelte +20 -0
  197. package/dist/components/widgets/LiteHeatmapChart.svelte.d.ts +10 -0
  198. package/dist/components/widgets/LiteInsightCard.svelte +34 -12
  199. package/dist/components/widgets/LiteInsightCard.svelte.d.ts +7 -4
  200. package/dist/components/widgets/LiteLineChart.svelte +6 -3
  201. package/dist/components/widgets/LiteLineChart.svelte.d.ts +0 -5
  202. package/dist/components/widgets/LitePieChart.svelte +5 -3
  203. package/dist/components/widgets/LitePieChart.svelte.d.ts +0 -5
  204. package/dist/components/widgets/LiteRadarChart.svelte +20 -0
  205. package/dist/components/widgets/LiteRadarChart.svelte.d.ts +10 -0
  206. package/dist/components/widgets/LiteRoseChart.svelte +20 -0
  207. package/dist/components/widgets/LiteRoseChart.svelte.d.ts +10 -0
  208. package/dist/components/widgets/LiteScatterChart.svelte +20 -0
  209. package/dist/components/widgets/LiteScatterChart.svelte.d.ts +10 -0
  210. package/dist/components/widgets/LiteWaterfallChart.svelte +20 -0
  211. package/dist/components/widgets/LiteWaterfallChart.svelte.d.ts +10 -0
  212. package/dist/components/widgets/chart-geometry.d.ts +65 -0
  213. package/dist/components/widgets/chart-geometry.js +229 -0
  214. package/dist/components/widgets/index.d.ts +10 -0
  215. package/dist/components/widgets/index.js +10 -0
  216. package/dist/index.d.ts +40 -0
  217. package/dist/index.js +47 -0
  218. package/dist/lite-code-theme.css +139 -0
  219. package/dist/lite.css +108 -1
  220. package/dist/rich-content.d.ts +47 -0
  221. package/dist/rich-content.js +498 -0
  222. package/dist/schema-generator.js +3 -1
  223. package/dist/server-adapter.js +6 -11
  224. package/dist/value-normalization.d.ts +4 -0
  225. package/dist/value-normalization.js +13 -0
  226. package/package.json +18 -4
@@ -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}
@@ -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>
@@ -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,30 +1,47 @@
1
1
  <script lang="ts">
2
2
  /**
3
- * LiteTabs — SSR-compatible tab navigation.
4
- * Uses simple <a> tags and flexbox. No JS required.
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
- <div class="lite-tabs">
30
+ <nav class={`lite-tabs ${className}`.trim()} aria-label={label}>
22
31
  {#each items as item, _i (_i)}
23
- <a href={item.href} class="lite-tab {activeValue === item.value ? 'active' : ''}">
24
- {item.label}
25
- </a>
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
- </div>
44
+ </nav>
28
45
 
29
46
  <style>
30
47
  .lite-tabs {
@@ -43,15 +60,8 @@
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: #1D2129;
50
- text-decoration: none;
51
- }
52
- .lite-tab.active {
53
- color: #165DFF;
54
- border-bottom-color: #165DFF;
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
- * Uses simple <a> tags and flexbox. No JS required.
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;
@@ -0,0 +1,54 @@
1
+ <script lang="ts">
2
+ interface TourStep {
3
+ title: string;
4
+ description?: string;
5
+ href?: string;
6
+ }
7
+
8
+ interface Props {
9
+ steps: TourStep[];
10
+ title?: string;
11
+ current?: number;
12
+ dismissHref?: string;
13
+ label?: string;
14
+ }
15
+
16
+ let { steps, title = 'Guided tour', current = 0, dismissHref, label = 'Guided tour' }: Props = $props();
17
+ </script>
18
+
19
+ <section class="lite-tour lite-card" aria-label={label}>
20
+ <header>
21
+ <h2>{title}</h2>
22
+ {#if dismissHref}<a href={dismissHref} aria-label="Dismiss tour">×</a>{/if}
23
+ </header>
24
+ <ol>
25
+ {#each steps as step, index (step.title)}
26
+ <li data-active={index === current || undefined}>
27
+ <span>{index + 1}</span>
28
+ <div>
29
+ <strong>{step.title}</strong>
30
+ {#if step.description}<p>{step.description}</p>{/if}
31
+ {#if step.href}<a href={step.href}>View step</a>{/if}
32
+ </div>
33
+ </li>
34
+ {/each}
35
+ </ol>
36
+ </section>
37
+
38
+ <style>
39
+ .lite-tour { display: block; }
40
+ .lite-tour header { display: flex; align-items: baseline; justify-content: space-between; }
41
+ .lite-tour h2 { margin: 0; color: #1D2129; font-size: 14px; }
42
+ .lite-tour header a { color: #4E5969; font-size: 20px; line-height: 1; text-decoration: none; }
43
+ .lite-tour ol { display: block; margin: 0; padding: 0; list-style: none; }
44
+ .lite-tour li { display: flex; padding: 8px; border: 1px solid #F2F3F5; border-radius: 6px; }
45
+ .lite-tour li[data-active] { border-color: #165DFF; background: #F7F8FA; }
46
+ .lite-tour li > span { display: inline-grid; flex: 0 0 24px; place-items: center; width: 24px; height: 24px; border-radius: 999px; background: #E8F3FF; color: #165DFF; font-size: 12px; font-weight: 600; }
47
+ .lite-tour li strong { color: #1D2129; font-size: 13px; }
48
+ .lite-tour li p { margin: 2px 0 0; color: #4E5969; font-size: 12px; line-height: 1.5; }
49
+ .lite-tour li a { color: #165DFF; font-size: 12px; }
50
+
51
+ .lite-tour > * + * { margin-top: 12px; }
52
+ .lite-tour li + li { margin-top: 8px; }
53
+ .lite-tour li > span { margin-right: 10px; }
54
+ </style>
@@ -0,0 +1,15 @@
1
+ interface TourStep {
2
+ title: string;
3
+ description?: string;
4
+ href?: string;
5
+ }
6
+ interface Props {
7
+ steps: TourStep[];
8
+ title?: string;
9
+ current?: number;
10
+ dismissHref?: string;
11
+ label?: string;
12
+ }
13
+ declare const LiteTour: import("svelte").Component<Props, {}, "">;
14
+ type LiteTour = ReturnType<typeof LiteTour>;
15
+ export default LiteTour;
@@ -16,6 +16,8 @@
16
16
  disabled?: boolean;
17
17
  label?: string;
18
18
  description?: string;
19
+ /** Caller class merged with the built-in class list. */
20
+ class?: string;
19
21
  }
20
22
 
21
23
  let {
@@ -26,6 +28,7 @@
26
28
  disabled = false,
27
29
  label,
28
30
  description,
31
+ class: className = ''
29
32
  }: Props = $props();
30
33
 
31
34
  const targetKeySet = $derived(new Set(targetKeys.map(String)));
@@ -33,7 +36,7 @@
33
36
  const targetItems = $derived(dataSource.filter((item) => targetKeySet.has(String(item.key))));
34
37
  </script>
35
38
 
36
- <div class="lite-transfer-container lite-form-group">
39
+ <div class="lite-transfer-container lite-form-group {className}">
37
40
  {#if label}
38
41
  <span class="lite-label">{label}</span>
39
42
  {/if}
@@ -12,6 +12,8 @@ interface Props {
12
12
  disabled?: boolean;
13
13
  label?: string;
14
14
  description?: string;
15
+ /** Caller class merged with the built-in class list. */
16
+ class?: string;
15
17
  }
16
18
  declare const LiteTransfer: import("svelte").Component<Props, {}, "">;
17
19
  type LiteTransfer = ReturnType<typeof LiteTransfer>;
@@ -0,0 +1,48 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+
4
+ interface TreeNode {
5
+ id: string;
6
+ label: string;
7
+ href?: string;
8
+ disabled?: boolean;
9
+ children?: TreeNode[];
10
+ }
11
+
12
+ interface Props {
13
+ nodes: TreeNode[];
14
+ label?: string;
15
+ selected?: string;
16
+ children?: Snippet<[TreeNode]>;
17
+ }
18
+
19
+ let { nodes, label = 'Tree', selected, children }: Props = $props();
20
+ </script>
21
+
22
+ {#snippet branch(items: TreeNode[], depth: number)}
23
+ <ul class="lite-tree__list" role={depth === 0 ? 'tree' : 'group'} aria-label={depth === 0 ? label : undefined}>
24
+ {#each items as node (node.id)}
25
+ <li role="treeitem" aria-selected={selected === node.id} aria-disabled={node.disabled || undefined}>
26
+ {#if node.href && !node.disabled}
27
+ <a href={node.href} class:active={selected === node.id}>{node.label}</a>
28
+ {:else}
29
+ <span class:active={selected === node.id}>{node.label}</span>
30
+ {/if}
31
+ {#if node.children?.length}{@render branch(node.children, depth + 1)}{/if}
32
+ {#if children}{@render children(node)}{/if}
33
+ </li>
34
+ {/each}
35
+ </ul>
36
+ {/snippet}
37
+
38
+ <nav class="lite-tree" aria-label={label}>
39
+ {@render branch(nodes, 0)}
40
+ </nav>
41
+
42
+ <style>
43
+ .lite-tree__list { margin: 0; padding-left: 16px; list-style: none; }
44
+ .lite-tree > .lite-tree__list { padding-left: 0; }
45
+ .lite-tree__list li { padding: 2px 0; color: #1D2129; font-size: 13px; }
46
+ .lite-tree__list a, .lite-tree__list span { display: inline-block; padding: 4px 8px; border-radius: 4px; color: #1D2129; text-decoration: none; }
47
+ .lite-tree__list a:hover, .lite-tree__list .active { background: #E8F3FF; color: #165DFF; }
48
+ </style>
@@ -0,0 +1,17 @@
1
+ import type { Snippet } from 'svelte';
2
+ interface TreeNode {
3
+ id: string;
4
+ label: string;
5
+ href?: string;
6
+ disabled?: boolean;
7
+ children?: TreeNode[];
8
+ }
9
+ interface Props {
10
+ nodes: TreeNode[];
11
+ label?: string;
12
+ selected?: string;
13
+ children?: Snippet<[TreeNode]>;
14
+ }
15
+ declare const LiteTree: import("svelte").Component<Props, {}, "">;
16
+ type LiteTree = ReturnType<typeof LiteTree>;
17
+ export default LiteTree;
@@ -0,0 +1,53 @@
1
+ <script lang="ts">
2
+ import type { HTMLFormAttributes } from 'svelte/elements';
3
+ import LiteSteps from './LiteSteps.svelte';
4
+ import LiteOtpInput from './LiteOtpInput.svelte';
5
+
6
+ interface Props {
7
+ current?: number;
8
+ /** Step labels; mirrors the reference `steps` prop. */
9
+ steps?: string[];
10
+ action: string;
11
+ method?: HTMLFormAttributes['method'];
12
+ codeName?: string;
13
+ submitLabel?: string;
14
+ title?: string;
15
+ /** Applied to the step list, matching the reference component. */
16
+ class?: string;
17
+ }
18
+
19
+ let {
20
+ current = 1,
21
+ steps = ['Password verified', 'Enter verification code', 'Access granted'],
22
+ action,
23
+ method = 'POST',
24
+ codeName = 'code',
25
+ submitLabel = 'Verify',
26
+ title = 'Two-factor authentication',
27
+ class: className = '',
28
+ }: Props = $props();
29
+ </script>
30
+
31
+ <section class="lite-card lite-two-factor" aria-label={title}>
32
+ <h2>{title}</h2>
33
+ <LiteSteps
34
+ current={current}
35
+ label="Progress"
36
+ class={className}
37
+ items={steps.map((step) => ({ title: step }))}
38
+ />
39
+ <form {method} {action} class="lite-two-factor__form">
40
+ <LiteOtpInput name={codeName} />
41
+ <button class="lite-btn lite-btn-primary" type="submit">{submitLabel}</button>
42
+ </form>
43
+ <p class="lite-muted">Recovery codes can be used once if the authenticator is unavailable.</p>
44
+ </section>
45
+
46
+ <style>
47
+ .lite-two-factor { display: block; }
48
+ .lite-two-factor h2 { margin: 0; color: #1D2129; font-size: 18px; }
49
+ .lite-two-factor__form { display: block; justify-items: start; }
50
+
51
+ .lite-two-factor > * + * { margin-top: 16px; }
52
+ .lite-two-factor__form > * + * { margin-top: 12px; }
53
+ </style>
@@ -0,0 +1,16 @@
1
+ import type { HTMLFormAttributes } from 'svelte/elements';
2
+ interface Props {
3
+ current?: number;
4
+ /** Step labels; mirrors the reference `steps` prop. */
5
+ steps?: string[];
6
+ action: string;
7
+ method?: HTMLFormAttributes['method'];
8
+ codeName?: string;
9
+ submitLabel?: string;
10
+ title?: string;
11
+ /** Applied to the step list, matching the reference component. */
12
+ class?: string;
13
+ }
14
+ declare const LiteTwoFactorStepper: import("svelte").Component<Props, {}, "">;
15
+ type LiteTwoFactorStepper = ReturnType<typeof LiteTwoFactorStepper>;
16
+ export default LiteTwoFactorStepper;
@@ -5,6 +5,8 @@
5
5
  oldTitle?: string;
6
6
  newTitle?: string;
7
7
  fieldLabels?: Record<string, string>;
8
+ /** Caller class merged with the built-in class list. */
9
+ class?: string;
8
10
  }
9
11
 
10
12
  let {
@@ -13,6 +15,7 @@
13
15
  oldTitle = 'Previous Version',
14
16
  newTitle = 'Current Version',
15
17
  fieldLabels = {},
18
+ class: className = '',
16
19
  }: Props = $props();
17
20
 
18
21
  const allKeys = $derived(
@@ -35,7 +38,7 @@
35
38
  }
36
39
  </script>
37
40
 
38
- <div class="lite-diff-viewer">
41
+ <div class="lite-diff-viewer {className}">
39
42
  <div class="lite-diff-header">
40
43
  <strong>Record Comparison</strong>
41
44
  </div>
@@ -4,6 +4,8 @@ interface Props {
4
4
  oldTitle?: string;
5
5
  newTitle?: string;
6
6
  fieldLabels?: Record<string, string>;
7
+ /** Caller class merged with the built-in class list. */
8
+ class?: string;
7
9
  }
8
10
  declare const LiteVersionDiffViewer: import("svelte").Component<Props, {}, "">;
9
11
  type LiteVersionDiffViewer = ReturnType<typeof LiteVersionDiffViewer>;