@lupinum/ginko-docs 0.2.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.
Files changed (240) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +112 -0
  3. package/app/app.config.ts +49 -0
  4. package/app/app.vue +71 -0
  5. package/app/assets/css/prose.css +1154 -0
  6. package/app/assets/css/tailwind.css +365 -0
  7. package/app/components/OgImage/GinkoDocs.satori.vue +117 -0
  8. package/app/components/content/DocumentPageShell.vue +55 -0
  9. package/app/components/content/Feedback.vue +97 -0
  10. package/app/components/content/PageMarkdownCopy.vue +102 -0
  11. package/app/components/mdc/MdcAccordion.vue +64 -0
  12. package/app/components/mdc/MdcAccordionItem.vue +51 -0
  13. package/app/components/mdc/MdcAlert.vue +34 -0
  14. package/app/components/mdc/MdcAside.vue +27 -0
  15. package/app/components/mdc/MdcCallout.vue +62 -0
  16. package/app/components/mdc/MdcCard.vue +186 -0
  17. package/app/components/mdc/MdcCardGroup.vue +47 -0
  18. package/app/components/mdc/MdcCenter.vue +71 -0
  19. package/app/components/mdc/MdcCodeGroup.vue +193 -0
  20. package/app/components/mdc/MdcColumn.vue +70 -0
  21. package/app/components/mdc/MdcDocImg.vue +25 -0
  22. package/app/components/mdc/MdcDropcap.vue +84 -0
  23. package/app/components/mdc/MdcError.vue +16 -0
  24. package/app/components/mdc/MdcField.vue +62 -0
  25. package/app/components/mdc/MdcFieldGroup.vue +18 -0
  26. package/app/components/mdc/MdcFigure.vue +51 -0
  27. package/app/components/mdc/MdcIdea.vue +16 -0
  28. package/app/components/mdc/MdcInfo.vue +16 -0
  29. package/app/components/mdc/MdcLayout.vue +57 -0
  30. package/app/components/mdc/MdcNote.vue +16 -0
  31. package/app/components/mdc/MdcPassage.vue +32 -0
  32. package/app/components/mdc/MdcQuiz.vue +281 -0
  33. package/app/components/mdc/MdcQuizOption.vue +91 -0
  34. package/app/components/mdc/MdcQuizQuestion.vue +226 -0
  35. package/app/components/mdc/MdcReadMore.vue +90 -0
  36. package/app/components/mdc/MdcReadMoreGroup.vue +18 -0
  37. package/app/components/mdc/MdcShortcut.vue +46 -0
  38. package/app/components/mdc/MdcStep.vue +42 -0
  39. package/app/components/mdc/MdcSteps.vue +25 -0
  40. package/app/components/mdc/MdcSuccess.vue +16 -0
  41. package/app/components/mdc/MdcTab.vue +17 -0
  42. package/app/components/mdc/MdcTabs.vue +132 -0
  43. package/app/components/mdc/MdcTimeline.vue +14 -0
  44. package/app/components/mdc/MdcTimelineItem.vue +49 -0
  45. package/app/components/mdc/MdcWarning.vue +16 -0
  46. package/app/components/mdc/icons.ts +10 -0
  47. package/app/components/prose/ProseA.vue +27 -0
  48. package/app/components/prose/ProseBlockquote.vue +14 -0
  49. package/app/components/prose/ProseCode.vue +14 -0
  50. package/app/components/prose/ProseEm.vue +14 -0
  51. package/app/components/prose/ProseH1.vue +18 -0
  52. package/app/components/prose/ProseH2.vue +24 -0
  53. package/app/components/prose/ProseH3.vue +24 -0
  54. package/app/components/prose/ProseH4.vue +14 -0
  55. package/app/components/prose/ProseHr.vue +12 -0
  56. package/app/components/prose/ProseImg.vue +120 -0
  57. package/app/components/prose/ProseLi.vue +14 -0
  58. package/app/components/prose/ProseOl.vue +14 -0
  59. package/app/components/prose/ProseP.vue +14 -0
  60. package/app/components/prose/ProsePre.vue +217 -0
  61. package/app/components/prose/ProseStrong.vue +14 -0
  62. package/app/components/prose/ProseTable.vue +16 -0
  63. package/app/components/prose/ProseTbody.vue +14 -0
  64. package/app/components/prose/ProseTd.vue +14 -0
  65. package/app/components/prose/ProseTh.vue +14 -0
  66. package/app/components/prose/ProseThead.vue +14 -0
  67. package/app/components/prose/ProseTr.vue +14 -0
  68. package/app/components/prose/ProseUl.vue +14 -0
  69. package/app/components/site/ModeToggle.vue +123 -0
  70. package/app/components/site/SiteBanner.vue +56 -0
  71. package/app/components/site/SiteFooter.vue +80 -0
  72. package/app/components/site/SiteHeader.vue +250 -0
  73. package/app/components/site/SiteInteractionLayer.vue +35 -0
  74. package/app/components/site/SiteLocaleSwitcher.vue +268 -0
  75. package/app/components/site/SiteLogoMark.vue +12 -0
  76. package/app/components/site/SiteSkipLink.vue +14 -0
  77. package/app/components/ui/accordion/Accordion.vue +15 -0
  78. package/app/components/ui/accordion/AccordionContent.vue +23 -0
  79. package/app/components/ui/accordion/AccordionItem.vue +24 -0
  80. package/app/components/ui/accordion/AccordionTrigger.vue +35 -0
  81. package/app/components/ui/accordion/index.ts +4 -0
  82. package/app/components/ui/alert/Alert.vue +21 -0
  83. package/app/components/ui/alert/AlertDescription.vue +22 -0
  84. package/app/components/ui/alert/AlertTitle.vue +22 -0
  85. package/app/components/ui/alert/index.ts +34 -0
  86. package/app/components/ui/badge/Badge.vue +28 -0
  87. package/app/components/ui/badge/index.ts +24 -0
  88. package/app/components/ui/button/Button.vue +31 -0
  89. package/app/components/ui/button/index.ts +35 -0
  90. package/app/components/ui/card/Card.vue +16 -0
  91. package/app/components/ui/card/CardAction.vue +17 -0
  92. package/app/components/ui/card/CardContent.vue +14 -0
  93. package/app/components/ui/card/CardDescription.vue +14 -0
  94. package/app/components/ui/card/CardFooter.vue +14 -0
  95. package/app/components/ui/card/CardHeader.vue +22 -0
  96. package/app/components/ui/card/CardTitle.vue +14 -0
  97. package/app/components/ui/card/card-variants.ts +15 -0
  98. package/app/components/ui/card/index.ts +8 -0
  99. package/app/components/ui/checkbox/Checkbox.vue +35 -0
  100. package/app/components/ui/checkbox/index.ts +1 -0
  101. package/app/components/ui/collapsible/Collapsible.vue +15 -0
  102. package/app/components/ui/collapsible/CollapsibleContent.vue +25 -0
  103. package/app/components/ui/collapsible/CollapsibleTrigger.vue +12 -0
  104. package/app/components/ui/collapsible/index.ts +3 -0
  105. package/app/components/ui/dialog/Dialog.vue +15 -0
  106. package/app/components/ui/dialog/DialogClose.vue +12 -0
  107. package/app/components/ui/dialog/DialogContent.vue +69 -0
  108. package/app/components/ui/dialog/DialogDescription.vue +21 -0
  109. package/app/components/ui/dialog/DialogFooter.vue +15 -0
  110. package/app/components/ui/dialog/DialogHeader.vue +12 -0
  111. package/app/components/ui/dialog/DialogOverlay.vue +26 -0
  112. package/app/components/ui/dialog/DialogPortal.vue +12 -0
  113. package/app/components/ui/dialog/DialogTitle.vue +21 -0
  114. package/app/components/ui/dialog/DialogTrigger.vue +12 -0
  115. package/app/components/ui/dialog/index.ts +10 -0
  116. package/app/components/ui/dropdown-menu/DropdownMenu.vue +15 -0
  117. package/app/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +36 -0
  118. package/app/components/ui/dropdown-menu/DropdownMenuContent.vue +40 -0
  119. package/app/components/ui/dropdown-menu/DropdownMenuGroup.vue +12 -0
  120. package/app/components/ui/dropdown-menu/DropdownMenuItem.vue +41 -0
  121. package/app/components/ui/dropdown-menu/DropdownMenuLabel.vue +25 -0
  122. package/app/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +15 -0
  123. package/app/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +37 -0
  124. package/app/components/ui/dropdown-menu/DropdownMenuSeparator.vue +23 -0
  125. package/app/components/ui/dropdown-menu/DropdownMenuShortcut.vue +17 -0
  126. package/app/components/ui/dropdown-menu/DropdownMenuSub.vue +15 -0
  127. package/app/components/ui/dropdown-menu/DropdownMenuSubContent.vue +29 -0
  128. package/app/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +31 -0
  129. package/app/components/ui/dropdown-menu/DropdownMenuTrigger.vue +14 -0
  130. package/app/components/ui/dropdown-menu/index.ts +16 -0
  131. package/app/components/ui/input/Input.vue +23 -0
  132. package/app/components/ui/input/index.ts +1 -0
  133. package/app/components/ui/kbd/Kbd.vue +23 -0
  134. package/app/components/ui/kbd/KbdGroup.vue +14 -0
  135. package/app/components/ui/kbd/index.ts +22 -0
  136. package/app/components/ui/label/Label.vue +14 -0
  137. package/app/components/ui/label/index.ts +1 -0
  138. package/app/components/ui/scroll-area/ScrollArea.vue +39 -0
  139. package/app/components/ui/scroll-area/ScrollBar.vue +33 -0
  140. package/app/components/ui/scroll-area/index.ts +2 -0
  141. package/app/components/ui/separator/Separator.vue +27 -0
  142. package/app/components/ui/separator/index.ts +1 -0
  143. package/app/components/ui/sheet/Sheet.vue +15 -0
  144. package/app/components/ui/sheet/SheetClose.vue +12 -0
  145. package/app/components/ui/sheet/SheetContent.vue +59 -0
  146. package/app/components/ui/sheet/SheetDescription.vue +21 -0
  147. package/app/components/ui/sheet/SheetFooter.vue +12 -0
  148. package/app/components/ui/sheet/SheetHeader.vue +12 -0
  149. package/app/components/ui/sheet/SheetOverlay.vue +26 -0
  150. package/app/components/ui/sheet/SheetTitle.vue +21 -0
  151. package/app/components/ui/sheet/SheetTrigger.vue +12 -0
  152. package/app/components/ui/sheet/index.ts +8 -0
  153. package/app/components/ui/switch/Switch.vue +39 -0
  154. package/app/components/ui/switch/index.ts +1 -0
  155. package/app/components/ui/tabs/Tabs.vue +24 -0
  156. package/app/components/ui/tabs/TabsContent.vue +21 -0
  157. package/app/components/ui/tabs/TabsList.vue +26 -0
  158. package/app/components/ui/tabs/TabsTrigger.vue +28 -0
  159. package/app/components/ui/tabs/index.ts +4 -0
  160. package/app/components/ui/textarea/Textarea.vue +31 -0
  161. package/app/components/ui/textarea/index.ts +1 -0
  162. package/app/composables/site-navigation.utils.ts +80 -0
  163. package/app/composables/useCanonicalUrl.ts +9 -0
  164. package/app/composables/useContentRouteAlternates.ts +43 -0
  165. package/app/composables/useGinkoAnalytics.ts +37 -0
  166. package/app/composables/useGinkoDocsConfig.ts +6 -0
  167. package/app/composables/useGinkoOgImage.ts +20 -0
  168. package/app/composables/useLocalizedPath.ts +12 -0
  169. package/app/composables/useLocalizedRouteSwitch.ts +31 -0
  170. package/app/composables/usePageMarkdownActions.ts +79 -0
  171. package/app/composables/useSchemaJsonLd.ts +25 -0
  172. package/app/composables/useSiteNavigation.ts +86 -0
  173. package/app/config/site.utils.ts +36 -0
  174. package/app/error.vue +125 -0
  175. package/app/features/docs/components/DocsContributeLinks.vue +65 -0
  176. package/app/features/docs/components/DocsMobileToc.vue +104 -0
  177. package/app/features/docs/components/DocsPageContent.vue +188 -0
  178. package/app/features/docs/components/DocsPageNav.vue +57 -0
  179. package/app/features/docs/components/DocsSidebar.vue +129 -0
  180. package/app/features/docs/components/DocsSidebarDropdown.vue +70 -0
  181. package/app/features/docs/components/DocsSidebarItem.vue +169 -0
  182. package/app/features/docs/components/DocsSidebarList.vue +35 -0
  183. package/app/features/docs/components/DocsSidebarTabs.vue +35 -0
  184. package/app/features/docs/components/DocsToc.vue +60 -0
  185. package/app/features/docs/composables/useDocsEntryPath.ts +13 -0
  186. package/app/features/docs/composables/useDocsNavigation.ts +29 -0
  187. package/app/features/docs/composables/useDocsNavigationData.ts +15 -0
  188. package/app/features/docs/composables/useScrollspy.ts +67 -0
  189. package/app/features/docs/docs-navigation.ts +170 -0
  190. package/app/features/search/command-center.ts +156 -0
  191. package/app/features/search/components/SiteCommandCenter.vue +323 -0
  192. package/app/features/search/components/SiteSearchPageHighlight.vue +124 -0
  193. package/app/features/search/useCommandCenter.ts +300 -0
  194. package/app/layouts/blog.vue +15 -0
  195. package/app/layouts/default.vue +12 -0
  196. package/app/layouts/docs.vue +20 -0
  197. package/app/lib/errors.ts +84 -0
  198. package/app/lib/schema-org.ts +38 -0
  199. package/app/lib/utils.ts +7 -0
  200. package/app/pages/blog/[slug].vue +211 -0
  201. package/app/pages/blog/index.vue +106 -0
  202. package/app/pages/docs/[...slug].vue +10 -0
  203. package/app/pages/docs/index.vue +23 -0
  204. package/app/pages/index.vue +140 -0
  205. package/app/plugins/ssr-width.ts +6 -0
  206. package/app/utils/content.ts +56 -0
  207. package/app/utils/index.ts +1 -0
  208. package/components.ts +9 -0
  209. package/content.js +175 -0
  210. package/content.ts +148 -0
  211. package/i18n/i18n.config.ts +10 -0
  212. package/i18n/locales.ts +81 -0
  213. package/i18n/messages/global/banner.ts +8 -0
  214. package/i18n/messages/global/blog.ts +14 -0
  215. package/i18n/messages/global/command.ts +44 -0
  216. package/i18n/messages/global/docs.ts +32 -0
  217. package/i18n/messages/global/errors.ts +36 -0
  218. package/i18n/messages/global/feedback.ts +11 -0
  219. package/i18n/messages/global/index.ts +21 -0
  220. package/i18n/messages/global/nav.ts +18 -0
  221. package/i18n/messages/global/site.ts +4 -0
  222. package/i18n/messages/global/theme.ts +7 -0
  223. package/i18n/messages/index.ts +20 -0
  224. package/i18n/messages/localize.ts +35 -0
  225. package/i18n/messages/source.ts +5 -0
  226. package/i18n/routes.ts +33 -0
  227. package/icon-bundle.ts +141 -0
  228. package/index.d.ts +13 -0
  229. package/modules/feature-routing.ts +32 -0
  230. package/nuxt.config.ts +194 -0
  231. package/package.json +91 -0
  232. package/runtime/markdown/inline-code-highlight.ts +155 -0
  233. package/runtime/server/agent-markdown.ts +21 -0
  234. package/runtime/utils.ts +7 -0
  235. package/server/mcp/tools/get-page.ts +14 -0
  236. package/server/mcp/tools/list-pages.ts +10 -0
  237. package/server/plugins/agent-markdown.ts +6 -0
  238. package/shared/route-slugs.ts +5 -0
  239. package/shared/types/app-config.ts +100 -0
  240. package/tags.ts +204 -0
@@ -0,0 +1,46 @@
1
+ <script setup lang="ts">
2
+ import { computed, onMounted, ref } from "vue";
3
+ import type { HTMLAttributes } from "vue";
4
+ import { cn } from "../../utils";
5
+
6
+ interface Props {
7
+ value?: string;
8
+ size?: "sm" | "md";
9
+ class?: HTMLAttributes["class"];
10
+ }
11
+
12
+ const props = withDefaults(defineProps<Props>(), {
13
+ size: "md",
14
+ });
15
+
16
+ const metaSymbol = ref("Ctrl");
17
+
18
+ // Safe from Nuxt SSR because onMounted only fires on the client
19
+ onMounted(() => {
20
+ if (typeof navigator !== "undefined" && navigator.userAgent.includes("Macintosh")) {
21
+ metaSymbol.value = "⌘";
22
+ }
23
+ });
24
+
25
+ const resolvedValue = computed(() => {
26
+ if (props.value === "meta") return metaSymbol.value;
27
+ return props.value;
28
+ });
29
+ </script>
30
+
31
+ <template>
32
+ <kbd
33
+ :class="
34
+ cn(
35
+ 'pointer-events-none inline-flex w-fit items-center justify-center gap-1 rounded-sm bg-muted font-sans font-medium text-muted-foreground ring-1 ring-border select-none [&_svg:not([class*=size-])]:size-3',
36
+ size === 'md' ? 'h-7 min-w-7 px-1.5 text-sm' : 'h-5 min-w-5 px-1 text-xs',
37
+ props.class,
38
+ )
39
+ "
40
+ >
41
+ <!-- Provide a slot so users can inject custom icons instead of strings if needed -->
42
+ <slot>
43
+ {{ resolvedValue }}
44
+ </slot>
45
+ </kbd>
46
+ </template>
@@ -0,0 +1,42 @@
1
+ <script setup lang="ts">
2
+ import type { ComputedRef, HTMLAttributes } from "vue";
3
+ import { computed, inject } from "vue";
4
+ import { cn } from "../../utils";
5
+ import { resolveIconifyIcon } from "./icons";
6
+
7
+ type StepsVariant = "icons" | "numbered";
8
+
9
+ const props = defineProps<{
10
+ title?: string;
11
+ icon?: string;
12
+ class?: HTMLAttributes["class"];
13
+ }>();
14
+
15
+ const stepsVariant = inject<ComputedRef<StepsVariant>>(
16
+ "mdcStepsVariant",
17
+ computed(() => "icons"),
18
+ );
19
+
20
+ const isNumbered = computed(() => stepsVariant.value === "numbered");
21
+
22
+ const iconName = computed(() => {
23
+ const icon = props.icon?.trim();
24
+ if (!icon) return "lucide:circle";
25
+ return resolveIconifyIcon(icon) ?? "lucide:circle";
26
+ });
27
+ </script>
28
+
29
+ <template>
30
+ <div :class="cn('content-step', props.class)">
31
+ <div class="content-step-marker" aria-hidden="true">
32
+ <Icon v-if="!isNumbered" :name="iconName" class="size-3.5" />
33
+ </div>
34
+
35
+ <div class="content-step-body content-prose content-prose-trim">
36
+ <p v-if="title" class="content-step-title">
37
+ {{ title }}
38
+ </p>
39
+ <slot />
40
+ </div>
41
+ </div>
42
+ </template>
@@ -0,0 +1,25 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from "vue";
3
+ import { computed, provide } from "vue";
4
+ import { cn } from "../../utils";
5
+
6
+ const props = withDefaults(
7
+ defineProps<{
8
+ variant?: "icons" | "numbered";
9
+ class?: HTMLAttributes["class"];
10
+ }>(),
11
+ {
12
+ variant: "icons",
13
+ },
14
+ );
15
+
16
+ const normalizedVariant = computed(() => (props.variant === "numbered" ? "numbered" : "icons"));
17
+
18
+ provide("mdcStepsVariant", normalizedVariant);
19
+ </script>
20
+
21
+ <template>
22
+ <div :class="cn('content-steps not-prose', props.class)" :data-variant="normalizedVariant">
23
+ <slot />
24
+ </div>
25
+ </template>
@@ -0,0 +1,16 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from "vue";
3
+ import MdcCallout from "./MdcCallout.vue";
4
+
5
+ const props = defineProps<{
6
+ title?: string;
7
+ icon?: string;
8
+ class?: HTMLAttributes["class"];
9
+ }>();
10
+ </script>
11
+
12
+ <template>
13
+ <MdcCallout :title="title" :icon="icon" type="success" :class="props.class">
14
+ <slot />
15
+ </MdcCallout>
16
+ </template>
@@ -0,0 +1,17 @@
1
+ <script setup lang="ts">
2
+ defineOptions({
3
+ inheritAttrs: false,
4
+ });
5
+
6
+ defineProps<{
7
+ icon?: string;
8
+ label?: string;
9
+ inGroup?: boolean;
10
+ }>();
11
+ </script>
12
+
13
+ <template>
14
+ <div :label="label" :in-group="inGroup">
15
+ <slot />
16
+ </div>
17
+ </template>
@@ -0,0 +1,132 @@
1
+ <script setup lang="ts">
2
+ import type { VNode } from "vue";
3
+ import { h, ref, resolveComponent, useSlots } from "vue";
4
+ import { cn } from "../../utils";
5
+ import { resolveIconifyIcon } from "./icons";
6
+
7
+ const props = withDefaults(
8
+ defineProps<{
9
+ variant?: "separate" | "line";
10
+ padded?: boolean;
11
+ inStack?: boolean;
12
+ }>(),
13
+ {
14
+ variant: "separate",
15
+ padded: true,
16
+ inStack: false,
17
+ },
18
+ );
19
+
20
+ const slots = useSlots();
21
+ const activeValue = ref("");
22
+
23
+ type TabItem = {
24
+ icon?: string;
25
+ label: string;
26
+ node: VNode;
27
+ value: string;
28
+ };
29
+
30
+ function getTabLabel(node: VNode, index: number) {
31
+ const label = node.props?.label;
32
+ return typeof label === "string" && label.trim().length > 0 ? label : `Tab ${index + 1}`;
33
+ }
34
+
35
+ function getTabIcon(node: VNode) {
36
+ const icon = node.props?.icon;
37
+ return typeof icon === "string" ? resolveIconifyIcon(icon) : undefined;
38
+ }
39
+
40
+ function getItems(): TabItem[] {
41
+ return (slots.default?.() ?? [])
42
+ .filter((node): node is VNode => Boolean(node?.type))
43
+ .map((node, index) => ({
44
+ icon: getTabIcon(node),
45
+ label: getTabLabel(node, index),
46
+ node,
47
+ value: getTabLabel(node, index),
48
+ }));
49
+ }
50
+
51
+ function renderTabs() {
52
+ const items = getItems();
53
+ const Icon = resolveComponent("Icon");
54
+ const resolvedValue = items.some((item) => item.value === activeValue.value)
55
+ ? activeValue.value
56
+ : activeValue.value || items[0]?.value || "";
57
+
58
+ if (!items.length) {
59
+ return null;
60
+ }
61
+
62
+ return h(
63
+ "div",
64
+ {
65
+ class: cn("content-tabs not-prose group", props.inStack && "content-tabs-in-stack"),
66
+ },
67
+ [
68
+ h("div", { class: "content-tabs-header" }, [
69
+ h(
70
+ "div",
71
+ {
72
+ class: "content-tabs-list",
73
+ role: "tablist",
74
+ },
75
+ items.map((item) =>
76
+ h(
77
+ "button",
78
+ {
79
+ key: item.value,
80
+ type: "button",
81
+ role: "tab",
82
+ "aria-selected": resolvedValue === item.value,
83
+ class: cn(
84
+ "content-tabs-tab",
85
+ resolvedValue === item.value && "content-tabs-tab-active",
86
+ ),
87
+ onClick: () => {
88
+ activeValue.value = item.value;
89
+ },
90
+ },
91
+ [
92
+ item.icon
93
+ ? h(Icon, {
94
+ name: item.icon,
95
+ class: "content-tabs-tab-icon",
96
+ "aria-hidden": "true",
97
+ })
98
+ : null,
99
+ item.label,
100
+ ],
101
+ ),
102
+ ),
103
+ ),
104
+ ]),
105
+ h(
106
+ "div",
107
+ { class: "content-tabs-panels" },
108
+ items.map((item) =>
109
+ h(
110
+ "div",
111
+ {
112
+ key: item.value,
113
+ value: item.value,
114
+ role: "tabpanel",
115
+ class: cn(
116
+ "content-tabs-content-area content-prose content-prose-trim [&>figure:only-child]:-m-4 [&>figure:only-child]:border-none",
117
+ props.padded ? "p-4" : "p-0",
118
+ ),
119
+ style: resolvedValue === item.value ? undefined : { display: "none" },
120
+ },
121
+ [h(item.node, { inGroup: true })],
122
+ ),
123
+ ),
124
+ ),
125
+ ],
126
+ );
127
+ }
128
+ </script>
129
+
130
+ <template>
131
+ <component :is="renderTabs" />
132
+ </template>
@@ -0,0 +1,14 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from "vue";
3
+ import { cn } from "../../utils";
4
+
5
+ const props = defineProps<{
6
+ class?: HTMLAttributes["class"];
7
+ }>();
8
+ </script>
9
+
10
+ <template>
11
+ <div :class="cn('not-prose mb-12 ml-4 border-l border-border pl-8', props.class)">
12
+ <slot />
13
+ </div>
14
+ </template>
@@ -0,0 +1,49 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from "vue";
3
+ import { cn } from "../../utils";
4
+
5
+ const props = defineProps<{
6
+ date?: string;
7
+ label?: string;
8
+ title?: string;
9
+ class?: HTMLAttributes["class"];
10
+ }>();
11
+ </script>
12
+
13
+ <template>
14
+ <div :class="cn('relative pb-8 last:pb-0', props.class)">
15
+ <div
16
+ class="absolute top-0.5 -left-[2.45rem] flex h-5 w-5 items-center justify-center rounded-full border border-border bg-background"
17
+ >
18
+ <div class="size-2 rounded-full bg-primary" />
19
+ </div>
20
+ <div class="mb-2 flex flex-wrap items-center gap-2">
21
+ <span
22
+ v-if="date"
23
+ class="inline-flex items-center rounded-md border border-border bg-muted/50 px-2 py-0.5 text-xs font-medium text-muted-foreground"
24
+ >
25
+ {{ date }}
26
+ </span>
27
+ <span
28
+ v-if="label"
29
+ class="inline-flex items-center rounded-md bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary"
30
+ >
31
+ {{ label }}
32
+ </span>
33
+ </div>
34
+ <p v-if="title" class="mb-1 font-semibold text-foreground">
35
+ {{ title }}
36
+ </p>
37
+ <div
38
+ :class="
39
+ cn(
40
+ 'content-prose content-prose-trim text-muted-foreground',
41
+ '[&_a]:font-medium [&_a]:text-foreground [&_a]:underline [&_a]:underline-offset-4',
42
+ '[&_p]:my-2 [&_p]:text-pretty [&_p:first-child]:mt-0 [&_p:last-child]:mb-0',
43
+ )
44
+ "
45
+ >
46
+ <slot />
47
+ </div>
48
+ </div>
49
+ </template>
@@ -0,0 +1,16 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from "vue";
3
+ import MdcCallout from "./MdcCallout.vue";
4
+
5
+ const props = defineProps<{
6
+ title?: string;
7
+ icon?: string;
8
+ class?: HTMLAttributes["class"];
9
+ }>();
10
+ </script>
11
+
12
+ <template>
13
+ <MdcCallout :title="title" :icon="icon" type="warning" :class="props.class">
14
+ <slot />
15
+ </MdcCallout>
16
+ </template>
@@ -0,0 +1,10 @@
1
+ export function resolveIconifyIcon(name?: string | null): string | undefined {
2
+ if (!name?.trim()) return undefined;
3
+ const n = name.trim();
4
+ if (n.startsWith("i-lucide-")) return `lucide:${n.slice("i-lucide-".length)}`;
5
+ return n.includes(":") ? n : `lucide:${n.replace(/_/g, "-").toLowerCase()}`;
6
+ }
7
+
8
+ export function isExternalLink(to?: string | null) {
9
+ return Boolean(to && /^(https?:)?\/\//.test(to));
10
+ }
@@ -0,0 +1,27 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from "vue";
3
+ import { computed } from "vue";
4
+ import { cn } from "../../utils";
5
+
6
+ const props = defineProps<{
7
+ href?: string;
8
+ target?: string;
9
+ class?: HTMLAttributes["class"];
10
+ }>();
11
+
12
+ const isExternal = computed(
13
+ () => props.target === "_blank" || (props.href && /^https?:\/\//.test(props.href)),
14
+ );
15
+ </script>
16
+
17
+ <template>
18
+ <NuxtLink :href="props.href || ''" :target="props.target" :class="cn(props.class)">
19
+ <slot />
20
+ <Icon
21
+ v-if="isExternal"
22
+ name="lucide:arrow-up-right"
23
+ class="ml-0.5 inline size-3 align-text-top"
24
+ aria-hidden="true"
25
+ />
26
+ </NuxtLink>
27
+ </template>
@@ -0,0 +1,14 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from "vue";
3
+ import { cn } from "../../utils";
4
+
5
+ const props = defineProps<{
6
+ class?: HTMLAttributes["class"];
7
+ }>();
8
+ </script>
9
+
10
+ <template>
11
+ <blockquote :class="cn(props.class)">
12
+ <slot />
13
+ </blockquote>
14
+ </template>
@@ -0,0 +1,14 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from "vue";
3
+ import { cn } from "../../utils";
4
+
5
+ const props = defineProps<{
6
+ class?: HTMLAttributes["class"];
7
+ }>();
8
+ </script>
9
+
10
+ <template>
11
+ <code :class="cn('content-code', props.class)">
12
+ <slot />
13
+ </code>
14
+ </template>
@@ -0,0 +1,14 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from "vue";
3
+ import { cn } from "../../utils";
4
+
5
+ const props = defineProps<{
6
+ class?: HTMLAttributes["class"];
7
+ }>();
8
+ </script>
9
+
10
+ <template>
11
+ <em :class="cn(props.class)">
12
+ <slot />
13
+ </em>
14
+ </template>
@@ -0,0 +1,18 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from "vue";
3
+ import { cn } from "../../utils";
4
+
5
+ const props = defineProps<{
6
+ id?: string;
7
+ class?: HTMLAttributes["class"];
8
+ }>();
9
+ </script>
10
+
11
+ <template>
12
+ <h1 :id="id" :class="cn('scroll-mt-28', props.class)">
13
+ <a v-if="id" :href="`#${id}`" class="inline-flex items-center gap-2">
14
+ <slot />
15
+ </a>
16
+ <slot v-else />
17
+ </h1>
18
+ </template>
@@ -0,0 +1,24 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from "vue";
3
+ import { cn } from "../../utils";
4
+
5
+ const props = defineProps<{
6
+ id?: string;
7
+ class?: HTMLAttributes["class"];
8
+ }>();
9
+ </script>
10
+
11
+ <template>
12
+ <h2 :id="id" :class="cn('flex scroll-mt-28 flex-row items-center gap-1.5', props.class)">
13
+ <a v-if="id" :href="`#${id}`" class="peer" data-card="">
14
+ <slot />
15
+ </a>
16
+ <Icon
17
+ v-if="id"
18
+ name="lucide:link"
19
+ class="size-3 shrink-0 text-muted-foreground opacity-0 transition-opacity peer-hover:opacity-100"
20
+ aria-hidden="true"
21
+ />
22
+ <slot v-else />
23
+ </h2>
24
+ </template>
@@ -0,0 +1,24 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from "vue";
3
+ import { cn } from "../../utils";
4
+
5
+ const props = defineProps<{
6
+ id?: string;
7
+ class?: HTMLAttributes["class"];
8
+ }>();
9
+ </script>
10
+
11
+ <template>
12
+ <h3 :id="id" :class="cn('flex scroll-mt-28 flex-row items-center gap-1.5', props.class)">
13
+ <a v-if="id" :href="`#${id}`" class="peer" data-card="">
14
+ <slot />
15
+ </a>
16
+ <Icon
17
+ v-if="id"
18
+ name="lucide:link"
19
+ class="size-3 shrink-0 text-muted-foreground opacity-0 transition-opacity peer-hover:opacity-100"
20
+ aria-hidden="true"
21
+ />
22
+ <slot v-else />
23
+ </h3>
24
+ </template>
@@ -0,0 +1,14 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from "vue";
3
+ import { cn } from "../../utils";
4
+
5
+ const props = defineProps<{
6
+ class?: HTMLAttributes["class"];
7
+ }>();
8
+ </script>
9
+
10
+ <template>
11
+ <h4 :class="cn('scroll-mt-28', props.class)">
12
+ <slot />
13
+ </h4>
14
+ </template>
@@ -0,0 +1,12 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from "vue";
3
+ import { cn } from "../../utils";
4
+
5
+ const props = defineProps<{
6
+ class?: HTMLAttributes["class"];
7
+ }>();
8
+ </script>
9
+
10
+ <template>
11
+ <hr :class="cn(props.class)" />
12
+ </template>
@@ -0,0 +1,120 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from "vue";
3
+ import { computed, ref } from "vue";
4
+ import { useI18n } from "#imports";
5
+ import {
6
+ Dialog,
7
+ DialogContent,
8
+ DialogDescription,
9
+ DialogTitle,
10
+ } from "#ginko-docs/components/ui/dialog";
11
+ import { useGinkoDocsConfig } from "#ginko-docs/composables/useGinkoDocsConfig";
12
+ import { cn } from "../../utils";
13
+
14
+ const props = withDefaults(
15
+ defineProps<{
16
+ src?: string;
17
+ alt?: string;
18
+ title?: string;
19
+ caption?: string;
20
+ description?: string;
21
+ width?: string | number;
22
+ height?: string | number;
23
+ bleed?: boolean | string;
24
+ aspect?: "auto" | "video" | "wide" | "square" | "portrait";
25
+ fit?: "cover" | "contain";
26
+ align?: "left" | "center" | "right";
27
+ class?: HTMLAttributes["class"];
28
+ }>(),
29
+ {
30
+ aspect: "auto",
31
+ fit: "cover",
32
+ align: "center",
33
+ },
34
+ );
35
+
36
+ const { t } = useI18n();
37
+ const config = useGinkoDocsConfig();
38
+ const zoomEnabled = computed(() => config.images?.zoom !== false);
39
+ const zoomOpen = ref(false);
40
+
41
+ const shouldBleed = computed(() => props.bleed === true || props.bleed === "true");
42
+
43
+ const aspectClass = computed(() => {
44
+ return {
45
+ auto: "",
46
+ video: "aspect-video",
47
+ wide: "aspect-[21/9]",
48
+ square: "aspect-square",
49
+ portrait: "aspect-[4/5]",
50
+ }[props.aspect];
51
+ });
52
+
53
+ const imageClass = computed(() =>
54
+ cn("w-full", aspectClass.value, props.fit === "contain" ? "object-contain" : "object-cover"),
55
+ );
56
+ </script>
57
+
58
+ <template>
59
+ <figure
60
+ :class="cn('content-media not-prose', props.class)"
61
+ :data-bleed="shouldBleed ? 'true' : undefined"
62
+ >
63
+ <template v-if="src">
64
+ <button
65
+ v-if="zoomEnabled"
66
+ type="button"
67
+ class="block w-full cursor-zoom-in rounded-[inherit] focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none"
68
+ :aria-label="`${t('docs.zoomImage')}: ${alt ?? ''}`"
69
+ @click="zoomOpen = true"
70
+ >
71
+ <NuxtImg
72
+ :src="src"
73
+ :alt="alt"
74
+ :width="width"
75
+ :height="height"
76
+ sizes="100vw md:768px"
77
+ loading="lazy"
78
+ :class="imageClass"
79
+ />
80
+ </button>
81
+ <NuxtImg
82
+ v-else
83
+ :src="src"
84
+ :alt="alt"
85
+ :width="width"
86
+ :height="height"
87
+ sizes="100vw md:768px"
88
+ loading="lazy"
89
+ :class="imageClass"
90
+ />
91
+ </template>
92
+ <figcaption
93
+ v-if="caption || title || alt || description"
94
+ :class="
95
+ cn(
96
+ align === 'left' && 'text-left',
97
+ align === 'center' && 'text-center',
98
+ align === 'right' && 'text-right',
99
+ )
100
+ "
101
+ >
102
+ <span>{{ caption || title || alt }}</span>
103
+ <span v-if="description" class="content-media-description">
104
+ {{ description }}
105
+ </span>
106
+ </figcaption>
107
+
108
+ <Dialog v-if="zoomEnabled" v-model:open="zoomOpen">
109
+ <DialogContent
110
+ class="max-h-[90dvh] w-auto max-w-[min(96vw,80rem)] overflow-auto border-none bg-transparent p-0 shadow-none"
111
+ >
112
+ <DialogTitle class="sr-only">{{
113
+ caption || title || alt || t("docs.zoomImage")
114
+ }}</DialogTitle>
115
+ <DialogDescription v-if="description" class="sr-only">{{ description }}</DialogDescription>
116
+ <img :src="src" :alt="alt" class="max-h-[88dvh] w-auto rounded-lg object-contain" />
117
+ </DialogContent>
118
+ </Dialog>
119
+ </figure>
120
+ </template>