@joewinke/jatui 0.1.24 → 0.1.26

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 (242) hide show
  1. package/dist/actions/collapse.d.ts +80 -0
  2. package/dist/actions/collapse.js +134 -0
  3. package/dist/actions/railNav.d.ts +167 -0
  4. package/dist/actions/railNav.js +351 -0
  5. package/dist/components/AnnotationLayer.svelte +108 -0
  6. package/dist/components/AnnotationLayer.svelte.d.ts +12 -0
  7. package/dist/components/AnnotationPanel.svelte +319 -0
  8. package/dist/components/AnnotationPanel.svelte.d.ts +13 -0
  9. package/dist/components/AudioWaveform.svelte +701 -0
  10. package/dist/components/AudioWaveform.svelte.d.ts +19 -0
  11. package/dist/components/AvailabilityModal.svelte +177 -0
  12. package/dist/components/AvailabilityModal.svelte.d.ts +14 -0
  13. package/dist/components/AvatarUpload.svelte +234 -0
  14. package/dist/components/AvatarUpload.svelte.d.ts +23 -0
  15. package/dist/components/Badge.svelte +38 -0
  16. package/dist/components/Badge.svelte.d.ts +14 -0
  17. package/dist/components/BookingForm.svelte +278 -0
  18. package/dist/components/BookingForm.svelte.d.ts +37 -0
  19. package/dist/components/BurndownChart.svelte +778 -0
  20. package/dist/components/BurndownChart.svelte.d.ts +17 -0
  21. package/dist/components/Button.svelte +81 -0
  22. package/dist/components/Button.svelte.d.ts +21 -0
  23. package/dist/components/CalendarPicker.svelte +284 -0
  24. package/dist/components/CalendarPicker.svelte.d.ts +22 -0
  25. package/dist/components/Card.svelte +67 -0
  26. package/dist/components/Card.svelte.d.ts +17 -0
  27. package/dist/components/CharacterCounter.svelte +82 -0
  28. package/dist/components/CharacterCounter.svelte.d.ts +10 -0
  29. package/dist/components/ChipInput.svelte +609 -0
  30. package/dist/components/ChipInput.svelte.d.ts +55 -0
  31. package/dist/components/Collapse.svelte +91 -0
  32. package/dist/components/Collapse.svelte.d.ts +18 -0
  33. package/dist/components/ColorSelector.svelte +167 -0
  34. package/dist/components/ColorSelector.svelte.d.ts +9 -0
  35. package/dist/components/CommentThread.svelte +773 -0
  36. package/dist/components/CommentThread.svelte.d.ts +32 -0
  37. package/dist/components/ConfirmDialog.svelte +348 -0
  38. package/dist/components/ConfirmDialog.svelte.d.ts +3 -0
  39. package/dist/components/ConfirmModal.svelte +142 -0
  40. package/dist/components/ConfirmModal.svelte.d.ts +15 -0
  41. package/dist/components/ContextMenu.svelte +188 -0
  42. package/dist/components/ContextMenu.svelte.d.ts +31 -0
  43. package/dist/components/CountdownTimer.svelte +94 -0
  44. package/dist/components/CountdownTimer.svelte.d.ts +10 -0
  45. package/dist/components/DateRangePicker.svelte +194 -0
  46. package/dist/components/DateRangePicker.svelte.d.ts +10 -0
  47. package/dist/components/Drawer.svelte +143 -0
  48. package/dist/components/Drawer.svelte.d.ts +33 -0
  49. package/dist/components/EmojiPicker.svelte +159 -0
  50. package/dist/components/EmojiPicker.svelte.d.ts +8 -0
  51. package/dist/components/EntityPreviewCard.svelte +104 -0
  52. package/dist/components/EntityPreviewCard.svelte.d.ts +9 -0
  53. package/dist/components/FileDropzone.svelte +493 -0
  54. package/dist/components/FileDropzone.svelte.d.ts +40 -0
  55. package/dist/components/FilePicker.svelte +488 -0
  56. package/dist/components/FilePicker.svelte.d.ts +20 -0
  57. package/dist/components/FileThumbnail.svelte +80 -0
  58. package/dist/components/FileThumbnail.svelte.d.ts +12 -0
  59. package/dist/components/FilterDropdown.svelte +203 -0
  60. package/dist/components/FilterDropdown.svelte.d.ts +48 -0
  61. package/dist/components/FloatingActionBar.svelte +354 -0
  62. package/dist/components/FloatingActionBar.svelte.d.ts +51 -0
  63. package/dist/components/GPSTracker.svelte +202 -0
  64. package/dist/components/GPSTracker.svelte.d.ts +34 -0
  65. package/dist/components/HunkDiffView.svelte +348 -0
  66. package/dist/components/HunkDiffView.svelte.d.ts +9 -0
  67. package/dist/components/ImageLightbox.svelte +274 -0
  68. package/dist/components/ImageLightbox.svelte.d.ts +25 -0
  69. package/dist/components/ImageUpload.svelte +147 -0
  70. package/dist/components/ImageUpload.svelte.d.ts +10 -0
  71. package/dist/components/InlineEdit.svelte +291 -0
  72. package/dist/components/InlineEdit.svelte.d.ts +45 -0
  73. package/dist/components/InputDialog.svelte +327 -0
  74. package/dist/components/InputDialog.svelte.d.ts +3 -0
  75. package/dist/components/KeyboardShortcutsOverlay.svelte +296 -0
  76. package/dist/components/KeyboardShortcutsOverlay.svelte.d.ts +42 -0
  77. package/dist/components/LazyImage.svelte +123 -0
  78. package/dist/components/LazyImage.svelte.d.ts +14 -0
  79. package/dist/components/LinkShortener.svelte +274 -0
  80. package/dist/components/LinkShortener.svelte.d.ts +27 -0
  81. package/dist/components/LoadingSpinner.svelte +106 -0
  82. package/dist/components/LoadingSpinner.svelte.d.ts +21 -0
  83. package/dist/components/LocationMap.svelte +186 -0
  84. package/dist/components/LocationMap.svelte.d.ts +11 -0
  85. package/dist/components/MapView.svelte +341 -0
  86. package/dist/components/MapView.svelte.d.ts +20 -0
  87. package/dist/components/MarkupEditor.svelte +485 -0
  88. package/dist/components/MarkupEditor.svelte.d.ts +10 -0
  89. package/dist/components/MarkupOverlay.svelte +55 -0
  90. package/dist/components/MarkupOverlay.svelte.d.ts +8 -0
  91. package/dist/components/MediaWorkbench.svelte +871 -0
  92. package/dist/components/MediaWorkbench.svelte.d.ts +9 -0
  93. package/dist/components/MilestoneCard.svelte +98 -0
  94. package/dist/components/MilestoneCard.svelte.d.ts +16 -0
  95. package/dist/components/MilestoneTimeline.svelte +91 -0
  96. package/dist/components/MilestoneTimeline.svelte.d.ts +15 -0
  97. package/dist/components/Modal.svelte +244 -0
  98. package/dist/components/Modal.svelte.d.ts +35 -0
  99. package/dist/components/PDFViewer.svelte +105 -0
  100. package/dist/components/PDFViewer.svelte.d.ts +9 -0
  101. package/dist/components/PdfThumbnail.svelte +63 -0
  102. package/dist/components/PdfThumbnail.svelte.d.ts +9 -0
  103. package/dist/components/PhoneInput.svelte +212 -0
  104. package/dist/components/PhoneInput.svelte.d.ts +25 -0
  105. package/dist/components/ResizableDivider.svelte +307 -0
  106. package/dist/components/ResizableDivider.svelte.d.ts +26 -0
  107. package/dist/components/ResizablePanel.svelte +305 -0
  108. package/dist/components/ResizablePanel.svelte.d.ts +18 -0
  109. package/dist/components/SearchDropdown.svelte +421 -0
  110. package/dist/components/SearchDropdown.svelte.d.ts +24 -0
  111. package/dist/components/SelectInput.svelte +237 -0
  112. package/dist/components/SelectInput.svelte.d.ts +26 -0
  113. package/dist/components/SidebarUserFooter.svelte +34 -0
  114. package/dist/components/SidebarUserFooter.svelte.d.ts +16 -0
  115. package/dist/components/SignaturePad.svelte +175 -0
  116. package/dist/components/SignaturePad.svelte.d.ts +17 -0
  117. package/dist/components/SmartImageEditor.svelte +720 -0
  118. package/dist/components/SmartImageEditor.svelte.d.ts +24 -0
  119. package/dist/components/SortDropdown.svelte +156 -0
  120. package/dist/components/SortDropdown.svelte.d.ts +40 -0
  121. package/dist/components/Sparkline.svelte +116 -0
  122. package/dist/components/Sparkline.svelte.d.ts +12 -0
  123. package/dist/components/SpeechForm.svelte +114 -0
  124. package/dist/components/SpeechForm.svelte.d.ts +17 -0
  125. package/dist/components/StatusBadge.svelte +157 -0
  126. package/dist/components/StatusBadge.svelte.d.ts +24 -0
  127. package/dist/components/TaskTypeIcon.svelte +54 -0
  128. package/dist/components/TaskTypeIcon.svelte.d.ts +17 -0
  129. package/dist/components/TextArea.svelte +162 -0
  130. package/dist/components/TextArea.svelte.d.ts +30 -0
  131. package/dist/components/TextInput.svelte +131 -0
  132. package/dist/components/TextInput.svelte.d.ts +29 -0
  133. package/dist/components/ThemeSelector.svelte +206 -0
  134. package/dist/components/ThemeSelector.svelte.d.ts +14 -0
  135. package/dist/components/TimeSlotPicker.svelte +162 -0
  136. package/dist/components/TimeSlotPicker.svelte.d.ts +18 -0
  137. package/dist/components/UserAvatar.svelte +72 -0
  138. package/dist/components/UserAvatar.svelte.d.ts +11 -0
  139. package/dist/components/VariablePicker.svelte +170 -0
  140. package/dist/components/VariablePicker.svelte.d.ts +40 -0
  141. package/dist/components/VoicePlayer.svelte +422 -0
  142. package/dist/components/VoicePlayer.svelte.d.ts +18 -0
  143. package/dist/components/linked-columns/LinkedColumns.svelte +526 -0
  144. package/dist/components/linked-columns/LinkedColumns.svelte.d.ts +130 -0
  145. package/dist/components/markup.d.ts +47 -0
  146. package/dist/components/markup.js +201 -0
  147. package/dist/components/messaging/Avatar.svelte +81 -0
  148. package/dist/components/messaging/Avatar.svelte.d.ts +11 -0
  149. package/dist/components/messaging/ChannelInfoModal.svelte +163 -0
  150. package/dist/components/messaging/ChannelInfoModal.svelte.d.ts +18 -0
  151. package/dist/components/messaging/ChannelList.svelte +107 -0
  152. package/dist/components/messaging/ChannelList.svelte.d.ts +11 -0
  153. package/dist/components/messaging/ChannelMemberAvatarStack.svelte +69 -0
  154. package/dist/components/messaging/ChannelMemberAvatarStack.svelte.d.ts +11 -0
  155. package/dist/components/messaging/ChannelMembersModal.svelte +182 -0
  156. package/dist/components/messaging/ChannelMembersModal.svelte.d.ts +16 -0
  157. package/dist/components/messaging/CreateChannelModal.svelte +190 -0
  158. package/dist/components/messaging/CreateChannelModal.svelte.d.ts +14 -0
  159. package/dist/components/messaging/DirectMessageList.svelte +145 -0
  160. package/dist/components/messaging/DirectMessageList.svelte.d.ts +12 -0
  161. package/dist/components/messaging/EmojiSelector.svelte +261 -0
  162. package/dist/components/messaging/EmojiSelector.svelte.d.ts +19 -0
  163. package/dist/components/messaging/MentionAutocomplete.svelte +193 -0
  164. package/dist/components/messaging/MentionAutocomplete.svelte.d.ts +17 -0
  165. package/dist/components/messaging/MessageAttachment.svelte +273 -0
  166. package/dist/components/messaging/MessageAttachment.svelte.d.ts +13 -0
  167. package/dist/components/messaging/MessageAttachmentUpload.svelte +243 -0
  168. package/dist/components/messaging/MessageAttachmentUpload.svelte.d.ts +19 -0
  169. package/dist/components/messaging/MessageInput.svelte +452 -0
  170. package/dist/components/messaging/MessageInput.svelte.d.ts +28 -0
  171. package/dist/components/messaging/MessageItem.svelte +341 -0
  172. package/dist/components/messaging/MessageItem.svelte.d.ts +41 -0
  173. package/dist/components/messaging/MessageThread.svelte +306 -0
  174. package/dist/components/messaging/MessageThread.svelte.d.ts +30 -0
  175. package/dist/components/messaging/NotificationSettingsModal.svelte +234 -0
  176. package/dist/components/messaging/NotificationSettingsModal.svelte.d.ts +13 -0
  177. package/dist/components/messaging/QuotedMessageDisplay.svelte +123 -0
  178. package/dist/components/messaging/QuotedMessageDisplay.svelte.d.ts +10 -0
  179. package/dist/components/messaging/StartDMModal.svelte +100 -0
  180. package/dist/components/messaging/StartDMModal.svelte.d.ts +14 -0
  181. package/dist/components/messaging/ThreadPanel.svelte +153 -0
  182. package/dist/components/messaging/ThreadPanel.svelte.d.ts +16 -0
  183. package/dist/components/pipeline/DESIGN.md +361 -0
  184. package/dist/components/pipeline/Pipeline.svelte +391 -0
  185. package/dist/components/pipeline/Pipeline.svelte.d.ts +28 -0
  186. package/dist/components/pipeline/PipelineCard.svelte +94 -0
  187. package/dist/components/pipeline/PipelineCard.svelte.d.ts +13 -0
  188. package/dist/components/pipeline/PipelineColumn.svelte +163 -0
  189. package/dist/components/pipeline/PipelineColumn.svelte.d.ts +30 -0
  190. package/dist/components/replay/ChapterTimeline.svelte +326 -0
  191. package/dist/components/replay/ChapterTimeline.svelte.d.ts +39 -0
  192. package/dist/components/session-nav/transcriptModel.d.ts +132 -0
  193. package/dist/components/session-nav/transcriptModel.js +285 -0
  194. package/dist/data/emojis.d.ts +18 -0
  195. package/dist/data/emojis.js +1196 -0
  196. package/dist/index.d.ts +142 -0
  197. package/dist/index.js +142 -0
  198. package/dist/stores/confirmDialog.svelte.d.ts +21 -0
  199. package/dist/stores/confirmDialog.svelte.js +31 -0
  200. package/dist/stores/inputDialog.svelte.d.ts +24 -0
  201. package/dist/stores/inputDialog.svelte.js +32 -0
  202. package/dist/styles/rail.css +63 -0
  203. package/dist/types/annotation.d.ts +32 -0
  204. package/dist/types/annotation.js +3 -0
  205. package/dist/types/booking.d.ts +115 -0
  206. package/dist/types/booking.js +24 -0
  207. package/dist/types/comments.d.ts +65 -0
  208. package/dist/types/comments.js +22 -0
  209. package/dist/types/entityPreview.d.ts +42 -0
  210. package/dist/types/entityPreview.js +10 -0
  211. package/dist/types/filePicker.d.ts +15 -0
  212. package/dist/types/filePicker.js +1 -0
  213. package/dist/types/googleMaps.d.ts +51 -0
  214. package/dist/types/maps.d.ts +43 -0
  215. package/dist/types/maps.js +4 -0
  216. package/dist/types/messaging.d.ts +282 -0
  217. package/dist/types/messaging.js +100 -0
  218. package/dist/types/milestone.d.ts +20 -0
  219. package/dist/types/milestone.js +7 -0
  220. package/dist/types/pipeline.d.ts +115 -0
  221. package/dist/types/pipeline.js +15 -0
  222. package/dist/types/smartImageEditor.d.ts +42 -0
  223. package/dist/types/smartImageEditor.js +1 -0
  224. package/dist/types/templateVars.d.ts +34 -0
  225. package/dist/types/templateVars.js +12 -0
  226. package/dist/utils/currency.d.ts +8 -0
  227. package/dist/utils/currency.js +17 -0
  228. package/dist/utils/daisyuiColors.d.ts +37 -0
  229. package/dist/utils/daisyuiColors.js +152 -0
  230. package/dist/utils/dateFormatters.d.ts +69 -0
  231. package/dist/utils/dateFormatters.js +199 -0
  232. package/dist/utils/googleMapsLoader.d.ts +19 -0
  233. package/dist/utils/googleMapsLoader.js +121 -0
  234. package/dist/utils/mentionParser.d.ts +67 -0
  235. package/dist/utils/mentionParser.js +132 -0
  236. package/dist/utils/phone.d.ts +13 -0
  237. package/dist/utils/phone.js +67 -0
  238. package/dist/utils/phoneFormat.d.ts +26 -0
  239. package/dist/utils/phoneFormat.js +69 -0
  240. package/dist/utils/taskUtils.d.ts +37 -0
  241. package/dist/utils/taskUtils.js +71 -0
  242. package/package.json +3 -2
@@ -0,0 +1,115 @@
1
+ /** A single stage (column) in the pipeline */
2
+ export interface PipelineStage {
3
+ id: string;
4
+ label: string;
5
+ order: number;
6
+ /** oklch color string, e.g. "oklch(0.70 0.18 240)" */
7
+ color?: string;
8
+ /** DaisyUI semantic color fallback: "primary" | "secondary" | "success" | "warning" | "error" | "info" */
9
+ semantic?: string;
10
+ /** Optional icon (SVG path or component name) */
11
+ icon?: string;
12
+ /** Whether cards can be dragged out of this column */
13
+ draggableOut?: boolean;
14
+ /** Whether cards can be dropped into this column */
15
+ droppableIn?: boolean;
16
+ }
17
+ /** Resolved colors for a stage, computed from PipelineStage.color or .semantic */
18
+ export interface StageColors {
19
+ bg: string;
20
+ text: string;
21
+ border: string;
22
+ accent: string;
23
+ }
24
+ /** A single item (card) in the pipeline. Generic — consumers extend with their own fields. */
25
+ export interface PipelineItem {
26
+ id: string;
27
+ stageId: string;
28
+ title: string;
29
+ /** Optional subtitle (e.g. client name, company) */
30
+ subtitle?: string;
31
+ /** Numeric value for metrics aggregation (e.g. deal value, session cost) */
32
+ value?: number;
33
+ /** ISO date string — when the item entered the current stage */
34
+ stageEnteredAt?: string;
35
+ /** ISO date string — expected completion/close date */
36
+ expectedDate?: string;
37
+ /** Priority: 0 = highest */
38
+ priority?: number;
39
+ /** Assignee name or ID */
40
+ assignee?: string;
41
+ /** Freeform labels/tags */
42
+ labels?: string[];
43
+ /** Arbitrary metadata for card snippets to consume */
44
+ meta?: Record<string, unknown>;
45
+ }
46
+ /** A single metric to display in the pipeline header */
47
+ export interface PipelineMetric {
48
+ label: string;
49
+ value: string | number;
50
+ /** Optional format hint: "currency" | "percent" | "number" */
51
+ format?: 'currency' | 'percent' | 'number';
52
+ /** Change from previous period, e.g. +5 or -2.3 */
53
+ change?: number;
54
+ /** DaisyUI color for the metric card */
55
+ color?: string;
56
+ }
57
+ /** Per-stage aggregate computed by the Pipeline component */
58
+ export interface StageMetrics {
59
+ stageId: string;
60
+ count: number;
61
+ totalValue: number;
62
+ }
63
+ /** View mode for the pipeline display */
64
+ export type PipelineViewMode = 'kanban' | 'table';
65
+ /** Table column definition for table view */
66
+ export interface PipelineTableColumn {
67
+ key: string;
68
+ label: string;
69
+ /** Width hint: "sm" (80px) | "md" (120px) | "lg" (200px) | "flex" (fill) */
70
+ width?: 'sm' | 'md' | 'lg' | 'flex';
71
+ /** Sort direction if sortable */
72
+ sortable?: boolean;
73
+ }
74
+ /** Drag-drop configuration */
75
+ export interface PipelineDragConfig {
76
+ enabled: boolean;
77
+ /** Duration for flip animation in ms (default: 200) */
78
+ flipDurationMs?: number;
79
+ /** CSS class applied to the drop zone during drag */
80
+ dropTargetClass?: string;
81
+ /** Stage IDs where drag is disabled (overrides per-stage draggableOut/droppableIn) */
82
+ disabledStages?: string[];
83
+ }
84
+ /** Top-level pipeline configuration */
85
+ export interface PipelineConfig {
86
+ /** Which views are available */
87
+ views?: PipelineViewMode[];
88
+ /** Default view on mount */
89
+ defaultView?: PipelineViewMode;
90
+ /** Drag-drop settings */
91
+ drag?: PipelineDragConfig;
92
+ /** Whether columns can be collapsed */
93
+ collapsible?: boolean;
94
+ /** Column min-height in px (default: 200) */
95
+ columnMinHeight?: number;
96
+ /** Table columns for table view */
97
+ tableColumns?: PipelineTableColumn[];
98
+ /** Currency code for value formatting (default: "USD") */
99
+ currency?: string;
100
+ }
101
+ /** Fired when an item is moved between stages via drag-drop */
102
+ export interface PipelineStageChangeEvent {
103
+ itemId: string;
104
+ fromStageId: string;
105
+ toStageId: string;
106
+ /** New index within the target stage */
107
+ newIndex: number;
108
+ }
109
+ /** Fired when an item is clicked */
110
+ export interface PipelineItemClickEvent {
111
+ item: PipelineItem;
112
+ stageId: string;
113
+ }
114
+ export declare const DEFAULT_DRAG_CONFIG: PipelineDragConfig;
115
+ export declare const DEFAULT_PIPELINE_CONFIG: PipelineConfig;
@@ -0,0 +1,15 @@
1
+ // ─── Core Stage/Column Types ───
2
+ // ─── Defaults ───
3
+ export var DEFAULT_DRAG_CONFIG = {
4
+ enabled: true,
5
+ flipDurationMs: 200,
6
+ dropTargetClass: 'outline-dashed outline-2 outline-base-content/20'
7
+ };
8
+ export var DEFAULT_PIPELINE_CONFIG = {
9
+ views: ['kanban'],
10
+ defaultView: 'kanban',
11
+ drag: DEFAULT_DRAG_CONFIG,
12
+ collapsible: true,
13
+ columnMinHeight: 200,
14
+ currency: 'USD'
15
+ };
@@ -0,0 +1,42 @@
1
+ export interface ImageVariantSpec {
2
+ name: string;
3
+ width: number;
4
+ height: number;
5
+ fit?: "contain" | "cover" | "fill";
6
+ /** CSS hex color or "transparent". Transparent background when omitted. */
7
+ background?: string;
8
+ /**
9
+ * Optional Gemini edit instruction run on the (background-removed) source
10
+ * before Sharp's deterministic resize. Used to intelligently re-frame the
11
+ * variant — e.g. crop a logo down to just the brand mark, or compose an OG
12
+ * card. Falls back to Sharp-only if the Gemini call fails.
13
+ */
14
+ aiPrompt?: string;
15
+ }
16
+ export interface ImageProcessingSpec {
17
+ removeBackground?: boolean;
18
+ aspectRatio?: string;
19
+ variants: ImageVariantSpec[];
20
+ }
21
+ export interface VariantResult {
22
+ name: string;
23
+ url: string;
24
+ width: number;
25
+ height: number;
26
+ backgroundRemovalFailed?: boolean;
27
+ /** True when this variant had an aiPrompt but the Gemini edit call failed
28
+ * and we fell back to Sharp-only. The result is still uploaded; this is a
29
+ * non-blocking signal that the smart re-frame didn't happen. */
30
+ aiEditFailed?: boolean;
31
+ }
32
+ export type VariantState = {
33
+ status: "idle";
34
+ } | {
35
+ status: "loading";
36
+ } | {
37
+ status: "done";
38
+ result: VariantResult;
39
+ } | {
40
+ status: "error";
41
+ message: string;
42
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Template variable types — shared shape between the JST server-side registry
3
+ * (`src/lib/server/template-vars.ts`, `getVarsForCategory`) and the
4
+ * VariablePicker component.
5
+ *
6
+ * jatui cannot import the host app's `$lib/server` module (server-only), so
7
+ * these types are mirrored here. They are kept structurally identical to the
8
+ * registry's output so `getVarsForCategory(category, availableVars)` can be
9
+ * passed straight into `<VariablePicker groups={...} />` with no mapping —
10
+ * same jst↔jatui structural-compatibility pattern used by CommentThread.
11
+ */
12
+ /** A single insertable merge variable. */
13
+ export interface TemplateVar {
14
+ /**
15
+ * Dotted variable path inserted into the template as `{{name}}`.
16
+ * e.g. `contact.name`, `org.logo_url`, `total`.
17
+ */
18
+ name: string;
19
+ /** Human label shown in the picker, e.g. "Contact name". */
20
+ label: string;
21
+ /** Optional one-line help text describing the value. */
22
+ description?: string;
23
+ /** Optional sample value shown as a hint, e.g. "Acme Inc.". */
24
+ example?: string;
25
+ }
26
+ /** Variable context group, e.g. all client/org/financial/custom vars. */
27
+ export interface TemplateVarGroup {
28
+ /** Stable group id — matches VarGroupId in the host app's template-vars registry. */
29
+ id: string;
30
+ /** Group heading shown in the picker, e.g. "Client". */
31
+ label: string;
32
+ /** Variables in this group (never empty — empty groups are omitted). */
33
+ vars: TemplateVar[];
34
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Template variable types — shared shape between the JST server-side registry
3
+ * (`src/lib/server/template-vars.ts`, `getVarsForCategory`) and the
4
+ * VariablePicker component.
5
+ *
6
+ * jatui cannot import the host app's `$lib/server` module (server-only), so
7
+ * these types are mirrored here. They are kept structurally identical to the
8
+ * registry's output so `getVarsForCategory(category, availableVars)` can be
9
+ * passed straight into `<VariablePicker groups={...} />` with no mapping —
10
+ * same jst↔jatui structural-compatibility pattern used by CommentThread.
11
+ */
12
+ export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Currency formatting utilities
3
+ */
4
+ /**
5
+ * Format a number as USD currency string.
6
+ * Override locale/currency by passing options.
7
+ */
8
+ export declare function formatCurrency(amount: number, locale?: string, currency?: string): string;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Currency formatting utilities
3
+ */
4
+ /**
5
+ * Format a number as USD currency string.
6
+ * Override locale/currency by passing options.
7
+ */
8
+ export function formatCurrency(amount, locale, currency) {
9
+ if (locale === void 0) { locale = 'en-US'; }
10
+ if (currency === void 0) { currency = 'USD'; }
11
+ return new Intl.NumberFormat(locale, {
12
+ style: 'currency',
13
+ currency: currency,
14
+ minimumFractionDigits: 2,
15
+ maximumFractionDigits: 2
16
+ }).format(amount);
17
+ }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * DaisyUI Color Utility — runtime CSS-var resolution for JS/Canvas contexts.
3
+ *
4
+ * Reads --color-* custom properties at runtime so any custom DaisyUI theme
5
+ * works correctly. SSR-safe: falls back to transparent/black when window is absent.
6
+ */
7
+ /**
8
+ * Get a DaisyUI semantic color string usable in Canvas / JS.
9
+ * Returns the raw CSS value (hex, oklch, or similar) from the active theme.
10
+ */
11
+ export declare function getDaisyUIColor(colorName: string): string;
12
+ /**
13
+ * Create a lighter version of a color using color-mix (works with hex and oklch).
14
+ */
15
+ export declare function lightenColor(color: string, amount?: number): string;
16
+ /**
17
+ * Create a darker version of a color using color-mix.
18
+ */
19
+ export declare function darkenColor(color: string, amount?: number): string;
20
+ /**
21
+ * Setup theme change detection.
22
+ * Clears color cache when theme changes and optionally calls a callback.
23
+ */
24
+ export declare function watchThemeChanges(onThemeChange?: () => void): () => void;
25
+ /**
26
+ * Check if we're currently in a dark theme by comparing base luminance.
27
+ * Uses a hidden canvas pixel to resolve the computed color to RGB.
28
+ */
29
+ export declare function isDarkTheme(): boolean;
30
+ /**
31
+ * Get the current theme name if available.
32
+ */
33
+ export declare function getCurrentTheme(): string | null;
34
+ /**
35
+ * Clear the color cache manually.
36
+ */
37
+ export declare function clearColorCache(): void;
@@ -0,0 +1,152 @@
1
+ /**
2
+ * DaisyUI Color Utility — runtime CSS-var resolution for JS/Canvas contexts.
3
+ *
4
+ * Reads --color-* custom properties at runtime so any custom DaisyUI theme
5
+ * works correctly. SSR-safe: falls back to transparent/black when window is absent.
6
+ */
7
+ var colorCache = new Map();
8
+ var themeObserver = null;
9
+ function resolveViaDOM(colorName) {
10
+ var el = document.documentElement;
11
+ var raw = getComputedStyle(el).getPropertyValue("--color-".concat(colorName)).trim();
12
+ if (raw)
13
+ return raw;
14
+ // DaisyUI v4 used shortened oklch channel vars (e.g. --p); try that form
15
+ var shortMap = {
16
+ primary: '--p',
17
+ 'primary-content': '--pc',
18
+ secondary: '--s',
19
+ 'secondary-content': '--sc',
20
+ accent: '--a',
21
+ 'accent-content': '--ac',
22
+ neutral: '--n',
23
+ 'neutral-content': '--nc',
24
+ 'base-100': '--b1',
25
+ 'base-200': '--b2',
26
+ 'base-300': '--b3',
27
+ 'base-content': '--bc',
28
+ info: '--in',
29
+ 'info-content': '--inc',
30
+ success: '--su',
31
+ 'success-content': '--suc',
32
+ warning: '--wa',
33
+ 'warning-content': '--wac',
34
+ error: '--er',
35
+ 'error-content': '--erc',
36
+ };
37
+ var shortVar = shortMap[colorName];
38
+ if (shortVar) {
39
+ var shortRaw = getComputedStyle(el).getPropertyValue(shortVar).trim();
40
+ if (shortRaw)
41
+ return "oklch(".concat(shortRaw, ")");
42
+ }
43
+ return 'oklch(0.5 0 0)';
44
+ }
45
+ /**
46
+ * Get a DaisyUI semantic color string usable in Canvas / JS.
47
+ * Returns the raw CSS value (hex, oklch, or similar) from the active theme.
48
+ */
49
+ export function getDaisyUIColor(colorName) {
50
+ if (typeof window === 'undefined')
51
+ return 'oklch(0.5 0 0)';
52
+ if (colorCache.has(colorName)) {
53
+ return colorCache.get(colorName);
54
+ }
55
+ var resolved = resolveViaDOM(colorName);
56
+ colorCache.set(colorName, resolved);
57
+ return resolved;
58
+ }
59
+ /**
60
+ * Create a lighter version of a color using color-mix (works with hex and oklch).
61
+ */
62
+ export function lightenColor(color, amount) {
63
+ if (amount === void 0) { amount = 0.2; }
64
+ var pct = Math.round(amount * 100);
65
+ return "color-mix(in oklch, white ".concat(pct, "%, ").concat(color, ")");
66
+ }
67
+ /**
68
+ * Create a darker version of a color using color-mix.
69
+ */
70
+ export function darkenColor(color, amount) {
71
+ if (amount === void 0) { amount = 0.2; }
72
+ var pct = Math.round(amount * 100);
73
+ return "color-mix(in oklch, black ".concat(pct, "%, ").concat(color, ")");
74
+ }
75
+ /**
76
+ * Setup theme change detection.
77
+ * Clears color cache when theme changes and optionally calls a callback.
78
+ */
79
+ export function watchThemeChanges(onThemeChange) {
80
+ if (themeObserver) {
81
+ themeObserver.disconnect();
82
+ }
83
+ themeObserver = new MutationObserver(function (mutations) {
84
+ var themeChanged = false;
85
+ mutations.forEach(function (mutation) {
86
+ if (mutation.type === 'attributes' &&
87
+ (mutation.attributeName === 'data-theme' ||
88
+ mutation.attributeName === 'class')) {
89
+ themeChanged = true;
90
+ }
91
+ });
92
+ if (themeChanged) {
93
+ colorCache.clear();
94
+ if (onThemeChange) {
95
+ onThemeChange();
96
+ }
97
+ }
98
+ });
99
+ themeObserver.observe(document.documentElement, {
100
+ attributes: true,
101
+ attributeFilter: ['data-theme', 'class'],
102
+ });
103
+ return function () {
104
+ if (themeObserver) {
105
+ themeObserver.disconnect();
106
+ themeObserver = null;
107
+ }
108
+ };
109
+ }
110
+ /**
111
+ * Check if we're currently in a dark theme by comparing base luminance.
112
+ * Uses a hidden canvas pixel to resolve the computed color to RGB.
113
+ */
114
+ export function isDarkTheme() {
115
+ if (typeof window === 'undefined')
116
+ return false;
117
+ var baseContent = getDaisyUIColor('base-content');
118
+ var base100 = getDaisyUIColor('base-100');
119
+ return getLuminance(baseContent) > getLuminance(base100);
120
+ }
121
+ function getLuminance(color) {
122
+ // Resolve via a temporary off-screen canvas pixel
123
+ var canvas = document.createElement('canvas');
124
+ canvas.width = 1;
125
+ canvas.height = 1;
126
+ var ctx = canvas.getContext('2d');
127
+ if (!ctx)
128
+ return 0.5;
129
+ try {
130
+ ctx.fillStyle = color;
131
+ ctx.fillRect(0, 0, 1, 1);
132
+ var _a = ctx.getImageData(0, 0, 1, 1).data, r = _a[0], g = _a[1], b = _a[2];
133
+ return (r * 299 + g * 587 + b * 114) / (1000 * 255);
134
+ }
135
+ catch (_b) {
136
+ return 0.5;
137
+ }
138
+ }
139
+ /**
140
+ * Get the current theme name if available.
141
+ */
142
+ export function getCurrentTheme() {
143
+ if (typeof window === 'undefined')
144
+ return null;
145
+ return document.documentElement.getAttribute('data-theme');
146
+ }
147
+ /**
148
+ * Clear the color cache manually.
149
+ */
150
+ export function clearColorCache() {
151
+ colorCache.clear();
152
+ }
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Date formatting utilities for consistent date/time display.
3
+ *
4
+ * UTC/ISO Timestamp Handling:
5
+ * Database timestamps are often stored without timezone info (e.g., "2024-11-21 15:30:00").
6
+ * These utilities normalize timestamps to ensure correct UTC parsing.
7
+ */
8
+ /**
9
+ * Normalize a timestamp string to proper ISO 8601 format.
10
+ * Handles database timestamps that may lack 'T' separator or 'Z' suffix.
11
+ */
12
+ export declare function normalizeTimestamp(timestamp: string): string;
13
+ /**
14
+ * Parse a potentially non-standard timestamp into a Date object.
15
+ * Accepts a Date (returned by postgres.js), ISO string, or null/undefined.
16
+ */
17
+ export declare function parseTimestamp(timestamp: Date | string | null | undefined): Date | null;
18
+ /**
19
+ * Format relative time (e.g., "2d", "3mo", "1y").
20
+ * Compact format suitable for tables and compact UIs.
21
+ */
22
+ export declare function formatRelativeTime(dateStr: Date | string | null | undefined): string;
23
+ /**
24
+ * Format full date and time for tooltips and detailed views.
25
+ */
26
+ export declare function formatFullDate(dateStr: Date | string | null | undefined): string;
27
+ /**
28
+ * Format short date for compact displays (e.g., date range picker).
29
+ */
30
+ export declare function formatShortDate(dateStr: Date | string | null | undefined): string;
31
+ /**
32
+ * Format last activity time for agent cards.
33
+ * Shows "Just now", "Xm ago", "Xh ago", or "Xd ago".
34
+ */
35
+ export declare function formatLastActivity(timestamp: Date | string | null | undefined): string;
36
+ /**
37
+ * Format date for display (simple locale string).
38
+ */
39
+ export declare function formatDate(dateString: Date | string | null | undefined): string;
40
+ /**
41
+ * Get milliseconds since timestamp (for calculations).
42
+ */
43
+ export declare function getTimeSinceMs(timestamp: Date | string | null | undefined): number;
44
+ /**
45
+ * Get minutes since timestamp.
46
+ */
47
+ export declare function getTimeSinceMinutes(timestamp: Date | string | null | undefined): number;
48
+ /**
49
+ * Check if timestamp is within a given number of minutes.
50
+ */
51
+ export declare function isWithinMinutes(timestamp: Date | string | null | undefined, minutes: number): boolean;
52
+ /**
53
+ * Format date + time for detail views (e.g. "Jan 5, 2:30 PM").
54
+ * No year — use formatFullDate when year is needed.
55
+ */
56
+ export declare function formatDateTime(dateStr: Date | string | null | undefined): string;
57
+ /**
58
+ * Color-coded relative age for task rows.
59
+ * Returns a label (e.g. "3d", "2w") and an oklch color string
60
+ * that shifts from green (fresh) → blue → amber → orange → red (stale).
61
+ *
62
+ * Usage:
63
+ * const age = taskAge(task.created_at)
64
+ * // <span style="color: {age.color}">{age.label}</span>
65
+ */
66
+ export declare function taskAge(dateStr: string): {
67
+ label: string;
68
+ color: string;
69
+ };