@wordup-md/nuxt-layer-shadcn-unocss 0.2.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 (359) hide show
  1. package/.cursor/rules/active-context-rule.mdc +8 -0
  2. package/.cursor/rules/memory-bank-overview.mdc +17 -0
  3. package/.cursor/rules/product-context-rule.mdc +8 -0
  4. package/.cursor/rules/progress-rule.mdc +8 -0
  5. package/.cursor/rules/projectbrief-rule.mdc +8 -0
  6. package/.cursor/rules/system-patterns-rule.mdc +8 -0
  7. package/.cursor/rules/tech-context-rule.mdc +8 -0
  8. package/.cursorrules +52 -0
  9. package/.editorconfig +12 -0
  10. package/.nuxtrc +1 -0
  11. package/.playground/app.config.ts +189 -0
  12. package/.playground/assets/style.css +15 -0
  13. package/.playground/components/content/MdcExample.vue +81 -0
  14. package/.playground/components/content/MdcReplay.vue +319 -0
  15. package/.playground/content/1.getting-started/1.introduction.md +8 -0
  16. package/.playground/content/1.getting-started/2.writing/1.markdown.md +56 -0
  17. package/.playground/content/1.getting-started/2.writing/2.pages.md +177 -0
  18. package/.playground/content/1.getting-started/2.writing/3.folders.md +56 -0
  19. package/.playground/content/1.getting-started/2.writing/_dir.yml +3 -0
  20. package/.playground/content/1.getting-started/_dir.yml +3 -0
  21. package/.playground/content/2.content-elements/1.text-formatting.md +60 -0
  22. package/.playground/content/2.content-elements/10.horizontal-rule.md +25 -0
  23. package/.playground/content/2.content-elements/11.tables.md +25 -0
  24. package/.playground/content/2.content-elements/12.overview.md +93 -0
  25. package/.playground/content/2.content-elements/13.text-components.md +36 -0
  26. package/.playground/content/2.content-elements/2.headings.md +32 -0
  27. package/.playground/content/2.content-elements/3.paragraphs.md +39 -0
  28. package/.playground/content/2.content-elements/4.lists.md +37 -0
  29. package/.playground/content/2.content-elements/5.links.md +17 -0
  30. package/.playground/content/2.content-elements/6.images.md +17 -0
  31. package/.playground/content/2.content-elements/7.blockquotes.md +17 -0
  32. package/.playground/content/2.content-elements/8.code-blocks.md +141 -0
  33. package/.playground/content/2.content-elements/9.inline-code.md +21 -0
  34. package/.playground/content/2.content-elements/_dir.yml +3 -0
  35. package/.playground/content/2.content-elements/index.md +8 -0
  36. package/.playground/content/3.components/1.index.md +187 -0
  37. package/.playground/content/3.components/2.docs/_dir.yml +3 -0
  38. package/.playground/content/3.components/2.docs/alert.md +152 -0
  39. package/.playground/content/3.components/2.docs/badge.md +131 -0
  40. package/.playground/content/3.components/2.docs/button-link.md +53 -0
  41. package/.playground/content/3.components/2.docs/callout.md +16 -0
  42. package/.playground/content/3.components/2.docs/code-group.md +77 -0
  43. package/.playground/content/3.components/2.docs/code-snippet.md +129 -0
  44. package/.playground/content/3.components/2.docs/field-group.md +62 -0
  45. package/.playground/content/3.components/2.docs/field.md +39 -0
  46. package/.playground/content/3.components/2.docs/file-tree.md +144 -0
  47. package/.playground/content/3.components/2.docs/icon.md +94 -0
  48. package/.playground/content/3.components/2.docs/pm.md +67 -0
  49. package/.playground/content/3.components/2.docs/read-more.md +44 -0
  50. package/.playground/content/3.components/2.docs/shortcut.md +36 -0
  51. package/.playground/content/3.components/2.docs/stack.md +81 -0
  52. package/.playground/content/3.components/2.docs/steps.md +148 -0
  53. package/.playground/content/3.components/2.docs/tabs.md +375 -0
  54. package/.playground/content/3.components/3.page/_dir.yml +2 -0
  55. package/.playground/content/3.components/3.page/accordion.md +74 -0
  56. package/.playground/content/3.components/3.page/card-group.md +115 -0
  57. package/.playground/content/3.components/3.page/card.md +142 -0
  58. package/.playground/content/3.components/3.page/collapsible.md +61 -0
  59. package/.playground/content/3.components/3.page/hero-alt.md +118 -0
  60. package/.playground/content/3.components/3.page/hero.md +60 -0
  61. package/.playground/content/3.components/3.page/team-card.md +82 -0
  62. package/.playground/content/3.components/_dir.yml +2 -0
  63. package/.playground/content/4.development/1.configuration/1.overview.md +297 -0
  64. package/.playground/content/4.development/1.configuration/2.nuxt-content.md +105 -0
  65. package/.playground/content/4.development/1.configuration/3.og-image.md +86 -0
  66. package/.playground/content/4.development/1.configuration/4.edit-link.md +63 -0
  67. package/.playground/content/4.development/1.configuration/5.banner.md +52 -0
  68. package/.playground/content/4.development/1.configuration/6.carbon-ads.md +65 -0
  69. package/.playground/content/4.development/1.configuration/7.umami.md +41 -0
  70. package/.playground/content/4.development/1.configuration/_dir.yml +3 -0
  71. package/.playground/content/4.development/2.advanced/1.override.md +49 -0
  72. package/.playground/content/4.development/2.advanced/2.math.md +89 -0
  73. package/.playground/content/4.development/2.advanced/_dir.yml +3 -0
  74. package/.playground/content/4.development/3.themes.md +9 -0
  75. package/.playground/content/4.development/4.composables.md +38 -0
  76. package/.playground/content/4.development/5.installation.md +36 -0
  77. package/.playground/content/4.development/_dir.yml +3 -0
  78. package/.playground/content/_menu-footer.md +5 -0
  79. package/.playground/content/index.md +67 -0
  80. package/.playground/content/test-card.md +187 -0
  81. package/.playground/content/test.md +88 -0
  82. package/.playground/content/test2.md +12 -0
  83. package/.playground/content/test3.md +187 -0
  84. package/.playground/nuxt.config.ts +52 -0
  85. package/.playground/public/banner-preview.png +0 -0
  86. package/.playground/public/favicon.ico +0 -0
  87. package/.playground/public/front-matter-showcase/authors.png +0 -0
  88. package/.playground/public/front-matter-showcase/badges.png +0 -0
  89. package/.playground/public/front-matter-showcase/nav-badges.png +0 -0
  90. package/.playground/public/hero.png +0 -0
  91. package/.playground/public/logo-dark.svg +12 -0
  92. package/.playground/public/logo.svg +12 -0
  93. package/.playground/public/og-nuxt-seo.png +0 -0
  94. package/.playground/public/og-nuxt.png +0 -0
  95. package/.playground/public/og-shadcn-docs-dark.png +0 -0
  96. package/.playground/public/og-shadcn-docs.png +0 -0
  97. package/.playground/public/sidebar-default.png +0 -0
  98. package/.playground/public/sidebar-group.png +0 -0
  99. package/.playground/public/sidebar-tree.png +0 -0
  100. package/.playground/uno.config.ts +16 -0
  101. package/README.md +93 -0
  102. package/app.vue +59 -0
  103. package/assets/css/a11y.css +48 -0
  104. package/assets/css/mdc-editor.css +91 -0
  105. package/components/A11yModeToggle.vue +23 -0
  106. package/components/DarkModeToggle.vue +26 -0
  107. package/components/LinkIcon.vue +32 -0
  108. package/components/OgImage/ShadcnDocs.vue +55 -0
  109. package/components/ThemeCustomizer.vue +156 -0
  110. package/components/ThemePopover.vue +27 -0
  111. package/components/content/Accordion.vue +18 -0
  112. package/components/content/AccordionItem.vue +32 -0
  113. package/components/content/Alert.vue +100 -0
  114. package/components/content/Badge.vue +52 -0
  115. package/components/content/ButtonLink.vue +38 -0
  116. package/components/content/Callout.vue +17 -0
  117. package/components/content/Card.vue +173 -0
  118. package/components/content/CardGroup.vue +38 -0
  119. package/components/content/CodeCopy.vue +52 -0
  120. package/components/content/CodeGroup._vue +27 -0
  121. package/components/content/CodeSnippet._vue +78 -0
  122. package/components/content/Collapsible.vue +80 -0
  123. package/components/content/Field.vue +53 -0
  124. package/components/content/FieldGroup.vue +5 -0
  125. package/components/content/FileTree.vue +110 -0
  126. package/components/content/FileTreeItem.vue +64 -0
  127. package/components/content/FileTreeRoot.vue +27 -0
  128. package/components/content/Hero.vue +154 -0
  129. package/components/content/HeroAlt.vue +116 -0
  130. package/components/content/Icon.vue +69 -0
  131. package/components/content/Kbd.vue +20 -0
  132. package/components/content/PmInstall.vue +35 -0
  133. package/components/content/PmRun.vue +31 -0
  134. package/components/content/PmX.vue +31 -0
  135. package/components/content/ProseA.vue +21 -0
  136. package/components/content/ProseBlockquote.vue +5 -0
  137. package/components/content/ProseCode.vue +121 -0
  138. package/components/content/ProseCodeInline.vue +24 -0
  139. package/components/content/ProseEm.vue +5 -0
  140. package/components/content/ProseH1.vue +27 -0
  141. package/components/content/ProseH2.vue +22 -0
  142. package/components/content/ProseH3.vue +21 -0
  143. package/components/content/ProseH4.vue +21 -0
  144. package/components/content/ProseH5.vue +21 -0
  145. package/components/content/ProseH6.vue +21 -0
  146. package/components/content/ProseHr.vue +3 -0
  147. package/components/content/ProseImg.vue +42 -0
  148. package/components/content/ProseLi.vue +5 -0
  149. package/components/content/ProseOl.vue +5 -0
  150. package/components/content/ProseP.vue +5 -0
  151. package/components/content/ProsePre.vue +56 -0
  152. package/components/content/ProseSection.vue +27 -0
  153. package/components/content/ProseStrong.vue +5 -0
  154. package/components/content/ProseTable.vue +7 -0
  155. package/components/content/ProseTbody.vue +5 -0
  156. package/components/content/ProseTd.vue +5 -0
  157. package/components/content/ProseTh.vue +5 -0
  158. package/components/content/ProseThead.vue +5 -0
  159. package/components/content/ProseTr.vue +5 -0
  160. package/components/content/ProseUl.vue +5 -0
  161. package/components/content/ReadMore.vue +41 -0
  162. package/components/content/Shortcut.vue +20 -0
  163. package/components/content/Stack.vue +17 -0
  164. package/components/content/Steps.vue +23 -0
  165. package/components/content/Tabs.vue +52 -0
  166. package/components/content/TabsInner.vue +263 -0
  167. package/components/content/TeamCard.vue +52 -0
  168. package/components/content/TeamCardGroup.vue +5 -0
  169. package/components/content/global/AlertEditor.vue +58 -0
  170. package/components/content/global/BadgeEditor.vue +56 -0
  171. package/components/content/global/BrEditor.vue +3 -0
  172. package/components/content/global/CardEditor.vue +142 -0
  173. package/components/content/global/CardGroupEditor.vue +50 -0
  174. package/components/content/global/CodeGroup.vue +13 -0
  175. package/components/content/global/CodeGroupEditor.vue +50 -0
  176. package/components/content/global/DivEditor.vue +22 -0
  177. package/components/content/global/FieldEditor.vue +38 -0
  178. package/components/content/global/FieldGroupEditor.vue +24 -0
  179. package/components/content/global/HeroEditor.vue +67 -0
  180. package/components/content/global/ProseSectionEditor.vue +180 -0
  181. package/components/content/global/ReadMoreEditor.vue +70 -0
  182. package/components/content/global/SectionEditor.vue +22 -0
  183. package/components/content/global/StackEditor.vue +35 -0
  184. package/components/content/global/StepsEditor.vue +55 -0
  185. package/components/content/global/Tabs._vue +97 -0
  186. package/components/content/global/TabsEditor.vue +38 -0
  187. package/components/layout/Aside.vue +83 -0
  188. package/components/layout/AsideTree.vue +25 -0
  189. package/components/layout/AsideTreeItem.vue +86 -0
  190. package/components/layout/AsideTreeItemButton.vue +32 -0
  191. package/components/layout/Banner.vue +77 -0
  192. package/components/layout/Breadcrumb.vue +34 -0
  193. package/components/layout/DocsFooter.vue +6 -0
  194. package/components/layout/EditLink.vue +23 -0
  195. package/components/layout/Footer.vue +80 -0
  196. package/components/layout/FooterItem.vue +50 -0
  197. package/components/layout/FooterSubmenuItem.vue +39 -0
  198. package/components/layout/Header/Logo.vue +30 -0
  199. package/components/layout/Header/MenuItem.vue +83 -0
  200. package/components/layout/Header/Nav.vue +112 -0
  201. package/components/layout/Header/NavMobile.vue +14 -0
  202. package/components/layout/Header/NavMobileItem.vue +79 -0
  203. package/components/layout/Header/SubmenuItem.vue +39 -0
  204. package/components/layout/Header.vue +160 -0
  205. package/components/layout/LangSwitcher.vue +90 -0
  206. package/components/layout/MobileNav.vue +44 -0
  207. package/components/layout/PrevNext.vue +24 -0
  208. package/components/layout/PrevNextButton.vue +50 -0
  209. package/components/layout/SearchButton.vue +46 -0
  210. package/components/layout/SearchDialog.vue +217 -0
  211. package/components/layout/Title.vue +98 -0
  212. package/components/layout/Toc.vue +99 -0
  213. package/components/layout/TocTree.vue +42 -0
  214. package/components/ui/accordion/Accordion.vue +19 -0
  215. package/components/ui/accordion/AccordionContent.vue +24 -0
  216. package/components/ui/accordion/AccordionItem.vue +24 -0
  217. package/components/ui/accordion/AccordionTrigger.vue +39 -0
  218. package/components/ui/accordion/index.ts +4 -0
  219. package/components/ui/alert/Alert.vue +19 -0
  220. package/components/ui/alert/AlertDescription.vue +14 -0
  221. package/components/ui/alert/AlertTitle.vue +14 -0
  222. package/components/ui/alert/index.ts +23 -0
  223. package/components/ui/avatar/Avatar.vue +25 -0
  224. package/components/ui/avatar/AvatarFallback.vue +11 -0
  225. package/components/ui/avatar/AvatarImage.vue +12 -0
  226. package/components/ui/avatar/index.ts +24 -0
  227. package/components/ui/badge/Badge.vue +17 -0
  228. package/components/ui/badge/index.ts +71 -0
  229. package/components/ui/breadcrumb/Breadcrumb.vue +16 -0
  230. package/components/ui/breadcrumb/BreadcrumbItem.vue +16 -0
  231. package/components/ui/breadcrumb/BreadcrumbLink.vue +23 -0
  232. package/components/ui/breadcrumb/BreadcrumbList.vue +16 -0
  233. package/components/ui/breadcrumb/BreadcrumbPage.vue +19 -0
  234. package/components/ui/breadcrumb/BreadcrumbSeparator.vue +23 -0
  235. package/components/ui/breadcrumb/index.ts +6 -0
  236. package/components/ui/button/Button.vue +29 -0
  237. package/components/ui/button/index.ts +35 -0
  238. package/components/ui/card/Card.vue +21 -0
  239. package/components/ui/card/CardContent.vue +14 -0
  240. package/components/ui/card/CardDescription.vue +14 -0
  241. package/components/ui/card/CardFooter.vue +14 -0
  242. package/components/ui/card/CardHeader.vue +14 -0
  243. package/components/ui/card/CardTitle.vue +18 -0
  244. package/components/ui/card/index.ts +6 -0
  245. package/components/ui/collapsible/Collapsible.vue +18 -0
  246. package/components/ui/collapsible/CollapsibleContent.vue +14 -0
  247. package/components/ui/collapsible/CollapsibleTrigger.vue +11 -0
  248. package/components/ui/collapsible/index.ts +3 -0
  249. package/components/ui/command/Command.vue +89 -0
  250. package/components/ui/command/CommandEmpty.vue +30 -0
  251. package/components/ui/command/CommandGroup.vue +50 -0
  252. package/components/ui/command/CommandInput.vue +44 -0
  253. package/components/ui/command/CommandInputOnly.vue +50 -0
  254. package/components/ui/command/CommandItem.vue +79 -0
  255. package/components/ui/command/CommandList.vue +28 -0
  256. package/components/ui/command/CommandSeparator.vue +24 -0
  257. package/components/ui/command/index.ts +24 -0
  258. package/components/ui/dialog/Dialog.vue +14 -0
  259. package/components/ui/dialog/DialogClose.vue +11 -0
  260. package/components/ui/dialog/DialogContent.vue +52 -0
  261. package/components/ui/dialog/DialogDescription.vue +24 -0
  262. package/components/ui/dialog/DialogFooter.vue +19 -0
  263. package/components/ui/dialog/DialogHeader.vue +16 -0
  264. package/components/ui/dialog/DialogScrollContent.vue +61 -0
  265. package/components/ui/dialog/DialogTitle.vue +29 -0
  266. package/components/ui/dialog/DialogTrigger.vue +11 -0
  267. package/components/ui/dialog/index.ts +9 -0
  268. package/components/ui/input/Input.vue +27 -0
  269. package/components/ui/input/index.ts +1 -0
  270. package/components/ui/label/Label.vue +27 -0
  271. package/components/ui/label/index.ts +1 -0
  272. package/components/ui/navigation-menu/NavigationMenu.vue +33 -0
  273. package/components/ui/navigation-menu/NavigationMenuContent.vue +34 -0
  274. package/components/ui/navigation-menu/NavigationMenuIndicator.vue +24 -0
  275. package/components/ui/navigation-menu/NavigationMenuItem.vue +11 -0
  276. package/components/ui/navigation-menu/NavigationMenuLink.vue +19 -0
  277. package/components/ui/navigation-menu/NavigationMenuList.vue +33 -0
  278. package/components/ui/navigation-menu/NavigationMenuTrigger.vue +34 -0
  279. package/components/ui/navigation-menu/NavigationMenuViewport.vue +33 -0
  280. package/components/ui/navigation-menu/index.ts +14 -0
  281. package/components/ui/popover/Popover.vue +15 -0
  282. package/components/ui/popover/PopoverContent.vue +49 -0
  283. package/components/ui/popover/PopoverTrigger.vue +11 -0
  284. package/components/ui/popover/index.ts +4 -0
  285. package/components/ui/scroll-area/ScrollArea.vue +32 -0
  286. package/components/ui/scroll-area/ScrollBar.vue +41 -0
  287. package/components/ui/scroll-area/index.ts +2 -0
  288. package/components/ui/separator/Separator.vue +20 -0
  289. package/components/ui/separator/index.ts +1 -0
  290. package/components/ui/sheet/Sheet.vue +14 -0
  291. package/components/ui/sheet/SheetClose.vue +11 -0
  292. package/components/ui/sheet/SheetContent.vue +58 -0
  293. package/components/ui/sheet/SheetDescription.vue +22 -0
  294. package/components/ui/sheet/SheetFooter.vue +19 -0
  295. package/components/ui/sheet/SheetHeader.vue +16 -0
  296. package/components/ui/sheet/SheetTitle.vue +22 -0
  297. package/components/ui/sheet/SheetTrigger.vue +11 -0
  298. package/components/ui/sheet/index.ts +31 -0
  299. package/components/ui/slider/Slider.vue +36 -0
  300. package/components/ui/slider/index.ts +1 -0
  301. package/components/ui/tabs/Tabs.vue +15 -0
  302. package/components/ui/tabs/TabsContent.vue +22 -0
  303. package/components/ui/tabs/TabsList.vue +25 -0
  304. package/components/ui/tabs/TabsTrigger.vue +27 -0
  305. package/components/ui/tabs/index.ts +4 -0
  306. package/components/ui/textarea/Textarea.vue +27 -0
  307. package/components/ui/textarea/index.ts +1 -0
  308. package/components/ui/toast/Toast.vue +28 -0
  309. package/components/ui/toast/ToastAction.vue +22 -0
  310. package/components/ui/toast/ToastClose.vue +27 -0
  311. package/components/ui/toast/ToastDescription.vue +22 -0
  312. package/components/ui/toast/ToastProvider.vue +11 -0
  313. package/components/ui/toast/ToastTitle.vue +22 -0
  314. package/components/ui/toast/ToastViewport.vue +20 -0
  315. package/components/ui/toast/Toaster.vue +34 -0
  316. package/components/ui/toast/index.ts +38 -0
  317. package/components/ui/toast/use-toast.ts +165 -0
  318. package/components.json +18 -0
  319. package/composables/useBreadcrumb.ts +47 -0
  320. package/composables/useCollapsedMap.ts +3 -0
  321. package/composables/useConfig.ts +227 -0
  322. package/composables/useEditLink.ts +27 -0
  323. package/composables/useI18nDocs.ts +114 -0
  324. package/composables/useMdcMenu.ts +204 -0
  325. package/composables/usePm.ts +58 -0
  326. package/composables/useScrollspy.ts +51 -0
  327. package/composables/useThemes.ts +46 -0
  328. package/composables/useToast.ts +1 -0
  329. package/content/index.md +45 -0
  330. package/eslint.config.js +3 -0
  331. package/i18n/i18n.config.ts +414 -0
  332. package/index.d.ts +610 -0
  333. package/layouts/blank.vue +5 -0
  334. package/layouts/default.vue +9 -0
  335. package/layouts/editorial.vue +83 -0
  336. package/lib/registry/themes.ts +636 -0
  337. package/lib/uno-preset.ts +143 -0
  338. package/memory-bank/activeContext.md +17 -0
  339. package/memory-bank/productContext.md +21 -0
  340. package/memory-bank/progress.md +16 -0
  341. package/memory-bank/projectbrief.md +20 -0
  342. package/memory-bank/systemPatterns.md +25 -0
  343. package/memory-bank/techContext.md +29 -0
  344. package/modules/inject-css.ts +40 -0
  345. package/nuxt.config.ts +124 -0
  346. package/package.json +71 -0
  347. package/pages/[...slug].vue +109 -0
  348. package/pages/admin/[...slug].vue +145 -0
  349. package/pages/index.vue +24 -0
  350. package/plugins/injectCssHmr.ts +26 -0
  351. package/plugins/wordup.ts +130 -0
  352. package/public/content-doc.json +792 -0
  353. package/public/iconesjs.svg +4 -0
  354. package/scripts/buildContentDoc-cli.ts +8 -0
  355. package/scripts/buildContentDoc.ts +165 -0
  356. package/tailwind.config.js +1 -0
  357. package/tsconfig.json +3 -0
  358. package/uno.config.mjs +58 -0
  359. package/utils/index.ts +12 -0
@@ -0,0 +1,217 @@
1
+ <!-- eslint-disable vue/no-v-html -->
2
+ <template>
3
+ <UiDialog v-model:open="open">
4
+ <UiDialogContent class="p-0 max-w-2xl">
5
+ <VisuallyHidden as-child>
6
+ <UiDialogTitle />
7
+ </VisuallyHidden>
8
+ <VisuallyHidden as-child>
9
+ <UiDialogDescription aria-describedby="undefined" />
10
+ </VisuallyHidden>
11
+ <UiCommand class="h-svh sm:h-[50svh]">
12
+ <UiCommandInputOnly
13
+ v-model="input"
14
+ :loading="searchLoading"
15
+ :placeholder="$t(placeholderDetailed)"
16
+ @keydown.enter="handleEnter"
17
+ @keydown.down="handleNavigate(1)"
18
+ @keydown.up="handleNavigate(-1)"
19
+ />
20
+ <UiCommandList
21
+ class="text-sm"
22
+ @escape-key-down="open = false"
23
+ >
24
+ <template v-if="!input?.length">
25
+ <template
26
+ v-for="item in navigation"
27
+ :key="item._path"
28
+ >
29
+ <UiCommandGroup
30
+ v-if="item.children"
31
+ :heading="item.title"
32
+ class="p-1.5"
33
+ >
34
+ <NuxtLinkLocale
35
+ v-for="child in item.children"
36
+ :key="child.id"
37
+ :to="child._path"
38
+ >
39
+ <UiCommandItem :value="child._path">
40
+ <Icon
41
+ v-if="child.icon"
42
+ :name="child.icon"
43
+ class="mr-2 size-4"
44
+ />
45
+ <div
46
+ v-else
47
+ class="mr-2 size-4"
48
+ />
49
+ <span>{{ child.title }}</span>
50
+ </UiCommandItem>
51
+ </NuxtLinkLocale>
52
+ </UiCommandGroup>
53
+ <UiCommandSeparator v-if="item.children" />
54
+ </template>
55
+ <UiCommandGroup
56
+ v-if="darkModeToggle"
57
+ heading="Theme"
58
+ class="p-1.5"
59
+ >
60
+ <UiCommandItem
61
+ value="light"
62
+ @click="colorMode.preference = 'light'"
63
+ >
64
+ <NuxtIcon
65
+ name="lucide:sun"
66
+ class="mr-2 size-4"
67
+ />
68
+ <span>{{ $t('Light') }}</span>
69
+ </UiCommandItem>
70
+ <UiCommandItem
71
+ value="dark"
72
+ @click="colorMode.preference = 'dark'"
73
+ >
74
+ <NuxtIcon
75
+ name="lucide:moon"
76
+ class="mr-2 size-4"
77
+ />
78
+ <span>{{ $t('Dark') }}</span>
79
+ </UiCommandItem>
80
+ <UiCommandItem
81
+ value="system"
82
+ @click="colorMode.preference = 'auto'"
83
+ >
84
+ <NuxtIcon
85
+ name="lucide:monitor"
86
+ class="mr-2 size-4"
87
+ />
88
+ <span>{{ $t('System') }}</span>
89
+ </UiCommandItem>
90
+ </UiCommandGroup>
91
+ </template>
92
+ <div
93
+ v-else-if="searchResult?.length"
94
+ class="p-1.5"
95
+ >
96
+ <NuxtLinkLocale
97
+ v-for="(item, i) in searchResult"
98
+ :id="i"
99
+ :key="item.id"
100
+ :to="item.id"
101
+ class="hover:bg-muted flex select-none rounded-md p-2 hover:cursor-pointer"
102
+ :class="[i === activeSelect && 'bg-muted']"
103
+ @click="open = false; activeSelect = i;"
104
+ >
105
+ <Icon
106
+ v-if="getItemIcon(item.id)"
107
+ :name="getItemIcon(item.id)"
108
+ class="mr-2 size-4 shrink-0 self-center"
109
+ />
110
+ <div
111
+ v-else
112
+ class="mr-2 size-4 shrink-0"
113
+ />
114
+
115
+ <span
116
+ v-for="(subtitle, j) in item.titles"
117
+ :key="`${subtitle}${j}`"
118
+ class="flex shrink-0 self-center"
119
+ >
120
+ {{ subtitle }}
121
+ <Icon
122
+ name="lucide:chevron-right"
123
+ class="text-muted-foreground mx-0.5 self-center"
124
+ />
125
+ </span>
126
+ <span class="shrink-0 self-center">
127
+ {{ item.title }}
128
+ </span>
129
+ <span
130
+ class="text-muted-foreground ml-2 self-center truncate text-xs"
131
+ v-html="getHighlightedContent(item.content)"
132
+ />
133
+ </NuxtLinkLocale>
134
+ </div>
135
+ <div
136
+ v-else
137
+ class="text-muted-foreground pt-4 text-center"
138
+ >
139
+ {{ $t('No results found.') }}
140
+ </div>
141
+ </UiCommandList>
142
+ </UiCommand>
143
+ </UiDialogContent>
144
+ </UiDialog>
145
+ </template>
146
+
147
+ <script setup lang="ts">
148
+ import { VisuallyHidden } from 'reka-ui'
149
+
150
+ const { darkModeToggle } = useConfig().value.header
151
+
152
+ const open = defineModel<boolean>('open')
153
+ const colorMode = useColorMode()
154
+ const { placeholderDetailed } = useConfig().value.search
155
+
156
+ const activeSelect = ref(0)
157
+
158
+ const { Meta_K, Ctrl_K } = useMagicKeys({
159
+ passive: false,
160
+ onEventFired(e) {
161
+ if (e.key === 'k' && (e.metaKey || e.ctrlKey))
162
+ e.preventDefault()
163
+ },
164
+ })
165
+ watch([Meta_K, Ctrl_K], (v) => {
166
+ if (v[0] || v[1])
167
+ open.value = true
168
+ })
169
+
170
+ const input = ref('')
171
+ const searchResult = ref()
172
+ const searchLoading = ref(false)
173
+
174
+ const { localizeSearchResult } = useI18nDocs()
175
+
176
+ watch(
177
+ input,
178
+ async (v) => {
179
+ activeSelect.value = 0
180
+ if (!v)
181
+ return
182
+
183
+ searchLoading.value = true
184
+ const result = (await searchContent(v)).value
185
+
186
+ searchResult.value = localizeSearchResult(result)
187
+ searchLoading.value = false
188
+ },
189
+ )
190
+
191
+ function getHighlightedContent(text: string) {
192
+ return text.replace(input.value, `<span class="font-semibold underline">${input.value}</span>`)
193
+ }
194
+
195
+ const { navKeyFromPath } = useContentHelpers()
196
+ const { navigation } = useI18nDocs()
197
+
198
+ function getItemIcon(path: string) {
199
+ return navKeyFromPath(path, 'icon', navigation.value)
200
+ }
201
+
202
+ watch(activeSelect, (value) => {
203
+ document.querySelector(`[id="${value}"]`)?.scrollIntoView({ block: 'nearest' })
204
+ })
205
+
206
+ async function handleEnter() {
207
+ if (searchResult.value[activeSelect.value]?.id) {
208
+ await navigateTo(searchResult.value[activeSelect.value].id)
209
+ open.value = false
210
+ }
211
+ }
212
+
213
+ function handleNavigate(delta: -1 | 1) {
214
+ if (activeSelect.value + delta >= 0 && activeSelect.value + delta < searchResult.value.length)
215
+ activeSelect.value += delta
216
+ }
217
+ </script>
@@ -0,0 +1,98 @@
1
+ <template>
2
+ <div class="mb-6">
3
+ <MDC
4
+ v-if="title"
5
+ tag="prose-h1"
6
+ :value="title"
7
+ unwrap="p"
8
+ class="-ml-0.5"
9
+ />
10
+ <MDC
11
+ v-if="description"
12
+ :value="description"
13
+ unwrap="p"
14
+ class="pt-1 text-2xl text-muted-foreground text-pretty"
15
+ />
16
+
17
+ <div
18
+ v-if="badges"
19
+ class="flex gap-2 pt-4"
20
+ >
21
+ <NuxtLink
22
+ v-for="(badge, i) in badges"
23
+ :key="i"
24
+ :to="badge.to"
25
+ :target="badge.target"
26
+ >
27
+ <UiBadge
28
+ :variant="badge.variant || 'secondary'"
29
+ :type="badge.type"
30
+ class="gap-1 rounded-md"
31
+ >
32
+ <Icon
33
+ v-if="badge.to || badge.icon"
34
+ :size="12"
35
+ :name="badge.icon || 'lucide:external-link'"
36
+ />
37
+ {{ badge.value }}
38
+ </UiBadge>
39
+ </NuxtLink>
40
+ </div>
41
+
42
+ <div
43
+ v-if="authors"
44
+ class="-mx-4 flex divide-x pt-4"
45
+ >
46
+ <NuxtLink
47
+ v-for="author in authors"
48
+ :key="author.name"
49
+ :to="author.to"
50
+ :target="author.target"
51
+ class="flex items-center gap-2 px-4"
52
+ >
53
+ <UiAvatar
54
+ v-if="author.avatar"
55
+ class="size-8"
56
+ >
57
+ <UiAvatarImage
58
+ :src="author.avatar"
59
+ :alt="author.name"
60
+ />
61
+ </UiAvatar>
62
+ <div>
63
+ <div class="text-sm font-semibold">
64
+ {{ author.name }}
65
+ </div>
66
+ <div
67
+ v-if="author.username"
68
+ class="text-xs font-medium leading-4 text-muted-foreground"
69
+ >
70
+ @{{ author.username }}
71
+ </div>
72
+ </div>
73
+ </NuxtLink>
74
+ </div>
75
+ </div>
76
+ </template>
77
+
78
+ <script setup lang="ts">
79
+ defineProps<{
80
+ title?: string
81
+ description?: string
82
+ badges?: {
83
+ value?: string
84
+ icon?: string
85
+ to?: string
86
+ target?: Target
87
+ type?: 'default' | 'info' | 'warning' | 'success' | 'danger' | 'lime'
88
+ variant?: 'default' | 'secondary' | 'destructive' | 'outline'
89
+ }[]
90
+ authors?: {
91
+ name: string
92
+ username?: string
93
+ avatar?: string
94
+ to?: string
95
+ target?: Target
96
+ }[]
97
+ }>()
98
+ </script>
@@ -0,0 +1,99 @@
1
+ <template>
2
+ <UiScrollArea
3
+ v-if="!isSmall"
4
+ orientation="vertical"
5
+ class="z-30 hidden overflow-y-auto md:block lg:block"
6
+ type="hover"
7
+ >
8
+ <div class="flex flex-col">
9
+ <div v-if="toc?.links.length">
10
+ <p class="mb-2 text-base font-semibold">
11
+ {{ $t(title) }}
12
+ </p>
13
+
14
+ <LayoutTocTree
15
+ :links="toc.links.filter((x: any) => x.id !== 'hide-toc')"
16
+ :level="0"
17
+ :class="[links.length && 'border-b pb-5']"
18
+ />
19
+
20
+ <div
21
+ v-if="links"
22
+ class="pt-5 text-muted-foreground"
23
+ >
24
+ <NuxtLink
25
+ v-for="(link, i) in links"
26
+ :key="i"
27
+ :to="link.to"
28
+ :target="link.target"
29
+ class="flex w-full gap-1 underline-offset-4 hover:underline [&:not(:first-child)]:pt-3"
30
+ >
31
+ <Icon
32
+ v-if="link.icon"
33
+ :name="link.icon"
34
+ class="mr-1 self-center"
35
+ />
36
+ {{ $t(link.title) }}
37
+ <NuxtIcon
38
+ v-if="link.showLinkIcon ?? true"
39
+ name="lucide:arrow-up-right"
40
+ class="ml-auto self-center text-muted-foreground"
41
+ size="13"
42
+ />
43
+ </NuxtLink>
44
+ </div>
45
+ </div>
46
+ <!-- <div class="flex-grow" /> -->
47
+ </div>
48
+ </UiScrollArea>
49
+
50
+ <UiCollapsible
51
+ v-else
52
+ v-model:open="isOpen"
53
+ class="block w-full text-sm lg:hidden"
54
+ :class="{ 'border-b': border }"
55
+ >
56
+ <UiCollapsibleTrigger class="flex w-full px-4 py-3 text-left font-medium">
57
+ {{ $t(title) }}
58
+ <NuxtIcon
59
+ name="lucide:chevron-right"
60
+ class="ml-auto self-center transition-all"
61
+ :class="[isOpen && 'rotate-90']"
62
+ />
63
+ </UiCollapsibleTrigger>
64
+
65
+ <UiCollapsibleContent>
66
+ <LayoutTocTree
67
+ :links="toc.links"
68
+ :level="0"
69
+ class="mx-4 mb-3 border-l pl-4 text-sm"
70
+ />
71
+ </UiCollapsibleContent>
72
+ </UiCollapsible>
73
+ </template>
74
+
75
+ <script setup lang="ts">
76
+ defineProps<{ isSmall?: boolean }>()
77
+
78
+ const { toc } = useContent()
79
+ const { title, links: configLinks } = useConfig().value.toc
80
+ const { border } = useConfig().value.header
81
+ const isOpen = ref(false)
82
+
83
+ const { url, enabledToc, text, icon } = useEditLink()
84
+
85
+ const links = computed(() => {
86
+ if (enabledToc.value) {
87
+ return configLinks.concat([
88
+ {
89
+ title: text,
90
+ icon,
91
+ to: url.value,
92
+ target: '_blank',
93
+ showLinkIcon: true,
94
+ },
95
+ ])
96
+ }
97
+ return configLinks
98
+ })
99
+ </script>
@@ -0,0 +1,42 @@
1
+ <template>
2
+ <ul :class="[level !== 0 && 'pl-4']">
3
+ <li
4
+ v-for="link in links"
5
+ :key="link.id"
6
+ class="pt-2"
7
+ >
8
+ <NuxtLink
9
+ :to="`#${link.id}`"
10
+ class="text-muted-foreground transition-all hover:text-primary"
11
+ :class="[activeHeadings.includes(link.id) && 'text-primary']"
12
+ >
13
+ {{ link.text }}
14
+ </NuxtLink>
15
+ <TocTree
16
+ v-if="link.children"
17
+ :links="(link.children || []).filter((x: any) => x.id !== 'hide-toc')"
18
+ :level="level + 1"
19
+ />
20
+ </li>
21
+ </ul>
22
+ </template>
23
+
24
+ <script setup lang="ts">
25
+ import type { TocLink } from '@nuxt/content'
26
+
27
+ defineProps<{
28
+ links: TocLink[]
29
+ level: number
30
+ }>()
31
+
32
+ const { activeHeadings, updateHeadings } = useScrollspy()
33
+
34
+ onMounted(() =>
35
+ updateHeadings([
36
+ ...document.querySelectorAll('.docs-content h1'),
37
+ ...document.querySelectorAll('.docs-content h2'),
38
+ ...document.querySelectorAll('.docs-content h3'),
39
+ ...document.querySelectorAll('.docs-content h4'),
40
+ ]),
41
+ )
42
+ </script>
@@ -0,0 +1,19 @@
1
+ <template>
2
+ <AccordionRoot v-bind="forwarded">
3
+ <slot />
4
+ </AccordionRoot>
5
+ </template>
6
+
7
+ <script setup lang="ts">
8
+ import {
9
+ AccordionRoot,
10
+ type AccordionRootEmits,
11
+ type AccordionRootProps,
12
+ useForwardPropsEmits,
13
+ } from 'reka-ui'
14
+
15
+ const props = defineProps<AccordionRootProps>()
16
+ const emits = defineEmits<AccordionRootEmits>()
17
+
18
+ const forwarded = useForwardPropsEmits(props, emits)
19
+ </script>
@@ -0,0 +1,24 @@
1
+ <template>
2
+ <AccordionContent
3
+ v-bind="delegatedProps"
4
+ class="overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
5
+ >
6
+ <div :class="cn('pb-4 pt-0', props.class)">
7
+ <slot />
8
+ </div>
9
+ </AccordionContent>
10
+ </template>
11
+
12
+ <script setup lang="ts">
13
+ import { AccordionContent, type AccordionContentProps } from 'reka-ui'
14
+ import { computed, type HTMLAttributes } from 'vue'
15
+ import { cn } from '@/lib/utils'
16
+
17
+ const props = defineProps<AccordionContentProps & { class?: HTMLAttributes['class'] }>()
18
+
19
+ const delegatedProps = computed(() => {
20
+ const { class: _, ...delegated } = props
21
+
22
+ return delegated
23
+ })
24
+ </script>
@@ -0,0 +1,24 @@
1
+ <template>
2
+ <AccordionItem
3
+ v-bind="forwardedProps"
4
+ :class="cn('border-b', props.class)"
5
+ >
6
+ <slot />
7
+ </AccordionItem>
8
+ </template>
9
+
10
+ <script setup lang="ts">
11
+ import { AccordionItem, type AccordionItemProps, useForwardProps } from 'reka-ui'
12
+ import { computed, type HTMLAttributes } from 'vue'
13
+ import { cn } from '@/lib/utils'
14
+
15
+ const props = defineProps<AccordionItemProps & { class?: HTMLAttributes['class'] }>()
16
+
17
+ const delegatedProps = computed(() => {
18
+ const { class: _, ...delegated } = props
19
+
20
+ return delegated
21
+ })
22
+
23
+ const forwardedProps = useForwardProps(delegatedProps)
24
+ </script>
@@ -0,0 +1,39 @@
1
+ <template>
2
+ <AccordionHeader class="flex">
3
+ <AccordionTrigger
4
+ v-bind="delegatedProps"
5
+ :class="
6
+ cn(
7
+ 'flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>.ui-chevron]:rotate-180',
8
+ props.class,
9
+ )
10
+ "
11
+ >
12
+ <slot />
13
+ <slot name="icon">
14
+ <Icon
15
+ name="lucide:chevron-down"
16
+ class="ui-chevron flex size-4 shrink-0 transition-transform duration-200"
17
+ />
18
+ </slot>
19
+ </AccordionTrigger>
20
+ </AccordionHeader>
21
+ </template>
22
+
23
+ <script setup lang="ts">
24
+ import {
25
+ AccordionHeader,
26
+ AccordionTrigger,
27
+ type AccordionTriggerProps,
28
+ } from 'reka-ui'
29
+ import { computed, type HTMLAttributes } from 'vue'
30
+ import { cn } from '@/lib/utils'
31
+
32
+ const props = defineProps<AccordionTriggerProps & { class?: HTMLAttributes['class'] }>()
33
+
34
+ const delegatedProps = computed(() => {
35
+ const { class: _, ...delegated } = props
36
+
37
+ return delegated
38
+ })
39
+ </script>
@@ -0,0 +1,4 @@
1
+ export { default as Accordion } from './Accordion.vue'
2
+ export { default as AccordionContent } from './AccordionContent.vue'
3
+ export { default as AccordionItem } from './AccordionItem.vue'
4
+ export { default as AccordionTrigger } from './AccordionTrigger.vue'
@@ -0,0 +1,19 @@
1
+ <template>
2
+ <div
3
+ :class="cn(alertVariants({ variant }), props.class)"
4
+ role="alert"
5
+ >
6
+ <slot />
7
+ </div>
8
+ </template>
9
+
10
+ <script setup lang="ts">
11
+ import type { HTMLAttributes } from 'vue'
12
+ import { type AlertVariants, alertVariants } from '.'
13
+ import { cn } from '@/lib/utils'
14
+
15
+ const props = defineProps<{
16
+ class?: HTMLAttributes['class']
17
+ variant?: AlertVariants['variant']
18
+ }>()
19
+ </script>
@@ -0,0 +1,14 @@
1
+ <template>
2
+ <div :class="cn('text-sm [&_p]:leading-relaxed', props.class)">
3
+ <slot />
4
+ </div>
5
+ </template>
6
+
7
+ <script setup lang="ts">
8
+ import type { HTMLAttributes } from 'vue'
9
+ import { cn } from '@/lib/utils'
10
+
11
+ const props = defineProps<{
12
+ class?: HTMLAttributes['class']
13
+ }>()
14
+ </script>
@@ -0,0 +1,14 @@
1
+ <template>
2
+ <h5 :class="cn('mb-1 font-medium leading-none tracking-tight', props.class)">
3
+ <slot />
4
+ </h5>
5
+ </template>
6
+
7
+ <script setup lang="ts">
8
+ import type { HTMLAttributes } from 'vue'
9
+ import { cn } from '@/lib/utils'
10
+
11
+ const props = defineProps<{
12
+ class?: HTMLAttributes['class']
13
+ }>()
14
+ </script>
@@ -0,0 +1,23 @@
1
+ import { cva, type VariantProps } from 'class-variance-authority'
2
+
3
+ export { default as Alert } from './Alert.vue'
4
+ export { default as AlertDescription } from './AlertDescription.vue'
5
+ export { default as AlertTitle } from './AlertTitle.vue'
6
+
7
+ export const alertVariants = cva(
8
+ 'relative w-full rounded-lg border p-4 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7',
9
+ {
10
+ variants: {
11
+ variant: {
12
+ default: 'bg-background text-foreground',
13
+ destructive:
14
+ 'border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive',
15
+ },
16
+ },
17
+ defaultVariants: {
18
+ variant: 'default',
19
+ },
20
+ },
21
+ )
22
+
23
+ export type AlertVariants = VariantProps<typeof alertVariants>
@@ -0,0 +1,25 @@
1
+ <template>
2
+ <AvatarRoot :class="cn(avatarVariant({ size, shape }), props.class)">
3
+ <slot />
4
+ </AvatarRoot>
5
+ </template>
6
+
7
+ <script setup lang="ts">
8
+ import type { HTMLAttributes } from 'vue'
9
+ import { AvatarRoot } from 'reka-ui'
10
+ import { avatarVariant, type AvatarVariants } from '.'
11
+ import { cn } from '@/lib/utils'
12
+
13
+ const props = withDefaults(
14
+ defineProps<{
15
+ class?: HTMLAttributes['class']
16
+ size?: AvatarVariants['size']
17
+ shape?: AvatarVariants['shape']
18
+ }>(),
19
+ {
20
+ class: '',
21
+ size: 'sm',
22
+ shape: 'circle',
23
+ },
24
+ )
25
+ </script>
@@ -0,0 +1,11 @@
1
+ <template>
2
+ <AvatarFallback v-bind="props">
3
+ <slot />
4
+ </AvatarFallback>
5
+ </template>
6
+
7
+ <script setup lang="ts">
8
+ import { AvatarFallback, type AvatarFallbackProps } from 'reka-ui'
9
+
10
+ const props = defineProps<AvatarFallbackProps>()
11
+ </script>