@grove-dev/astro 0.5.0-next.0 → 0.5.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.
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/index.d.ts +0 -2
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +0 -2
- package/dist/lib/index.js.map +1 -1
- package/dist/ui/button.d.ts +45 -0
- package/dist/ui/button.d.ts.map +1 -0
- package/dist/ui/button.js +82 -0
- package/dist/ui/button.js.map +1 -0
- package/package.json +8 -5
- package/src/components/CardGrid.astro +41 -0
- package/src/components/CardIcon.astro +67 -0
- package/src/components/CategoryGrid.astro +20 -5
- package/src/components/CollectionCard.astro +56 -0
- package/src/components/CollectionIndex.astro +21 -26
- package/src/components/CollectionPage.astro +36 -13
- package/src/components/CollectionRow.astro +62 -192
- package/src/components/CollectionTeaser.astro +4 -0
- package/src/components/ContributorsGrid.astro +4 -1
- package/src/components/DirectoryIndexClient.astro +127 -30
- package/src/components/EditorialSummary.astro +6 -5
- package/src/components/FilterGroupMenu.astro +24 -10
- package/src/components/FilterOptions.astro +6 -1
- package/src/components/FinalCta.astro +5 -3
- package/src/components/Hero.astro +85 -139
- package/src/components/IndexRow.astro +36 -69
- package/src/components/LanguageBreakdown.astro +5 -1
- package/src/components/OriginalCollection.astro +3 -2
- package/src/components/Pagination.astro +7 -20
- package/src/components/ProjectCard.astro +345 -0
- package/src/components/RecordHeader.astro +137 -77
- package/src/components/RecordSection.astro +14 -10
- package/src/components/RecordSidebar.astro +80 -22
- package/src/components/RefinePanel.astro +41 -62
- package/src/components/SmartLensTabs.astro +3 -7
- package/src/components/StackGrid.astro +26 -6
- package/src/components/SubmissionClient.astro +173 -52
- package/src/components/TableOfContents.astro +31 -5
- package/src/components/WhyThisExists.astro +1 -1
- package/src/index.ts +2 -2
- package/src/layouts/BaseLayout.astro +79 -9
- package/src/layouts/Header.astro +5 -4
- package/src/layouts/SectionHeader.astro +3 -2
- package/src/layouts/Seo.astro +28 -17
- package/src/layouts/ThemeToggle.astro +23 -6
- package/src/lib/index.ts +0 -2
- package/src/server/collections.ts +88 -1
- package/src/server/contrast.test.ts +82 -0
- package/src/server/contrast.ts +117 -0
- package/src/server/directory.test.ts +177 -0
- package/src/server/directory.ts +328 -206
- package/src/server/github-repo.test.ts +88 -0
- package/src/server/github-repo.ts +104 -0
- package/src/server/index.ts +4 -3
- package/src/server/models-home.test.ts +101 -0
- package/src/server/models.test.ts +135 -0
- package/src/server/models.ts +192 -43
- package/src/styles.css +128 -16
- package/dist/lib/scores.d.ts +0 -2
- package/dist/lib/scores.d.ts.map +0 -1
- package/dist/lib/scores.js +0 -2
- package/dist/lib/scores.js.map +0 -1
- package/src/components/CurationGrid.astro +0 -41
- package/src/components/DecisionRow.astro +0 -89
- package/src/components/ExploreByCategory.astro +0 -67
- package/src/components/ExploreByStack.astro +0 -78
- package/src/components/GroveDocumentHead.astro +0 -28
- package/src/components/ItemCard.astro +0 -323
- package/src/components/MinimalAbout.astro +0 -82
- package/src/components/ScoreBars.astro +0 -102
- package/src/lib/scores.ts +0 -1
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
/**
|
|
3
|
-
* ScoreBars — 4-bar score visualization.
|
|
4
|
-
*
|
|
5
|
-
* Renders a horizontal 4-cell bar per score dimension. Each cell
|
|
6
|
-
* fills based on the score tier (0..4) computed from a 0-100 value.
|
|
7
|
-
* The 5 dimensions are: activity, maturity, learning, contribution,
|
|
8
|
-
* docs. The "overall" bar is optional and rendered last as a
|
|
9
|
-
* composite when `showOverall` is true.
|
|
10
|
-
*
|
|
11
|
-
* Renders nothing when the record has no score block.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
import type { Score } from "@grove-dev/core";
|
|
15
|
-
import { scoreTier, scoreTierLabel, SCORE_LABELS } from "../lib/scores";
|
|
16
|
-
|
|
17
|
-
interface Props {
|
|
18
|
-
scores: Score | undefined | null;
|
|
19
|
-
/** Show the "overall" composite bar. Default true. */
|
|
20
|
-
showOverall?: boolean;
|
|
21
|
-
/** Compact mode — no labels next to the bars. */
|
|
22
|
-
compact?: boolean;
|
|
23
|
-
class?: string;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const {
|
|
27
|
-
scores,
|
|
28
|
-
showOverall = true,
|
|
29
|
-
compact = false,
|
|
30
|
-
class: className = "",
|
|
31
|
-
} = Astro.props;
|
|
32
|
-
|
|
33
|
-
const dimensions: (keyof Score)[] = showOverall
|
|
34
|
-
? ["activity", "maturity", "learning", "contribution", "docs", "overall"]
|
|
35
|
-
: ["activity", "maturity", "learning", "contribution", "docs"];
|
|
36
|
-
|
|
37
|
-
function dim(n: number | undefined): number {
|
|
38
|
-
if (typeof n !== "number") return 0;
|
|
39
|
-
return scoreTier(n);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function label(n: number | undefined): string {
|
|
43
|
-
if (typeof n !== "number") return "—";
|
|
44
|
-
return Math.round(n).toString();
|
|
45
|
-
}
|
|
46
|
-
---
|
|
47
|
-
|
|
48
|
-
{scores && (
|
|
49
|
-
<div
|
|
50
|
-
class:list={["grove-score-bars flex flex-col gap-2", className]}
|
|
51
|
-
aria-label="Project scores"
|
|
52
|
-
>
|
|
53
|
-
{dimensions.map((d) => {
|
|
54
|
-
const n = scores[d];
|
|
55
|
-
const tier = dim(n);
|
|
56
|
-
return (
|
|
57
|
-
<div
|
|
58
|
-
class:list={[
|
|
59
|
-
"grove-score-row flex items-center gap-2",
|
|
60
|
-
compact ? "text-2xs" : "text-2xs",
|
|
61
|
-
]}
|
|
62
|
-
title={`${SCORE_LABELS[d]}: ${label(n)} (${scoreTierLabel(typeof n === "number" ? n : 0)})`}
|
|
63
|
-
>
|
|
64
|
-
{!compact && (
|
|
65
|
-
<span class="w-20 flex-shrink-0 font-medium text-ink-700 dark:text-ink-300">
|
|
66
|
-
{SCORE_LABELS[d]}
|
|
67
|
-
</span>
|
|
68
|
-
)}
|
|
69
|
-
<span
|
|
70
|
-
class:list={[
|
|
71
|
-
"grove-score-cells flex gap-0.5",
|
|
72
|
-
compact ? "w-20" : "w-24",
|
|
73
|
-
]}
|
|
74
|
-
role="img"
|
|
75
|
-
aria-label={`${SCORE_LABELS[d]}: ${label(n)}`}
|
|
76
|
-
>
|
|
77
|
-
{[0, 1, 2, 3, 4].map((i) => (
|
|
78
|
-
<span
|
|
79
|
-
class:list={[
|
|
80
|
-
"grove-score-cell h-1.5 flex-1 rounded-sm",
|
|
81
|
-
i < tier
|
|
82
|
-
? d === "overall"
|
|
83
|
-
? "bg-ink-900 dark:bg-ink-100"
|
|
84
|
-
: "bg-ink-700 dark:bg-ink-300"
|
|
85
|
-
: "bg-ink-100 dark:bg-ink-900",
|
|
86
|
-
]}
|
|
87
|
-
></span>
|
|
88
|
-
))}
|
|
89
|
-
</span>
|
|
90
|
-
<span
|
|
91
|
-
class:list={[
|
|
92
|
-
"font-mono text-ink-500 dark:text-ink-400",
|
|
93
|
-
compact ? "ml-1" : "ml-2 w-7 text-right",
|
|
94
|
-
]}
|
|
95
|
-
>
|
|
96
|
-
{label(n)}
|
|
97
|
-
</span>
|
|
98
|
-
</div>
|
|
99
|
-
);
|
|
100
|
-
})}
|
|
101
|
-
</div>
|
|
102
|
-
)}
|
package/src/lib/scores.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "@grove-dev/core";
|