@baybreezy/docd 0.0.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.
Files changed (268) hide show
  1. package/app/app.config.ts +239 -0
  2. package/app/app.vue +19 -0
  3. package/app/assets/css/tailwind.css +335 -0
  4. package/app/assets/css/theme.css +1171 -0
  5. package/app/components/OgImage/Docs.takumi.vue +69 -0
  6. package/app/components/OgImage/Landing.takumi.vue +64 -0
  7. package/app/components/OgImage/Site.takumi.vue +32 -0
  8. package/app/components/Ui/Avatar/Avatar.vue +75 -0
  9. package/app/components/Ui/Avatar/Badge.vue +34 -0
  10. package/app/components/Ui/Avatar/Fallback.vue +30 -0
  11. package/app/components/Ui/Avatar/Group.vue +29 -0
  12. package/app/components/Ui/Avatar/GroupCount.vue +29 -0
  13. package/app/components/Ui/Avatar/Image.vue +29 -0
  14. package/app/components/Ui/Badge.vue +86 -0
  15. package/app/components/Ui/BadgeGroup.vue +314 -0
  16. package/app/components/Ui/BgPattern/Grid.vue +137 -0
  17. package/app/components/Ui/BorderBeam.vue +97 -0
  18. package/app/components/Ui/Breadcrumbs.vue +103 -0
  19. package/app/components/Ui/Button.vue +169 -0
  20. package/app/components/Ui/ButtonGroup/ButtonGroup.vue +54 -0
  21. package/app/components/Ui/ButtonGroup/Separator.vue +38 -0
  22. package/app/components/Ui/ButtonGroup/Text.vue +33 -0
  23. package/app/components/Ui/Card/Action.vue +31 -0
  24. package/app/components/Ui/Card/Card.vue +58 -0
  25. package/app/components/Ui/Card/Content.vue +34 -0
  26. package/app/components/Ui/Card/Description.vue +36 -0
  27. package/app/components/Ui/Card/Footer.vue +31 -0
  28. package/app/components/Ui/Card/Header.vue +31 -0
  29. package/app/components/Ui/Card/Title.vue +37 -0
  30. package/app/components/Ui/Collapsible/Collapsible.vue +16 -0
  31. package/app/components/Ui/Collapsible/Content.vue +27 -0
  32. package/app/components/Ui/Collapsible/Trigger.vue +13 -0
  33. package/app/components/Ui/Command/Command.vue +115 -0
  34. package/app/components/Ui/Command/Dialog.vue +65 -0
  35. package/app/components/Ui/Command/Empty.vue +32 -0
  36. package/app/components/Ui/Command/Footer.vue +40 -0
  37. package/app/components/Ui/Command/Group.vue +58 -0
  38. package/app/components/Ui/Command/Input.vue +57 -0
  39. package/app/components/Ui/Command/Item.vue +102 -0
  40. package/app/components/Ui/Command/List.vue +33 -0
  41. package/app/components/Ui/Command/Separator.vue +30 -0
  42. package/app/components/Ui/Command/Shortcut.vue +28 -0
  43. package/app/components/Ui/Container.vue +46 -0
  44. package/app/components/Ui/ContextMenu/Arrow.vue +43 -0
  45. package/app/components/Ui/ContextMenu/CheckboxItem.vue +42 -0
  46. package/app/components/Ui/ContextMenu/Content.vue +53 -0
  47. package/app/components/Ui/ContextMenu/ContextMenu.vue +14 -0
  48. package/app/components/Ui/ContextMenu/Group.vue +12 -0
  49. package/app/components/Ui/ContextMenu/Item.vue +65 -0
  50. package/app/components/Ui/ContextMenu/ItemIndicator.vue +30 -0
  51. package/app/components/Ui/ContextMenu/Label.vue +35 -0
  52. package/app/components/Ui/ContextMenu/Portal.vue +12 -0
  53. package/app/components/Ui/ContextMenu/RadioGroup.vue +16 -0
  54. package/app/components/Ui/ContextMenu/RadioItem.vue +40 -0
  55. package/app/components/Ui/ContextMenu/Separator.vue +25 -0
  56. package/app/components/Ui/ContextMenu/Shortcut.vue +30 -0
  57. package/app/components/Ui/ContextMenu/Sub.vue +15 -0
  58. package/app/components/Ui/ContextMenu/SubContent.vue +55 -0
  59. package/app/components/Ui/ContextMenu/SubTrigger.vue +42 -0
  60. package/app/components/Ui/ContextMenu/Trigger.vue +12 -0
  61. package/app/components/Ui/Dialog/Close.vue +12 -0
  62. package/app/components/Ui/Dialog/Content.vue +79 -0
  63. package/app/components/Ui/Dialog/Description.vue +29 -0
  64. package/app/components/Ui/Dialog/Dialog.vue +14 -0
  65. package/app/components/Ui/Dialog/Footer.vue +32 -0
  66. package/app/components/Ui/Dialog/Header.vue +32 -0
  67. package/app/components/Ui/Dialog/Overlay.vue +25 -0
  68. package/app/components/Ui/Dialog/Portal.vue +12 -0
  69. package/app/components/Ui/Dialog/Title.vue +29 -0
  70. package/app/components/Ui/Dialog/Trigger.vue +12 -0
  71. package/app/components/Ui/Divider.vue +102 -0
  72. package/app/components/Ui/Drawer/Close.vue +12 -0
  73. package/app/components/Ui/Drawer/Content.vue +67 -0
  74. package/app/components/Ui/Drawer/Description.vue +33 -0
  75. package/app/components/Ui/Drawer/Drawer.vue +17 -0
  76. package/app/components/Ui/Drawer/Footer.vue +35 -0
  77. package/app/components/Ui/Drawer/Header.vue +34 -0
  78. package/app/components/Ui/Drawer/Overlay.vue +20 -0
  79. package/app/components/Ui/Drawer/Portal.vue +12 -0
  80. package/app/components/Ui/Drawer/Title.vue +35 -0
  81. package/app/components/Ui/Drawer/Trigger.vue +12 -0
  82. package/app/components/Ui/DropdownMenu/Arrow.vue +43 -0
  83. package/app/components/Ui/DropdownMenu/CheckboxItem.vue +41 -0
  84. package/app/components/Ui/DropdownMenu/Content.vue +56 -0
  85. package/app/components/Ui/DropdownMenu/DropdownMenu.vue +15 -0
  86. package/app/components/Ui/DropdownMenu/Group.vue +12 -0
  87. package/app/components/Ui/DropdownMenu/Item.vue +64 -0
  88. package/app/components/Ui/DropdownMenu/ItemIndicator.vue +32 -0
  89. package/app/components/Ui/DropdownMenu/Label.vue +34 -0
  90. package/app/components/Ui/DropdownMenu/Portal.vue +12 -0
  91. package/app/components/Ui/DropdownMenu/RadioGroup.vue +16 -0
  92. package/app/components/Ui/DropdownMenu/RadioItem.vue +40 -0
  93. package/app/components/Ui/DropdownMenu/Separator.vue +25 -0
  94. package/app/components/Ui/DropdownMenu/Shortcut.vue +44 -0
  95. package/app/components/Ui/DropdownMenu/Sub.vue +14 -0
  96. package/app/components/Ui/DropdownMenu/SubContent.vue +56 -0
  97. package/app/components/Ui/DropdownMenu/SubTrigger.vue +47 -0
  98. package/app/components/Ui/DropdownMenu/Trigger.vue +12 -0
  99. package/app/components/Ui/FancyIcon.vue +243 -0
  100. package/app/components/Ui/GradientDivider.vue +26 -0
  101. package/app/components/Ui/IframeLazy.vue +97 -0
  102. package/app/components/Ui/Input.vue +97 -0
  103. package/app/components/Ui/InputGroup/Addon.vue +66 -0
  104. package/app/components/Ui/InputGroup/Button.vue +50 -0
  105. package/app/components/Ui/InputGroup/Input.vue +25 -0
  106. package/app/components/Ui/InputGroup/InputGroup.vue +44 -0
  107. package/app/components/Ui/InputGroup/Text.vue +33 -0
  108. package/app/components/Ui/InputGroup/Textarea.vue +25 -0
  109. package/app/components/Ui/Kbd/Group.vue +32 -0
  110. package/app/components/Ui/Kbd/Kbd.vue +62 -0
  111. package/app/components/Ui/Label.vue +40 -0
  112. package/app/components/Ui/Popover/Anchor.vue +13 -0
  113. package/app/components/Ui/Popover/Arrow.vue +42 -0
  114. package/app/components/Ui/Popover/Close.vue +13 -0
  115. package/app/components/Ui/Popover/Content.vue +55 -0
  116. package/app/components/Ui/Popover/Popover.vue +15 -0
  117. package/app/components/Ui/Popover/Portal.vue +13 -0
  118. package/app/components/Ui/Popover/Trigger.vue +12 -0
  119. package/app/components/Ui/Popover/X.vue +38 -0
  120. package/app/components/Ui/ScrollArea/Corner.vue +12 -0
  121. package/app/components/Ui/ScrollArea/ScrollArea.vue +38 -0
  122. package/app/components/Ui/ScrollArea/Scrollbar.vue +39 -0
  123. package/app/components/Ui/ScrollArea/Thumb.vue +39 -0
  124. package/app/components/Ui/ScrollArea/Viewport.vue +27 -0
  125. package/app/components/Ui/Scrollspy.vue +61 -0
  126. package/app/components/Ui/Separator.vue +40 -0
  127. package/app/components/Ui/Skeleton.vue +39 -0
  128. package/app/components/Ui/Sonner.vue +25 -0
  129. package/app/components/Ui/Tabs/Content.vue +27 -0
  130. package/app/components/Ui/Tabs/Indicator.vue +37 -0
  131. package/app/components/Ui/Tabs/List.vue +37 -0
  132. package/app/components/Ui/Tabs/Tabs.vue +25 -0
  133. package/app/components/Ui/Tabs/Trigger.vue +41 -0
  134. package/app/components/Ui/Textarea.vue +81 -0
  135. package/app/components/Ui/Tooltip/Arrow.vue +30 -0
  136. package/app/components/Ui/Tooltip/Content.vue +50 -0
  137. package/app/components/Ui/Tooltip/Portal.vue +12 -0
  138. package/app/components/Ui/Tooltip/Provider.vue +14 -0
  139. package/app/components/Ui/Tooltip/Tooltip.vue +25 -0
  140. package/app/components/Ui/Tooltip/Trigger.vue +12 -0
  141. package/app/components/Ui/Tree/Item.vue +15 -0
  142. package/app/components/Ui/Tree/Tree.vue +15 -0
  143. package/app/components/Ui/Tree/Virtualizer.vue +13 -0
  144. package/app/components/component-api/ComponentApiSection.vue +135 -0
  145. package/app/components/content/docs/Callout/DocsCallout.vue +99 -0
  146. package/app/components/content/prose/ProseA.global.vue +31 -0
  147. package/app/components/content/prose/ProseBlockquote.global.vue +28 -0
  148. package/app/components/content/prose/ProseCallout.global.vue +306 -0
  149. package/app/components/content/prose/ProseCard.global.vue +100 -0
  150. package/app/components/content/prose/ProseCodeCollapse.global.vue +125 -0
  151. package/app/components/content/prose/ProseCodeCopy.global.vue +67 -0
  152. package/app/components/content/prose/ProseCodeGroup.global.vue +104 -0
  153. package/app/components/content/prose/ProseCodeTree.global.vue +277 -0
  154. package/app/components/content/prose/ProseCollapsible.global.vue +64 -0
  155. package/app/components/content/prose/ProseColorModeImage.global.vue +58 -0
  156. package/app/components/content/prose/ProseComponentApi.global.vue +104 -0
  157. package/app/components/content/prose/ProseComponentEvents.global.vue +27 -0
  158. package/app/components/content/prose/ProseComponentExposed.global.vue +27 -0
  159. package/app/components/content/prose/ProseComponentProps.global.vue +27 -0
  160. package/app/components/content/prose/ProseComponentSlots.global.vue +27 -0
  161. package/app/components/content/prose/ProseEm.global.vue +5 -0
  162. package/app/components/content/prose/ProseField.global.vue +118 -0
  163. package/app/components/content/prose/ProseFieldGroup.global.vue +62 -0
  164. package/app/components/content/prose/ProseH1.global.vue +58 -0
  165. package/app/components/content/prose/ProseH2.global.vue +58 -0
  166. package/app/components/content/prose/ProseH3.global.vue +58 -0
  167. package/app/components/content/prose/ProseH4.global.vue +58 -0
  168. package/app/components/content/prose/ProseH5.global.vue +47 -0
  169. package/app/components/content/prose/ProseH6.global.vue +47 -0
  170. package/app/components/content/prose/ProseHr.global.vue +33 -0
  171. package/app/components/content/prose/ProseIconList.global.vue +113 -0
  172. package/app/components/content/prose/ProseImg.global.vue +119 -0
  173. package/app/components/content/prose/ProseLead.global.vue +28 -0
  174. package/app/components/content/prose/ProseLi.global.vue +25 -0
  175. package/app/components/content/prose/ProseMermaid.global.vue +127 -0
  176. package/app/components/content/prose/ProseOl.global.vue +25 -0
  177. package/app/components/content/prose/ProseP.global.vue +25 -0
  178. package/app/components/content/prose/ProsePmInstall.global.vue +60 -0
  179. package/app/components/content/prose/ProsePmRun.global.vue +51 -0
  180. package/app/components/content/prose/ProsePmX.global.vue +56 -0
  181. package/app/components/content/prose/ProsePre.global.vue +181 -0
  182. package/app/components/content/prose/ProseShowCase.global.vue +56 -0
  183. package/app/components/content/prose/ProseSmartIcon.global.vue +54 -0
  184. package/app/components/content/prose/ProseStep.global.vue +22 -0
  185. package/app/components/content/prose/ProseSteps.global.vue +22 -0
  186. package/app/components/content/prose/ProseStrong.global.vue +34 -0
  187. package/app/components/content/prose/ProseTable.global.vue +34 -0
  188. package/app/components/content/prose/ProseTabs.global.vue +104 -0
  189. package/app/components/content/prose/ProseTabsInner.global.vue +274 -0
  190. package/app/components/content/prose/ProseTbody.global.vue +5 -0
  191. package/app/components/content/prose/ProseTd.global.vue +25 -0
  192. package/app/components/content/prose/ProseTh.global.vue +25 -0
  193. package/app/components/content/prose/ProseThead.global.vue +9 -0
  194. package/app/components/content/prose/ProseTr.global.vue +35 -0
  195. package/app/components/content/prose/ProseUl.global.vue +25 -0
  196. package/app/components/docs/DocsExtraStuff.vue +39 -0
  197. package/app/components/docs/DocsGithubLink.vue +11 -0
  198. package/app/components/docs/DocsHeader.vue +3 -0
  199. package/app/components/docs/DocsLogo.vue +74 -0
  200. package/app/components/docs/DocsMobileBar.vue +26 -0
  201. package/app/components/docs/DocsMobileNav.vue +49 -0
  202. package/app/components/docs/DocsNav.vue +161 -0
  203. package/app/components/docs/DocsPageTransition.vue +32 -0
  204. package/app/components/docs/DocsSearch.vue +220 -0
  205. package/app/components/docs/DocsSearchButton.vue +20 -0
  206. package/app/components/docs/DocsThemeCustomizer.vue +229 -0
  207. package/app/components/docs/DocsThemeToggler.vue +98 -0
  208. package/app/components/docs/DocsTocRail.vue +162 -0
  209. package/app/components/docs/DocsToclink.vue +52 -0
  210. package/app/components/docs/DocsZigZagRail.vue +70 -0
  211. package/app/components/landing/Hero.vue +222 -0
  212. package/app/components/page/PageFooter.vue +49 -0
  213. package/app/components/page/PageHeader.vue +68 -0
  214. package/app/components/page/PageHeaderLinks.vue +138 -0
  215. package/app/components/page/PageMobileToc.vue +162 -0
  216. package/app/components/page/PageToc.vue +33 -0
  217. package/app/composables/useDefaultSlotItems.ts +90 -0
  218. package/app/composables/useDocPage.ts +66 -0
  219. package/app/composables/useDocSearch.ts +23 -0
  220. package/app/composables/useDocd.ts +107 -0
  221. package/app/composables/useLogoAssets.ts +319 -0
  222. package/app/composables/usePm.ts +73 -0
  223. package/app/composables/useProseComponentMeta.ts +30 -0
  224. package/app/composables/useScrollspy.ts +327 -0
  225. package/app/composables/useSeo.ts +240 -0
  226. package/app/composables/useUIConfig.ts +36 -0
  227. package/app/layouts/default.vue +5 -0
  228. package/app/layouts/docs.vue +64 -0
  229. package/app/middleware/colorMode.global.ts +8 -0
  230. package/app/middleware/doc-page-layout.ts +11 -0
  231. package/app/middleware/landing-page-layout.ts +11 -0
  232. package/app/pages/[...slug].vue +63 -0
  233. package/app/plugins/mermaid.client.ts +35 -0
  234. package/app/plugins/navigation-direction.client.ts +15 -0
  235. package/app/plugins/theme-restore.client.ts +7 -0
  236. package/app/templates/landing.vue +40 -0
  237. package/app/transitions/presets.ts +71 -0
  238. package/app/types/prose-component-meta.d.ts +4 -0
  239. package/app/utils/og.ts +26 -0
  240. package/app/utils/prerender.ts +9 -0
  241. package/app/utils/translucent.ts +56 -0
  242. package/app/utils/tw-helper.ts +4 -0
  243. package/content.config.ts +81 -0
  244. package/index.d.ts +25 -0
  245. package/modules/config.ts +89 -0
  246. package/modules/custom-icons.ts +17 -0
  247. package/modules/markdown-rewrite.ts +96 -0
  248. package/modules/prose-component-meta.ts +150 -0
  249. package/modules/routing.ts +22 -0
  250. package/modules/skills/index.ts +167 -0
  251. package/modules/skills/runtime/server/routes/skills-files.ts +49 -0
  252. package/modules/skills/runtime/server/routes/skills-index.ts +8 -0
  253. package/nuxt.config.ts +96 -0
  254. package/nuxt.schema.ts +288 -0
  255. package/package.json +95 -0
  256. package/server/mcp/tools/get-page.ts +66 -0
  257. package/server/mcp/tools/list-pages.ts +61 -0
  258. package/server/routes/sitemap.xml.ts +73 -0
  259. package/server/utils/content.ts +3 -0
  260. package/tailwind.config.cjs +55 -0
  261. package/utils/component-api-content.ts +467 -0
  262. package/utils/component-api-discovery.ts +165 -0
  263. package/utils/component-api-schema.ts +28 -0
  264. package/utils/component-api.ts +243 -0
  265. package/utils/generate-prose-component-meta.ts +303 -0
  266. package/utils/git.ts +123 -0
  267. package/utils/meta.ts +40 -0
  268. package/utils/pages.ts +21 -0
@@ -0,0 +1,115 @@
1
+ <template>
2
+ <ListboxRoot
3
+ cmdk-root
4
+ v-bind="forwarded"
5
+ :class="styles({ class: normalizeClass(props.class) || undefined })"
6
+ data-slot="command"
7
+ >
8
+ <slot />
9
+ </ListboxRoot>
10
+ </template>
11
+ <script lang="ts">
12
+ import { reactiveOmit } from "@vueuse/core";
13
+ import { createContext, ListboxRoot, useFilter, useForwardPropsEmits } from "reka-ui";
14
+ import type { ListboxRootEmits, ListboxRootProps } from "reka-ui";
15
+ import { normalizeClass } from "vue";
16
+ import type { HTMLAttributes } from "vue";
17
+
18
+ export const [useCommand, provideCommandContext] = createContext<{
19
+ allItems: Ref<Map<string, string>>;
20
+ allGroups: Ref<Map<string, Set<string>>>;
21
+ filterState: {
22
+ search: string;
23
+ filtered: { count: number; items: Map<string, number>; groups: Set<string> };
24
+ };
25
+ }>("Command");
26
+
27
+ export const [useCommandGroup, provideCommandGroupContext] = createContext<{
28
+ id?: string;
29
+ }>("CommandGroup");
30
+ </script>
31
+
32
+ <script setup lang="ts">
33
+ const props = withDefaults(
34
+ defineProps<ListboxRootProps & { class?: HTMLAttributes["class"] }>(),
35
+ {
36
+ modelValue: "",
37
+ }
38
+ );
39
+
40
+ const emits = defineEmits<ListboxRootEmits>();
41
+ const forwarded = useForwardPropsEmits(reactiveOmit(props, "class"), emits);
42
+
43
+ const styles = tv({
44
+ base: "flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground has-data-[slot=command-footer]:p-0",
45
+ });
46
+
47
+ const allItems = ref<Map<string, string>>(new Map());
48
+ const allGroups = ref<Map<string, Set<string>>>(new Map());
49
+
50
+ const { contains } = useFilter({ sensitivity: "base" });
51
+ const filterState = reactive({
52
+ search: "",
53
+ filtered: {
54
+ /** The count of all visible items. */
55
+ count: 0,
56
+ /** Map from visible item id to its search score. */
57
+ items: new Map() as Map<string, number>,
58
+ /** Set of groups with at least one visible item. */
59
+ groups: new Set() as Set<string>,
60
+ },
61
+ });
62
+
63
+ function filterItems() {
64
+ const tokens = filterState.search
65
+ .trim()
66
+ .split(/\s+/)
67
+ .map((token) => token.trim())
68
+ .filter(Boolean);
69
+
70
+ if (!tokens.length) {
71
+ filterState.filtered.count = allItems.value.size;
72
+ // Do nothing, each item will know to show itself because search is empty
73
+ return;
74
+ }
75
+
76
+ // Reset the groups
77
+ filterState.filtered.groups = new Set();
78
+ let itemCount = 0;
79
+
80
+ // Check which items should be included
81
+ for (const [id, value] of allItems.value) {
82
+ let score = 0;
83
+ for (const token of tokens) {
84
+ if (!contains(value, token)) {
85
+ score = 0;
86
+ break;
87
+ }
88
+ score += 1;
89
+ }
90
+
91
+ filterState.filtered.items.set(id, score);
92
+ if (score > 0) itemCount++;
93
+ }
94
+
95
+ // Check which groups have at least 1 item shown
96
+ for (const [groupId, group] of allGroups.value) {
97
+ for (const itemId of group) {
98
+ if (filterState.filtered.items.get(itemId)! > 0) {
99
+ filterState.filtered.groups.add(groupId);
100
+ break;
101
+ }
102
+ }
103
+ }
104
+
105
+ filterState.filtered.count = itemCount;
106
+ }
107
+
108
+ watch(
109
+ () => filterState.search,
110
+ () => {
111
+ filterItems();
112
+ }
113
+ );
114
+ provideCommandContext({ allItems, allGroups, filterState });
115
+ </script>
@@ -0,0 +1,65 @@
1
+ <template>
2
+ <UiDialog v-bind="forwarded">
3
+ <UiDialogContent
4
+ :hide-close="showCloseButton"
5
+ :translucent="translucent"
6
+ class="overflow-hidden rounded-xl! p-0 shadow-lg"
7
+ >
8
+ <UiDialogHeader class="sr-only">
9
+ <UiDialogTitle :title />
10
+ <UiDialogDescription :description />
11
+ </UiDialogHeader>
12
+ <UiCommand :highlight-on-hover>
13
+ <slot />
14
+ </UiCommand>
15
+ </UiDialogContent>
16
+ </UiDialog>
17
+ </template>
18
+
19
+ <script lang="ts" setup>
20
+ import { useForwardPropsEmits } from "reka-ui";
21
+ import type { DialogRootEmits, DialogRootProps } from "reka-ui";
22
+
23
+ const props = withDefaults(
24
+ defineProps<
25
+ DialogRootProps & {
26
+ /**
27
+ * The title of the command dialog.
28
+ *
29
+ * @default "Command Palette"
30
+ */
31
+ title?: string;
32
+ /**
33
+ * The description of the command dialog.
34
+ *
35
+ * @default "Search for a command to run...".
36
+ */
37
+ description?: string;
38
+ /**
39
+ * Whether to show the close button in the dialog header.
40
+ *
41
+ * @default true
42
+ */
43
+ showCloseButton?: boolean;
44
+ /**
45
+ * Whether to render the dialog content with a translucent surface.
46
+ */
47
+ translucent?: boolean;
48
+ /**
49
+ * When `true`, hover over item will trigger highlight
50
+ */
51
+ highlightOnHover?: boolean;
52
+ }
53
+ >(),
54
+ {
55
+ title: "Command Palette",
56
+ description: "Search for a command to run...",
57
+ }
58
+ );
59
+ const emits = defineEmits<DialogRootEmits>();
60
+
61
+ const forwarded = useForwardPropsEmits(
62
+ reactiveOmit(props, "translucent", "highlightOnHover"),
63
+ emits
64
+ );
65
+ </script>
@@ -0,0 +1,32 @@
1
+ <template>
2
+ <Primitive
3
+ v-if="isRender"
4
+ v-bind="forwarded"
5
+ :class="styles({ class: normalizeClass(props.class) || undefined })"
6
+ data-slot="command-empty"
7
+ cmdk-empty
8
+ >
9
+ <slot />
10
+ </Primitive>
11
+ </template>
12
+
13
+ <script setup lang="ts">
14
+ import { reactiveOmit } from "@vueuse/core";
15
+ import { Primitive } from "reka-ui";
16
+ import type { PrimitiveProps } from "reka-ui";
17
+ import { normalizeClass } from "vue";
18
+ import type { HTMLAttributes } from "vue";
19
+
20
+ import { useCommand } from "./Command.vue";
21
+
22
+ const props = defineProps<PrimitiveProps & { class?: HTMLAttributes["class"] }>();
23
+
24
+ const forwarded = reactiveOmit(props, "class");
25
+
26
+ const { filterState } = useCommand();
27
+ const isRender = computed(() => !!filterState.search && filterState.filtered.count === 0);
28
+
29
+ const styles = tv({
30
+ base: "py-6 text-center text-sm",
31
+ });
32
+ </script>
@@ -0,0 +1,40 @@
1
+ <template>
2
+ <Primitive
3
+ data-slot="command-footer"
4
+ :as
5
+ :as-child
6
+ :class="styles({ class: normalizeClass(props.class) })"
7
+ >
8
+ <slot>
9
+ <slot name="navigate">
10
+ <div class="flex items-center gap-1">
11
+ <UiKbd variant="outline">↑</UiKbd>
12
+ <UiKbd variant="outline">↓</UiKbd>
13
+ <span class="text-xs">to navigate</span>
14
+ </div>
15
+ </slot>
16
+ <slot name="escape">
17
+ <div class="flex items-center gap-1">
18
+ <UiKbd variant="outline">esc</UiKbd>
19
+ <span class="text-xs">to close</span>
20
+ </div>
21
+ </slot>
22
+ </slot>
23
+ </Primitive>
24
+ </template>
25
+
26
+ <script lang="ts">
27
+ import { Primitive, type PrimitiveProps } from "reka-ui";
28
+ import { normalizeClass, type HTMLAttributes } from "vue";
29
+ export type CommandFooterProps = PrimitiveProps & {
30
+ /** Custom class(es) to add to the element */
31
+ class?: HTMLAttributes["class"];
32
+ };
33
+ const styles = tv({
34
+ base: "z-5 flex items-center gap-2 border-t bg-input/30 p-2 px-3 text-sm",
35
+ });
36
+ </script>
37
+
38
+ <script lang="ts" setup>
39
+ const props = defineProps<CommandFooterProps>();
40
+ </script>
@@ -0,0 +1,58 @@
1
+ <template>
2
+ <ListboxGroup
3
+ v-bind="forwarded"
4
+ :id="id"
5
+ :class="styles({ class: normalizeClass(props.class) || undefined })"
6
+ data-slot="command-group"
7
+ :hidden="isRender ? undefined : true"
8
+ cmdk-group
9
+ >
10
+ <ListboxGroupLabel
11
+ v-if="heading"
12
+ cmdk-group-heading
13
+ class="px-2 py-1.5 text-xs font-medium text-muted-foreground"
14
+ >
15
+ {{ heading }}
16
+ </ListboxGroupLabel>
17
+ <slot />
18
+ </ListboxGroup>
19
+ </template>
20
+
21
+ <script setup lang="ts">
22
+ import { reactiveOmit } from "@vueuse/core";
23
+ import { ListboxGroup, ListboxGroupLabel } from "reka-ui";
24
+ import type { ListboxGroupProps } from "reka-ui";
25
+ import { normalizeClass } from "vue";
26
+ import type { HTMLAttributes } from "vue";
27
+
28
+ import { provideCommandGroupContext, useCommand } from "./Command.vue";
29
+
30
+ const props = defineProps<
31
+ ListboxGroupProps & {
32
+ /** Custom class(es) to add to the element */
33
+ class?: HTMLAttributes["class"];
34
+ heading?: string;
35
+ }
36
+ >();
37
+
38
+ const styles = tv({
39
+ base: "overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",
40
+ });
41
+
42
+ const forwarded = reactiveOmit(props, "class");
43
+
44
+ const { allGroups, filterState } = useCommand();
45
+ const id = useId();
46
+
47
+ const isRender = computed(() =>
48
+ !filterState.search ? true : filterState.filtered.groups.has(id)
49
+ );
50
+
51
+ provideCommandGroupContext({ id });
52
+ onMounted(() => {
53
+ if (!allGroups.value.has(id)) allGroups.value.set(id, new Set());
54
+ });
55
+ onUnmounted(() => {
56
+ allGroups.value.delete(id);
57
+ });
58
+ </script>
@@ -0,0 +1,57 @@
1
+ <template>
2
+ <div data-slot="command-input-wrapper" class="p-1 pb-0" cmdk-input-wrapper>
3
+ <UiInputGroup
4
+ class="h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!"
5
+ >
6
+ <ListboxFilter
7
+ v-bind="{ ...forwardedProps, ...$attrs }"
8
+ v-model="filterState.search"
9
+ data-slot="command-input"
10
+ auto-focus
11
+ cmdk-input
12
+ :class="styles({ class: normalizeClass(props.class) || undefined })"
13
+ />
14
+ <UiInputGroupAddon>
15
+ <Icon :name="icon" class="size-4 shrink-0 opacity-50" />
16
+ </UiInputGroupAddon>
17
+ </UiInputGroup>
18
+ </div>
19
+ </template>
20
+
21
+ <script setup lang="ts">
22
+ import { reactiveOmit } from "@vueuse/core";
23
+ import { ListboxFilter, useForwardProps } from "reka-ui";
24
+ import type { ListboxFilterProps } from "reka-ui";
25
+ import { normalizeClass } from "vue";
26
+ import type { HTMLAttributes } from "vue";
27
+
28
+ import { useCommand } from "./Command.vue";
29
+
30
+ defineOptions({ inheritAttrs: false });
31
+
32
+ const props = withDefaults(
33
+ defineProps<
34
+ ListboxFilterProps & {
35
+ /** Custom class(es) to add to the element */
36
+ class?: HTMLAttributes["class"];
37
+ /**
38
+ * The name of the icon to display for the search input.
39
+ *
40
+ * @default "lucide:search"
41
+ */
42
+ icon?: string;
43
+ }
44
+ >(),
45
+ {
46
+ icon: "lucide:search",
47
+ }
48
+ );
49
+
50
+ const styles = tv({
51
+ base: "w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
52
+ });
53
+
54
+ const forwardedProps = useForwardProps(reactiveOmit(props, "class"));
55
+
56
+ const { filterState } = useCommand();
57
+ </script>
@@ -0,0 +1,102 @@
1
+ <template>
2
+ <ListboxItem
3
+ v-if="isRender"
4
+ v-bind="forwarded"
5
+ :id="id"
6
+ ref="itemRef"
7
+ :class="styles({ class: normalizeClass(props.class) || undefined })"
8
+ data-slot="command-item"
9
+ cmdk-item
10
+ @select="
11
+ () => {
12
+ filterState.search = '';
13
+ }
14
+ "
15
+ >
16
+ <slot>
17
+ <slot name="icon">
18
+ <Icon v-if="icon" :name="icon" />
19
+ </slot>
20
+ <slot name="text">
21
+ {{ text }}
22
+ </slot>
23
+ <slot name="shortcut">
24
+ <UiCommandShortcut v-if="shortcut" :shortcut="shortcut" />
25
+ </slot>
26
+ </slot>
27
+ </ListboxItem>
28
+ </template>
29
+
30
+ <script setup lang="ts">
31
+ import { reactiveOmit, useCurrentElement } from "@vueuse/core";
32
+ import type { ListboxItemEmits, ListboxItemProps } from "reka-ui";
33
+ import { ListboxItem, useForwardPropsEmits, useId } from "reka-ui";
34
+ import type { HTMLAttributes } from "vue";
35
+ import { normalizeClass } from "vue";
36
+
37
+ import { useCommand, useCommandGroup } from "./Command.vue";
38
+
39
+ const props = defineProps<
40
+ ListboxItemProps & {
41
+ /** Custom class(es) to add to the element */
42
+ class?: HTMLAttributes["class"];
43
+ /** Icon to render */
44
+ icon?: string;
45
+ /** Text to render */
46
+ text?: string;
47
+ /** Shortcut to render */
48
+ shortcut?: string;
49
+ }
50
+ >();
51
+ const emits = defineEmits<ListboxItemEmits>();
52
+
53
+ const forwarded = useForwardPropsEmits(
54
+ reactiveOmit(props, "class", "icon", "text", "shortcut"),
55
+ emits
56
+ );
57
+
58
+ const id = useId();
59
+ const { filterState, allItems, allGroups } = useCommand();
60
+ const groupContext = useCommandGroup();
61
+
62
+ const styles = tv({
63
+ base: "group/command-item relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none in-data-[slot=dialog-content]:rounded-lg! data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-accent data-highlighted:text-accent-foreground data-[state=checked]:bg-muted data-[state=checked]:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground",
64
+ });
65
+
66
+ const isRender = computed(() => {
67
+ if (!filterState.search) {
68
+ return true;
69
+ } else {
70
+ const filteredCurrentItem = filterState.filtered.items.get(id);
71
+ // If the filtered items is undefined means not in the all times map yet
72
+ // Do the first render to add into the map
73
+ if (filteredCurrentItem === undefined) {
74
+ return true;
75
+ }
76
+
77
+ // Check with filter
78
+ return filteredCurrentItem > 0;
79
+ }
80
+ });
81
+
82
+ const itemRef = ref();
83
+ const currentElement = useCurrentElement(itemRef);
84
+ onMounted(() => {
85
+ if (!(currentElement.value instanceof HTMLElement)) return;
86
+
87
+ // textValue to perform filter
88
+ allItems.value.set(id, currentElement.value.textContent ?? props?.value!.toString());
89
+
90
+ const groupId = groupContext?.id;
91
+ if (groupId) {
92
+ if (!allGroups.value.has(groupId)) {
93
+ allGroups.value.set(groupId, new Set([id]));
94
+ } else {
95
+ allGroups.value.get(groupId)?.add(id);
96
+ }
97
+ }
98
+ });
99
+ onUnmounted(() => {
100
+ allItems.value.delete(id);
101
+ });
102
+ </script>
@@ -0,0 +1,33 @@
1
+ <template>
2
+ <ListboxContent
3
+ data-slot="command-list"
4
+ v-bind="forwarded"
5
+ cmdk-list
6
+ :class="styles({ class: normalizeClass(props.class) || undefined })"
7
+ >
8
+ <div role="presentation">
9
+ <slot />
10
+ </div>
11
+ </ListboxContent>
12
+ </template>
13
+
14
+ <script setup lang="ts">
15
+ import { reactiveOmit } from "@vueuse/core";
16
+ import { ListboxContent, useForwardProps } from "reka-ui";
17
+ import type { ListboxContentProps } from "reka-ui";
18
+ import { normalizeClass } from "vue";
19
+ import type { HTMLAttributes } from "vue";
20
+
21
+ const props = defineProps<
22
+ ListboxContentProps & {
23
+ /** Custom class(es) to add to the element */
24
+ class?: HTMLAttributes["class"];
25
+ }
26
+ >();
27
+
28
+ const forwarded = useForwardProps(reactiveOmit(props, "class"));
29
+
30
+ const styles = tv({
31
+ base: "no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",
32
+ });
33
+ </script>
@@ -0,0 +1,30 @@
1
+ <template>
2
+ <Separator
3
+ v-bind="forwarded"
4
+ :class="styles({ class: normalizeClass(props.class) || undefined })"
5
+ data-slot="command-separator"
6
+ cmdk-separator
7
+ >
8
+ <slot />
9
+ </Separator>
10
+ </template>
11
+
12
+ <script setup lang="ts">
13
+ import { reactiveOmit } from "@vueuse/core";
14
+ import { Separator } from "reka-ui";
15
+ import type { SeparatorProps } from "reka-ui";
16
+ import { normalizeClass } from "vue";
17
+ import type { HTMLAttributes } from "vue";
18
+
19
+ const props = defineProps<
20
+ SeparatorProps & {
21
+ /** Custom class(es) to add to the element */
22
+ class?: HTMLAttributes["class"];
23
+ }
24
+ >();
25
+
26
+ const forwarded = reactiveOmit(props, "class");
27
+ const styles = tv({
28
+ base: "-mx-1 h-px bg-border",
29
+ });
30
+ </script>
@@ -0,0 +1,28 @@
1
+ <template>
2
+ <Primitive
3
+ :as="as || 'span'"
4
+ :as-child="asChild"
5
+ :class="styles({ class: normalizeClass(props.class) || undefined })"
6
+ >
7
+ <slot>{{ shortcut }}</slot>
8
+ </Primitive>
9
+ </template>
10
+
11
+ <script lang="ts" setup>
12
+ import { Primitive } from "reka-ui";
13
+ import type { PrimitiveProps } from "reka-ui";
14
+ import { normalizeClass } from "vue";
15
+ import type { HTMLAttributes } from "vue";
16
+
17
+ const props = defineProps<
18
+ PrimitiveProps & {
19
+ /** Custom class(es) to add to the element */
20
+ class?: HTMLAttributes["class"];
21
+ /** The shortcut text to render */
22
+ shortcut?: any;
23
+ }
24
+ >();
25
+ const styles = tv({
26
+ base: "ml-auto text-xs tracking-widest text-muted-foreground group-data-selected/command-item:text-foreground",
27
+ });
28
+ </script>
@@ -0,0 +1,46 @@
1
+ <template>
2
+ <Primitive
3
+ data-slot="container"
4
+ :data-constrained="constrained"
5
+ :class="styles({ class: normalizeClass(props.class) || undefined, constrained })"
6
+ v-bind="forwarded"
7
+ >
8
+ <slot />
9
+ </Primitive>
10
+ </template>
11
+
12
+ <script lang="ts" setup>
13
+ import { Primitive } from "reka-ui";
14
+ import type { PrimitiveProps } from "reka-ui";
15
+ import { normalizeClass } from "vue";
16
+ import type { HTMLAttributes } from "vue";
17
+
18
+ const props = withDefaults(
19
+ defineProps<
20
+ PrimitiveProps & {
21
+ /** Custom class(es) to add to the element */
22
+ class?: HTMLAttributes["class"];
23
+ /** Whether to constrain the width of the container */
24
+ constrained?: boolean;
25
+ }
26
+ >(),
27
+ {
28
+ as: "div",
29
+ }
30
+ );
31
+
32
+ const forwarded = reactiveOmit(props, "class", "constrained");
33
+
34
+ const styles = tv({
35
+ base: "mx-auto w-full max-w-7xl 2xl:max-w-(--breakpoint-2xl)",
36
+ variants: {
37
+ constrained: {
38
+ true: "sm:px-6",
39
+ false: "px-4 sm:px-6",
40
+ },
41
+ },
42
+ defaultVariants: {
43
+ constrained: false,
44
+ },
45
+ });
46
+ </script>
@@ -0,0 +1,43 @@
1
+ <template>
2
+ <ContextMenuArrow
3
+ data-slot="context-menu-arrow"
4
+ v-bind="forwarded"
5
+ :class="
6
+ styles({
7
+ translucent: props.translucent,
8
+ class: normalizeClass(props.class) || undefined,
9
+ })
10
+ "
11
+ />
12
+ </template>
13
+
14
+ <script lang="ts" setup>
15
+ import { ContextMenuArrow } from "reka-ui";
16
+ import type { ContextMenuArrowProps } from "reka-ui";
17
+ import { normalizeClass } from "vue";
18
+ import type { HTMLAttributes } from "vue";
19
+
20
+ const props = withDefaults(
21
+ defineProps<
22
+ ContextMenuArrowProps & {
23
+ /** Custom class(es) to add to the arrow */
24
+ class?: HTMLAttributes["class"];
25
+ /** Whether to render the arrow with a translucent surface */
26
+ translucent?: boolean;
27
+ }
28
+ >(),
29
+ {
30
+ width: 12,
31
+ height: 6,
32
+ }
33
+ );
34
+ const forwarded = reactiveOmit(props, "class", "translucent");
35
+ const styles = tv({
36
+ base: "fill-popover stroke-border",
37
+ variants: {
38
+ translucent: {
39
+ true: getTranslucentFloatingArrowClasses("popover"),
40
+ },
41
+ },
42
+ });
43
+ </script>