astro-awesomeness 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cn-B2A3VjBM.js +3 -0
- package/dist/components/index.js +1 -1
- package/dist/{index-CrcndL2W.d.ts → index-iwkIePdz.d.ts} +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +2 -2
- package/dist/{lib-BqEjsOJx.js → lib-D7HdNeEs.js} +2 -2
- package/dist/{lib-BqEjsOJx.js.map → lib-D7HdNeEs.js.map} +1 -1
- package/package.json +9 -9
- package/src/astro/author-byline.astro +2 -1
- package/src/astro/author-card.astro +2 -1
- package/src/astro/code-block.astro +2 -1
- package/src/astro/footer.astro +2 -1
- package/src/astro/header.astro +2 -1
- package/src/astro/pagination.astro +2 -1
- package/src/astro/prose.astro +2 -1
- package/src/astro/table-of-contents.astro +3 -2
- package/src/astro/tag-list.astro +2 -1
- package/src/lib/cn.ts +1 -1
- package/dist/cn-DmzdyV07.js +0 -3
package/dist/components/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cn } from "
|
|
1
|
+
import { cn } from "cn";
|
|
2
2
|
//#region src/lib/category-label.d.ts
|
|
3
3
|
declare const categoryLabel: (name: string) => string;
|
|
4
4
|
//#endregion
|
|
@@ -54,4 +54,4 @@ declare namespace index_d_exports {
|
|
|
54
54
|
}
|
|
55
55
|
//#endregion
|
|
56
56
|
export { requireEnv as a, PostParams as c, getRelatedPosts as d, formatDate as f, slugify as i, PostUrlBuilder as l, cn as m, DEFAULT_TAG_BASE as n, readingTime as o, categoryLabel as p, tagUrl as r, PostLike as s, index_d_exports as t, createPostUrl as u };
|
|
57
|
-
//# sourceMappingURL=index-
|
|
57
|
+
//# sourceMappingURL=index-iwkIePdz.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Author, Post, Tag, t as index_d_exports } from "./content/index.js";
|
|
2
|
-
import { t as index_d_exports$1 } from "./index-
|
|
2
|
+
import { t as index_d_exports$1 } from "./index-iwkIePdz.js";
|
|
3
3
|
export { type Author, type Post, type Tag, index_d_exports as content, index_d_exports$1 as lib };
|
package/dist/index.js
CHANGED
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as requireEnv, c as PostParams, d as getRelatedPosts, f as formatDate, i as slugify, l as PostUrlBuilder, m as cn, n as DEFAULT_TAG_BASE, o as readingTime, p as categoryLabel, r as tagUrl, s as PostLike, u as createPostUrl } from "../index-
|
|
1
|
+
import { a as requireEnv, c as PostParams, d as getRelatedPosts, f as formatDate, i as slugify, l as PostUrlBuilder, m as cn, n as DEFAULT_TAG_BASE, o as readingTime, p as categoryLabel, r as tagUrl, s as PostLike, u as createPostUrl } from "../index-iwkIePdz.js";
|
|
2
2
|
export { DEFAULT_TAG_BASE, type PostLike, type PostParams, type PostUrlBuilder, categoryLabel, cn, createPostUrl, formatDate, getRelatedPosts, readingTime, requireEnv, slugify, tagUrl };
|
package/dist/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as cn } from "../cn-
|
|
2
|
-
import { a as readingTime, c as getRelatedPosts, i as requireEnv, l as formatDate, n as DEFAULT_TAG_BASE, o as createPostUrl, r as tagUrl, s as slugify, u as categoryLabel } from "../lib-
|
|
1
|
+
import { t as cn } from "../cn-B2A3VjBM.js";
|
|
2
|
+
import { a as readingTime, c as getRelatedPosts, i as requireEnv, l as formatDate, n as DEFAULT_TAG_BASE, o as createPostUrl, r as tagUrl, s as slugify, u as categoryLabel } from "../lib-D7HdNeEs.js";
|
|
3
3
|
|
|
4
4
|
export { DEFAULT_TAG_BASE, categoryLabel, cn, createPostUrl, formatDate, getRelatedPosts, readingTime, requireEnv, slugify, tagUrl };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-w6R9maHv.js";
|
|
2
|
-
import { t as cn } from "./cn-
|
|
2
|
+
import { t as cn } from "./cn-B2A3VjBM.js";
|
|
3
3
|
|
|
4
4
|
//#region src/lib/category-label.ts
|
|
5
5
|
const NAMED_ENTITIES = {
|
|
@@ -151,4 +151,4 @@ var lib_exports = /* @__PURE__ */ __exportAll({
|
|
|
151
151
|
|
|
152
152
|
//#endregion
|
|
153
153
|
export { readingTime as a, getRelatedPosts as c, requireEnv as i, formatDate as l, DEFAULT_TAG_BASE as n, createPostUrl as o, tagUrl as r, slugify as s, lib_exports as t, categoryLabel as u };
|
|
154
|
-
//# sourceMappingURL=lib-
|
|
154
|
+
//# sourceMappingURL=lib-D7HdNeEs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib-
|
|
1
|
+
{"version":3,"file":"lib-D7HdNeEs.js","names":[],"sources":["../src/lib/category-label.ts","../src/lib/format-date.ts","../src/lib/get-related-posts.ts","../src/lib/slugify.ts","../src/lib/post-url.ts","../src/lib/reading-time.ts","../src/lib/require-env.ts","../src/lib/tag-url.ts","../src/lib/index.ts"],"sourcesContent":["const NAMED_ENTITIES = {\n amp: \"&\",\n apos: \"'\",\n gt: \">\",\n hellip: \"\\u2026\",\n ldquo: \"\\u201c\",\n lsquo: \"\\u2018\",\n lt: \"<\",\n nbsp: \"\\u00a0\",\n ndash: \"\\u2013\",\n quot: '\"',\n rdquo: \"\\u201d\",\n rsquo: \"\\u2019\",\n} as const;\n\nconst MAX_CODE_POINT = 1_114_111;\nconst EM_DASH = 8212;\nconst HEX_RADIX = 16;\nconst ENTITY_PATTERN = /&(?:#(?<decimal>\\d+)|#x(?<hex>[\\dA-F]+)|(?<named>[A-Z]+));/giv;\n\nconst isNamedEntity = (key: string): key is keyof typeof NAMED_ENTITIES =>\n Object.hasOwn(NAMED_ENTITIES, key);\n\nconst fromCodePoint = (codePoint: number, entity: string): string =>\n Number.isInteger(codePoint) && codePoint <= MAX_CODE_POINT && codePoint !== EM_DASH\n ? String.fromCodePoint(codePoint)\n : entity;\n\nconst decodeEntity = (entity: string, decimal?: string, hex?: string, named?: string): string => {\n if (decimal !== undefined) {\n return fromCodePoint(Number(decimal), entity);\n }\n if (hex !== undefined) {\n return fromCodePoint(Number.parseInt(hex, HEX_RADIX), entity);\n }\n if (named === undefined) {\n return entity;\n }\n const key = named.toLowerCase();\n if (!isNamedEntity(key)) {\n return entity;\n }\n return NAMED_ENTITIES[key];\n};\n\nconst categoryLabel = (name: string): string => name.replaceAll(ENTITY_PATTERN, decodeEntity);\n\nexport { categoryLabel };\n","const defaultOptions: Intl.DateTimeFormatOptions = {\n day: \"numeric\",\n month: \"long\",\n timeZone: \"UTC\",\n year: \"numeric\",\n};\n\nconst formatterCache = new Map<string, Intl.DateTimeFormat>();\n\nconst getFormatter = (key: string, locale: string, options: Intl.DateTimeFormatOptions) => {\n let formatter = formatterCache.get(key);\n if (!formatter) {\n formatter = new Intl.DateTimeFormat(locale, options);\n formatterCache.set(key, formatter);\n }\n return formatter;\n};\n\nconst formatDate = (date: Date, locale: string = \"en-US\", options?: Intl.DateTimeFormatOptions) => {\n if (!options) {\n return getFormatter(locale, locale, defaultOptions).format(date);\n }\n const merged = { ...defaultOptions, ...options };\n return getFormatter(`${locale}:${JSON.stringify(merged)}`, locale, merged).format(date);\n};\n\nexport { formatDate };\n","type HasTags = { data: { tags: Array<string> }; id: string };\n\nconst getRelatedPosts = <T extends HasTags>(current: T, all: Array<T>, n: number) => {\n const currentTagSet = new Set(current.data.tags);\n const scored: Array<{ post: T; score: number }> = [];\n\n for (const post of all) {\n if (post.id === current.id) {\n continue;\n }\n let score = 0;\n for (const tag of post.data.tags) {\n if (currentTagSet.has(tag)) {\n score++;\n }\n }\n scored.push({ post, score });\n }\n\n return scored\n .toSorted((x, y) => y.score - x.score)\n .slice(0, n)\n .map(({ post }) => post);\n};\n\nexport { getRelatedPosts };\n","const slugify = (input: string) =>\n input\n .normalize(\"NFD\")\n .replaceAll(/[̀-ͯ]/gv, \"\")\n .toLowerCase()\n .replaceAll(/[^a-z0-9\\s\\-]/gv, \"\")\n .trim()\n .replaceAll(/[\\s\\-]+/gv, \"-\")\n .replaceAll(/^-+|-+$/gv, \"\");\n\nexport { slugify };\n","import { slugify } from \"./slugify\";\n\ntype PostLike = {\n data: {\n categories?: Array<string>;\n seo?: { canonical_url?: string };\n };\n id: string;\n};\n\ntype PostParams = { category: string; slug: string };\n\ntype PostUrlBuilder = {\n postParams: (post: PostLike) => PostParams;\n postUrl: (post: PostLike) => string;\n};\n\nconst createPostUrl = (\n categorySlugMap: Record<string, string>,\n defaultCategory: string,\n): PostUrlBuilder => {\n const postParams = (post: PostLike): PostParams => {\n const canonical = post.data.seo?.canonical_url;\n if (canonical !== undefined && canonical !== \"\") {\n try {\n const segments = new URL(canonical).pathname.split(\"/\").filter(Boolean);\n const category = segments.at(-2);\n const slug = segments.at(-1);\n if (category !== undefined && slug !== undefined) {\n return { category, slug };\n }\n } catch {\n // Malformed canonical_url; fall through to category-derived logic.\n }\n }\n const first = post.data.categories?.at(0);\n const category =\n first !== undefined && first !== \"\"\n ? (categorySlugMap[first] ?? slugify(first))\n : defaultCategory;\n return { category, slug: post.id };\n };\n\n const postUrl = (post: PostLike): string => {\n const { category, slug } = postParams(post);\n return `/${category}/${slug}/`;\n };\n\n return { postParams, postUrl };\n};\n\nexport type { PostLike, PostParams, PostUrlBuilder };\nexport { createPostUrl };\n","const WORDS_PER_MINUTE = 200;\n\nconst readingTime = (input: string) => {\n const stripped = input\n .replaceAll(/<[^>]*>/gv, \"\")\n .replaceAll(/[#*_`>\\-]/gv, \" \")\n .replaceAll(/\\s+/gv, \" \")\n .trim();\n const words = stripped.length === 0 ? 0 : stripped.split(\" \").length;\n const minutes = Math.max(1, Math.ceil(words / WORDS_PER_MINUTE));\n return { minutes, words };\n};\n\nexport { readingTime };\n","const requireEnv = (name: string): string => {\n const value = process.env[name];\n if (value === undefined || value === \"\") {\n throw new Error(`Missing required env var: ${name}`);\n }\n return value;\n};\n\nexport { requireEnv };\n","import { slugify } from \"./slugify\";\n\nconst DEFAULT_TAG_BASE = \"/tag\";\n\nconst tagUrl = (tag: string, base: string = DEFAULT_TAG_BASE): string =>\n `${base.replace(/\\/+$/v, \"\")}/${slugify(tag)}/`;\n\nexport { DEFAULT_TAG_BASE, tagUrl };\n","export { cn } from \"./cn\";\nexport { categoryLabel } from \"./category-label\";\nexport { formatDate } from \"./format-date\";\nexport { getRelatedPosts } from \"./get-related-posts\";\nexport type { PostLike, PostParams, PostUrlBuilder } from \"./post-url\";\nexport { createPostUrl } from \"./post-url\";\nexport { readingTime } from \"./reading-time\";\nexport { requireEnv } from \"./require-env\";\nexport { slugify } from \"./slugify\";\nexport { DEFAULT_TAG_BASE, tagUrl } from \"./tag-url\";\n"],"mappings":";;;;AAAA,MAAM,iBAAiB;CACrB,KAAK;CACL,MAAM;CACN,IAAI;CACJ,QAAQ;CACR,OAAO;CACP,OAAO;CACP,IAAI;CACJ,MAAM;CACN,OAAO;CACP,MAAM;CACN,OAAO;CACP,OAAO;AACT;AAEA,MAAM,iBAAiB;AACvB,MAAM,UAAU;AAChB,MAAM,YAAY;AAClB,MAAM,iBAAiB,gFAA8D;AAErF,MAAM,iBAAiB,QACrB,OAAO,OAAO,gBAAgB,GAAG;AAEnC,MAAM,iBAAiB,WAAmB,WACxC,OAAO,UAAU,SAAS,KAAK,aAAa,kBAAkB,cAAc,UACxE,OAAO,cAAc,SAAS,IAC9B;AAEN,MAAM,gBAAgB,QAAgB,SAAkB,KAAc,UAA2B;CAC/F,IAAI,YAAY,QACd,OAAO,cAAc,OAAO,OAAO,GAAG,MAAM;CAE9C,IAAI,QAAQ,QACV,OAAO,cAAc,OAAO,SAAS,KAAK,SAAS,GAAG,MAAM;CAE9D,IAAI,UAAU,QACZ,OAAO;CAET,MAAM,MAAM,MAAM,YAAY;CAC9B,IAAI,CAAC,cAAc,GAAG,GACpB,OAAO;CAET,OAA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,QAAQ,IAAI;CAC1B,IAAI,UAAU,UAAa,UAAU,IACnC,MAAM,IAAI,MAAM,6BAA6B,MAAM;CAErD,OAAO;AACT;;;;ACJA,MAAM,mBAAmB;AAEzB,MAAM,UAAU,KAAa,OAAe,qBAC1C,GAAG,KAAK,QAAQ,uBAAM,GAAG,EAAE,EAAE,GAAG,QAAQ,GAAG,EAAE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro-awesomeness",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Astro 6/7 blog theme with shadcn primitives and a Tailwind v4 preset.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"astro",
|
|
@@ -54,22 +54,22 @@
|
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@base-ui/react": "^1.6.0",
|
|
56
56
|
"class-variance-authority": "^0.7.1",
|
|
57
|
-
"
|
|
58
|
-
"lucide-react": "^1.
|
|
57
|
+
"cn": "^0.2.4",
|
|
58
|
+
"lucide-react": "^1.34.0",
|
|
59
59
|
"tw-animate-css": "^1.4.0",
|
|
60
60
|
"zod": "^4.4.3"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@tailwindcss/postcss": "^4.3.2",
|
|
64
|
-
"@types/node": "^26.
|
|
64
|
+
"@types/node": "^26.4.0",
|
|
65
65
|
"@types/react": "^19.2.17",
|
|
66
|
-
"@types/react-dom": "^19.2.
|
|
67
|
-
"@vitest/coverage-v8": "^4.1.
|
|
66
|
+
"@types/react-dom": "^19.2.5",
|
|
67
|
+
"@vitest/coverage-v8": "^4.1.11",
|
|
68
68
|
"tailwindcss": "^4.3.2",
|
|
69
69
|
"typescript": "^7.0.2",
|
|
70
|
-
"vitest": "^4.1.
|
|
71
|
-
"@repo/
|
|
72
|
-
"@repo/config
|
|
70
|
+
"vitest": "^4.1.11",
|
|
71
|
+
"@repo/config-vitest": "0.0.0",
|
|
72
|
+
"@repo/typescript-config": "0.0.0"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
75
|
"astro": "^6.0.0 || ^7.0.0",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { Author } from "../content";
|
|
3
|
+
import { cn } from "../lib/cn";
|
|
3
4
|
|
|
4
5
|
type Props = {
|
|
5
6
|
author: Author;
|
|
@@ -8,7 +9,7 @@ type Props = {
|
|
|
8
9
|
|
|
9
10
|
const { author, class: className = "" } = Astro.props;
|
|
10
11
|
---
|
|
11
|
-
<div class
|
|
12
|
+
<div class={cn("flex items-center gap-2", className)}>
|
|
12
13
|
{author.photoUrl && (
|
|
13
14
|
<img
|
|
14
15
|
src={author.photoUrl}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { Author } from "../content";
|
|
3
|
+
import { cn } from "../lib/cn";
|
|
3
4
|
|
|
4
5
|
type Props = {
|
|
5
6
|
author: Author;
|
|
@@ -8,7 +9,7 @@ type Props = {
|
|
|
8
9
|
|
|
9
10
|
const { author, class: className = "" } = Astro.props;
|
|
10
11
|
---
|
|
11
|
-
<aside class
|
|
12
|
+
<aside class={cn("border-border bg-muted/50 flex gap-4 rounded-lg border p-4", className)}>
|
|
12
13
|
{author.photoUrl && (
|
|
13
14
|
<img
|
|
14
15
|
src={author.photoUrl}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { Code } from "astro:components";
|
|
3
|
+
import { cn } from "../lib/cn";
|
|
3
4
|
|
|
4
5
|
type Props = {
|
|
5
6
|
code: string;
|
|
@@ -9,6 +10,6 @@ type Props = {
|
|
|
9
10
|
|
|
10
11
|
const { code, lang = "ts", class: className = "" } = Astro.props;
|
|
11
12
|
---
|
|
12
|
-
<div class
|
|
13
|
+
<div class={cn("bg-muted border-border overflow-hidden rounded-md border", className)}>
|
|
13
14
|
<Code code={code} lang={lang} theme="github-dark" />
|
|
14
15
|
</div>
|
package/src/astro/footer.astro
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
import { cn } from "../lib/cn";
|
|
2
3
|
type Props = {
|
|
3
4
|
siteTitle: string;
|
|
4
5
|
class?: string;
|
|
@@ -7,7 +8,7 @@ type Props = {
|
|
|
7
8
|
const { siteTitle, class: className = "" } = Astro.props;
|
|
8
9
|
const year = new Date().getFullYear();
|
|
9
10
|
---
|
|
10
|
-
<footer class
|
|
11
|
+
<footer class={cn("border-border text-muted-foreground mt-16 border-t py-6 text-sm", className)}>
|
|
11
12
|
<div class="mx-auto flex max-w-5xl flex-col items-center justify-between gap-2 px-5 sm:flex-row sm:px-8">
|
|
12
13
|
<p>© {year} {siteTitle}</p>
|
|
13
14
|
<slot name="links" />
|
package/src/astro/header.astro
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { ThemeToggle } from "../components/theme-toggle";
|
|
3
|
+
import { cn } from "../lib/cn";
|
|
3
4
|
|
|
4
5
|
type Props = {
|
|
5
6
|
siteTitle: string;
|
|
@@ -17,7 +18,7 @@ const {
|
|
|
17
18
|
showThemeToggle = true,
|
|
18
19
|
} = Astro.props;
|
|
19
20
|
---
|
|
20
|
-
<header class
|
|
21
|
+
<header class={cn("border-border bg-background/80 sticky top-0 z-40 border-b backdrop-blur", className)}>
|
|
21
22
|
<div class="mx-auto flex max-w-5xl items-center justify-between px-5 py-4 sm:px-8">
|
|
22
23
|
<a href={homeHref} class="text-foreground font-serif text-lg font-semibold tracking-tight">
|
|
23
24
|
<slot name="brand">{siteTitle}</slot>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
import { cn } from "../lib/cn";
|
|
2
3
|
type Props = {
|
|
3
4
|
currentPage: number;
|
|
4
5
|
lastPage: number;
|
|
@@ -23,7 +24,7 @@ const {
|
|
|
23
24
|
const hasPrev = currentPage > 1;
|
|
24
25
|
const hasNext = currentPage < lastPage;
|
|
25
26
|
---
|
|
26
|
-
<nav class
|
|
27
|
+
<nav class={cn("mt-8 flex items-center justify-between", className)} aria-label="Pagination">
|
|
27
28
|
{hasPrev ? (
|
|
28
29
|
<a
|
|
29
30
|
href={urlForPage(currentPage - 1)}
|
package/src/astro/prose.astro
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { slugify } from "../lib/slugify";
|
|
3
|
+
import { cn } from "../lib/cn";
|
|
3
4
|
|
|
4
5
|
type Heading = { depth: number; text: string; slug: string };
|
|
5
6
|
|
|
@@ -24,11 +25,11 @@ const visible: Array<Heading> = headings
|
|
|
24
25
|
.map((h) => ({ depth: h.depth, text: h.text, slug: h.slug ?? slugify(h.text) }));
|
|
25
26
|
---
|
|
26
27
|
{visible.length > 0 && (
|
|
27
|
-
<nav class
|
|
28
|
+
<nav class={cn("text-sm", className)} aria-label="Table of contents">
|
|
28
29
|
<p class="text-muted-foreground mb-2 font-medium tracking-wide uppercase">{heading}</p>
|
|
29
30
|
<ul class="space-y-1">
|
|
30
31
|
{visible.map((item) => (
|
|
31
|
-
<li class
|
|
32
|
+
<li class={cn("leading-snug", item.depth === 3 && "pl-4")}>
|
|
32
33
|
<a
|
|
33
34
|
href={`#${item.slug}`}
|
|
34
35
|
class="text-muted-foreground hover:text-foreground block transition-colors"
|
package/src/astro/tag-list.astro
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { DEFAULT_TAG_BASE, tagUrl } from "../lib/tag-url";
|
|
3
|
+
import { cn } from "../lib/cn";
|
|
3
4
|
|
|
4
5
|
type Props = {
|
|
5
6
|
tags: Array<string>;
|
|
@@ -9,7 +10,7 @@ type Props = {
|
|
|
9
10
|
|
|
10
11
|
const { tags, base = DEFAULT_TAG_BASE, class: className = "" } = Astro.props;
|
|
11
12
|
---
|
|
12
|
-
<ul class
|
|
13
|
+
<ul class={cn("flex flex-wrap gap-2", className)}>
|
|
13
14
|
{tags.map((tag) => (
|
|
14
15
|
<li>
|
|
15
16
|
<a
|
package/src/lib/cn.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { cn } from "
|
|
1
|
+
export { cn } from "cn";
|
package/dist/cn-DmzdyV07.js
DELETED