@grove-dev/astro 0.5.1 → 0.5.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grove-dev/astro",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "type": "module",
5
5
  "description": "Composable Astro UI, data adapters, and integration for Grove directories.",
6
6
  "license": "MIT",
@@ -60,7 +60,7 @@
60
60
  "sanitize-html": "^2.17.5",
61
61
  "shiki": "^1.29.2",
62
62
  "yaml": "^2.9.0",
63
- "@grove-dev/core": "0.5.1"
63
+ "@grove-dev/core": "0.5.2"
64
64
  },
65
65
  "peerDependencies": {
66
66
  "astro": "^6.0.0 || ^7.0.0"
@@ -39,6 +39,14 @@ interface Props {
39
39
  initial: IndexFilters;
40
40
  pathPrefix?: string;
41
41
  class?: string;
42
+ /**
43
+ * Emit the default flex layout on the root. Pass `false` when the
44
+ * caller owns the layout — e.g. `layout={false} class="contents"` to
45
+ * promote the filter triggers into the parent's flex row. Without
46
+ * this the root's own `flex` would win over any display utility in
47
+ * `class`, since Tailwind emits `.contents` before `.flex`.
48
+ */
49
+ layout?: boolean;
42
50
  /** Hide the sort select (e.g. when the page renders its own). */
43
51
  hide?: Array<"sort">;
44
52
  }
@@ -48,6 +56,7 @@ const {
48
56
  initial,
49
57
  pathPrefix = "/",
50
58
  class: className = "",
59
+ layout = true,
51
60
  hide = [],
52
61
  } = Astro.props;
53
62
 
@@ -69,7 +78,7 @@ const groups = groupModels.map((group) => ({
69
78
  }));
70
79
  ---
71
80
 
72
- <div class:list={["flex flex-wrap items-center gap-2", className]} role="toolbar" aria-label="Filter items">
81
+ <div class:list={[layout && "flex flex-wrap items-center gap-2", className]} role="toolbar" aria-label="Filter items">
73
82
  {groups.map((group) => <FilterGroupMenu {...group} />)}
74
83
 
75
84
  {!hide.includes("sort") && (
@@ -23,6 +23,14 @@ interface Props {
23
23
  currentParams: URLSearchParams;
24
24
  pathPrefix?: string;
25
25
  class?: string;
26
+ /**
27
+ * Emit the default flex layout on the root. Pass `false` when the
28
+ * caller owns the layout — e.g. `layout={false} class="contents"` to
29
+ * promote the tabs into the parent's flex row. Without this the
30
+ * root's own `flex` would win over any display utility in `class`,
31
+ * since Tailwind emits `.contents` before `.flex`.
32
+ */
33
+ layout?: boolean;
26
34
  /** Override the visible lens list (defaults to LENSES). */
27
35
  lensIds?: readonly string[];
28
36
  /** Consumer noun for the unfiltered lens, e.g. "All apps". */
@@ -33,6 +41,7 @@ const {
33
41
  currentParams,
34
42
  pathPrefix = "/",
35
43
  class: className = "",
44
+ layout = true,
36
45
  lensIds,
37
46
  allLabel,
38
47
  } = Astro.props;
@@ -48,7 +57,8 @@ const lenses =
48
57
 
49
58
  <nav
50
59
  class:list={[
51
- "grove-lens-tabs flex flex-wrap items-center gap-1.5",
60
+ "grove-lens-tabs",
61
+ layout && "flex flex-wrap items-center gap-1.5",
52
62
  className,
53
63
  ]}
54
64
  aria-label="Curated views"