@grove-dev/starlight 0.6.1 → 0.8.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 (44) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +77 -78
  3. package/components/custom/ContainerSection.astro +1 -1
  4. package/components/custom/LinkButton.astro +134 -89
  5. package/components/custom/dropdown/Dropdown.astro +5 -5
  6. package/components/custom/dropdown/DropdownContent.astro +66 -66
  7. package/components/custom/dropdown/DropdownItem.astro +14 -9
  8. package/components/custom/dropdown/DropdownLabel.astro +4 -4
  9. package/components/custom/dropdown/DropdownTrigger.astro +13 -13
  10. package/components/custom/dropdown/index.ts +14 -14
  11. package/components/overrides/Footer.astro +3 -3
  12. package/components/overrides/Header.astro +5 -6
  13. package/components/overrides/Hero.astro +20 -12
  14. package/components/overrides/PageFrame.astro +25 -9
  15. package/components/overrides/PageSidebar.astro +1 -0
  16. package/components/overrides/PageTitle.astro +3 -3
  17. package/components/overrides/Search.astro +6 -6
  18. package/components/overrides/Sidebar.astro +38 -1
  19. package/components/overrides/SocialIcons.astro +3 -1
  20. package/components/overrides/ThemeSelect.astro +4 -4
  21. package/components/overrides/TwoColumnContent.astro +1 -1
  22. package/components/overrides/parts/Drawer.astro +13 -7
  23. package/components/overrides/parts/NavBar.astro +12 -31
  24. package/components/overrides/parts/SidebarSublist.astro +75 -4
  25. package/components/overrides/parts/toc/TableOfContentsList.astro +4 -4
  26. package/components/overrides/parts/toc/starlight-toc.ts +96 -98
  27. package/core/config/docs-schema.ts +58 -0
  28. package/core/config/expresive-code.ts +49 -51
  29. package/core/config/override.ts +37 -33
  30. package/core/config/schemas.ts +62 -41
  31. package/core/config/vite.ts +14 -14
  32. package/core/i18n.ts +175 -0
  33. package/core/plugin.ts +45 -43
  34. package/core/sidebar.ts +22 -0
  35. package/global.d.ts +3 -3
  36. package/package.json +3 -19
  37. package/schema.ts +44 -13
  38. package/styles/base.css +883 -896
  39. package/styles/layers.css +1 -1
  40. package/styles/theme.css +62 -62
  41. package/user-components.ts +1 -2
  42. package/virtual.d.ts +28 -28
  43. package/THIRD_PARTY_LICENSES.md +0 -68
  44. package/components/custom/Card.astro +0 -118
package/schema.ts CHANGED
@@ -1,24 +1,55 @@
1
1
  import { z } from 'astro/zod';
2
+ import { markDocsSchemaLoaded } from './core/config/docs-schema';
3
+
4
+ // Lets `Hero.astro` tell "the user never wired up the schema" apart from "this page has no extra
5
+ // hero fields", so it only warns in the first case. See `core/config/docs-schema.ts`.
6
+ markDocsSchemaLoaded();
2
7
 
3
8
  export const heroLayoutSchema = z
4
- .enum(['centered', 'centered-top', 'split-left', 'split-right', 'banner'])
5
- .default('centered')
6
- .describe(
7
- 'The layout of the hero section. "centered" places the image below the text, "centered-top" places it above, "split-left" places text left and image right, "split-right" places text right and image left.'
8
- );
9
+ .enum(['centered', 'centered-top', 'split-left', 'split-right', 'banner'])
10
+ .default('centered')
11
+ .describe(
12
+ 'The layout of the hero section. "centered" places the image below the text, "centered-top" places it above, "split-left" places text left and image right, "split-right" places text right and image left.',
13
+ );
9
14
 
10
15
  export type HeroLayout = z.infer<typeof heroLayoutSchema>;
11
16
 
12
17
  export const ExtendDocsSchema = z.object({
13
- hero: z
18
+ hero: z
19
+ .object({
20
+ layout: heroLayoutSchema,
21
+ announcement: z
14
22
  .object({
15
- layout: heroLayoutSchema,
16
- announcement: z
17
- .object({
18
- text: z.string(),
19
- link: z.string(),
20
- })
21
- .optional(),
23
+ text: z.string(),
24
+ link: z.string(),
22
25
  })
23
26
  .optional(),
27
+ actions: z
28
+ .array(
29
+ z.object({
30
+ /**
31
+ * Button style to use. Starlight's own `primary` and `minimal` are accepted
32
+ * as aliases of `default` and `ghost` so existing frontmatter keeps working.
33
+ *
34
+ * Requires `@astrojs/starlight >= 0.41.4`, which is the first version whose
35
+ * `docsSchema({ extend })` deep-merges instead of intersecting — an
36
+ * intersection cannot widen an enum Starlight already declares.
37
+ */
38
+ variant: z
39
+ .enum([
40
+ 'default',
41
+ 'link',
42
+ 'secondary',
43
+ 'outline',
44
+ 'ghost',
45
+ 'destructive',
46
+ 'primary',
47
+ 'minimal',
48
+ ])
49
+ .default('default'),
50
+ }),
51
+ )
52
+ .default([]),
53
+ })
54
+ .optional(),
24
55
  });