@uptrademedia/site-kit 1.0.8 → 1.0.9

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.
@@ -71,34 +71,44 @@ async function BlogPost({
71
71
  showAuthor = true,
72
72
  basePath = "/blog",
73
73
  className,
74
+ styles = {},
75
+ unstyled = false,
74
76
  children
75
77
  }) {
78
+ const inlineStyle = (defaultStyle, classKey) => unstyled || styles[classKey] ? void 0 : defaultStyle;
76
79
  if (!apiKey) {
77
80
  console.warn("[Blog] No API key configured");
78
81
  return null;
79
82
  }
80
83
  const post = await fetchBlogPost(apiUrl, apiKey, slug);
81
84
  if (!post) {
82
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, style: { textAlign: "center", padding: 60 }, children: [
83
- /* @__PURE__ */ jsxRuntime.jsx("h1", { style: { fontSize: 24, marginBottom: 16 }, children: "Post Not Found" }),
84
- /* @__PURE__ */ jsxRuntime.jsx("p", { style: { color: "#6b7280" }, children: "The blog post you're looking for doesn't exist or has been removed." }),
85
- /* @__PURE__ */ jsxRuntime.jsx(
86
- "a",
87
- {
88
- href: basePath,
89
- style: {
90
- display: "inline-block",
91
- marginTop: 24,
92
- padding: "12px 24px",
93
- backgroundColor: "#3b82f6",
94
- color: "#fff",
95
- borderRadius: 8,
96
- textDecoration: "none"
97
- },
98
- children: "\u2190 Back to Blog"
99
- }
100
- )
101
- ] });
85
+ return /* @__PURE__ */ jsxRuntime.jsxs(
86
+ "div",
87
+ {
88
+ className: `${styles.notFound || ""} ${className || ""}`.trim() || void 0,
89
+ style: inlineStyle({ textAlign: "center", padding: 60 }, "notFound"),
90
+ children: [
91
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { style: inlineStyle({ fontSize: 24, marginBottom: 16 }, "notFound"), children: "Post Not Found" }),
92
+ /* @__PURE__ */ jsxRuntime.jsx("p", { style: inlineStyle({ color: "#6b7280" }, "notFound"), children: "The blog post you're looking for doesn't exist or has been removed." }),
93
+ /* @__PURE__ */ jsxRuntime.jsx(
94
+ "a",
95
+ {
96
+ href: basePath,
97
+ style: inlineStyle({
98
+ display: "inline-block",
99
+ marginTop: 24,
100
+ padding: "12px 24px",
101
+ backgroundColor: "#3b82f6",
102
+ color: "#fff",
103
+ borderRadius: 8,
104
+ textDecoration: "none"
105
+ }, "notFound"),
106
+ children: "\u2190 Back to Blog"
107
+ }
108
+ )
109
+ ]
110
+ }
111
+ );
102
112
  }
103
113
  const content = post.content_html || post.content || "";
104
114
  const tableOfContents = showToc ? generateTableOfContents(content) : [];
@@ -111,224 +121,356 @@ async function BlogPost({
111
121
  day: "numeric",
112
122
  year: "numeric"
113
123
  }) : null;
114
- return /* @__PURE__ */ jsxRuntime.jsxs("article", { className, children: [
115
- /* @__PURE__ */ jsxRuntime.jsxs("header", { style: { marginBottom: 32 }, children: [
116
- /* @__PURE__ */ jsxRuntime.jsxs("nav", { style: { marginBottom: 16, fontSize: 14, color: "#6b7280" }, children: [
117
- /* @__PURE__ */ jsxRuntime.jsx("a", { href: basePath, style: { color: "#3b82f6", textDecoration: "none" }, children: "Blog" }),
118
- post.category && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
119
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { margin: "0 8px" }, children: "/" }),
124
+ return /* @__PURE__ */ jsxRuntime.jsxs("article", { className: `${styles.article || ""} ${className || ""}`.trim() || void 0, children: [
125
+ /* @__PURE__ */ jsxRuntime.jsxs(
126
+ "header",
127
+ {
128
+ className: styles.header,
129
+ style: inlineStyle({ marginBottom: 32 }, "header"),
130
+ children: [
131
+ /* @__PURE__ */ jsxRuntime.jsxs(
132
+ "nav",
133
+ {
134
+ className: styles.breadcrumb,
135
+ style: inlineStyle({ marginBottom: 16, fontSize: 14, color: "#6b7280" }, "breadcrumb"),
136
+ children: [
137
+ /* @__PURE__ */ jsxRuntime.jsx(
138
+ "a",
139
+ {
140
+ href: basePath,
141
+ className: styles.breadcrumbLink,
142
+ style: inlineStyle({ color: "#3b82f6", textDecoration: "none" }, "breadcrumbLink"),
143
+ children: "Blog"
144
+ }
145
+ ),
146
+ post.category && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
147
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: inlineStyle({ margin: "0 8px" }, "breadcrumb"), children: "/" }),
148
+ /* @__PURE__ */ jsxRuntime.jsx(
149
+ "a",
150
+ {
151
+ href: `${basePath}?category=${post.category}`,
152
+ className: styles.breadcrumbLink,
153
+ style: inlineStyle({ color: "#3b82f6", textDecoration: "none" }, "breadcrumbLink"),
154
+ children: typeof post.category === "string" ? post.category : post.category?.name || "Uncategorized"
155
+ }
156
+ )
157
+ ] })
158
+ ]
159
+ }
160
+ ),
120
161
  /* @__PURE__ */ jsxRuntime.jsx(
121
- "a",
162
+ "h1",
122
163
  {
123
- href: `${basePath}?category=${post.category}`,
124
- style: { color: "#3b82f6", textDecoration: "none" },
125
- children: typeof post.category === "string" ? post.category : post.category?.name || "Uncategorized"
164
+ className: styles.title,
165
+ style: inlineStyle({ fontSize: 36, fontWeight: 700, lineHeight: 1.2, marginBottom: 16 }, "title"),
166
+ children: post.title
167
+ }
168
+ ),
169
+ post.subtitle && /* @__PURE__ */ jsxRuntime.jsx(
170
+ "p",
171
+ {
172
+ className: styles.subtitle,
173
+ style: inlineStyle({ fontSize: 20, color: "#6b7280", marginBottom: 16 }, "subtitle"),
174
+ children: post.subtitle
175
+ }
176
+ ),
177
+ /* @__PURE__ */ jsxRuntime.jsxs(
178
+ "div",
179
+ {
180
+ className: styles.meta,
181
+ style: inlineStyle({ display: "flex", alignItems: "center", gap: 16, flexWrap: "wrap" }, "meta"),
182
+ children: [
183
+ post.author && /* @__PURE__ */ jsxRuntime.jsxs(
184
+ "span",
185
+ {
186
+ className: styles.metaItem,
187
+ style: inlineStyle({ fontSize: 14, color: "#374151" }, "metaItem"),
188
+ children: [
189
+ "By ",
190
+ typeof post.author === "string" ? post.author : post.author.name
191
+ ]
192
+ }
193
+ ),
194
+ date && /* @__PURE__ */ jsxRuntime.jsx(
195
+ "span",
196
+ {
197
+ className: styles.metaItem,
198
+ style: inlineStyle({ fontSize: 14, color: "#6b7280" }, "metaItem"),
199
+ children: date
200
+ }
201
+ ),
202
+ post.reading_time_minutes && /* @__PURE__ */ jsxRuntime.jsxs(
203
+ "span",
204
+ {
205
+ className: styles.metaItem,
206
+ style: inlineStyle({ fontSize: 14, color: "#9ca3af" }, "metaItem"),
207
+ children: [
208
+ post.reading_time_minutes,
209
+ " min read"
210
+ ]
211
+ }
212
+ )
213
+ ]
126
214
  }
127
215
  )
128
- ] })
129
- ] }),
130
- /* @__PURE__ */ jsxRuntime.jsx("h1", { style: { fontSize: 36, fontWeight: 700, lineHeight: 1.2, marginBottom: 16 }, children: post.title }),
131
- post.subtitle && /* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize: 20, color: "#6b7280", marginBottom: 16 }, children: post.subtitle }),
132
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 16, flexWrap: "wrap" }, children: [
133
- post.author && /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontSize: 14, color: "#374151" }, children: [
134
- "By ",
135
- typeof post.author === "string" ? post.author : post.author.name
136
- ] }),
137
- date && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 14, color: "#6b7280" }, children: date }),
138
- post.reading_time_minutes && /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontSize: 14, color: "#9ca3af" }, children: [
139
- post.reading_time_minutes,
140
- " min read"
141
- ] })
142
- ] })
143
- ] }),
144
- post.featured_image && /* @__PURE__ */ jsxRuntime.jsx("figure", { style: { margin: "0 0 32px" }, children: /* @__PURE__ */ jsxRuntime.jsx(
145
- "img",
216
+ ]
217
+ }
218
+ ),
219
+ post.featured_image && /* @__PURE__ */ jsxRuntime.jsx(
220
+ "figure",
146
221
  {
147
- src: post.featured_image,
148
- alt: post.featured_image_alt || post.title,
149
- style: {
150
- width: "100%",
151
- maxHeight: 500,
152
- objectFit: "cover",
153
- borderRadius: 12
154
- }
222
+ className: styles.featuredImageWrapper,
223
+ style: inlineStyle({ margin: "0 0 32px" }, "featuredImageWrapper"),
224
+ children: /* @__PURE__ */ jsxRuntime.jsx(
225
+ "img",
226
+ {
227
+ src: post.featured_image,
228
+ alt: post.featured_image_alt || post.title,
229
+ className: styles.featuredImage,
230
+ style: inlineStyle({
231
+ width: "100%",
232
+ maxHeight: 500,
233
+ objectFit: "cover",
234
+ borderRadius: 12
235
+ }, "featuredImage")
236
+ }
237
+ )
155
238
  }
156
- ) }),
239
+ ),
157
240
  /* @__PURE__ */ jsxRuntime.jsxs(
158
241
  "div",
159
242
  {
160
- style: {
243
+ className: styles.contentLayout,
244
+ style: inlineStyle({
161
245
  display: showToc && tableOfContents.length > 0 ? "grid" : "block",
162
246
  gridTemplateColumns: showToc && tableOfContents.length > 0 ? "1fr 250px" : void 0,
163
247
  gap: 48
164
- },
248
+ }, "contentLayout"),
165
249
  children: [
166
250
  /* @__PURE__ */ jsxRuntime.jsx(
167
251
  "div",
168
252
  {
169
- className: "blog-content",
170
- style: {
253
+ className: `blog-content ${styles.content || ""}`.trim(),
254
+ style: inlineStyle({
171
255
  fontSize: 17,
172
256
  lineHeight: 1.8,
173
257
  color: "#374151"
174
- },
258
+ }, "content"),
175
259
  dangerouslySetInnerHTML: { __html: content }
176
260
  }
177
261
  ),
178
262
  showToc && tableOfContents.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
179
263
  "aside",
180
264
  {
181
- style: {
265
+ className: styles.tocSidebar,
266
+ style: inlineStyle({
182
267
  position: "sticky",
183
268
  top: 100,
184
269
  alignSelf: "start",
185
270
  padding: 20,
186
271
  backgroundColor: "#f9fafb",
187
272
  borderRadius: 12
188
- },
273
+ }, "tocSidebar"),
189
274
  children: [
190
275
  /* @__PURE__ */ jsxRuntime.jsx(
191
276
  "h4",
192
277
  {
193
- style: {
278
+ className: styles.tocTitle,
279
+ style: inlineStyle({
194
280
  margin: "0 0 12px",
195
281
  fontSize: 12,
196
282
  fontWeight: 600,
197
283
  textTransform: "uppercase",
198
284
  letterSpacing: "0.05em",
199
285
  color: "#6b7280"
200
- },
286
+ }, "tocTitle"),
201
287
  children: "On This Page"
202
288
  }
203
289
  ),
204
- /* @__PURE__ */ jsxRuntime.jsx("ul", { style: { listStyle: "none", margin: 0, padding: 0 }, children: tableOfContents.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
205
- "li",
290
+ /* @__PURE__ */ jsxRuntime.jsx(
291
+ "ul",
206
292
  {
207
- style: {
208
- paddingLeft: (item.level - 2) * 12,
209
- marginBottom: 8
210
- },
211
- children: /* @__PURE__ */ jsxRuntime.jsx(
212
- "a",
293
+ className: styles.tocList,
294
+ style: inlineStyle({ listStyle: "none", margin: 0, padding: 0 }, "tocList"),
295
+ children: tableOfContents.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
296
+ "li",
213
297
  {
214
- href: `#${item.id}`,
215
- style: {
216
- fontSize: 14,
217
- color: "#6b7280",
218
- textDecoration: "none"
219
- },
220
- children: item.text
221
- }
222
- )
223
- },
224
- item.id
225
- )) })
298
+ className: styles.tocItem,
299
+ style: inlineStyle({
300
+ paddingLeft: (item.level - 2) * 12,
301
+ marginBottom: 8
302
+ }, "tocItem"),
303
+ children: /* @__PURE__ */ jsxRuntime.jsx(
304
+ "a",
305
+ {
306
+ href: `#${item.id}`,
307
+ className: styles.tocLink,
308
+ style: inlineStyle({
309
+ fontSize: 14,
310
+ color: "#6b7280",
311
+ textDecoration: "none"
312
+ }, "tocLink"),
313
+ children: item.text
314
+ }
315
+ )
316
+ },
317
+ item.id
318
+ ))
319
+ }
320
+ )
226
321
  ]
227
322
  }
228
323
  )
229
324
  ]
230
325
  }
231
326
  ),
232
- post.tags && post.tags.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginTop: 32, display: "flex", gap: 8, flexWrap: "wrap" }, children: post.tags.map((tag, index) => {
233
- const tagName = typeof tag === "string" ? tag : tag?.name || "";
234
- return /* @__PURE__ */ jsxRuntime.jsxs(
235
- "a",
236
- {
237
- href: `${basePath}?tag=${tagName}`,
238
- style: {
239
- padding: "4px 12px",
240
- backgroundColor: "#f3f4f6",
241
- borderRadius: 9999,
242
- fontSize: 13,
243
- color: "#374151",
244
- textDecoration: "none"
245
- },
246
- children: [
247
- "#",
248
- tagName
249
- ]
250
- },
251
- `${tagName}-${index}`
252
- );
253
- }) }),
254
- (post.faq_items ?? post.faqItems) && Array.isArray(post.faq_items ?? post.faqItems) && (post.faq_items ?? post.faqItems).length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("section", { style: { marginTop: 48 }, children: [
255
- /* @__PURE__ */ jsxRuntime.jsx("h2", { style: { fontSize: 24, fontWeight: 600, marginBottom: 24 }, children: "Frequently Asked Questions" }),
256
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", flexDirection: "column", gap: 16 }, children: (post.faq_items ?? post.faqItems).map((faq, index) => /* @__PURE__ */ jsxRuntime.jsxs(
257
- "details",
258
- {
259
- style: {
260
- padding: 16,
261
- backgroundColor: "#f9fafb",
262
- borderRadius: 8
263
- },
264
- children: [
265
- /* @__PURE__ */ jsxRuntime.jsx(
266
- "summary",
267
- {
268
- style: {
269
- fontWeight: 500,
270
- cursor: "pointer",
271
- listStyle: "none"
272
- },
273
- children: faq.question
274
- }
275
- ),
276
- /* @__PURE__ */ jsxRuntime.jsx("p", { style: { marginTop: 12, color: "#6b7280" }, children: faq.answer })
277
- ]
278
- },
279
- index
280
- )) })
281
- ] }),
282
- showAuthor && post.author && typeof post.author === "object" && /* @__PURE__ */ jsxRuntime.jsx(AuthorSection, { author: normalizeAuthorForDisplay(post.author) }),
283
- showRelated && relatedPosts.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("section", { style: { marginTop: 48 }, children: [
284
- /* @__PURE__ */ jsxRuntime.jsx("h2", { style: { fontSize: 24, fontWeight: 600, marginBottom: 24 }, children: "Related Posts" }),
285
- /* @__PURE__ */ jsxRuntime.jsx(
286
- "div",
287
- {
288
- style: {
289
- display: "grid",
290
- gridTemplateColumns: "repeat(auto-fill, minmax(280px, 1fr))",
291
- gap: 24
292
- },
293
- children: relatedPosts.map((relatedPost) => /* @__PURE__ */ jsxRuntime.jsxs(
294
- "article",
327
+ post.tags && post.tags.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
328
+ "div",
329
+ {
330
+ className: styles.tags,
331
+ style: inlineStyle({ marginTop: 32, display: "flex", gap: 8, flexWrap: "wrap" }, "tags"),
332
+ children: post.tags.map((tag, index) => {
333
+ const tagName = typeof tag === "string" ? tag : tag?.name || "";
334
+ return /* @__PURE__ */ jsxRuntime.jsxs(
335
+ "a",
295
336
  {
296
- style: {
297
- backgroundColor: "#fff",
298
- borderRadius: 12,
299
- overflow: "hidden",
300
- boxShadow: "0 1px 3px rgba(0,0,0,0.1)"
301
- },
337
+ href: `${basePath}?tag=${tagName}`,
338
+ className: styles.tag,
339
+ style: inlineStyle({
340
+ padding: "4px 12px",
341
+ backgroundColor: "#f3f4f6",
342
+ borderRadius: 9999,
343
+ fontSize: 13,
344
+ color: "#374151",
345
+ textDecoration: "none"
346
+ }, "tag"),
347
+ children: [
348
+ "#",
349
+ tagName
350
+ ]
351
+ },
352
+ `${tagName}-${index}`
353
+ );
354
+ })
355
+ }
356
+ ),
357
+ (post.faq_items ?? post.faqItems) && Array.isArray(post.faq_items ?? post.faqItems) && (post.faq_items ?? post.faqItems).length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
358
+ "section",
359
+ {
360
+ className: styles.faqSection,
361
+ style: inlineStyle({ marginTop: 48 }, "faqSection"),
362
+ children: [
363
+ /* @__PURE__ */ jsxRuntime.jsx(
364
+ "h2",
365
+ {
366
+ className: styles.faqTitle,
367
+ style: inlineStyle({ fontSize: 24, fontWeight: 600, marginBottom: 24 }, "faqTitle"),
368
+ children: "Frequently Asked Questions"
369
+ }
370
+ ),
371
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: inlineStyle({ display: "flex", flexDirection: "column", gap: 16 }, "faqSection"), children: (post.faq_items ?? post.faqItems).map((faq, index) => /* @__PURE__ */ jsxRuntime.jsxs(
372
+ "details",
373
+ {
374
+ className: styles.faqItem,
375
+ style: inlineStyle({
376
+ padding: 16,
377
+ backgroundColor: "#f9fafb",
378
+ borderRadius: 8
379
+ }, "faqItem"),
302
380
  children: [
303
- relatedPost.featured_image && /* @__PURE__ */ jsxRuntime.jsx("a", { href: `${basePath}/${relatedPost.slug}`, children: /* @__PURE__ */ jsxRuntime.jsx(
304
- "img",
381
+ /* @__PURE__ */ jsxRuntime.jsx(
382
+ "summary",
305
383
  {
306
- src: relatedPost.featured_image,
307
- alt: relatedPost.title,
308
- style: { width: "100%", height: 150, objectFit: "cover" }
384
+ className: styles.faqQuestion,
385
+ style: inlineStyle({
386
+ fontWeight: 500,
387
+ cursor: "pointer",
388
+ listStyle: "none"
389
+ }, "faqQuestion"),
390
+ children: faq.question
309
391
  }
310
- ) }),
311
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { padding: 16 }, children: [
312
- /* @__PURE__ */ jsxRuntime.jsx("h3", { style: { fontSize: 16, fontWeight: 600, marginBottom: 8 }, children: /* @__PURE__ */ jsxRuntime.jsx(
313
- "a",
314
- {
315
- href: `${basePath}/${relatedPost.slug}`,
316
- style: { color: "inherit", textDecoration: "none" },
317
- children: relatedPost.title
318
- }
319
- ) }),
320
- relatedPost.excerpt && /* @__PURE__ */ jsxRuntime.jsxs("p", { style: { fontSize: 14, color: "#6b7280", margin: 0 }, children: [
321
- relatedPost.excerpt.slice(0, 100),
322
- "..."
323
- ] })
324
- ] })
392
+ ),
393
+ /* @__PURE__ */ jsxRuntime.jsx(
394
+ "p",
395
+ {
396
+ className: styles.faqAnswer,
397
+ style: inlineStyle({ marginTop: 12, color: "#6b7280" }, "faqAnswer"),
398
+ children: faq.answer
399
+ }
400
+ )
325
401
  ]
326
402
  },
327
- relatedPost.id
328
- ))
329
- }
330
- )
331
- ] })
403
+ index
404
+ )) })
405
+ ]
406
+ }
407
+ ),
408
+ showAuthor && post.author && typeof post.author === "object" && /* @__PURE__ */ jsxRuntime.jsx(AuthorSection, { author: normalizeAuthorForDisplay(post.author), className: styles.authorCard, unstyled }),
409
+ showRelated && relatedPosts.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
410
+ "section",
411
+ {
412
+ className: styles.relatedSection,
413
+ style: inlineStyle({ marginTop: 48 }, "relatedSection"),
414
+ children: [
415
+ /* @__PURE__ */ jsxRuntime.jsx(
416
+ "h2",
417
+ {
418
+ className: styles.relatedTitle,
419
+ style: inlineStyle({ fontSize: 24, fontWeight: 600, marginBottom: 24 }, "relatedTitle"),
420
+ children: "Related Posts"
421
+ }
422
+ ),
423
+ /* @__PURE__ */ jsxRuntime.jsx(
424
+ "div",
425
+ {
426
+ className: styles.relatedGrid,
427
+ style: inlineStyle({
428
+ display: "grid",
429
+ gridTemplateColumns: "repeat(auto-fill, minmax(280px, 1fr))",
430
+ gap: 24
431
+ }, "relatedGrid"),
432
+ children: relatedPosts.map((relatedPost) => /* @__PURE__ */ jsxRuntime.jsxs(
433
+ "article",
434
+ {
435
+ className: styles.relatedCard,
436
+ style: inlineStyle({
437
+ backgroundColor: "#fff",
438
+ borderRadius: 12,
439
+ overflow: "hidden",
440
+ boxShadow: "0 1px 3px rgba(0,0,0,0.1)"
441
+ }, "relatedCard"),
442
+ children: [
443
+ relatedPost.featured_image && /* @__PURE__ */ jsxRuntime.jsx("a", { href: `${basePath}/${relatedPost.slug}`, children: /* @__PURE__ */ jsxRuntime.jsx(
444
+ "img",
445
+ {
446
+ src: relatedPost.featured_image,
447
+ alt: relatedPost.title,
448
+ style: inlineStyle({ width: "100%", height: 150, objectFit: "cover" }, "relatedCard")
449
+ }
450
+ ) }),
451
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: inlineStyle({ padding: 16 }, "relatedCard"), children: [
452
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { style: inlineStyle({ fontSize: 16, fontWeight: 600, marginBottom: 8 }, "relatedCard"), children: /* @__PURE__ */ jsxRuntime.jsx(
453
+ "a",
454
+ {
455
+ href: `${basePath}/${relatedPost.slug}`,
456
+ style: inlineStyle({ color: "inherit", textDecoration: "none" }, "relatedCard"),
457
+ children: relatedPost.title
458
+ }
459
+ ) }),
460
+ relatedPost.excerpt && /* @__PURE__ */ jsxRuntime.jsxs("p", { style: inlineStyle({ fontSize: 14, color: "#6b7280", margin: 0 }, "relatedCard"), children: [
461
+ relatedPost.excerpt.slice(0, 100),
462
+ "..."
463
+ ] })
464
+ ] })
465
+ ]
466
+ },
467
+ relatedPost.id
468
+ ))
469
+ }
470
+ )
471
+ ]
472
+ }
473
+ )
332
474
  ] });
333
475
  }
334
476
  function normalizeAuthorForDisplay(author) {
@@ -352,12 +494,15 @@ function normalizeAuthorForDisplay(author) {
352
494
  };
353
495
  }
354
496
  function AuthorSection({
355
- author
497
+ author,
498
+ className,
499
+ unstyled = false
356
500
  }) {
357
501
  return /* @__PURE__ */ jsxRuntime.jsxs(
358
502
  "section",
359
503
  {
360
- style: {
504
+ className,
505
+ style: unstyled || className ? void 0 : {
361
506
  marginTop: 48,
362
507
  padding: 24,
363
508
  backgroundColor: "#f9fafb",
@@ -372,7 +517,7 @@ function AuthorSection({
372
517
  {
373
518
  src: author.avatar_url,
374
519
  alt: author.name,
375
- style: {
520
+ style: unstyled || className ? void 0 : {
376
521
  width: 80,
377
522
  height: 80,
378
523
  borderRadius: "50%",
@@ -381,17 +526,17 @@ function AuthorSection({
381
526
  }
382
527
  ),
383
528
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
384
- /* @__PURE__ */ jsxRuntime.jsx("h3", { style: { margin: "0 0 4px", fontSize: 18, fontWeight: 600 }, children: author.name }),
385
- "title" in author && author.title && /* @__PURE__ */ jsxRuntime.jsx("p", { style: { margin: "0 0 4px", fontSize: 14, color: "#6b7280" }, children: author.title }),
386
- author.bio && /* @__PURE__ */ jsxRuntime.jsx("p", { style: { margin: "0 0 12px", color: "#6b7280", fontSize: 14 }, children: author.bio }),
387
- author.social_links && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: 16 }, children: [
529
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { style: unstyled || className ? void 0 : { margin: "0 0 4px", fontSize: 18, fontWeight: 600 }, children: author.name }),
530
+ "title" in author && author.title && /* @__PURE__ */ jsxRuntime.jsx("p", { style: unstyled || className ? void 0 : { margin: "0 0 4px", fontSize: 14, color: "#6b7280" }, children: author.title }),
531
+ author.bio && /* @__PURE__ */ jsxRuntime.jsx("p", { style: unstyled || className ? void 0 : { margin: "0 0 12px", color: "#6b7280", fontSize: 14 }, children: author.bio }),
532
+ author.social_links && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: unstyled || className ? void 0 : { display: "flex", gap: 16 }, children: [
388
533
  author.social_links.twitter && /* @__PURE__ */ jsxRuntime.jsx(
389
534
  "a",
390
535
  {
391
536
  href: `https://twitter.com/${author.social_links.twitter}`,
392
537
  target: "_blank",
393
538
  rel: "noopener noreferrer",
394
- style: { color: "#3b82f6", fontSize: 14 },
539
+ style: unstyled || className ? void 0 : { color: "#3b82f6", fontSize: 14 },
395
540
  children: "Twitter"
396
541
  }
397
542
  ),
@@ -401,7 +546,7 @@ function AuthorSection({
401
546
  href: author.social_links.linkedin,
402
547
  target: "_blank",
403
548
  rel: "noopener noreferrer",
404
- style: { color: "#3b82f6", fontSize: 14 },
549
+ style: unstyled || className ? void 0 : { color: "#3b82f6", fontSize: 14 },
405
550
  children: "LinkedIn"
406
551
  }
407
552
  )
@@ -526,6 +671,8 @@ async function BlogList({
526
671
  showPagination = true,
527
672
  className,
528
673
  basePath = "/blog",
674
+ styles = {},
675
+ unstyled = false,
529
676
  renderPost,
530
677
  children
531
678
  }) {
@@ -533,6 +680,7 @@ async function BlogList({
533
680
  console.warn("[Blog] No API key configured");
534
681
  return null;
535
682
  }
683
+ const inlineStyle = (defaultStyle, classKey) => unstyled || styles[classKey] ? void 0 : defaultStyle;
536
684
  const [blogData, categories] = await Promise.all([
537
685
  fetchBlogList({
538
686
  apiUrl,
@@ -554,89 +702,116 @@ async function BlogList({
554
702
  }
555
703
  const { posts, pagination } = blogData;
556
704
  if (posts.length === 0) {
557
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className, style: { textAlign: "center", padding: 40 }, children: /* @__PURE__ */ jsxRuntime.jsx("p", { style: { color: "#6b7280" }, children: "No posts found." }) });
705
+ return /* @__PURE__ */ jsxRuntime.jsx(
706
+ "div",
707
+ {
708
+ className: `${styles.container || ""} ${styles.emptyState || ""} ${className || ""}`.trim() || void 0,
709
+ style: inlineStyle({ textAlign: "center", padding: 40 }, "emptyState"),
710
+ children: /* @__PURE__ */ jsxRuntime.jsx("p", { style: inlineStyle({ color: "#6b7280" }, "emptyState"), children: "No posts found." })
711
+ }
712
+ );
558
713
  }
559
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, children: [
560
- showCategoryFilter && categories.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("nav", { style: { marginBottom: 24, display: "flex", gap: 8, flexWrap: "wrap" }, children: [
561
- /* @__PURE__ */ jsxRuntime.jsx(
562
- "a",
563
- {
564
- href: basePath,
565
- style: {
566
- padding: "6px 12px",
567
- borderRadius: 9999,
568
- fontSize: 14,
569
- textDecoration: "none",
570
- backgroundColor: !category ? "#3b82f6" : "#f3f4f6",
571
- color: !category ? "#fff" : "#374151"
572
- },
573
- children: "All"
574
- }
575
- ),
576
- categories.map((cat) => /* @__PURE__ */ jsxRuntime.jsxs(
577
- "a",
578
- {
579
- href: `${basePath}?category=${cat.slug}`,
580
- style: {
581
- padding: "6px 12px",
582
- borderRadius: 9999,
583
- fontSize: 14,
584
- textDecoration: "none",
585
- backgroundColor: category === cat.slug ? "#3b82f6" : "#f3f4f6",
586
- color: category === cat.slug ? "#fff" : "#374151"
587
- },
588
- children: [
589
- cat.name,
590
- " (",
591
- cat.post_count,
592
- ")"
593
- ]
594
- },
595
- cat.slug
596
- ))
597
- ] }),
714
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${styles.container || ""} ${className || ""}`.trim() || void 0, children: [
715
+ showCategoryFilter && categories.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
716
+ "nav",
717
+ {
718
+ className: styles.categoryNav,
719
+ style: inlineStyle({ marginBottom: 24, display: "flex", gap: 8, flexWrap: "wrap" }, "categoryNav"),
720
+ children: [
721
+ /* @__PURE__ */ jsxRuntime.jsx(
722
+ "a",
723
+ {
724
+ href: basePath,
725
+ className: `${styles.categoryLink || ""} ${!category ? styles.categoryLinkActive || "" : styles.categoryLinkInactive || ""}`.trim() || void 0,
726
+ style: inlineStyle({
727
+ padding: "6px 12px",
728
+ borderRadius: 9999,
729
+ fontSize: 14,
730
+ textDecoration: "none",
731
+ backgroundColor: !category ? "#3b82f6" : "#f3f4f6",
732
+ color: !category ? "#fff" : "#374151"
733
+ }, "categoryLink"),
734
+ children: "All"
735
+ }
736
+ ),
737
+ categories.map((cat) => /* @__PURE__ */ jsxRuntime.jsxs(
738
+ "a",
739
+ {
740
+ href: `${basePath}?category=${cat.slug}`,
741
+ className: `${styles.categoryLink || ""} ${category === cat.slug ? styles.categoryLinkActive || "" : styles.categoryLinkInactive || ""}`.trim() || void 0,
742
+ style: inlineStyle({
743
+ padding: "6px 12px",
744
+ borderRadius: 9999,
745
+ fontSize: 14,
746
+ textDecoration: "none",
747
+ backgroundColor: category === cat.slug ? "#3b82f6" : "#f3f4f6",
748
+ color: category === cat.slug ? "#fff" : "#374151"
749
+ }, "categoryLink"),
750
+ children: [
751
+ cat.name,
752
+ " (",
753
+ cat.post_count,
754
+ ")"
755
+ ]
756
+ },
757
+ cat.slug
758
+ ))
759
+ ]
760
+ }
761
+ ),
598
762
  /* @__PURE__ */ jsxRuntime.jsx(
599
763
  "div",
600
764
  {
601
- style: {
765
+ className: styles.grid,
766
+ style: inlineStyle({
602
767
  display: "grid",
603
768
  gridTemplateColumns: "repeat(auto-fill, minmax(320px, 1fr))",
604
769
  gap: 24
605
- },
770
+ }, "grid"),
606
771
  children: posts.map(
607
- (post) => renderPost ? /* @__PURE__ */ jsxRuntime.jsx(React__default.default.Fragment, { children: renderPost(post) }, post.id) : /* @__PURE__ */ jsxRuntime.jsx(BlogPostCard, { post, basePath }, post.id)
772
+ (post) => renderPost ? /* @__PURE__ */ jsxRuntime.jsx(React__default.default.Fragment, { children: renderPost(post) }, post.id) : /* @__PURE__ */ jsxRuntime.jsx(BlogPostCard, { post, basePath, styles, unstyled }, post.id)
608
773
  )
609
774
  }
610
775
  ),
611
776
  showPagination && pagination.totalPages > 1 && /* @__PURE__ */ jsxRuntime.jsxs(
612
777
  "nav",
613
778
  {
614
- style: {
779
+ className: styles.pagination,
780
+ style: inlineStyle({
615
781
  marginTop: 40,
616
782
  display: "flex",
617
783
  justifyContent: "center",
618
784
  gap: 8
619
- },
785
+ }, "pagination"),
620
786
  children: [
621
787
  pagination.hasPrev && /* @__PURE__ */ jsxRuntime.jsx(
622
788
  "a",
623
789
  {
624
790
  href: buildPaginationUrl(basePath, page - 1, category),
625
- style: paginationLinkStyle,
791
+ className: styles.paginationLink,
792
+ style: inlineStyle(paginationLinkStyle, "paginationLink"),
626
793
  children: "\u2190 Previous"
627
794
  }
628
795
  ),
629
- /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { padding: "8px 16px", color: "#6b7280" }, children: [
630
- "Page ",
631
- pagination.page,
632
- " of ",
633
- pagination.totalPages
634
- ] }),
796
+ /* @__PURE__ */ jsxRuntime.jsxs(
797
+ "span",
798
+ {
799
+ className: styles.paginationInfo,
800
+ style: inlineStyle({ padding: "8px 16px", color: "#6b7280" }, "paginationInfo"),
801
+ children: [
802
+ "Page ",
803
+ pagination.page,
804
+ " of ",
805
+ pagination.totalPages
806
+ ]
807
+ }
808
+ ),
635
809
  pagination.hasNext && /* @__PURE__ */ jsxRuntime.jsx(
636
810
  "a",
637
811
  {
638
812
  href: buildPaginationUrl(basePath, page + 1, category),
639
- style: paginationLinkStyle,
813
+ className: styles.paginationLink,
814
+ style: inlineStyle(paginationLinkStyle, "paginationLink"),
640
815
  children: "Next \u2192"
641
816
  }
642
817
  )
@@ -645,89 +820,144 @@ async function BlogList({
645
820
  )
646
821
  ] });
647
822
  }
648
- function BlogPostCard({ post, basePath }) {
823
+ function BlogPostCard({ post, basePath, styles = {}, unstyled = false }) {
649
824
  const date = post.published_at ? new Date(post.published_at).toLocaleDateString("en-US", {
650
825
  month: "long",
651
826
  day: "numeric",
652
827
  year: "numeric"
653
828
  }) : null;
829
+ const inlineStyle = (defaultStyle, classKey) => unstyled || styles[classKey] ? void 0 : defaultStyle;
654
830
  return /* @__PURE__ */ jsxRuntime.jsxs(
655
831
  "article",
656
832
  {
657
- style: {
833
+ className: styles.card,
834
+ style: inlineStyle({
658
835
  backgroundColor: "#fff",
659
836
  borderRadius: 12,
660
837
  overflow: "hidden",
661
838
  boxShadow: "0 1px 3px rgba(0,0,0,0.1)",
662
839
  transition: "box-shadow 0.2s, transform 0.2s"
663
- },
840
+ }, "card"),
664
841
  children: [
665
- post.featured_image && /* @__PURE__ */ jsxRuntime.jsx("a", { href: `${basePath}/${post.slug}`, children: /* @__PURE__ */ jsxRuntime.jsx(
842
+ post.featured_image && /* @__PURE__ */ jsxRuntime.jsx("a", { href: `${basePath}/${post.slug}`, className: styles.cardImageWrapper, children: /* @__PURE__ */ jsxRuntime.jsx(
666
843
  "img",
667
844
  {
668
845
  src: post.featured_image,
669
846
  alt: post.featured_image_alt || post.title,
670
- style: {
847
+ className: styles.cardImage,
848
+ style: inlineStyle({
671
849
  width: "100%",
672
850
  height: 200,
673
851
  objectFit: "cover"
674
- }
852
+ }, "cardImage")
675
853
  }
676
854
  ) }),
677
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { padding: 20 }, children: [
678
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12, marginBottom: 12 }, children: [
679
- post.category && /* @__PURE__ */ jsxRuntime.jsx(
680
- "span",
681
- {
682
- style: {
683
- padding: "2px 8px",
684
- borderRadius: 4,
685
- fontSize: 12,
686
- fontWeight: 500,
687
- backgroundColor: "#eff6ff",
688
- color: "#3b82f6",
689
- textTransform: "uppercase"
690
- },
691
- children: typeof post.category === "string" ? post.category : post.category?.name || "Uncategorized"
692
- }
693
- ),
694
- date && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 13, color: "#6b7280" }, children: date })
695
- ] }),
696
- /* @__PURE__ */ jsxRuntime.jsx("h3", { style: { margin: "0 0 8px", fontSize: 18, fontWeight: 600, lineHeight: 1.4 }, children: /* @__PURE__ */ jsxRuntime.jsx(
697
- "a",
698
- {
699
- href: `${basePath}/${post.slug}`,
700
- style: { color: "inherit", textDecoration: "none" },
701
- children: post.title
702
- }
703
- ) }),
704
- post.excerpt && /* @__PURE__ */ jsxRuntime.jsx(
705
- "p",
706
- {
707
- style: {
708
- margin: "0 0 16px",
709
- fontSize: 14,
710
- color: "#6b7280",
711
- lineHeight: 1.6,
712
- display: "-webkit-box",
713
- WebkitLineClamp: 3,
714
- WebkitBoxOrient: "vertical",
715
- overflow: "hidden"
716
- },
717
- children: post.excerpt
718
- }
719
- ),
720
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
721
- post.author && /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontSize: 13, color: "#6b7280" }, children: [
722
- "By ",
723
- typeof post.author === "string" ? post.author : post.author.name
724
- ] }),
725
- post.reading_time_minutes && /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontSize: 13, color: "#9ca3af" }, children: [
726
- post.reading_time_minutes,
727
- " min read"
728
- ] })
729
- ] })
730
- ] })
855
+ /* @__PURE__ */ jsxRuntime.jsxs(
856
+ "div",
857
+ {
858
+ className: styles.cardBody,
859
+ style: inlineStyle({ padding: 20 }, "cardBody"),
860
+ children: [
861
+ /* @__PURE__ */ jsxRuntime.jsxs(
862
+ "div",
863
+ {
864
+ className: styles.cardMeta,
865
+ style: inlineStyle({ display: "flex", alignItems: "center", gap: 12, marginBottom: 12 }, "cardMeta"),
866
+ children: [
867
+ post.category && /* @__PURE__ */ jsxRuntime.jsx(
868
+ "span",
869
+ {
870
+ className: styles.cardCategory,
871
+ style: inlineStyle({
872
+ padding: "2px 8px",
873
+ borderRadius: 4,
874
+ fontSize: 12,
875
+ fontWeight: 500,
876
+ backgroundColor: "#eff6ff",
877
+ color: "#3b82f6",
878
+ textTransform: "uppercase"
879
+ }, "cardCategory"),
880
+ children: typeof post.category === "string" ? post.category : post.category?.name || "Uncategorized"
881
+ }
882
+ ),
883
+ date && /* @__PURE__ */ jsxRuntime.jsx(
884
+ "span",
885
+ {
886
+ className: styles.cardDate,
887
+ style: inlineStyle({ fontSize: 13, color: "#6b7280" }, "cardDate"),
888
+ children: date
889
+ }
890
+ )
891
+ ]
892
+ }
893
+ ),
894
+ /* @__PURE__ */ jsxRuntime.jsx(
895
+ "h3",
896
+ {
897
+ className: styles.cardTitle,
898
+ style: inlineStyle({ margin: "0 0 8px", fontSize: 18, fontWeight: 600, lineHeight: 1.4 }, "cardTitle"),
899
+ children: /* @__PURE__ */ jsxRuntime.jsx(
900
+ "a",
901
+ {
902
+ href: `${basePath}/${post.slug}`,
903
+ className: styles.cardTitleLink,
904
+ style: inlineStyle({ color: "inherit", textDecoration: "none" }, "cardTitleLink"),
905
+ children: post.title
906
+ }
907
+ )
908
+ }
909
+ ),
910
+ post.excerpt && /* @__PURE__ */ jsxRuntime.jsx(
911
+ "p",
912
+ {
913
+ className: styles.cardExcerpt,
914
+ style: inlineStyle({
915
+ margin: "0 0 16px",
916
+ fontSize: 14,
917
+ color: "#6b7280",
918
+ lineHeight: 1.6,
919
+ display: "-webkit-box",
920
+ WebkitLineClamp: 3,
921
+ WebkitBoxOrient: "vertical",
922
+ overflow: "hidden"
923
+ }, "cardExcerpt"),
924
+ children: post.excerpt
925
+ }
926
+ ),
927
+ /* @__PURE__ */ jsxRuntime.jsxs(
928
+ "div",
929
+ {
930
+ className: styles.cardFooter,
931
+ style: inlineStyle({ display: "flex", justifyContent: "space-between", alignItems: "center" }, "cardFooter"),
932
+ children: [
933
+ post.author && /* @__PURE__ */ jsxRuntime.jsxs(
934
+ "span",
935
+ {
936
+ className: styles.cardAuthor,
937
+ style: inlineStyle({ fontSize: 13, color: "#6b7280" }, "cardAuthor"),
938
+ children: [
939
+ "By ",
940
+ typeof post.author === "string" ? post.author : post.author.name
941
+ ]
942
+ }
943
+ ),
944
+ post.reading_time_minutes && /* @__PURE__ */ jsxRuntime.jsxs(
945
+ "span",
946
+ {
947
+ className: styles.cardReadingTime,
948
+ style: inlineStyle({ fontSize: 13, color: "#9ca3af" }, "cardReadingTime"),
949
+ children: [
950
+ post.reading_time_minutes,
951
+ " min read"
952
+ ]
953
+ }
954
+ )
955
+ ]
956
+ }
957
+ )
958
+ ]
959
+ }
960
+ )
731
961
  ]
732
962
  }
733
963
  );