diff --git a/packages/ui/package.json b/packages/ui/package.json index 4f5535d..af04bde 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,6 +1,6 @@ { "name": "@ewanc26/ui", - "version": "0.1.9", + "version": "0.2.0", "description": "Svelte UI component library extracted from ewancroft.uk — pluggable layout, UI primitives, stores, and SEO components.", "type": "module", "exports": { diff --git a/packages/ui/src/lib/components/layout/main/card/FeedCard.svelte b/packages/ui/src/lib/components/layout/main/card/FeedCard.svelte new file mode 100644 index 0000000..ce3f209 --- /dev/null +++ b/packages/ui/src/lib/components/layout/main/card/FeedCard.svelte @@ -0,0 +1,152 @@ + + +
+ {#if !items} + + + {#snippet skeleton()} +
+
+ {#each Array(3) as _} +
+
+
+
+
+
+
+
+ {/each} +
+ {/snippet} +
+ {:else if items.length > 0} + + {#snippet children()} +
+
+
+ {#each items as item, index (itemKey(item, index))} + + {#snippet children()} + +
+ {#if item.avatarUrl} + + {:else} + + {/if} +
+ + +
+

+ {item.title} +

+ {#if item.description} +

+ {item.description} +

+ {/if} + {#if item.timestamp} + + {/if} +
+ + +
+ {#if item.href} +
+ {/snippet} +
+ {/each} +
+ {/snippet} +
+ {:else} + + + {#snippet children()} +
+

{emptyMessage}

+
+ {/snippet} +
+ {/if} +
diff --git a/packages/ui/src/lib/components/layout/main/card/index.ts b/packages/ui/src/lib/components/layout/main/card/index.ts index ec74ec8..e6b7e3f 100644 --- a/packages/ui/src/lib/components/layout/main/card/index.ts +++ b/packages/ui/src/lib/components/layout/main/card/index.ts @@ -5,3 +5,5 @@ export { default as BlueskyPostCard } from './BlueskyPostCard.svelte'; export { default as TangledRepoCard } from './TangledRepoCard.svelte'; export { default as MusicStatusCard } from './MusicStatusCard.svelte'; export { default as KibunStatusCard } from './KibunStatusCard.svelte'; +export { default as FeedCard } from './FeedCard.svelte'; +export type { FeedItem } from './FeedCard.svelte'; diff --git a/packages/ui/src/lib/index.ts b/packages/ui/src/lib/index.ts index ef1d4cd..672e1cd 100644 --- a/packages/ui/src/lib/index.ts +++ b/packages/ui/src/lib/index.ts @@ -24,7 +24,8 @@ export { default as WolfToggle } from './components/layout/WolfToggle.svelte'; export { DynamicLinks, ScrollToTop, TangledRepos } from './components/layout/main/index.js'; // ─── Cards ──────────────────────────────────────────────────────────────────── -export { LinkCard, ProfileCard, PostCard, BlueskyPostCard, TangledRepoCard, MusicStatusCard, KibunStatusCard } from './components/layout/main/card/index.js'; +export { LinkCard, ProfileCard, PostCard, BlueskyPostCard, TangledRepoCard, MusicStatusCard, KibunStatusCard, FeedCard } from './components/layout/main/card/index.js'; +export type { FeedItem } from './components/layout/main/card/index.js'; // ─── SEO ────────────────────────────────────────────────────────────────────── export { MetaTags } from './components/seo/index.js';