@grove-dev/cli 0.5.0-next.2 → 0.5.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/collection-cli.d.ts +2 -1
- package/dist/collection-cli.d.ts.map +1 -1
- package/dist/collection-cli.js +33 -25
- package/dist/collection-cli.js.map +1 -1
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/site/data/taxonomy/licenses.yml +0 -8
- package/dist/site/data/taxonomy/topics.yml +29 -0
- package/dist/site/grove.config.ts +9 -3
- package/dist/site/package.json +3 -3
- package/dist/site/public/icons/platforms/android.svg +1 -1
- package/dist/site/public/icons/platforms/chrome.svg +1 -1
- package/dist/site/public/icons/platforms/ios.svg +1 -1
- package/dist/site/public/icons/platforms/ubuntu.svg +1 -1
- package/dist/site/public/icons/platforms/web.svg +4 -4
- package/dist/site/public/icons/platforms/windows.svg +5 -5
- package/dist/site/public/icons/stacks/go.svg +1 -1
- package/dist/site/public/icons/stacks/python.svg +1 -1
- package/dist/site/public/logo.svg +16 -0
- package/dist/site/src/components/PipelineStrip.astro +121 -0
- package/dist/site/src/components/TaxonomyList.astro +40 -42
- package/dist/site/src/pages/404.astro +18 -19
- package/dist/site/src/pages/[slug]/[recordSlug].astro +13 -4
- package/dist/site/src/pages/[slug]/index.astro +83 -65
- package/dist/site/src/pages/about.astro +67 -125
- package/dist/site/src/pages/categories/index.astro +30 -0
- package/dist/site/src/pages/collections/[slug].astro +4 -0
- package/dist/site/src/pages/collections/index.astro +5 -1
- package/dist/site/src/pages/contributors.astro +12 -10
- package/dist/site/src/pages/empty.astro +19 -3
- package/dist/site/src/pages/index.astro +24 -10
- package/dist/site/src/pages/stacks/index.astro +32 -0
- package/dist/site/src/pages/submit.astro +29 -16
- package/dist/site/src/styles/global.css +6 -11
- package/package.json +2 -2
|
@@ -8,11 +8,19 @@
|
|
|
8
8
|
* everything below the heading — the count, the card grid, the
|
|
9
9
|
* empty state, the back link — is identical, so it lives here.
|
|
10
10
|
*
|
|
11
|
+
* Records render through the package's canonical `ProjectCard` inside
|
|
12
|
+
* `CardGrid`, so taxonomy pages read as the same site as the browse
|
|
13
|
+
* and collection pages.
|
|
14
|
+
*
|
|
11
15
|
* Lives under `apps/example/src/components/` because the page
|
|
12
16
|
* shell (BaseLayout) and the SEO entry point (Seo) already ship
|
|
13
17
|
* from `@grove-dev/astro`; a consumer-side body template is the
|
|
14
18
|
* natural place for it.
|
|
15
19
|
*/
|
|
20
|
+
import CardGrid from "@grove-dev/astro/components/CardGrid.astro";
|
|
21
|
+
import ProjectCard from "@grove-dev/astro/components/ProjectCard.astro";
|
|
22
|
+
import { itemLabel, itemLabelPlural } from "@grove-dev/astro/server";
|
|
23
|
+
import { formatCount } from "@grove-dev/core";
|
|
16
24
|
|
|
17
25
|
interface TaxonomyRecord {
|
|
18
26
|
slug: string;
|
|
@@ -31,11 +39,15 @@ interface Props {
|
|
|
31
39
|
displayName: string;
|
|
32
40
|
/** Lede copy under the heading. */
|
|
33
41
|
lede: string;
|
|
34
|
-
/**
|
|
35
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Noun pair for the heading and count label. Defaults to the
|
|
44
|
+
* blueprint's singular/plural labels so irregular plurals render
|
|
45
|
+
* correctly on every blueprint.
|
|
46
|
+
*/
|
|
47
|
+
itemNoun?: { singular: string; plural: string };
|
|
36
48
|
/** Records filtered by `filterRecords` upstream. */
|
|
37
49
|
records: TaxonomyRecord[];
|
|
38
|
-
/** Index route (e.g. "/projects") for the back link. */
|
|
50
|
+
/** Index route (e.g. "/projects") for the back link and card hrefs. */
|
|
39
51
|
backHref?: string;
|
|
40
52
|
/** Back-link label. */
|
|
41
53
|
backLabel?: string;
|
|
@@ -46,65 +58,51 @@ const {
|
|
|
46
58
|
eyebrow,
|
|
47
59
|
displayName,
|
|
48
60
|
lede,
|
|
49
|
-
itemNoun =
|
|
61
|
+
itemNoun = { singular: itemLabel(), plural: itemLabelPlural() },
|
|
50
62
|
records,
|
|
51
63
|
backHref = "/projects",
|
|
52
|
-
backLabel =
|
|
64
|
+
backLabel = `← Back to all ${itemLabelPlural()}`,
|
|
53
65
|
} = Astro.props;
|
|
54
66
|
|
|
55
67
|
const count = records.length;
|
|
68
|
+
const hrefPrefix = backHref.replace(/\/$/, "");
|
|
69
|
+
type CardRecord = Parameters<typeof ProjectCard>[0]["record"];
|
|
56
70
|
---
|
|
57
71
|
|
|
58
|
-
<section class="mx-auto max-w-
|
|
59
|
-
<p class="text-
|
|
60
|
-
<h1 class="mt-
|
|
61
|
-
{displayName} {itemNoun}
|
|
72
|
+
<section class="mx-auto w-full max-w-wide px-5 py-12 sm:px-7 sm:py-16">
|
|
73
|
+
<p class="m-0 text-2xs font-medium uppercase tracking-wider text-ink-500 dark:text-ink-400">{eyebrow}</p>
|
|
74
|
+
<h1 class="m-0 mt-2 text-[1.875rem] font-semibold tracking-tight text-ink-900 sm:text-[2.125rem] dark:text-ink-100">
|
|
75
|
+
{displayName} {itemNoun.plural}
|
|
62
76
|
</h1>
|
|
63
|
-
<p class="mt-3 max-w-2xl text-
|
|
77
|
+
<p class="m-0 mt-3 max-w-2xl text-[0.9375rem] leading-relaxed text-ink-500 dark:text-ink-400">{lede}</p>
|
|
64
78
|
|
|
65
79
|
<div class="mt-10">
|
|
66
|
-
<p class="text-
|
|
67
|
-
{count
|
|
80
|
+
<p class="m-0 text-2xs font-medium uppercase tracking-wider text-ink-500 dark:text-ink-400">
|
|
81
|
+
{formatCount(count, itemNoun)}
|
|
68
82
|
</p>
|
|
69
83
|
|
|
70
84
|
{count === 0 ? (
|
|
71
|
-
<p class="mt-4 text-sm text-
|
|
85
|
+
<p class="mt-4 text-sm text-ink-500 dark:text-ink-400">No {itemNoun.plural} yet in {displayName}.</p>
|
|
72
86
|
) : (
|
|
73
|
-
<
|
|
74
|
-
{records.map((record) => (
|
|
75
|
-
<li class="
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
</h2>
|
|
84
|
-
{record.description && (
|
|
85
|
-
<p class="mt-2 text-sm leading-relaxed text-muted">
|
|
86
|
-
{record.description}
|
|
87
|
-
</p>
|
|
88
|
-
)}
|
|
89
|
-
{record.repoUrl && (
|
|
90
|
-
<a
|
|
91
|
-
href={record.repoUrl}
|
|
92
|
-
target="_blank"
|
|
93
|
-
rel="noopener noreferrer"
|
|
94
|
-
class="mt-3 inline-flex text-xs font-mono text-accent-cyan no-underline hover:underline"
|
|
95
|
-
>
|
|
96
|
-
{record.repoUrl.replace(/^https?:\/\//, "")}
|
|
97
|
-
</a>
|
|
98
|
-
)}
|
|
87
|
+
<CardGrid class="mt-6">
|
|
88
|
+
{records.map((record, i) => (
|
|
89
|
+
<li class="m-0 p-0">
|
|
90
|
+
<ProjectCard
|
|
91
|
+
record={record as CardRecord}
|
|
92
|
+
href={`${hrefPrefix}/${record.slug}`}
|
|
93
|
+
showCurated
|
|
94
|
+
showLicense
|
|
95
|
+
eager={i < 3}
|
|
96
|
+
/>
|
|
99
97
|
</li>
|
|
100
98
|
))}
|
|
101
|
-
</
|
|
99
|
+
</CardGrid>
|
|
102
100
|
)}
|
|
103
101
|
</div>
|
|
104
102
|
|
|
105
|
-
<p class="mt-12 text-
|
|
103
|
+
<p class="mt-12 text-2xs text-ink-500 dark:text-ink-400">
|
|
106
104
|
<a href={backHref} class="text-inherit no-underline hover:underline">
|
|
107
105
|
{backLabel}
|
|
108
106
|
</a>
|
|
109
107
|
</p>
|
|
110
|
-
</section>
|
|
108
|
+
</section>
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
import siteConfig from "@grove/generated/site-config.json";
|
|
10
10
|
import { indexSlug } from "@grove-dev/astro/server";
|
|
11
11
|
import BaseLayout from "@grove-dev/astro/layouts/BaseLayout.astro";
|
|
12
|
+
import { buttonClass } from "@grove-dev/astro/ui/button";
|
|
13
|
+
import SearchField from "@grove-dev/astro/ui/SearchField.astro";
|
|
12
14
|
|
|
13
15
|
const slug = indexSlug();
|
|
14
16
|
const title = `Not found — ${siteConfig.name}`;
|
|
@@ -21,43 +23,40 @@ const description = `That page doesn't exist on ${siteConfig.name}.`;
|
|
|
21
23
|
site={siteConfig}
|
|
22
24
|
noindex
|
|
23
25
|
>
|
|
26
|
+
{/* One recovery hierarchy: search is the primary tool, Browse the
|
|
27
|
+
single button action, home a quiet text link — no three
|
|
28
|
+
competing primary CTAs. Centered so the wide viewport doesn't
|
|
29
|
+
pin everything into the top-left corner. */}
|
|
24
30
|
<section class="py-12 sm:py-16">
|
|
25
|
-
<div class="mx-auto w-full max-w-
|
|
26
|
-
<span class="text-2xs font-medium uppercase tracking-wider text-
|
|
31
|
+
<div class="mx-auto w-full max-w-narrow px-5 py-16 text-center sm:px-7 sm:py-24">
|
|
32
|
+
<span class="text-2xs font-medium uppercase tracking-wider text-muted-foreground">
|
|
27
33
|
404
|
|
28
34
|
</span>
|
|
29
|
-
<h1 class="m-0 mt-2 text-[2.25rem]
|
|
35
|
+
<h1 class="m-0 mt-2 text-[2.25rem] font-semibold leading-[1.05] tracking-tight text-foreground sm:text-[3rem]">
|
|
30
36
|
Page not found
|
|
31
37
|
</h1>
|
|
32
|
-
<p class="m-0 mt-4 max-w-xl text-lg leading-relaxed text-
|
|
38
|
+
<p class="mx-auto m-0 mt-4 max-w-xl text-lg leading-relaxed text-muted-foreground">
|
|
33
39
|
The page you're looking for doesn't exist on {siteConfig.name}.
|
|
34
40
|
It may have been moved, renamed, or never existed.
|
|
35
41
|
</p>
|
|
36
42
|
|
|
37
43
|
<form
|
|
38
|
-
class="mt-8 flex max-w-xl flex-col gap-2 sm:flex-row sm:items-center"
|
|
44
|
+
class="mx-auto mt-8 flex max-w-xl flex-col gap-2 sm:flex-row sm:items-center"
|
|
39
45
|
role="search"
|
|
40
46
|
action={`/${slug}`}
|
|
41
47
|
method="get"
|
|
42
48
|
>
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
<input
|
|
46
|
-
type="search"
|
|
47
|
-
name="q"
|
|
48
|
-
placeholder={`Search ${slug}...`}
|
|
49
|
-
autocomplete="off"
|
|
50
|
-
class="w-full rounded-md border border-ink-200 bg-white py-2.5 px-3 text-sm placeholder:text-ink-400 focus:border-ink-900 focus:outline-none focus:ring-2 focus:ring-ink-900/10 dark:border-ink-800 dark:bg-ink-950 dark:text-ink-100"
|
|
51
|
-
/>
|
|
52
|
-
</label>
|
|
53
|
-
<button type="submit" class="inline-flex h-8 cursor-pointer items-center justify-center gap-1.5 rounded-[var(--radius)] border border-transparent px-3 text-sm font-medium leading-none no-underline outline-none transition-colors focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/35 bg-primary text-primary-foreground hover:bg-primary/90">
|
|
49
|
+
<SearchField class="flex-1" label="Search" placeholder={`Search ${slug}...`} id="not-found-search" />
|
|
50
|
+
<button type="submit" class={buttonClass("primary", "bare", "h-10 px-4 text-sm max-sm:min-h-11")}>
|
|
54
51
|
Search
|
|
55
52
|
</button>
|
|
56
53
|
</form>
|
|
57
54
|
|
|
58
|
-
<div class="mt-6 flex flex-wrap gap-
|
|
59
|
-
<a href=
|
|
60
|
-
<a href=
|
|
55
|
+
<div class="mt-6 flex flex-wrap items-center justify-center gap-4">
|
|
56
|
+
<a href={`/${slug}`} class={buttonClass("secondary", "sm")}>Browse {slug}</a>
|
|
57
|
+
<a href="/" class="text-sm font-medium text-muted-foreground underline decoration-border underline-offset-2 hover:text-foreground">
|
|
58
|
+
Back to home
|
|
59
|
+
</a>
|
|
61
60
|
</div>
|
|
62
61
|
</div>
|
|
63
62
|
</section>
|
|
@@ -38,23 +38,32 @@ const { record, name, title, description, itemSingular, jsonLd } = detail;
|
|
|
38
38
|
submitHref="/submit"
|
|
39
39
|
submitLabel={`Submit ${itemSingular}`}
|
|
40
40
|
>
|
|
41
|
-
<article class="py-
|
|
41
|
+
<article class="py-8 sm:py-10">
|
|
42
42
|
<div class="mx-auto w-full max-w-[1240px] px-5 sm:px-7">
|
|
43
43
|
<RecordHeader detail={detail} />
|
|
44
44
|
|
|
45
45
|
<div
|
|
46
|
-
class="grid grid-cols-1 gap-10 lg:grid-cols-[minmax(0,1fr)
|
|
46
|
+
class="grid grid-cols-1 gap-10 lg:grid-cols-[minmax(0,1fr)_300px] lg:gap-12"
|
|
47
47
|
>
|
|
48
|
+
{/* Reading column: editorial context, then the article —
|
|
49
|
+
no TOC panel pushing the body down. */}
|
|
48
50
|
<div class="min-w-0">
|
|
49
51
|
<EditorialSummary bestFor={detail.bestFor} caveats={detail.caveats} />
|
|
50
|
-
<TableOfContents items={detail.toc} />
|
|
51
52
|
<MarkdownBody
|
|
52
53
|
recordSlug={record.slug}
|
|
53
54
|
fallback={record.content ? "This record doesn't have notes yet." : undefined}
|
|
54
55
|
/>
|
|
55
56
|
</div>
|
|
56
|
-
|
|
57
|
+
{/* Right rail: the TOC and nothing else. */}
|
|
58
|
+
<div class="min-w-0 lg:sticky lg:top-20 lg:max-h-[calc(100vh-5rem)] lg:self-start lg:overflow-y-auto">
|
|
59
|
+
<TableOfContents items={detail.toc} />
|
|
60
|
+
</div>
|
|
57
61
|
</div>
|
|
62
|
+
|
|
63
|
+
{/* Metadata panels — full width below the article. */}
|
|
64
|
+
<section class="mt-12 border-t border-border pt-8" aria-label="Project details">
|
|
65
|
+
<RecordSidebar detail={detail} sticky={false} layout="grid" />
|
|
66
|
+
</section>
|
|
58
67
|
</div>
|
|
59
68
|
</article>
|
|
60
69
|
</BaseLayout>
|
|
@@ -13,22 +13,31 @@
|
|
|
13
13
|
* so the same page works for every blueprint without per-blueprint
|
|
14
14
|
* forks.
|
|
15
15
|
*
|
|
16
|
-
* Navigation model:
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
16
|
+
* Navigation model: the URL is the single source of truth for filter
|
|
17
|
+
* state — the form submits via `method="get"` so every change is a
|
|
18
|
+
* full-page navigation to `?q=...&sort=...&stack=...`. But this route
|
|
19
|
+
* is PRERENDERED: at build time `Astro.url.searchParams` is empty, so
|
|
20
|
+
* the server renders the unfiltered state once. `DirectoryIndexClient`
|
|
21
|
+
* re-reads `location.search` on load and re-derives the result list,
|
|
22
|
+
* chips, pagination, and facet intersection counts with the same
|
|
23
|
+
* `@grove-dev/core/directory` functions the server used.
|
|
21
24
|
*/
|
|
22
25
|
import siteConfig from "@grove/generated/site-config.json";
|
|
23
26
|
import { getDirectoryIndexModel, itemLabel, itemLabelPlural, taxonomy } from "@grove-dev/astro/server";
|
|
24
27
|
import type { IndexFilters } from "@grove-dev/astro";
|
|
25
28
|
import BaseLayout from "@grove-dev/astro/layouts/BaseLayout.astro";
|
|
29
|
+
import CardGrid from "@grove-dev/astro/components/CardGrid.astro";
|
|
26
30
|
import SmartLensTabs from "@grove-dev/astro/components/SmartLensTabs.astro";
|
|
27
31
|
import RefinePanel from "@grove-dev/astro/components/RefinePanel.astro";
|
|
28
32
|
import IndexRow from "@grove-dev/astro/components/IndexRow.astro";
|
|
29
33
|
import Pagination from "@grove-dev/astro/components/Pagination.astro";
|
|
30
34
|
import DirectoryIndexClient from "@grove-dev/astro/components/DirectoryIndexClient.astro";
|
|
31
35
|
import { removeFilter, searchParamsFromFilters, sortDisplay, SORT_OPTIONS } from "@grove-dev/astro";
|
|
36
|
+
import { formatCount, PRIMARY_LENSES } from "@grove-dev/core";
|
|
37
|
+
import { buttonClass, chipClass } from "@grove-dev/astro/ui/button";
|
|
38
|
+
import PageHeader from "@grove-dev/astro/ui/PageHeader.astro";
|
|
39
|
+
import SearchField from "@grove-dev/astro/ui/SearchField.astro";
|
|
40
|
+
import FilterDrawer from "@grove-dev/astro/ui/FilterDrawer.astro";
|
|
32
41
|
|
|
33
42
|
export function getStaticPaths() {
|
|
34
43
|
const routeSlug = siteConfig.blueprintConfig?.routeSlug ?? "projects";
|
|
@@ -36,8 +45,18 @@ export function getStaticPaths() {
|
|
|
36
45
|
}
|
|
37
46
|
|
|
38
47
|
const slug = siteConfig.blueprintConfig?.routeSlug ?? "projects";
|
|
39
|
-
const {
|
|
40
|
-
|
|
48
|
+
const {
|
|
49
|
+
total,
|
|
50
|
+
filters,
|
|
51
|
+
facetGroups,
|
|
52
|
+
searchPlaceholder,
|
|
53
|
+
sort,
|
|
54
|
+
sorted,
|
|
55
|
+
pages,
|
|
56
|
+
page,
|
|
57
|
+
chips,
|
|
58
|
+
clientItemsJson,
|
|
59
|
+
} = getDirectoryIndexModel(Astro.url.searchParams, siteConfig);
|
|
41
60
|
|
|
42
61
|
const title = `Browse ${slug} — ${siteConfig.name}`;
|
|
43
62
|
const description = `A searchable directory of ${itemLabelPlural()} for ${siteConfig.name}.`;
|
|
@@ -65,18 +84,16 @@ const clearFiltersHref = clearQuery ? `/${slug}?${clearQuery}` : `/${slug}`;
|
|
|
65
84
|
submitHref="/submit"
|
|
66
85
|
submitLabel={`Submit ${itemLabel()}`}
|
|
67
86
|
>
|
|
68
|
-
<section class="border-b border-
|
|
87
|
+
<section class="border-b border-border bg-background">
|
|
69
88
|
<div class="mx-auto w-full max-w-wide px-5 pt-10 sm:px-7 sm:pt-12">
|
|
70
|
-
<
|
|
71
|
-
{slug}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
</h1>
|
|
76
|
-
<p class="m-0 mt-2 max-w-[64ch] text-[0.9375rem] text-ink-500 dark:text-ink-400">
|
|
77
|
-
Search, filter, and explore {total} {itemLabel()}{total === 1 ? "" : "s"} in this directory.
|
|
78
|
-
</p>
|
|
89
|
+
<PageHeader
|
|
90
|
+
eyebrow={slug}
|
|
91
|
+
title={`Browse ${slug}`}
|
|
92
|
+
description={`Search, filter, and explore ${formatCount(total, { singular: itemLabel(), plural: itemLabelPlural() })} in this directory.`}
|
|
93
|
+
/>
|
|
79
94
|
|
|
95
|
+
{/* Discovery bar: one compact row on desktop — search grows,
|
|
96
|
+
sort and submit sit beside it. */}
|
|
80
97
|
<form
|
|
81
98
|
method="get"
|
|
82
99
|
action={`/${slug}`}
|
|
@@ -84,33 +101,18 @@ const clearFiltersHref = clearQuery ? `/${slug}?${clearQuery}` : `/${slug}`;
|
|
|
84
101
|
class="mt-6 flex flex-col gap-2 sm:flex-row"
|
|
85
102
|
role="search"
|
|
86
103
|
>
|
|
87
|
-
<
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
aria-hidden="true"
|
|
94
|
-
class="pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-ink-400"
|
|
95
|
-
fill="currentColor"
|
|
96
|
-
>
|
|
97
|
-
<path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.5 4.5 0 1 0-9 0 4.5 4.5 0 0 0 9 0Z" />
|
|
98
|
-
</svg>
|
|
99
|
-
<input
|
|
100
|
-
id="search-input"
|
|
101
|
-
type="search"
|
|
102
|
-
name="q"
|
|
103
|
-
value={filters.q ?? ""}
|
|
104
|
-
placeholder={`Search ${itemLabelPlural()}, stacks, categories, platforms, licenses...`}
|
|
105
|
-
class="h-10 w-full rounded-md border border-ink-200 bg-white py-2 pl-9 pr-3 text-sm text-ink-900 placeholder:text-ink-400 focus:border-ink-900 focus:outline-none focus:ring-2 focus:ring-ink-900/10 dark:border-ink-800 dark:bg-ink-950 dark:text-ink-100"
|
|
106
|
-
/>
|
|
107
|
-
</label>
|
|
104
|
+
<SearchField
|
|
105
|
+
class="flex-1"
|
|
106
|
+
label={`Search ${itemLabelPlural()}`}
|
|
107
|
+
value={filters.q ?? ""}
|
|
108
|
+
placeholder={searchPlaceholder}
|
|
109
|
+
/>
|
|
108
110
|
<label class="relative">
|
|
109
111
|
<span class="sr-only">{`Sort ${itemLabelPlural()}`}</span>
|
|
110
112
|
<select
|
|
111
113
|
id="sort-select"
|
|
112
114
|
name="sort"
|
|
113
|
-
class="h-10 w-full cursor-pointer appearance-none rounded-md border border-
|
|
115
|
+
class="h-10 w-full cursor-pointer appearance-none rounded-md border border-input bg-background py-1.5 pl-3 pr-8 text-sm font-medium text-foreground transition-colors hover:border-ring focus:border-ring focus:outline-none focus:ring-2 focus:ring-ring/20 sm:w-auto"
|
|
114
116
|
>
|
|
115
117
|
{SORT_OPTIONS.map((o) => (
|
|
116
118
|
<option value={o.value} selected={o.value === sort}>{o.label}</option>
|
|
@@ -121,30 +123,43 @@ const clearFiltersHref = clearQuery ? `/${slug}?${clearQuery}` : `/${slug}`;
|
|
|
121
123
|
width="11"
|
|
122
124
|
height="11"
|
|
123
125
|
aria-hidden="true"
|
|
124
|
-
class="pointer-events-none absolute right-2.5 top-1/2 -translate-y-1/2 text-
|
|
126
|
+
class="pointer-events-none absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"
|
|
125
127
|
fill="currentColor"
|
|
126
128
|
>
|
|
127
129
|
<path d="M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z" />
|
|
128
130
|
</svg>
|
|
129
131
|
</label>
|
|
130
|
-
<button type="submit" class="
|
|
132
|
+
<button type="submit" class={buttonClass("primary", "bare", "h-10 px-4 text-sm max-sm:min-h-11")}>Search</button>
|
|
131
133
|
</form>
|
|
132
134
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
135
|
+
{/* Lens tabs: single scrollable row on mobile instead of a
|
|
136
|
+
multi-row wall of controls. */}
|
|
137
|
+
<div class="mt-4 max-md:-mx-5 max-md:overflow-x-auto max-md:px-5">
|
|
138
|
+
<div class="flex items-center gap-2 md:flex-wrap max-md:w-max">
|
|
139
|
+
<SmartLensTabs
|
|
140
|
+
class="contents"
|
|
141
|
+
currentParams={Astro.url.searchParams}
|
|
142
|
+
pathPrefix={`/${slug}`}
|
|
143
|
+
lensIds={PRIMARY_LENSES}
|
|
144
|
+
allLabel={`All ${itemLabelPlural()}`}
|
|
145
|
+
/>
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
|
|
149
|
+
{/* Facet filters: inline dropdown row on desktop; a single
|
|
150
|
+
"Filters" button opening a bottom-sheet dialog on mobile. */}
|
|
151
|
+
<div class="mt-3 pb-6">
|
|
152
|
+
<FilterDrawer label="Filters" activeCount={chips.length}>
|
|
153
|
+
<div class="flex flex-wrap items-center gap-2 max-md:flex-col max-md:items-stretch">
|
|
154
|
+
<RefinePanel
|
|
155
|
+
class="contents"
|
|
156
|
+
groups={facetGroups}
|
|
157
|
+
initial={filters}
|
|
158
|
+
pathPrefix={`/${slug}`}
|
|
159
|
+
hide={["sort"]}
|
|
160
|
+
/>
|
|
161
|
+
</div>
|
|
162
|
+
</FilterDrawer>
|
|
148
163
|
</div>
|
|
149
164
|
</div>
|
|
150
165
|
</section>
|
|
@@ -177,7 +192,7 @@ const clearFiltersHref = clearQuery ? `/${slug}?${clearQuery}` : `/${slug}`;
|
|
|
177
192
|
{chips.map((chip) => (
|
|
178
193
|
<a
|
|
179
194
|
href={hrefForRemove(chip.key, chip.value)}
|
|
180
|
-
class=
|
|
195
|
+
class={chipClass()}
|
|
181
196
|
>
|
|
182
197
|
{chip.label} <span aria-hidden="true">x</span>
|
|
183
198
|
</a>
|
|
@@ -190,26 +205,29 @@ const clearFiltersHref = clearQuery ? `/${slug}?${clearQuery}` : `/${slug}`;
|
|
|
190
205
|
</div>
|
|
191
206
|
</div>
|
|
192
207
|
|
|
193
|
-
<
|
|
208
|
+
<CardGrid id="results-list">
|
|
194
209
|
{sorted.map((item, i) => (
|
|
195
210
|
<li class="m-0 p-0" data-record-slug={item.slug}>
|
|
196
211
|
<IndexRow
|
|
197
212
|
record={item as Parameters<typeof IndexRow>[0]["record"]}
|
|
198
213
|
detailHref={`/${slug}/${item.slug}`}
|
|
199
|
-
eager={i <
|
|
214
|
+
eager={i < 3}
|
|
200
215
|
/>
|
|
201
216
|
</li>
|
|
202
217
|
))}
|
|
203
|
-
</
|
|
218
|
+
</CardGrid>
|
|
204
219
|
<div id="empty-state" class:list={["py-12 text-center", sorted.length > 0 && "hidden"]}>
|
|
205
220
|
<p class="m-0 text-sm font-medium text-ink-700 dark:text-ink-200">
|
|
206
|
-
{`No ${
|
|
221
|
+
{`No ${itemLabelPlural()} match these filters.`}
|
|
207
222
|
</p>
|
|
208
|
-
<a href={clearFiltersHref} class="
|
|
223
|
+
<a href={clearFiltersHref} class={buttonClass("secondary", "sm", "mt-4")}>Clear filters</a>
|
|
209
224
|
</div>
|
|
210
|
-
|
|
225
|
+
{/* Plain div wrapper — Pagination renders its own
|
|
226
|
+
<nav aria-label="Pagination">, so a nav here would nest two
|
|
227
|
+
identical landmarks. */}
|
|
228
|
+
<div id="results-pagination" class="mt-8 flex flex-wrap items-center justify-center gap-1.5">
|
|
211
229
|
<Pagination current={page} total={pages} hrefFor={hrefForPage} />
|
|
212
|
-
</
|
|
230
|
+
</div>
|
|
213
231
|
</div>
|
|
214
232
|
</section>
|
|
215
233
|
|
|
@@ -224,7 +242,7 @@ const clearFiltersHref = clearQuery ? `/${slug}?${clearQuery}` : `/${slug}`;
|
|
|
224
242
|
</p>
|
|
225
243
|
<a
|
|
226
244
|
href="/submit"
|
|
227
|
-
class="
|
|
245
|
+
class={buttonClass("primary", "sm", "mt-2")}
|
|
228
246
|
>
|
|
229
247
|
{`Submit ${itemLabel()}`}
|
|
230
248
|
</a>
|