@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.
Files changed (72) hide show
  1. package/dist/index.js +2 -2
  2. package/dist/index.js.map +1 -1
  3. package/dist/lib/index.d.ts +0 -2
  4. package/dist/lib/index.d.ts.map +1 -1
  5. package/dist/lib/index.js +0 -2
  6. package/dist/lib/index.js.map +1 -1
  7. package/dist/ui/button.d.ts +45 -0
  8. package/dist/ui/button.d.ts.map +1 -0
  9. package/dist/ui/button.js +82 -0
  10. package/dist/ui/button.js.map +1 -0
  11. package/package.json +8 -5
  12. package/src/components/CardGrid.astro +41 -0
  13. package/src/components/CardIcon.astro +67 -0
  14. package/src/components/CategoryGrid.astro +20 -5
  15. package/src/components/CollectionCard.astro +56 -0
  16. package/src/components/CollectionIndex.astro +21 -26
  17. package/src/components/CollectionPage.astro +36 -13
  18. package/src/components/CollectionRow.astro +62 -192
  19. package/src/components/CollectionTeaser.astro +4 -0
  20. package/src/components/ContributorsGrid.astro +4 -1
  21. package/src/components/DirectoryIndexClient.astro +127 -30
  22. package/src/components/EditorialSummary.astro +6 -5
  23. package/src/components/FilterGroupMenu.astro +24 -10
  24. package/src/components/FilterOptions.astro +6 -1
  25. package/src/components/FinalCta.astro +5 -3
  26. package/src/components/Hero.astro +85 -139
  27. package/src/components/IndexRow.astro +36 -69
  28. package/src/components/LanguageBreakdown.astro +5 -1
  29. package/src/components/OriginalCollection.astro +3 -2
  30. package/src/components/Pagination.astro +7 -20
  31. package/src/components/ProjectCard.astro +345 -0
  32. package/src/components/RecordHeader.astro +137 -77
  33. package/src/components/RecordSection.astro +14 -10
  34. package/src/components/RecordSidebar.astro +80 -22
  35. package/src/components/RefinePanel.astro +41 -62
  36. package/src/components/SmartLensTabs.astro +3 -7
  37. package/src/components/StackGrid.astro +26 -6
  38. package/src/components/SubmissionClient.astro +173 -52
  39. package/src/components/TableOfContents.astro +31 -5
  40. package/src/components/WhyThisExists.astro +1 -1
  41. package/src/index.ts +2 -2
  42. package/src/layouts/BaseLayout.astro +79 -9
  43. package/src/layouts/Header.astro +5 -4
  44. package/src/layouts/SectionHeader.astro +3 -2
  45. package/src/layouts/Seo.astro +28 -17
  46. package/src/layouts/ThemeToggle.astro +23 -6
  47. package/src/lib/index.ts +0 -2
  48. package/src/server/collections.ts +88 -1
  49. package/src/server/contrast.test.ts +82 -0
  50. package/src/server/contrast.ts +117 -0
  51. package/src/server/directory.test.ts +177 -0
  52. package/src/server/directory.ts +328 -206
  53. package/src/server/github-repo.test.ts +88 -0
  54. package/src/server/github-repo.ts +104 -0
  55. package/src/server/index.ts +4 -3
  56. package/src/server/models-home.test.ts +101 -0
  57. package/src/server/models.test.ts +135 -0
  58. package/src/server/models.ts +192 -43
  59. package/src/styles.css +128 -16
  60. package/dist/lib/scores.d.ts +0 -2
  61. package/dist/lib/scores.d.ts.map +0 -1
  62. package/dist/lib/scores.js +0 -2
  63. package/dist/lib/scores.js.map +0 -1
  64. package/src/components/CurationGrid.astro +0 -41
  65. package/src/components/DecisionRow.astro +0 -89
  66. package/src/components/ExploreByCategory.astro +0 -67
  67. package/src/components/ExploreByStack.astro +0 -78
  68. package/src/components/GroveDocumentHead.astro +0 -28
  69. package/src/components/ItemCard.astro +0 -323
  70. package/src/components/MinimalAbout.astro +0 -82
  71. package/src/components/ScoreBars.astro +0 -102
  72. 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";