@heyramzi/ui 2.9.0 → 2.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (312) hide show
  1. package/dist/agents/helpers.js +52 -0
  2. package/dist/agents/index.js +3 -0
  3. package/dist/agents/page-state.js +65 -0
  4. package/dist/agents/types.js +1 -0
  5. package/dist/agents/vendor/color.js +149 -0
  6. package/dist/agents/vendor/draw.js +548 -0
  7. package/dist/agents/vendor/engine.js +632 -0
  8. package/dist/agents/vendor/mesh.js +727 -0
  9. package/dist/agents/vendor/plastic.js +3273 -0
  10. package/dist/agents/vendor/presets.js +171 -0
  11. package/dist/agents/vendor/shapes.js +24 -0
  12. package/dist/agents/vendor/ticker.js +56 -0
  13. package/dist/agents/vendor/types.js +0 -0
  14. package/dist/agents/vendor/wear.js +1525 -0
  15. package/dist/ai/ai-button/index.js +2 -0
  16. package/dist/ai/confirmation/confirmation-context.svelte.js +12 -0
  17. package/dist/ai/confirmation/index.js +9 -0
  18. package/dist/ai/generation-progress/index.js +2 -0
  19. package/dist/ai/index.js +11 -0
  20. package/dist/ai/loading-state/index.js +3 -0
  21. package/dist/ai/prompt-input/index.js +6 -0
  22. package/dist/ai/reasoning/index.js +4 -0
  23. package/dist/ai/reasoning/reasoning-context.svelte.js +12 -0
  24. package/dist/ai/response/index.js +3 -0
  25. package/dist/ai/suggestion/index.js +3 -0
  26. package/dist/ai/thinking-dots/index.js +3 -0
  27. package/dist/ai/typing-dots/index.js +2 -0
  28. package/dist/ai/voice-waveform/index.js +3 -0
  29. package/dist/animations/text-swap.js +30 -0
  30. package/dist/brand/index.js +65 -0
  31. package/dist/canvas/card/resize.js +10 -0
  32. package/dist/canvas/edges/edge-path.js +284 -0
  33. package/dist/canvas/editor/context-menu.js +42 -0
  34. package/dist/canvas/editor/dispatch.svelte.js +157 -0
  35. package/dist/canvas/editor/editor-context.js +8 -0
  36. package/dist/canvas/editor/editor-mode.js +0 -0
  37. package/dist/canvas/editor/frame.js +87 -0
  38. package/dist/canvas/editor/hand-context.js +8 -0
  39. package/dist/canvas/editor/history-core.js +221 -0
  40. package/dist/canvas/editor/keymap.js +193 -0
  41. package/dist/canvas/editor/layout-actions.js +170 -0
  42. package/dist/canvas/editor/lock.js +65 -0
  43. package/dist/canvas/editor/rebase.js +279 -0
  44. package/dist/canvas/editor/style.js +174 -0
  45. package/dist/canvas/editor/text-field-context.js +8 -0
  46. package/dist/canvas/editor/z-order.js +82 -0
  47. package/dist/canvas/headless/alignment.js +20 -0
  48. package/dist/canvas/headless/break-apart-find.js +324 -0
  49. package/dist/canvas/headless/break-apart-pieces.js +74 -0
  50. package/dist/canvas/headless/break-apart-plan.js +378 -0
  51. package/dist/canvas/headless/break-apart-style.js +93 -0
  52. package/dist/canvas/headless/break-apart.js +206 -0
  53. package/dist/canvas/headless/canvas-cleanup.js +70 -0
  54. package/dist/canvas/headless/edge-anchors.js +134 -0
  55. package/dist/canvas/headless/edge-memo.js +28 -0
  56. package/dist/canvas/headless/edge-serialization.js +31 -0
  57. package/dist/canvas/headless/figure-geometry.js +331 -0
  58. package/dist/canvas/headless/fit-viewport.js +82 -0
  59. package/dist/canvas/headless/grid.js +96 -0
  60. package/dist/canvas/headless/icon-node.js +45 -0
  61. package/dist/canvas/headless/index.js +1 -0
  62. package/dist/canvas/headless/linkify.js +25 -0
  63. package/dist/canvas/headless/pen-marks.js +115 -0
  64. package/dist/canvas/headless/sketch.js +250 -0
  65. package/dist/canvas/headless/snap-guides.js +100 -0
  66. package/dist/canvas/headless/svg-figure.js +137 -0
  67. package/dist/canvas/headless/table-layout.js +161 -0
  68. package/dist/canvas/index.js +25 -0
  69. package/dist/canvas/lod/lod-mode.svelte.js +22 -0
  70. package/dist/canvas/lod/render-all.svelte.js +45 -0
  71. package/dist/canvas/ops/arrange.js +83 -0
  72. package/dist/canvas/ops/ops.js +318 -0
  73. package/dist/canvas/pen/colors.js +41 -0
  74. package/dist/canvas/pen/eraser.js +35 -0
  75. package/dist/canvas/pen/geometry.js +143 -0
  76. package/dist/canvas/pen/index.js +9 -0
  77. package/dist/canvas/pen/ops.js +15 -0
  78. package/dist/canvas/pen/pen-session.js +171 -0
  79. package/dist/canvas/pen/plugin.js +129 -0
  80. package/dist/canvas/pen/shapes.js +80 -0
  81. package/dist/canvas/pen/stroke-path.js +37 -0
  82. package/dist/canvas/pen/types.js +30 -0
  83. package/dist/canvas/pen/ui.js +20 -0
  84. package/dist/canvas/plugin.js +51 -0
  85. package/dist/canvas/screen/glyphs.js +24 -0
  86. package/dist/canvas/screen/labels.js +24 -0
  87. package/dist/canvas/screen/parts.js +140 -0
  88. package/dist/canvas/screen/plugin.js +71 -0
  89. package/dist/canvas/screen/types.js +44 -0
  90. package/dist/canvas/screen/ui.js +13 -0
  91. package/dist/canvas/test-utils.js +18 -0
  92. package/dist/canvas/types.js +0 -0
  93. package/dist/canvas/ui/forward-wheel.js +27 -0
  94. package/dist/canvas/ui/icons.js +133 -0
  95. package/dist/canvas/ui/place-panel.js +57 -0
  96. package/dist/canvas/ui/shortcut-tip.js +18 -0
  97. package/dist/canvas/ui/tools.js +411 -0
  98. package/dist/charts/dashboard/chart.js +1 -0
  99. package/dist/charts/dashboard/data-table.js +7 -0
  100. package/dist/charts/dashboard/index.js +13 -0
  101. package/dist/charts/dashboard/windows.js +5 -0
  102. package/dist/charts/edge-fade.js +7 -0
  103. package/dist/charts/hover-band.js +13 -0
  104. package/dist/charts/index.js +19 -0
  105. package/dist/charts/motion.js +15 -0
  106. package/dist/charts/primitives/chart-utils.js +22 -0
  107. package/dist/charts/primitives/index.js +4 -0
  108. package/dist/components/copy/clipboard.js +38 -0
  109. package/dist/components/copy/copied.svelte.js +26 -0
  110. package/dist/components/copy/index.js +3 -0
  111. package/dist/components/data-table/data-table.js +55 -0
  112. package/dist/components/data-table/index.js +7 -0
  113. package/dist/components/docs/index.js +3 -0
  114. package/dist/components/docs/scroll-spy.svelte.js +71 -0
  115. package/dist/components/field-row/index.js +1 -0
  116. package/dist/components/hold-to-confirm/index.js +1 -0
  117. package/dist/components/icon/index.js +1 -0
  118. package/dist/components/language-flag/index.js +1 -0
  119. package/dist/components/list-page/filter-section.js +4 -0
  120. package/dist/components/list-page/index.js +25 -0
  121. package/dist/components/list-page/list-table.js +5 -0
  122. package/dist/components/list-page/queue-rail.js +3 -0
  123. package/dist/components/list-page/section-host.js +8 -0
  124. package/dist/components/list-page/step.js +5 -0
  125. package/dist/components/list-page/types.js +0 -0
  126. package/dist/components/locale-switch/index.js +1 -0
  127. package/dist/components/mark/index.js +1 -0
  128. package/dist/components/open-in/index.js +1 -0
  129. package/dist/components/picker/index.js +3 -0
  130. package/dist/components/picker/trigger.js +33 -0
  131. package/dist/components/picker/types.js +0 -0
  132. package/dist/components/section-card/index.js +1 -0
  133. package/dist/components/section-header/index.js +2 -0
  134. package/dist/components/segmented/collapse.js +32 -0
  135. package/dist/components/segmented/index.js +8 -0
  136. package/dist/components/segmented/segmented.js +50 -0
  137. package/dist/components/star-rating-input/index.js +2 -0
  138. package/dist/components/svg/index.js +1 -0
  139. package/dist/components/table-view/index.js +1 -0
  140. package/dist/components/table-view/types.js +0 -0
  141. package/dist/components/tags-input/index.js +2 -0
  142. package/dist/components/tags-input/tags.js +90 -0
  143. package/dist/components/theme/index.js +3 -0
  144. package/dist/components/toolbar/index.js +3 -0
  145. package/dist/components/toolbar/toolbar-trigger.js +4 -0
  146. package/dist/editor/anchors.js +17 -0
  147. package/dist/editor/block-id.js +62 -0
  148. package/dist/editor/block-ops.js +105 -0
  149. package/dist/editor/doc-blocks.js +181 -0
  150. package/dist/editor/extensions.js +200 -0
  151. package/dist/editor/index.js +4 -0
  152. package/dist/editor/markdown-test-helpers.js +6 -0
  153. package/dist/editor/markdown.js +486 -0
  154. package/dist/editor/serializer.js +268 -0
  155. package/dist/editor/slash-items.js +104 -0
  156. package/dist/editor/youtube-url.js +27 -0
  157. package/dist/effects/animated-beam/index.js +1 -0
  158. package/dist/effects/animated-beam/path-calculator.svelte.js +42 -0
  159. package/dist/effects/animated-beam/types.js +0 -0
  160. package/dist/effects/border-beam/css.js +420 -0
  161. package/dist/effects/border-beam/presets.js +1792 -0
  162. package/dist/effects/border-beam/register-properties.js +39 -0
  163. package/dist/effects/border-beam/types.js +0 -0
  164. package/dist/effects/image-comparison/compare.js +4 -0
  165. package/dist/effects/image-reveal/index.js +1 -0
  166. package/dist/effects/image-reveal/types.js +0 -0
  167. package/dist/effects/magnetic/magnetic.js +54 -0
  168. package/dist/effects/reveal/index.js +4 -0
  169. package/dist/effects/reveal/observe.js +43 -0
  170. package/dist/effects/reveal/types.js +0 -0
  171. package/dist/effects/shader-gradient/color.js +34 -0
  172. package/dist/effects/shader-gradient/index.js +1 -0
  173. package/dist/effects/shader-gradient/renderer.js +320 -0
  174. package/dist/effects/shader-gradient/shaders.js +280 -0
  175. package/dist/effects/shader-gradient/types.js +0 -0
  176. package/dist/icons/apple-symbol-exports.js +126 -0
  177. package/dist/icons/sf-symbols.js +465 -0
  178. package/dist/icons/trades.js +34 -0
  179. package/dist/inbox/index.js +4 -0
  180. package/dist/inbox/logic.js +156 -0
  181. package/dist/inbox/types.js +46 -0
  182. package/dist/index.js +18 -0
  183. package/dist/lib/arrive.js +13 -0
  184. package/dist/lib/icon-types.js +0 -0
  185. package/dist/lib/initials.js +17 -0
  186. package/dist/lib/layout.js +1 -0
  187. package/dist/lib/panel.js +3 -0
  188. package/dist/lib/result.js +26 -0
  189. package/dist/lib/sliding-pill.js +45 -0
  190. package/dist/lib/theme-transition.js +53 -0
  191. package/dist/lib/tone.js +32 -0
  192. package/dist/lib/utils.js +5 -0
  193. package/dist/onboarding/define-tours.js +28 -0
  194. package/dist/onboarding/index.js +4 -0
  195. package/dist/onboarding/onboarding.svelte.js +15 -0
  196. package/dist/onboarding/pick.js +16 -0
  197. package/dist/onboarding/stores.js +50 -0
  198. package/dist/onboarding/types.js +1 -0
  199. package/dist/onboarding/wait.js +25 -0
  200. package/dist/panel/index.js +1 -0
  201. package/dist/panel/side-panel-types.js +0 -0
  202. package/dist/record/demo-data.js +512 -0
  203. package/dist/record/fields.js +148 -0
  204. package/dist/record/format.js +97 -0
  205. package/dist/record/gutter.js +1 -0
  206. package/dist/record/index.js +15 -0
  207. package/dist/record/kinds.js +110 -0
  208. package/dist/record/logic.js +255 -0
  209. package/dist/record/types.js +52 -0
  210. package/dist/shadcn/accordion/index.js +5 -0
  211. package/dist/shadcn/alert/index.js +5 -0
  212. package/dist/shadcn/alert-dialog/index.js +12 -0
  213. package/dist/shadcn/attachment/index.js +10 -0
  214. package/dist/shadcn/avatar/index.js +7 -0
  215. package/dist/shadcn/badge/index.js +2 -0
  216. package/dist/shadcn/breadcrumb/index.js +8 -0
  217. package/dist/shadcn/bubble/index.js +5 -0
  218. package/dist/shadcn/button/index.js +2 -0
  219. package/dist/shadcn/calendar/index.js +19 -0
  220. package/dist/shadcn/card/index.js +8 -0
  221. package/dist/shadcn/checkbox/index.js +2 -0
  222. package/dist/shadcn/code-block/index.js +9 -0
  223. package/dist/shadcn/collapsible/index.js +4 -0
  224. package/dist/shadcn/command/index.js +13 -0
  225. package/dist/shadcn/context-menu/index.js +17 -0
  226. package/dist/shadcn/dialog/index.js +11 -0
  227. package/dist/shadcn/dropdown-menu/index.js +19 -0
  228. package/dist/shadcn/dropdown-menu/menu-item.js +23 -0
  229. package/dist/shadcn/empty/index.js +7 -0
  230. package/dist/shadcn/field/index.js +12 -0
  231. package/dist/shadcn/hooks/highlighter.js +92 -0
  232. package/dist/shadcn/hooks/is-mobile.svelte.js +7 -0
  233. package/dist/shadcn/hooks/use-highlighted-code.svelte.js +65 -0
  234. package/dist/shadcn/hover-card/index.js +5 -0
  235. package/dist/shadcn/input/index.js +3 -0
  236. package/dist/shadcn/input-otp/index.js +5 -0
  237. package/dist/shadcn/kbd/index.js +3 -0
  238. package/dist/shadcn/label/index.js +2 -0
  239. package/dist/shadcn/marker/index.js +4 -0
  240. package/dist/shadcn/message/index.js +7 -0
  241. package/dist/shadcn/message-scroller/index.js +8 -0
  242. package/dist/shadcn/popover/index.js +9 -0
  243. package/dist/shadcn/progress/index.js +2 -0
  244. package/dist/shadcn/progress/tone.js +11 -0
  245. package/dist/shadcn/radio-group/index.js +3 -0
  246. package/dist/shadcn/scroll-area/index.js +3 -0
  247. package/dist/shadcn/select/index.js +12 -0
  248. package/dist/shadcn/separator/index.js +2 -0
  249. package/dist/shadcn/sheet/index.js +11 -0
  250. package/dist/shadcn/sidebar/constants.js +6 -0
  251. package/dist/shadcn/sidebar/context.svelte.js +38 -0
  252. package/dist/shadcn/sidebar/index.js +25 -0
  253. package/dist/shadcn/skeleton/index.js +2 -0
  254. package/dist/shadcn/slider/index.js +2 -0
  255. package/dist/shadcn/sonner/index.js +1 -0
  256. package/dist/shadcn/spinner/index.js +1 -0
  257. package/dist/shadcn/switch/index.js +2 -0
  258. package/dist/shadcn/table/index.js +9 -0
  259. package/dist/shadcn/tabs/index.js +5 -0
  260. package/dist/shadcn/textarea/index.js +2 -0
  261. package/dist/shadcn/toggle/index.js +3 -0
  262. package/dist/shadcn/toggle-group/index.js +3 -0
  263. package/dist/shadcn/tooltip/context.js +8 -0
  264. package/dist/shadcn/tooltip/index.js +6 -0
  265. package/dist/shadcn/trace/index.js +9 -0
  266. package/dist/slides/bridges.js +66 -0
  267. package/dist/slides/deck-controller.svelte.js +221 -0
  268. package/dist/slides/export/capture.js +81 -0
  269. package/dist/slides/export/ffmpeg.js +85 -0
  270. package/dist/slides/export/index.js +4 -0
  271. package/dist/slides/export/launch.js +8 -0
  272. package/dist/slides/export/pdf.js +78 -0
  273. package/dist/slides/export/types.js +0 -0
  274. package/dist/slides/index.js +7 -0
  275. package/dist/slides/labels.js +26 -0
  276. package/dist/slides/layout.js +47 -0
  277. package/dist/slides/model.js +9 -0
  278. package/dist/slides/navigation.js +89 -0
  279. package/dist/slides/types.js +6 -0
  280. package/dist/status/define-statuses.js +16 -0
  281. package/dist/status/index.js +4 -0
  282. package/dist/status/status-types.js +0 -0
  283. package/dist/test-setup.js +26 -0
  284. package/dist/thread/index.js +3 -0
  285. package/dist/thread/logic.js +94 -0
  286. package/dist/thread/types.js +23 -0
  287. package/dist/work/board-order.js +109 -0
  288. package/dist/work/dates.js +19 -0
  289. package/dist/work/detail/detail-types.js +20 -0
  290. package/dist/work/docs/edited.js +39 -0
  291. package/dist/work/docs/index.js +7 -0
  292. package/dist/work/docs/labels.js +38 -0
  293. package/dist/work/docs/menu.js +121 -0
  294. package/dist/work/docs/outline.js +39 -0
  295. package/dist/work/gantt/logic.js +260 -0
  296. package/dist/work/inbox/inbox-logic.js +94 -0
  297. package/dist/work/inbox/inbox-statuses.js +86 -0
  298. package/dist/work/inbox/inbox-types.js +0 -0
  299. package/dist/work/inbox/index.js +1 -0
  300. package/dist/work/index.js +21 -0
  301. package/dist/work/kanban-drag.js +25 -0
  302. package/dist/work/kanban-types.js +0 -0
  303. package/dist/work/presets/sales.js +35 -0
  304. package/dist/work/reorder.js +10 -0
  305. package/dist/work/task-types.js +0 -0
  306. package/dist/work/time/duration.js +60 -0
  307. package/dist/work/time/time-types.js +25 -0
  308. package/dist/work/use-kanban-dnd.svelte.js +128 -0
  309. package/package.json +45 -3
  310. package/src/components/toolbar/toolbar-trigger.ts +8 -2
  311. package/src/record/demo-data.ts +4 -4
  312. package/src/record/record-demo.svelte +2 -2
@@ -0,0 +1,97 @@
1
+ const DAY_ONLY = /^\d{4}-\d{2}-\d{2}$/;
2
+ function parse(iso) {
3
+ return DAY_ONLY.test(iso) ? {
4
+ date: new Date(`${iso}T00:00:00Z`),
5
+ timeZone: "UTC"
6
+ } : {
7
+ date: new Date(iso)
8
+ };
9
+ }
10
+ export function formatDay(iso, locale = "en-GB") {
11
+ const { date, timeZone } = parse(iso);
12
+ return new Intl.DateTimeFormat(locale, {
13
+ weekday: "short",
14
+ day: "numeric",
15
+ month: "short",
16
+ timeZone
17
+ }).format(date);
18
+ }
19
+ export function formatRange(start, end, locale = "en-GB") {
20
+ if (!end || end.slice(0, 10) === start.slice(0, 10)) return formatDay(start, locale);
21
+ const a = parse(start);
22
+ const b = parse(end);
23
+ const sameMonth = a.date.getUTCFullYear() === b.date.getUTCFullYear() && a.date.getUTCMonth() === b.date.getUTCMonth();
24
+ if (!sameMonth) return `${formatDay(start, locale)} to ${formatDay(end, locale)}`;
25
+ const part = (d)=>new Intl.DateTimeFormat(locale, {
26
+ weekday: "short",
27
+ day: "numeric",
28
+ timeZone: "UTC"
29
+ }).format(d);
30
+ const month = new Intl.DateTimeFormat(locale, {
31
+ month: "short",
32
+ timeZone: "UTC"
33
+ }).format(b.date);
34
+ return `${part(a.date)} to ${part(b.date)} ${month}`;
35
+ }
36
+ export function formatDayHeader(day, locale = "en-GB") {
37
+ return new Intl.DateTimeFormat(locale, {
38
+ weekday: "short",
39
+ day: "numeric",
40
+ month: "short",
41
+ year: "numeric",
42
+ timeZone: "UTC"
43
+ }).format(new Date(`${day}T00:00:00Z`));
44
+ }
45
+ export function formatTime(iso, locale = "en-GB", timeZone) {
46
+ return new Intl.DateTimeFormat(locale, {
47
+ hour: "2-digit",
48
+ minute: "2-digit",
49
+ timeZone
50
+ }).format(new Date(iso));
51
+ }
52
+ export function formatAge(iso, now = Date.now(), locale = "en-GB") {
53
+ const seconds = Math.round((new Date(iso).getTime() - new Date(now).getTime()) / 1000);
54
+ const abs = Math.abs(seconds);
55
+ const rtf = new Intl.RelativeTimeFormat(locale, {
56
+ numeric: "auto",
57
+ style: "long"
58
+ });
59
+ const units = [
60
+ [
61
+ 31_536_000,
62
+ "year"
63
+ ],
64
+ [
65
+ 2_592_000,
66
+ "month"
67
+ ],
68
+ [
69
+ 604_800,
70
+ "week"
71
+ ],
72
+ [
73
+ 86_400,
74
+ "day"
75
+ ],
76
+ [
77
+ 3_600,
78
+ "hour"
79
+ ],
80
+ [
81
+ 60,
82
+ "minute"
83
+ ]
84
+ ];
85
+ for (const [size, unit] of units){
86
+ if (abs >= size) return rtf.format(Math.round(seconds / size), unit);
87
+ }
88
+ return rtf.format(0, "second");
89
+ }
90
+ export function formatMoney(amount, currency = "EUR", locale = "en-GB", compact = false) {
91
+ return new Intl.NumberFormat(locale, {
92
+ style: "currency",
93
+ currency,
94
+ maximumFractionDigits: compact || Number.isInteger(amount) ? 0 : 2,
95
+ notation: compact ? "compact" : "standard"
96
+ }).format(amount);
97
+ }
@@ -0,0 +1 @@
1
+ export const gutterClass = "px-4 @3xl:px-6";
@@ -0,0 +1,15 @@
1
+ export { default as RecordShell } from "../../src/record/record-shell.svelte";
2
+ export { default as RecordHeader } from "../../src/record/record-header.svelte";
3
+ export { default as WhereWeAre } from "../../src/record/where-we-are.svelte";
4
+ export { default as NextUp } from "../../src/record/next-up.svelte";
5
+ export { default as RecordStats } from "../../src/record/record-stats.svelte";
6
+ export { default as StepsRail } from "../../src/record/steps-rail.svelte";
7
+ export { default as RecordTimeline } from "../../src/record/record-timeline.svelte";
8
+ export { default as ProjectList } from "../../src/record/project-list.svelte";
9
+ export { default as FieldSection } from "../../src/record/field-section.svelte";
10
+ export { default as InfoList } from "../../src/record/info-list.svelte";
11
+ export { DEFAULT_RECORD_FILTERS, DEFAULT_RECORD_KINDS } from "./kinds.js";
12
+ export { DEFAULT_RECORD_LABELS, resolveLabels } from "./types.js";
13
+ export { activeProjects, dayRelation, eventsForFilter, filterCounts, foldGroups, groupEventsByDay, groupSteps, latestWhereWeAre, localDay, mergeClientEvents, nextAcrossProjects, nudgeStep, reorderIds, rollupProjects, stepMarkers, stepProgress } from "./logic.js";
14
+ export { fieldRow, groupFields, isFieldVisible, parseSaved, pickableOptions } from "./fields.js";
15
+ export { formatAge, formatDay, formatMoney, formatRange } from "./format.js";
@@ -0,0 +1,110 @@
1
+ import { CheckCircle, ClipboardText, CurrencyCircleDollar, EnvelopeSimple, File, Flag, Gavel, NavigationArrow, NotePencil, Phone, Receipt, Signpost, UsersThree } from "phosphor-svelte";
2
+ export const DEFAULT_RECORD_KINDS = [
3
+ {
4
+ key: "call",
5
+ label: "Call",
6
+ icon: Phone
7
+ },
8
+ {
9
+ key: "meeting",
10
+ label: "Meeting",
11
+ icon: UsersThree
12
+ },
13
+ {
14
+ key: "email",
15
+ label: "Email",
16
+ icon: EnvelopeSimple
17
+ },
18
+ {
19
+ key: "form",
20
+ label: "Form",
21
+ icon: ClipboardText
22
+ },
23
+ {
24
+ key: "note",
25
+ label: "Note",
26
+ icon: NotePencil
27
+ },
28
+ {
29
+ key: "status",
30
+ label: "Where we are",
31
+ icon: NavigationArrow
32
+ },
33
+ {
34
+ key: "stage",
35
+ label: "Stage",
36
+ icon: Signpost
37
+ },
38
+ {
39
+ key: "task.done",
40
+ label: "Task done",
41
+ icon: CheckCircle,
42
+ tone: "success"
43
+ },
44
+ {
45
+ key: "milestone.done",
46
+ label: "Step done",
47
+ icon: Flag,
48
+ tone: "success"
49
+ },
50
+ {
51
+ key: "invoice.sent",
52
+ label: "Invoice",
53
+ icon: Receipt
54
+ },
55
+ {
56
+ key: "payment",
57
+ label: "Payment",
58
+ icon: CurrencyCircleDollar,
59
+ tone: "success"
60
+ },
61
+ {
62
+ key: "decision",
63
+ label: "Decision",
64
+ icon: Gavel
65
+ },
66
+ {
67
+ key: "file",
68
+ label: "File",
69
+ icon: File
70
+ }
71
+ ];
72
+ export const DEFAULT_RECORD_FILTERS = [
73
+ {
74
+ key: "calls",
75
+ label: "Calls",
76
+ kinds: [
77
+ "call",
78
+ "meeting"
79
+ ]
80
+ },
81
+ {
82
+ key: "notes",
83
+ label: "Notes",
84
+ kinds: [
85
+ "note"
86
+ ]
87
+ },
88
+ {
89
+ key: "money",
90
+ label: "Money",
91
+ kinds: [
92
+ "invoice.sent",
93
+ "payment"
94
+ ]
95
+ },
96
+ {
97
+ key: "stage",
98
+ label: "Stage",
99
+ kinds: [
100
+ "stage"
101
+ ]
102
+ },
103
+ {
104
+ key: "status",
105
+ label: "Status",
106
+ kinds: [
107
+ "status"
108
+ ]
109
+ }
110
+ ];
@@ -0,0 +1,255 @@
1
+ export function localDay(iso, timeZone) {
2
+ return new Intl.DateTimeFormat("en-CA", {
3
+ year: "numeric",
4
+ month: "2-digit",
5
+ day: "2-digit",
6
+ timeZone
7
+ }).format(new Date(iso));
8
+ }
9
+ export function groupEventsByDay(events, timeZone) {
10
+ const sorted = [
11
+ ...events
12
+ ].sort((a, b)=>new Date(b.occurredAt).getTime() - new Date(a.occurredAt).getTime());
13
+ const groups = [];
14
+ for (const event of sorted){
15
+ const day = localDay(event.occurredAt, timeZone);
16
+ const last = groups[groups.length - 1];
17
+ if (last && last.day === day) last.events.push(event);
18
+ else groups.push({
19
+ day,
20
+ events: [
21
+ event
22
+ ]
23
+ });
24
+ }
25
+ return groups;
26
+ }
27
+ export function dayRelation(day, today) {
28
+ if (day === today) return "today";
29
+ const gap = (Date.parse(`${today}T00:00:00Z`) - Date.parse(`${day}T00:00:00Z`)) / 86_400_000;
30
+ return gap === 1 ? "yesterday" : "date";
31
+ }
32
+ export function eventsForFilter(events, filterKey, filters) {
33
+ const filter = filters.find((f)=>f.key === filterKey);
34
+ if (!filter) return [
35
+ ...events
36
+ ];
37
+ const kinds = new Set(filter.kinds);
38
+ return events.filter((e)=>kinds.has(e.kind));
39
+ }
40
+ export function filterCounts(events, filters) {
41
+ const counts = {};
42
+ for (const filter of filters){
43
+ const kinds = new Set(filter.kinds);
44
+ counts[filter.key] = events.filter((e)=>kinds.has(e.kind)).length;
45
+ }
46
+ return counts;
47
+ }
48
+ export function foldGroups(groups, limit) {
49
+ const kept = [];
50
+ let used = 0;
51
+ let total = 0;
52
+ for (const group of groups)total += group.events.length;
53
+ for (const group of groups){
54
+ if (used >= limit) break;
55
+ const room = limit - used;
56
+ const events = group.events.slice(0, room);
57
+ kept.push({
58
+ day: group.day,
59
+ events
60
+ });
61
+ used += events.length;
62
+ }
63
+ return {
64
+ groups: kept,
65
+ hidden: total - used
66
+ };
67
+ }
68
+ export function mergeClientEvents(clientEvents, projects) {
69
+ const seen = new Set();
70
+ const merged = [];
71
+ const add = (event)=>{
72
+ if (seen.has(event.id)) return;
73
+ seen.add(event.id);
74
+ merged.push(event);
75
+ };
76
+ for (const project of projects){
77
+ for (const event of project.events){
78
+ add({
79
+ ...event,
80
+ projectId: project.id,
81
+ projectName: project.name,
82
+ projectHref: project.href ?? null
83
+ });
84
+ }
85
+ }
86
+ for (const event of clientEvents)add({
87
+ ...event,
88
+ projectId: null,
89
+ projectName: null,
90
+ projectHref: null
91
+ });
92
+ return merged.sort((a, b)=>new Date(b.occurredAt).getTime() - new Date(a.occurredAt).getTime());
93
+ }
94
+ const ACTIVE = new Set([
95
+ "open",
96
+ "proposal",
97
+ "ongoing"
98
+ ]);
99
+ export function activeProjects(projects, stages) {
100
+ const category = new Map(stages.map((s)=>[
101
+ s.key,
102
+ s.category
103
+ ]));
104
+ return projects.filter((p)=>{
105
+ if (p.closed) return false;
106
+ const c = category.get(p.stageKey);
107
+ return c === undefined || ACTIVE.has(c);
108
+ });
109
+ }
110
+ export function nextAcrossProjects(projects, stages) {
111
+ let best = null;
112
+ for (const project of activeProjects(projects, stages)){
113
+ const next = project.next;
114
+ if (!next) continue;
115
+ const candidate = {
116
+ ...next,
117
+ projectId: project.id,
118
+ projectName: project.name
119
+ };
120
+ if (!best) {
121
+ best = candidate;
122
+ continue;
123
+ }
124
+ if (!best.date && candidate.date) best = candidate;
125
+ else if (best.date && candidate.date && candidate.date < best.date) best = candidate;
126
+ }
127
+ return best;
128
+ }
129
+ export function latestWhereWeAre(projects) {
130
+ let best = null;
131
+ for (const project of projects){
132
+ const status = project.whereWeAre;
133
+ if (!status || !status.text) continue;
134
+ const at = status.at ? new Date(status.at).getTime() : 0;
135
+ const bestAt = best?.at ? new Date(best.at).getTime() : -1;
136
+ if (!best || at > bestAt) best = {
137
+ ...status,
138
+ projectId: project.id,
139
+ projectName: project.name
140
+ };
141
+ }
142
+ return best;
143
+ }
144
+ export function rollupProjects(projects, stages, fallbackCurrency = "EUR") {
145
+ const category = new Map(stages.map((s)=>[
146
+ s.key,
147
+ s.category
148
+ ]));
149
+ const totals = {};
150
+ let lastCallAt = null;
151
+ for (const project of projects){
152
+ const currency = project.currency ?? fallbackCurrency;
153
+ const bucket = totals[currency] ??= {
154
+ pipeline: 0,
155
+ won: 0,
156
+ paid: 0
157
+ };
158
+ const c = category.get(project.stageKey);
159
+ const value = project.value ?? 0;
160
+ if (c === "open" || c === "proposal") bucket.pipeline += value;
161
+ if (c === "ongoing" || c === "completed") bucket.won += value;
162
+ bucket.paid += project.paid ?? 0;
163
+ if (project.lastCallAt && (!lastCallAt || project.lastCallAt > lastCallAt)) lastCallAt = project.lastCallAt;
164
+ }
165
+ return {
166
+ count: projects.length,
167
+ activeCount: activeProjects(projects, stages).length,
168
+ totals,
169
+ lastCallAt
170
+ };
171
+ }
172
+ export function visibleSteps(steps) {
173
+ return steps.filter((s)=>!s.hidden);
174
+ }
175
+ export function stepProgress(steps) {
176
+ const visible = visibleSteps(steps);
177
+ return {
178
+ done: visible.filter((s)=>s.done).length,
179
+ total: visible.length
180
+ };
181
+ }
182
+ export function stepMarkers(steps, today) {
183
+ const visible = visibleSteps(steps);
184
+ const currentId = visible.find((s)=>!s.done)?.id ?? null;
185
+ const markers = new Map();
186
+ let beforeCurrent = currentId !== null;
187
+ for (const step of visible){
188
+ if (step.done) {
189
+ markers.set(step.id, "complete");
190
+ continue;
191
+ }
192
+ if (step.id === currentId) {
193
+ markers.set(step.id, "current");
194
+ beforeCurrent = false;
195
+ continue;
196
+ }
197
+ const due = (step.end ?? step.start)?.slice(0, 10);
198
+ const overdue = due !== undefined && due < today;
199
+ markers.set(step.id, beforeCurrent || overdue ? "late" : "pending");
200
+ }
201
+ return markers;
202
+ }
203
+ export function groupSteps(steps, groups = []) {
204
+ const known = new Set(groups.map((g)=>g.key));
205
+ const buckets = groups.map((g)=>({
206
+ key: g.key,
207
+ label: g.label,
208
+ steps: []
209
+ }));
210
+ const loose = {
211
+ key: "",
212
+ label: null,
213
+ steps: []
214
+ };
215
+ for (const step of steps){
216
+ const bucket = buckets.find((b)=>b.key === step.group);
217
+ (step.group && known.has(step.group) && bucket ? bucket : loose).steps.push(step);
218
+ }
219
+ const result = buckets.filter((b)=>b.steps.length > 0);
220
+ if (loose.steps.length > 0) result.push(loose);
221
+ return result;
222
+ }
223
+ export function reorderIds(ids, movedId, targetId, before) {
224
+ if (movedId === targetId) return [
225
+ ...ids
226
+ ];
227
+ const from = ids.indexOf(movedId);
228
+ if (from < 0 || !ids.includes(targetId)) return [
229
+ ...ids
230
+ ];
231
+ const next = [
232
+ ...ids
233
+ ];
234
+ next.splice(from, 1);
235
+ const at = next.indexOf(targetId);
236
+ next.splice(before ? at : at + 1, 0, movedId);
237
+ return next;
238
+ }
239
+ export function nudgeStep(steps, id, direction) {
240
+ const ids = steps.map((s)=>s.id);
241
+ const step = steps.find((s)=>s.id === id);
242
+ if (!step) return ids;
243
+ const mates = steps.filter((s)=>s.group === step.group && !s.hidden);
244
+ const at = mates.findIndex((s)=>s.id === id);
245
+ const neighbour = mates[at + direction];
246
+ if (!neighbour) return ids;
247
+ const a = ids.indexOf(id);
248
+ const b = ids.indexOf(neighbour.id);
249
+ const first = ids[a];
250
+ const second = ids[b];
251
+ if (first === undefined || second === undefined) return ids;
252
+ ids[a] = second;
253
+ ids[b] = first;
254
+ return ids;
255
+ }
@@ -0,0 +1,52 @@
1
+ export const DEFAULT_RECORD_LABELS = {
2
+ whereWeAre: "Where we are",
3
+ more: "More",
4
+ less: "Less",
5
+ next: "Next",
6
+ late: "Late",
7
+ steps: "Steps",
8
+ stepsCount: (done, total)=>`${done}/${total}`,
9
+ editSteps: "Choose visible steps",
10
+ rename: "Rename",
11
+ resetName: "Reset name",
12
+ hide: "Hide",
13
+ show: "Show",
14
+ moveUp: "Move up",
15
+ moveDown: "Move down",
16
+ shownCount: (shown, total)=>`${shown} of ${total} shown`,
17
+ openSteps: "Open steps",
18
+ activity: "Activity",
19
+ all: "All",
20
+ noEvents: "Nothing logged yet",
21
+ older: (count)=>`Show ${count} older`,
22
+ today: "Today",
23
+ yesterday: "Yesterday",
24
+ by: (name)=>`by ${name}`,
25
+ projects: "Projects",
26
+ projectCount: (count)=>count === 1 ? "1 project" : `${count} projects`,
27
+ noProjects: "No projects",
28
+ details: "Details",
29
+ edit: (field)=>`Edit ${field}`,
30
+ add: (field)=>`Add ${field.toLowerCase()}`,
31
+ save: "Save",
32
+ cancel: "Cancel",
33
+ search: "Search",
34
+ noMatch: "No match",
35
+ pipeline: "Pipeline",
36
+ won: "Won",
37
+ paid: "Paid",
38
+ lastCall: "Last call",
39
+ lastTouch: "Last touch",
40
+ noCall: "None yet",
41
+ open: "Open",
42
+ edited: "edited",
43
+ noSteps: "No steps yet",
44
+ saveFailed: "Couldn't save",
45
+ required: "Required"
46
+ };
47
+ export function resolveLabels(labels) {
48
+ return labels ? {
49
+ ...DEFAULT_RECORD_LABELS,
50
+ ...labels
51
+ } : DEFAULT_RECORD_LABELS;
52
+ }
@@ -0,0 +1,5 @@
1
+ import Root from "../../../src/shadcn/accordion/accordion.svelte";
2
+ import Content from "../../../src/shadcn/accordion/accordion-content.svelte";
3
+ import Item from "../../../src/shadcn/accordion/accordion-item.svelte";
4
+ import Trigger from "../../../src/shadcn/accordion/accordion-trigger.svelte";
5
+ export { Content, Content as AccordionContent, Item, Item as AccordionItem, Root, Root as Accordion, Trigger, Trigger as AccordionTrigger };
@@ -0,0 +1,5 @@
1
+ import Root from "../../../src/shadcn/alert/alert.svelte";
2
+ import Description from "../../../src/shadcn/alert/alert-description.svelte";
3
+ import Title from "../../../src/shadcn/alert/alert-title.svelte";
4
+ export { alertVariants } from "../../../src/shadcn/alert/alert.svelte";
5
+ export { Root, Description, Title, Root as Alert, Description as AlertDescription, Title as AlertTitle };
@@ -0,0 +1,12 @@
1
+ import Root from "../../../src/shadcn/alert-dialog/alert-dialog.svelte";
2
+ import Portal from "../../../src/shadcn/alert-dialog/alert-dialog-portal.svelte";
3
+ import Trigger from "../../../src/shadcn/alert-dialog/alert-dialog-trigger.svelte";
4
+ import Title from "../../../src/shadcn/alert-dialog/alert-dialog-title.svelte";
5
+ import Action from "../../../src/shadcn/alert-dialog/alert-dialog-action.svelte";
6
+ import Cancel from "../../../src/shadcn/alert-dialog/alert-dialog-cancel.svelte";
7
+ import Footer from "../../../src/shadcn/alert-dialog/alert-dialog-footer.svelte";
8
+ import Header from "../../../src/shadcn/alert-dialog/alert-dialog-header.svelte";
9
+ import Overlay from "../../../src/shadcn/alert-dialog/alert-dialog-overlay.svelte";
10
+ import Content from "../../../src/shadcn/alert-dialog/alert-dialog-content.svelte";
11
+ import Description from "../../../src/shadcn/alert-dialog/alert-dialog-description.svelte";
12
+ export { Root, Title, Action, Cancel, Portal, Footer, Header, Trigger, Overlay, Content, Description, Root as AlertDialog, Title as AlertDialogTitle, Action as AlertDialogAction, Cancel as AlertDialogCancel, Portal as AlertDialogPortal, Footer as AlertDialogFooter, Header as AlertDialogHeader, Trigger as AlertDialogTrigger, Overlay as AlertDialogOverlay, Content as AlertDialogContent, Description as AlertDialogDescription };
@@ -0,0 +1,10 @@
1
+ import Action from "../../../src/shadcn/attachment/attachment-action.svelte";
2
+ import Actions from "../../../src/shadcn/attachment/attachment-actions.svelte";
3
+ import Content from "../../../src/shadcn/attachment/attachment-content.svelte";
4
+ import Description from "../../../src/shadcn/attachment/attachment-description.svelte";
5
+ import Group from "../../../src/shadcn/attachment/attachment-group.svelte";
6
+ import Media from "../../../src/shadcn/attachment/attachment-media.svelte";
7
+ import Title from "../../../src/shadcn/attachment/attachment-title.svelte";
8
+ import Trigger from "../../../src/shadcn/attachment/attachment-trigger.svelte";
9
+ import Root, { attachmentVariants } from "../../../src/shadcn/attachment/attachment.svelte";
10
+ export { Root, Group, Media, Content, Title, Description, Actions, Action, Trigger, attachmentVariants, Root as Attachment, Group as AttachmentGroup, Media as AttachmentMedia, Content as AttachmentContent, Title as AttachmentTitle, Description as AttachmentDescription, Actions as AttachmentActions, Action as AttachmentAction, Trigger as AttachmentTrigger };
@@ -0,0 +1,7 @@
1
+ import Root from "../../../src/shadcn/avatar/avatar.svelte";
2
+ import Image from "../../../src/shadcn/avatar/avatar-image.svelte";
3
+ import Fallback from "../../../src/shadcn/avatar/avatar-fallback.svelte";
4
+ import Badge from "../../../src/shadcn/avatar/avatar-badge.svelte";
5
+ import Group from "../../../src/shadcn/avatar/avatar-group.svelte";
6
+ import GroupCount from "../../../src/shadcn/avatar/avatar-group-count.svelte";
7
+ export { Root, Image, Fallback, Badge, Group, GroupCount, Root as Avatar, Image as AvatarImage, Fallback as AvatarFallback, Badge as AvatarBadge, Group as AvatarGroup, GroupCount as AvatarGroupCount };
@@ -0,0 +1,2 @@
1
+ export { default as Badge } from "../../../src/shadcn/badge/badge.svelte";
2
+ export { badgeVariants } from "../../../src/shadcn/badge/badge.svelte";
@@ -0,0 +1,8 @@
1
+ import Root from "../../../src/shadcn/breadcrumb/breadcrumb.svelte";
2
+ import Ellipsis from "../../../src/shadcn/breadcrumb/breadcrumb-ellipsis.svelte";
3
+ import Item from "../../../src/shadcn/breadcrumb/breadcrumb-item.svelte";
4
+ import Separator from "../../../src/shadcn/breadcrumb/breadcrumb-separator.svelte";
5
+ import Link from "../../../src/shadcn/breadcrumb/breadcrumb-link.svelte";
6
+ import List from "../../../src/shadcn/breadcrumb/breadcrumb-list.svelte";
7
+ import Page from "../../../src/shadcn/breadcrumb/breadcrumb-page.svelte";
8
+ export { Root, Ellipsis, Item, Separator, Link, List, Page, Root as Breadcrumb, Ellipsis as BreadcrumbEllipsis, Item as BreadcrumbItem, Separator as BreadcrumbSeparator, Link as BreadcrumbLink, List as BreadcrumbList, Page as BreadcrumbPage };
@@ -0,0 +1,5 @@
1
+ import Content from "../../../src/shadcn/bubble/bubble-content.svelte";
2
+ import Group from "../../../src/shadcn/bubble/bubble-group.svelte";
3
+ import Reactions, { bubbleReactionsVariants } from "../../../src/shadcn/bubble/bubble-reactions.svelte";
4
+ import Root, { bubbleVariants } from "../../../src/shadcn/bubble/bubble.svelte";
5
+ export { Root, Group, Content, Reactions, bubbleVariants, bubbleReactionsVariants, Root as Bubble, Group as BubbleGroup, Content as BubbleContent, Reactions as BubbleReactions };
@@ -0,0 +1,2 @@
1
+ import Root, { buttonVariants } from "../../../src/shadcn/button/button.svelte";
2
+ export { Root, Root as Button, buttonVariants };
@@ -0,0 +1,19 @@
1
+ import Root from "../../../src/shadcn/calendar/calendar.svelte";
2
+ import Cell from "../../../src/shadcn/calendar/calendar-cell.svelte";
3
+ import Day from "../../../src/shadcn/calendar/calendar-day.svelte";
4
+ import Grid from "../../../src/shadcn/calendar/calendar-grid.svelte";
5
+ import Header from "../../../src/shadcn/calendar/calendar-header.svelte";
6
+ import Months from "../../../src/shadcn/calendar/calendar-months.svelte";
7
+ import GridRow from "../../../src/shadcn/calendar/calendar-grid-row.svelte";
8
+ import Heading from "../../../src/shadcn/calendar/calendar-heading.svelte";
9
+ import GridBody from "../../../src/shadcn/calendar/calendar-grid-body.svelte";
10
+ import GridHead from "../../../src/shadcn/calendar/calendar-grid-head.svelte";
11
+ import HeadCell from "../../../src/shadcn/calendar/calendar-head-cell.svelte";
12
+ import NextButton from "../../../src/shadcn/calendar/calendar-next-button.svelte";
13
+ import PrevButton from "../../../src/shadcn/calendar/calendar-prev-button.svelte";
14
+ import MonthSelect from "../../../src/shadcn/calendar/calendar-month-select.svelte";
15
+ import YearSelect from "../../../src/shadcn/calendar/calendar-year-select.svelte";
16
+ import Month from "../../../src/shadcn/calendar/calendar-month.svelte";
17
+ import Nav from "../../../src/shadcn/calendar/calendar-nav.svelte";
18
+ import Caption from "../../../src/shadcn/calendar/calendar-caption.svelte";
19
+ export { Day, Cell, Grid, Header, Months, GridRow, Heading, GridBody, GridHead, HeadCell, NextButton, PrevButton, Nav, Month, YearSelect, MonthSelect, Caption, Root as Calendar };
@@ -0,0 +1,8 @@
1
+ import Root from "../../../src/shadcn/card/card.svelte";
2
+ import Content from "../../../src/shadcn/card/card-content.svelte";
3
+ import Description from "../../../src/shadcn/card/card-description.svelte";
4
+ import Footer from "../../../src/shadcn/card/card-footer.svelte";
5
+ import Header from "../../../src/shadcn/card/card-header.svelte";
6
+ import Title from "../../../src/shadcn/card/card-title.svelte";
7
+ import Action from "../../../src/shadcn/card/card-action.svelte";
8
+ export { Root, Content, Description, Footer, Header, Title, Action, Root as Card, Content as CardContent, Description as CardDescription, Footer as CardFooter, Header as CardHeader, Title as CardTitle, Action as CardAction };
@@ -0,0 +1,2 @@
1
+ import Root from "../../../src/shadcn/checkbox/checkbox.svelte";
2
+ export { Root, Root as Checkbox };
@@ -0,0 +1,9 @@
1
+ import Actions from "../../../src/shadcn/code-block/code-block-actions.svelte";
2
+ import Content from "../../../src/shadcn/code-block/code-block-content.svelte";
3
+ import CopyButton from "../../../src/shadcn/code-block/code-block-copy-button.svelte";
4
+ import Footer from "../../../src/shadcn/code-block/code-block-footer.svelte";
5
+ import Header from "../../../src/shadcn/code-block/code-block-header.svelte";
6
+ import Title from "../../../src/shadcn/code-block/code-block-title.svelte";
7
+ import Line, { codeBlockLineVariants } from "../../../src/shadcn/code-block/code-block-line.svelte";
8
+ import Root, { codeBlockVariants } from "../../../src/shadcn/code-block/code-block.svelte";
9
+ export { Root, Header, Title, Actions, CopyButton, Content, Line, Footer, codeBlockVariants, codeBlockLineVariants, Root as CodeBlock, Header as CodeBlockHeader, Title as CodeBlockTitle, Actions as CodeBlockActions, CopyButton as CodeBlockCopyButton, Content as CodeBlockContent, Line as CodeBlockLine, Footer as CodeBlockFooter };
@@ -0,0 +1,4 @@
1
+ import Root from "../../../src/shadcn/collapsible/collapsible.svelte";
2
+ import Trigger from "../../../src/shadcn/collapsible/collapsible-trigger.svelte";
3
+ import Content from "../../../src/shadcn/collapsible/collapsible-content.svelte";
4
+ export { Root, Content, Trigger, Root as Collapsible, Content as CollapsibleContent, Trigger as CollapsibleTrigger };