blodemd 0.0.4 → 0.0.6

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 (185) hide show
  1. package/README.md +12 -1
  2. package/dev-server/app/[[...slug]]/page.tsx +139 -0
  3. package/dev-server/app/blodemd-dev/invalidate/route.ts +12 -0
  4. package/dev-server/app/blodemd-dev/static/[...path]/route.ts +32 -0
  5. package/dev-server/app/blodemd-dev/version/route.ts +14 -0
  6. package/dev-server/app/blodemd-internal/proxy/route.ts +86 -0
  7. package/dev-server/app/error.tsx +24 -0
  8. package/dev-server/app/globals.css +4 -0
  9. package/dev-server/app/layout.tsx +38 -0
  10. package/dev-server/app/not-found.tsx +18 -0
  11. package/dev-server/app/search/route.ts +17 -0
  12. package/dev-server/components/dev-reload-script.tsx +86 -0
  13. package/dev-server/components/providers.tsx +15 -0
  14. package/dev-server/lib/dev-state.ts +8 -0
  15. package/dev-server/lib/local-content-source.ts +103 -0
  16. package/dev-server/lib/local-runtime.tsx +558 -0
  17. package/dev-server/next.config.js +46 -0
  18. package/dev-server/package.json +57 -0
  19. package/dev-server/postcss.config.mjs +7 -0
  20. package/dev-server/public/glide-variable.woff2 +0 -0
  21. package/dev-server/tsconfig.json +49 -0
  22. package/dist/cli.mjs +299 -26
  23. package/dist/cli.mjs.map +1 -1
  24. package/docs/app/globals.css +455 -0
  25. package/docs/components/api/api-playground.tsx +295 -0
  26. package/docs/components/api/api-reference.tsx +121 -0
  27. package/docs/components/content/collection-index.tsx +114 -0
  28. package/docs/components/docs/contextual-menu.tsx +406 -0
  29. package/docs/components/docs/copy-page-menu.tsx +255 -0
  30. package/docs/components/docs/doc-header.tsx +192 -0
  31. package/docs/components/docs/doc-shell.tsx +289 -0
  32. package/docs/components/docs/doc-sidebar.tsx +206 -0
  33. package/docs/components/docs/doc-toc.tsx +45 -0
  34. package/docs/components/docs/mobile-nav.tsx +207 -0
  35. package/docs/components/mdx/accordion.tsx +83 -0
  36. package/docs/components/mdx/badge.tsx +79 -0
  37. package/docs/components/mdx/callout.tsx +88 -0
  38. package/docs/components/mdx/card.tsx +104 -0
  39. package/docs/components/mdx/code-block.tsx +75 -0
  40. package/docs/components/mdx/code-group.tsx +94 -0
  41. package/docs/components/mdx/color.tsx +87 -0
  42. package/docs/components/mdx/columns.tsx +25 -0
  43. package/docs/components/mdx/expandable.tsx +45 -0
  44. package/docs/components/mdx/field-layout.tsx +77 -0
  45. package/docs/components/mdx/frame.tsx +23 -0
  46. package/docs/components/mdx/get-text-content.ts +18 -0
  47. package/docs/components/mdx/icon.tsx +56 -0
  48. package/docs/components/mdx/index.tsx +96 -0
  49. package/docs/components/mdx/installer.tsx +20 -0
  50. package/docs/components/mdx/panel.tsx +11 -0
  51. package/docs/components/mdx/param-field.tsx +56 -0
  52. package/docs/components/mdx/preview.tsx +36 -0
  53. package/docs/components/mdx/prompt.tsx +63 -0
  54. package/docs/components/mdx/request-example.tsx +27 -0
  55. package/docs/components/mdx/response-field.tsx +42 -0
  56. package/docs/components/mdx/steps.tsx +92 -0
  57. package/docs/components/mdx/tabs.tsx +88 -0
  58. package/docs/components/mdx/tile.tsx +43 -0
  59. package/docs/components/mdx/tooltip.tsx +71 -0
  60. package/docs/components/mdx/tree.tsx +120 -0
  61. package/docs/components/mdx/type-table.tsx +71 -0
  62. package/docs/components/mdx/update.tsx +44 -0
  63. package/docs/components/mdx/video.tsx +12 -0
  64. package/docs/components/mdx/view.tsx +66 -0
  65. package/docs/components/providers.tsx +15 -0
  66. package/docs/components/ui/breadcrumb.tsx +92 -0
  67. package/docs/components/ui/button.tsx +90 -0
  68. package/docs/components/ui/card.tsx +92 -0
  69. package/docs/components/ui/command.tsx +139 -0
  70. package/docs/components/ui/dialog.tsx +97 -0
  71. package/docs/components/ui/field.tsx +237 -0
  72. package/docs/components/ui/input.tsx +105 -0
  73. package/docs/components/ui/label.tsx +22 -0
  74. package/docs/components/ui/popover.tsx +72 -0
  75. package/docs/components/ui/search.tsx +380 -0
  76. package/docs/components/ui/separator.tsx +26 -0
  77. package/docs/components/ui/sheet.tsx +104 -0
  78. package/docs/components/ui/sidebar.tsx +433 -0
  79. package/docs/components/ui/theme-toggle.tsx +62 -0
  80. package/docs/components/ui/tooltip.tsx +53 -0
  81. package/docs/lib/contextual-options.ts +193 -0
  82. package/docs/lib/docs-collection.ts +22 -0
  83. package/docs/lib/mdx.ts +90 -0
  84. package/docs/lib/navigation.ts +288 -0
  85. package/docs/lib/openapi.ts +158 -0
  86. package/docs/lib/routes.ts +10 -0
  87. package/docs/lib/server-cache.ts +83 -0
  88. package/docs/lib/shiki.ts +35 -0
  89. package/docs/lib/theme.ts +29 -0
  90. package/docs/lib/toc.ts +2 -0
  91. package/docs/lib/utils.ts +5 -0
  92. package/package.json +34 -3
  93. package/packages/@repo/common/dist/index.d.ts +9 -0
  94. package/packages/@repo/common/dist/index.d.ts.map +1 -0
  95. package/packages/@repo/common/dist/index.js +42 -0
  96. package/packages/@repo/common/package.json +34 -0
  97. package/packages/@repo/common/src/common.unit.test.ts +55 -0
  98. package/packages/@repo/common/src/index.ts +51 -0
  99. package/packages/@repo/contracts/dist/api-key.d.ts +30 -0
  100. package/packages/@repo/contracts/dist/api-key.d.ts.map +1 -0
  101. package/packages/@repo/contracts/dist/api-key.js +20 -0
  102. package/packages/@repo/contracts/dist/dates.d.ts +4 -0
  103. package/packages/@repo/contracts/dist/dates.d.ts.map +1 -0
  104. package/packages/@repo/contracts/dist/dates.js +2 -0
  105. package/packages/@repo/contracts/dist/deployment.d.ts +71 -0
  106. package/packages/@repo/contracts/dist/deployment.d.ts.map +1 -0
  107. package/packages/@repo/contracts/dist/deployment.js +46 -0
  108. package/packages/@repo/contracts/dist/domain.d.ts +94 -0
  109. package/packages/@repo/contracts/dist/domain.d.ts.map +1 -0
  110. package/packages/@repo/contracts/dist/domain.js +36 -0
  111. package/packages/@repo/contracts/dist/ids.d.ts +14 -0
  112. package/packages/@repo/contracts/dist/ids.d.ts.map +1 -0
  113. package/packages/@repo/contracts/dist/ids.js +10 -0
  114. package/packages/@repo/contracts/dist/index.d.ts +10 -0
  115. package/packages/@repo/contracts/dist/index.d.ts.map +1 -0
  116. package/packages/@repo/contracts/dist/index.js +11 -0
  117. package/packages/@repo/contracts/dist/pagination.d.ts +23 -0
  118. package/packages/@repo/contracts/dist/pagination.d.ts.map +1 -0
  119. package/packages/@repo/contracts/dist/pagination.js +15 -0
  120. package/packages/@repo/contracts/dist/project.d.ts +25 -0
  121. package/packages/@repo/contracts/dist/project.d.ts.map +1 -0
  122. package/packages/@repo/contracts/dist/project.js +23 -0
  123. package/packages/@repo/contracts/dist/tenant.d.ts +99 -0
  124. package/packages/@repo/contracts/dist/tenant.d.ts.map +1 -0
  125. package/packages/@repo/contracts/dist/tenant.js +36 -0
  126. package/packages/@repo/contracts/dist/user.d.ts +9 -0
  127. package/packages/@repo/contracts/dist/user.d.ts.map +1 -0
  128. package/packages/@repo/contracts/dist/user.js +9 -0
  129. package/packages/@repo/contracts/package.json +37 -0
  130. package/packages/@repo/contracts/src/api-key.ts +27 -0
  131. package/packages/@repo/contracts/src/dates.ts +4 -0
  132. package/packages/@repo/contracts/src/deployment.ts +73 -0
  133. package/packages/@repo/contracts/src/domain.ts +51 -0
  134. package/packages/@repo/contracts/src/ids.ts +22 -0
  135. package/packages/@repo/contracts/src/index.ts +11 -0
  136. package/packages/@repo/contracts/src/pagination.ts +21 -0
  137. package/packages/@repo/contracts/src/project.ts +30 -0
  138. package/packages/@repo/contracts/src/tenant.ts +54 -0
  139. package/packages/@repo/contracts/src/user.ts +12 -0
  140. package/packages/@repo/models/dist/docs-config.d.ts +985 -0
  141. package/packages/@repo/models/dist/docs-config.d.ts.map +1 -0
  142. package/packages/@repo/models/dist/docs-config.js +548 -0
  143. package/packages/@repo/models/dist/index.d.ts +3 -0
  144. package/packages/@repo/models/dist/index.d.ts.map +1 -0
  145. package/packages/@repo/models/dist/index.js +3 -0
  146. package/packages/@repo/models/dist/tenant.d.ts +25 -0
  147. package/packages/@repo/models/dist/tenant.d.ts.map +1 -0
  148. package/packages/@repo/models/dist/tenant.js +1 -0
  149. package/packages/@repo/models/package.json +37 -0
  150. package/packages/@repo/models/src/docs-config.ts +648 -0
  151. package/packages/@repo/models/src/index.ts +3 -0
  152. package/packages/@repo/models/src/tenant.ts +29 -0
  153. package/packages/@repo/prebuild/dist/index.d.ts +2 -0
  154. package/packages/@repo/prebuild/dist/index.d.ts.map +1 -0
  155. package/packages/@repo/prebuild/dist/index.js +2 -0
  156. package/packages/@repo/prebuild/dist/openapi.d.ts +43 -0
  157. package/packages/@repo/prebuild/dist/openapi.d.ts.map +1 -0
  158. package/packages/@repo/prebuild/dist/openapi.js +58 -0
  159. package/packages/@repo/prebuild/package.json +39 -0
  160. package/packages/@repo/prebuild/src/index.ts +2 -0
  161. package/packages/@repo/prebuild/src/openapi.ts +116 -0
  162. package/packages/@repo/previewing/dist/blob-source.d.ts +16 -0
  163. package/packages/@repo/previewing/dist/blob-source.d.ts.map +1 -0
  164. package/packages/@repo/previewing/dist/blob-source.js +110 -0
  165. package/packages/@repo/previewing/dist/content-source.d.ts +12 -0
  166. package/packages/@repo/previewing/dist/content-source.d.ts.map +1 -0
  167. package/packages/@repo/previewing/dist/content-source.js +1 -0
  168. package/packages/@repo/previewing/dist/fs-source.d.ts +11 -0
  169. package/packages/@repo/previewing/dist/fs-source.d.ts.map +1 -0
  170. package/packages/@repo/previewing/dist/fs-source.js +79 -0
  171. package/packages/@repo/previewing/dist/index.d.ts +120 -0
  172. package/packages/@repo/previewing/dist/index.d.ts.map +1 -0
  173. package/packages/@repo/previewing/dist/index.js +984 -0
  174. package/packages/@repo/previewing/package.json +41 -0
  175. package/packages/@repo/previewing/src/blob-source.ts +167 -0
  176. package/packages/@repo/previewing/src/content-source.ts +12 -0
  177. package/packages/@repo/previewing/src/fs-source.ts +111 -0
  178. package/packages/@repo/previewing/src/index.ts +1490 -0
  179. package/packages/@repo/previewing/src/index.unit.test.ts +290 -0
  180. package/packages/@repo/validation/dist/index.d.ts +12 -0
  181. package/packages/@repo/validation/dist/index.d.ts.map +1 -0
  182. package/packages/@repo/validation/dist/index.js +30 -0
  183. package/packages/@repo/validation/package.json +37 -0
  184. package/packages/@repo/validation/src/index.ts +59 -0
  185. package/packages/@repo/validation/src/mintlify-docs-schema.json +5016 -0
@@ -0,0 +1,66 @@
1
+ "use client";
2
+
3
+ import { isValidElement, useCallback, useMemo, useState } from "react";
4
+ import type { MouseEvent, ReactElement, ReactNode } from "react";
5
+
6
+ import { cn } from "@/lib/utils";
7
+
8
+ interface ViewItemProps {
9
+ title: string;
10
+ icon?: ReactNode;
11
+ children: ReactNode;
12
+ }
13
+
14
+ export const View = ({ children }: ViewItemProps) => children as ReactElement;
15
+
16
+ interface ViewGroupProps {
17
+ children: ReactNode;
18
+ }
19
+
20
+ export const ViewGroup = ({ children }: ViewGroupProps) => {
21
+ const items = useMemo(() => {
22
+ const nodes = Array.isArray(children) ? children : [children];
23
+ return nodes.filter(
24
+ (child): child is ReactElement<ViewItemProps> =>
25
+ isValidElement<ViewItemProps>(child) && child.type === View
26
+ );
27
+ }, [children]);
28
+
29
+ const [active, setActive] = useState(0);
30
+
31
+ const handleSelect = useCallback((event: MouseEvent<HTMLButtonElement>) => {
32
+ const index = Number(event.currentTarget.dataset.index ?? "0");
33
+ setActive(index);
34
+ }, []);
35
+
36
+ if (!items.length) {
37
+ return children as ReactElement;
38
+ }
39
+
40
+ return (
41
+ <div className="my-4">
42
+ <div className="mb-4 flex flex-wrap gap-2">
43
+ {items.map((item, index) => (
44
+ <button
45
+ className={cn(
46
+ "inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-sm font-medium transition-colors",
47
+ index === active
48
+ ? "bg-primary text-primary-foreground"
49
+ : "bg-muted text-muted-foreground hover:text-foreground"
50
+ )}
51
+ data-index={index}
52
+ key={item.props.title}
53
+ onClick={handleSelect}
54
+ type="button"
55
+ >
56
+ {item.props.icon ? (
57
+ <span className="shrink-0">{item.props.icon}</span>
58
+ ) : null}
59
+ {item.props.title}
60
+ </button>
61
+ ))}
62
+ </div>
63
+ <div>{items[active]}</div>
64
+ </div>
65
+ );
66
+ };
@@ -0,0 +1,15 @@
1
+ "use client";
2
+
3
+ import { ThemeProvider } from "next-themes";
4
+
5
+ export const Providers = ({ children }: { children: React.ReactNode }) => (
6
+ <ThemeProvider
7
+ attribute="class"
8
+ defaultTheme="system"
9
+ disableTransitionOnChange
10
+ enableColorScheme
11
+ storageKey="theme"
12
+ >
13
+ {children}
14
+ </ThemeProvider>
15
+ );
@@ -0,0 +1,92 @@
1
+ import { Slot } from "radix-ui";
2
+ import type { ComponentProps } from "react";
3
+
4
+ import { cn } from "@/lib/utils";
5
+
6
+ const Breadcrumb = ({ ...props }: ComponentProps<"nav">) => (
7
+ <nav aria-label="breadcrumb" data-slot="breadcrumb" {...props} />
8
+ );
9
+
10
+ const BreadcrumbList = ({ className, ...props }: ComponentProps<"ol">) => (
11
+ <ol
12
+ data-slot="breadcrumb-list"
13
+ className={cn(
14
+ "flex flex-wrap items-center gap-1.5 text-sm text-muted-foreground break-words sm:gap-2.5",
15
+ className
16
+ )}
17
+ {...props}
18
+ />
19
+ );
20
+
21
+ const BreadcrumbItem = ({ className, ...props }: ComponentProps<"li">) => (
22
+ <li
23
+ data-slot="breadcrumb-item"
24
+ className={cn("inline-flex items-center gap-1.5", className)}
25
+ {...props}
26
+ />
27
+ );
28
+
29
+ const BreadcrumbLink = ({
30
+ asChild,
31
+ className,
32
+ ...props
33
+ }: ComponentProps<"a"> & { asChild?: boolean }) => {
34
+ const Comp = asChild ? Slot.Root : "a";
35
+
36
+ return (
37
+ <Comp
38
+ data-slot="breadcrumb-link"
39
+ className={cn("transition-colors hover:text-foreground", className)}
40
+ {...props}
41
+ />
42
+ );
43
+ };
44
+
45
+ const BreadcrumbPage = ({ className, ...props }: ComponentProps<"span">) => (
46
+ <span
47
+ data-slot="breadcrumb-page"
48
+ aria-disabled="true"
49
+ aria-current="page"
50
+ className={cn("font-normal text-foreground", className)}
51
+ {...props}
52
+ />
53
+ );
54
+
55
+ const BreadcrumbSeparator = ({
56
+ children,
57
+ className,
58
+ ...props
59
+ }: ComponentProps<"li">) => (
60
+ <li
61
+ data-slot="breadcrumb-separator"
62
+ role="presentation"
63
+ aria-hidden="true"
64
+ className={cn("[&>svg]:size-3.5", className)}
65
+ {...props}
66
+ >
67
+ {children ?? (
68
+ <svg
69
+ xmlns="http://www.w3.org/2000/svg"
70
+ width="16"
71
+ height="16"
72
+ viewBox="0 0 24 24"
73
+ fill="none"
74
+ stroke="currentColor"
75
+ strokeWidth="2"
76
+ strokeLinecap="round"
77
+ strokeLinejoin="round"
78
+ >
79
+ <path d="m9 18 6-6-6-6" />
80
+ </svg>
81
+ )}
82
+ </li>
83
+ );
84
+
85
+ export {
86
+ Breadcrumb,
87
+ BreadcrumbItem,
88
+ BreadcrumbLink,
89
+ BreadcrumbList,
90
+ BreadcrumbPage,
91
+ BreadcrumbSeparator,
92
+ };
@@ -0,0 +1,90 @@
1
+ import { mergeProps } from "@base-ui/react/merge-props";
2
+ import { useRender } from "@base-ui/react/use-render";
3
+ import { cva } from "class-variance-authority";
4
+ import type { VariantProps } from "class-variance-authority";
5
+ import type * as React from "react";
6
+
7
+ import { cn } from "@/lib/utils";
8
+
9
+ const buttonVariants = cva(
10
+ "group/button inline-flex shrink-0 select-none items-center justify-center whitespace-nowrap rounded-lg border border-transparent bg-clip-padding font-medium text-sm outline-none transition-[color,background-color,border-color,box-shadow,opacity,transform] duration-150 ease-out focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-45 aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:opacity-45 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
11
+ {
12
+ defaultVariants: {
13
+ size: "default",
14
+ variant: "default",
15
+ },
16
+ variants: {
17
+ size: {
18
+ default:
19
+ "h-10 gap-1.5 px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5",
20
+ icon: "size-10",
21
+ "icon-lg": "size-11",
22
+ "icon-sm":
23
+ "size-9 in-data-[slot=button-group]:rounded-lg rounded-[min(var(--radius-md),12px)]",
24
+ "icon-xs":
25
+ "size-8 in-data-[slot=button-group]:rounded-lg rounded-[min(var(--radius-md),10px)] [&_svg:not([class*='size-'])]:size-3",
26
+ input:
27
+ "h-[var(--field-height)] gap-2 rounded-[var(--field-radius)] px-[var(--field-padding-x)] py-[var(--field-padding-y)]",
28
+ "input-sm":
29
+ "h-[var(--field-height-sm)] gap-2 rounded-[var(--field-radius)] px-[var(--field-padding-x)] py-[var(--field-padding-y)]",
30
+ lg: "h-11 gap-1.5 px-4 has-data-[icon=inline-end]:pr-3.5 has-data-[icon=inline-start]:pl-3.5",
31
+ sm: "h-9 gap-1 in-data-[slot=button-group]:rounded-lg rounded-[min(var(--radius-md),12px)] px-3 text-[0.8rem] has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3.5",
32
+ xs: "h-8 gap-1 in-data-[slot=button-group]:rounded-lg rounded-[min(var(--radius-md),10px)] px-2.5 text-xs has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3",
33
+ },
34
+ variant: {
35
+ default:
36
+ "bg-primary text-primary-foreground hover:bg-primary/90 active:bg-primary/95 aria-pressed:bg-primary/95",
37
+ destructive:
38
+ "bg-red-600 text-white hover:bg-red-700 focus-visible:border-red-600 focus-visible:ring-red-500/30 active:bg-red-800 aria-pressed:bg-red-800 dark:bg-red-500 dark:aria-pressed:bg-red-300 dark:active:bg-red-300 dark:hover:bg-red-400",
39
+ destructiveSecondary:
40
+ "border-red-200 text-red-700 hover:bg-red-50 active:bg-red-100 aria-pressed:bg-red-100 dark:border-red-800 dark:text-red-300 dark:aria-pressed:bg-red-950 dark:active:bg-red-950 dark:hover:bg-red-950/60",
41
+ ghost:
42
+ "hover:bg-muted hover:text-foreground active:bg-muted/80 aria-expanded:bg-muted aria-pressed:bg-muted/80 dark:aria-pressed:bg-muted/60 dark:active:bg-muted/60 dark:hover:bg-muted/50",
43
+ input:
44
+ "border-input bg-card font-normal font-sans text-base text-foreground leading-snug shadow-input hover:border-input-hover focus-visible:ring-2 focus-visible:ring-ring/15 focus-visible:ring-offset-1 focus-visible:ring-offset-background active:border-input-hover/80 aria-pressed:border-input-hover aria-invalid:border-destructive-foreground data-[placeholder]:text-placeholder-foreground",
45
+ link: "text-primary underline-offset-4 hover:underline active:opacity-80 aria-pressed:underline aria-pressed:opacity-80",
46
+ outline:
47
+ "border-border bg-background hover:bg-muted hover:text-foreground active:bg-muted/80 aria-expanded:bg-muted aria-pressed:bg-muted/80 dark:border-input dark:bg-input/30 dark:aria-pressed:bg-input/60 dark:active:bg-input/60 dark:hover:bg-input/50",
48
+ secondary:
49
+ "bg-secondary text-secondary-foreground hover:bg-secondary/85 active:bg-secondary/75 aria-expanded:bg-secondary aria-pressed:bg-secondary/75",
50
+ success:
51
+ "bg-green-600 text-white hover:bg-green-700 focus-visible:border-green-600 focus-visible:ring-green-500/30 active:bg-green-800 aria-pressed:bg-green-800 dark:bg-green-500 dark:aria-pressed:bg-green-300 dark:active:bg-green-300 dark:hover:bg-green-400",
52
+ successSecondary:
53
+ "border-green-200 text-green-700 hover:bg-green-50 active:bg-green-100 aria-pressed:bg-green-100 dark:border-green-800 dark:text-green-300 dark:aria-pressed:bg-green-950 dark:active:bg-green-950 dark:hover:bg-green-950/60",
54
+ warning:
55
+ "bg-yellow-600 text-white hover:bg-yellow-700 focus-visible:border-yellow-600 focus-visible:ring-yellow-500/30 active:bg-yellow-800 aria-pressed:bg-yellow-800 dark:bg-yellow-500 dark:text-yellow-950 dark:aria-pressed:bg-yellow-300 dark:active:bg-yellow-300 dark:hover:bg-yellow-400",
56
+ warningSecondary:
57
+ "border-yellow-200 text-yellow-700 hover:bg-yellow-50 active:bg-yellow-100 aria-pressed:bg-yellow-100 dark:border-yellow-800 dark:text-yellow-300 dark:aria-pressed:bg-yellow-950 dark:active:bg-yellow-950 dark:hover:bg-yellow-950/60",
58
+ },
59
+ },
60
+ }
61
+ );
62
+
63
+ const Button = ({
64
+ className,
65
+ variant = "default",
66
+ size = "default",
67
+ asChild = false,
68
+ children,
69
+ ...props
70
+ }: React.ComponentProps<"button"> &
71
+ VariantProps<typeof buttonVariants> & {
72
+ asChild?: boolean;
73
+ }) =>
74
+ useRender({
75
+ defaultTagName: "button",
76
+ props: mergeProps<"button">(
77
+ {
78
+ className: cn(buttonVariants({ className, size, variant })),
79
+ },
80
+ asChild ? props : { ...props, children }
81
+ ),
82
+ render: asChild ? (children as React.ReactElement) : undefined,
83
+ state: {
84
+ size,
85
+ slot: "button",
86
+ variant,
87
+ },
88
+ });
89
+
90
+ export { Button, buttonVariants };
@@ -0,0 +1,92 @@
1
+ import type * as React from "react";
2
+
3
+ import { cn } from "@/lib/utils";
4
+
5
+ const Card = ({
6
+ className,
7
+ size = "default",
8
+ ...props
9
+ }: React.ComponentProps<"div"> & { size?: "default" | "sm" }) => (
10
+ <div
11
+ className={cn(
12
+ "group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-card-foreground text-sm ring-1 ring-foreground/10 has-[>img:first-child]:pt-0 has-data-[slot=card-footer]:pb-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",
13
+ className
14
+ )}
15
+ data-size={size}
16
+ data-slot="card"
17
+ {...props}
18
+ />
19
+ );
20
+
21
+ const CardHeader = ({ className, ...props }: React.ComponentProps<"div">) => (
22
+ <div
23
+ className={cn(
24
+ "group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] group-data-[size=sm]/card:px-3 [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",
25
+ className
26
+ )}
27
+ data-slot="card-header"
28
+ {...props}
29
+ />
30
+ );
31
+
32
+ const CardTitle = ({ className, ...props }: React.ComponentProps<"div">) => (
33
+ <div
34
+ className={cn(
35
+ "font-medium text-base leading-snug group-data-[size=sm]/card:text-sm",
36
+ className
37
+ )}
38
+ data-slot="card-title"
39
+ {...props}
40
+ />
41
+ );
42
+
43
+ const CardDescription = ({
44
+ className,
45
+ ...props
46
+ }: React.ComponentProps<"div">) => (
47
+ <div
48
+ className={cn("text-muted-foreground text-sm", className)}
49
+ data-slot="card-description"
50
+ {...props}
51
+ />
52
+ );
53
+
54
+ const CardAction = ({ className, ...props }: React.ComponentProps<"div">) => (
55
+ <div
56
+ className={cn(
57
+ "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
58
+ className
59
+ )}
60
+ data-slot="card-action"
61
+ {...props}
62
+ />
63
+ );
64
+
65
+ const CardContent = ({ className, ...props }: React.ComponentProps<"div">) => (
66
+ <div
67
+ className={cn("px-4 group-data-[size=sm]/card:px-3", className)}
68
+ data-slot="card-content"
69
+ {...props}
70
+ />
71
+ );
72
+
73
+ const CardFooter = ({ className, ...props }: React.ComponentProps<"div">) => (
74
+ <div
75
+ className={cn(
76
+ "flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3",
77
+ className
78
+ )}
79
+ data-slot="card-footer"
80
+ {...props}
81
+ />
82
+ );
83
+
84
+ export {
85
+ Card,
86
+ CardHeader,
87
+ CardFooter,
88
+ CardTitle,
89
+ CardAction,
90
+ CardDescription,
91
+ CardContent,
92
+ };
@@ -0,0 +1,139 @@
1
+ "use client";
2
+
3
+ import { SearchIcon } from "blode-icons-react";
4
+ import { Command as CommandPrimitive } from "cmdk";
5
+ import type * as React from "react";
6
+
7
+ import {
8
+ Dialog,
9
+ DialogContent,
10
+ DialogDescription,
11
+ DialogHeader,
12
+ DialogTitle,
13
+ } from "@/components/ui/dialog";
14
+ import { cn } from "@/lib/utils";
15
+
16
+ const Command = ({
17
+ className,
18
+ ...props
19
+ }: React.ComponentProps<typeof CommandPrimitive>) => (
20
+ <CommandPrimitive
21
+ className={cn(
22
+ "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
23
+ className
24
+ )}
25
+ data-slot="command"
26
+ {...props}
27
+ />
28
+ );
29
+
30
+ const CommandDialog = ({
31
+ title = "Command Palette",
32
+ description = "Search for a command to run...",
33
+ children,
34
+ className,
35
+ showCloseButton = true,
36
+ ...props
37
+ }: React.ComponentProps<typeof Dialog> & {
38
+ title?: string;
39
+ description?: string;
40
+ children?: React.ReactNode;
41
+ className?: string;
42
+ showCloseButton?: boolean;
43
+ } & Omit<React.ComponentProps<typeof Dialog>, "children">) => (
44
+ <Dialog {...props}>
45
+ <DialogContent
46
+ className={cn("overflow-hidden p-0", className)}
47
+ showCloseButton={showCloseButton}
48
+ >
49
+ <DialogHeader className="sr-only">
50
+ <DialogTitle>{title}</DialogTitle>
51
+ <DialogDescription>{description}</DialogDescription>
52
+ </DialogHeader>
53
+ <Command className="**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
54
+ {children}
55
+ </Command>
56
+ </DialogContent>
57
+ </Dialog>
58
+ );
59
+
60
+ const CommandInput = ({
61
+ className,
62
+ ...props
63
+ }: React.ComponentProps<typeof CommandPrimitive.Input>) => (
64
+ <div
65
+ className="flex h-9 items-center gap-2 border-b px-3"
66
+ data-slot="command-input-wrapper"
67
+ >
68
+ <SearchIcon className="size-4 shrink-0 opacity-50" />
69
+ <CommandPrimitive.Input
70
+ className={cn(
71
+ "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
72
+ className
73
+ )}
74
+ data-slot="command-input"
75
+ {...props}
76
+ />
77
+ </div>
78
+ );
79
+
80
+ const CommandList = ({
81
+ className,
82
+ ...props
83
+ }: React.ComponentProps<typeof CommandPrimitive.List>) => (
84
+ <CommandPrimitive.List
85
+ className={cn(
86
+ "max-h-[300px] scroll-py-1 overflow-y-auto overflow-x-hidden",
87
+ className
88
+ )}
89
+ data-slot="command-list"
90
+ {...props}
91
+ />
92
+ );
93
+
94
+ const CommandEmpty = ({
95
+ ...props
96
+ }: React.ComponentProps<typeof CommandPrimitive.Empty>) => (
97
+ <CommandPrimitive.Empty
98
+ className="py-6 text-center text-sm"
99
+ data-slot="command-empty"
100
+ {...props}
101
+ />
102
+ );
103
+
104
+ const CommandGroup = ({
105
+ className,
106
+ ...props
107
+ }: React.ComponentProps<typeof CommandPrimitive.Group>) => (
108
+ <CommandPrimitive.Group
109
+ className={cn(
110
+ "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:text-xs",
111
+ className
112
+ )}
113
+ data-slot="command-group"
114
+ {...props}
115
+ />
116
+ );
117
+
118
+ const CommandItem = ({
119
+ className,
120
+ ...props
121
+ }: React.ComponentProps<typeof CommandPrimitive.Item>) => (
122
+ <CommandPrimitive.Item
123
+ className={cn(
124
+ "relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",
125
+ className
126
+ )}
127
+ data-slot="command-item"
128
+ {...props}
129
+ />
130
+ );
131
+
132
+ export {
133
+ CommandDialog,
134
+ CommandInput,
135
+ CommandList,
136
+ CommandEmpty,
137
+ CommandGroup,
138
+ CommandItem,
139
+ };
@@ -0,0 +1,97 @@
1
+ "use client";
2
+
3
+ import { XIcon } from "blode-icons-react";
4
+ import { Dialog as DialogPrimitive } from "radix-ui";
5
+ import * as React from "react";
6
+
7
+ import { cn } from "@/lib/utils";
8
+
9
+ const Dialog = ({
10
+ ...props
11
+ }: React.ComponentProps<typeof DialogPrimitive.Root>) => (
12
+ <DialogPrimitive.Root data-slot="dialog" {...props} />
13
+ );
14
+
15
+ const DialogPortal = ({
16
+ ...props
17
+ }: React.ComponentProps<typeof DialogPrimitive.Portal>) => (
18
+ <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />
19
+ );
20
+
21
+ const DialogOverlay = ({
22
+ className,
23
+ ...props
24
+ }: React.ComponentProps<typeof DialogPrimitive.Overlay>) => (
25
+ <DialogPrimitive.Overlay
26
+ data-slot="dialog-overlay"
27
+ className={cn(
28
+ "fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",
29
+ className
30
+ )}
31
+ {...props}
32
+ />
33
+ );
34
+
35
+ const DialogContent = ({
36
+ className,
37
+ children,
38
+ showCloseButton = true,
39
+ ...props
40
+ }: React.ComponentProps<typeof DialogPrimitive.Content> & {
41
+ showCloseButton?: boolean;
42
+ }) => (
43
+ <DialogPortal data-slot="dialog-portal">
44
+ <DialogOverlay />
45
+ <DialogPrimitive.Content
46
+ data-slot="dialog-content"
47
+ className={cn(
48
+ "fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",
49
+ className
50
+ )}
51
+ {...props}
52
+ >
53
+ {children}
54
+ {showCloseButton && (
55
+ <DialogPrimitive.Close
56
+ data-slot="dialog-close"
57
+ className="absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
58
+ >
59
+ <XIcon />
60
+ <span className="sr-only">Close</span>
61
+ </DialogPrimitive.Close>
62
+ )}
63
+ </DialogPrimitive.Content>
64
+ </DialogPortal>
65
+ );
66
+
67
+ const DialogHeader = ({ className, ...props }: React.ComponentProps<"div">) => (
68
+ <div
69
+ data-slot="dialog-header"
70
+ className={cn("flex flex-col gap-2 text-center sm:text-left", className)}
71
+ {...props}
72
+ />
73
+ );
74
+
75
+ const DialogTitle = ({
76
+ className,
77
+ ...props
78
+ }: React.ComponentProps<typeof DialogPrimitive.Title>) => (
79
+ <DialogPrimitive.Title
80
+ data-slot="dialog-title"
81
+ className={cn("text-lg leading-none font-semibold", className)}
82
+ {...props}
83
+ />
84
+ );
85
+
86
+ const DialogDescription = ({
87
+ className,
88
+ ...props
89
+ }: React.ComponentProps<typeof DialogPrimitive.Description>) => (
90
+ <DialogPrimitive.Description
91
+ data-slot="dialog-description"
92
+ className={cn("text-sm text-muted-foreground", className)}
93
+ {...props}
94
+ />
95
+ );
96
+
97
+ export { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle };