@suzumiyaaoba/mdxr 0.1.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 (236) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +56 -0
  3. package/dist/cli.d.mts +1 -0
  4. package/dist/cli.mjs +2902 -0
  5. package/dist/components.d.mts +791 -0
  6. package/dist/components.mjs +2 -0
  7. package/dist/config-SI9IyFiC.mjs +184 -0
  8. package/dist/doc-context-CEqzMYKv.d.mts +568 -0
  9. package/dist/index.d.mts +20 -0
  10. package/dist/index.mjs +4 -0
  11. package/dist/ui-GKFD0mx5.mjs +15986 -0
  12. package/package.json +131 -0
  13. package/skill/SKILL.md +49 -0
  14. package/skill/references/components/charts.md +172 -0
  15. package/skill/references/components/document.md +98 -0
  16. package/skill/references/components/forms.md +35 -0
  17. package/skill/references/components/investigation.md +198 -0
  18. package/skill/references/components/layout.md +68 -0
  19. package/skill/references/components/output.md +158 -0
  20. package/skill/references/components/planning.md +155 -0
  21. package/skill/references/components/reports.md +252 -0
  22. package/skill/references/components/shadcn.md +19 -0
  23. package/skill/references/components.md +186 -0
  24. package/skill/references/extending.md +48 -0
  25. package/src/ask-sheet.ts +40 -0
  26. package/src/assets/css.ts +392 -0
  27. package/src/assets/scripts.ts +78 -0
  28. package/src/catalog.ts +287 -0
  29. package/src/cli.ts +178 -0
  30. package/src/client/doc-events.ts +1108 -0
  31. package/src/client/entry.ts +27 -0
  32. package/src/client-js.ts +47 -0
  33. package/src/component-map.ts +47 -0
  34. package/src/components/ui/accordion.tsx +77 -0
  35. package/src/components/ui/alert-dialog.tsx +185 -0
  36. package/src/components/ui/alert.tsx +76 -0
  37. package/src/components/ui/aspect-ratio.tsx +22 -0
  38. package/src/components/ui/attachment.tsx +208 -0
  39. package/src/components/ui/avatar.tsx +106 -0
  40. package/src/components/ui/badge.tsx +52 -0
  41. package/src/components/ui/breadcrumb.tsx +121 -0
  42. package/src/components/ui/bubble.tsx +128 -0
  43. package/src/components/ui/button-group.tsx +88 -0
  44. package/src/components/ui/button.tsx +58 -0
  45. package/src/components/ui/calendar.tsx +226 -0
  46. package/src/components/ui/card.tsx +102 -0
  47. package/src/components/ui/carousel.tsx +246 -0
  48. package/src/components/ui/chart.tsx +379 -0
  49. package/src/components/ui/checkbox.tsx +27 -0
  50. package/src/components/ui/collapsible.tsx +19 -0
  51. package/src/components/ui/combobox.tsx +298 -0
  52. package/src/components/ui/command.tsx +193 -0
  53. package/src/components/ui/context-menu.tsx +271 -0
  54. package/src/components/ui/dialog.tsx +159 -0
  55. package/src/components/ui/direction.tsx +4 -0
  56. package/src/components/ui/drawer.tsx +227 -0
  57. package/src/components/ui/dropdown-menu.tsx +269 -0
  58. package/src/components/ui/empty.tsx +104 -0
  59. package/src/components/ui/field.tsx +237 -0
  60. package/src/components/ui/fieldset.tsx +32 -0
  61. package/src/components/ui/frame.tsx +87 -0
  62. package/src/components/ui/hover-card.tsx +50 -0
  63. package/src/components/ui/input-group.tsx +159 -0
  64. package/src/components/ui/input-otp.tsx +83 -0
  65. package/src/components/ui/input.tsx +19 -0
  66. package/src/components/ui/item.tsx +202 -0
  67. package/src/components/ui/kbd.tsx +26 -0
  68. package/src/components/ui/label.tsx +19 -0
  69. package/src/components/ui/marker.tsx +71 -0
  70. package/src/components/ui/menubar.tsx +284 -0
  71. package/src/components/ui/message-scroller.tsx +128 -0
  72. package/src/components/ui/message.tsx +91 -0
  73. package/src/components/ui/meter.tsx +80 -0
  74. package/src/components/ui/native-select.tsx +64 -0
  75. package/src/components/ui/navigation-menu.tsx +170 -0
  76. package/src/components/ui/pagination.tsx +133 -0
  77. package/src/components/ui/popover.tsx +87 -0
  78. package/src/components/ui/progress.tsx +82 -0
  79. package/src/components/ui/questionnaire.tsx +328 -0
  80. package/src/components/ui/radio-group.tsx +35 -0
  81. package/src/components/ui/resizable.tsx +49 -0
  82. package/src/components/ui/scroll-area.tsx +50 -0
  83. package/src/components/ui/select.tsx +201 -0
  84. package/src/components/ui/separator.tsx +22 -0
  85. package/src/components/ui/sheet.tsx +135 -0
  86. package/src/components/ui/sidebar.tsx +730 -0
  87. package/src/components/ui/skeleton.tsx +13 -0
  88. package/src/components/ui/slider.tsx +51 -0
  89. package/src/components/ui/spinner.tsx +16 -0
  90. package/src/components/ui/switch.tsx +31 -0
  91. package/src/components/ui/table.tsx +113 -0
  92. package/src/components/ui/tabs.tsx +82 -0
  93. package/src/components/ui/textarea.tsx +17 -0
  94. package/src/components/ui/toast.tsx +229 -0
  95. package/src/components/ui/toggle-group.tsx +87 -0
  96. package/src/components/ui/toggle.tsx +43 -0
  97. package/src/components/ui/tooltip.tsx +65 -0
  98. package/src/components.ts +78 -0
  99. package/src/config.ts +56 -0
  100. package/src/define.ts +122 -0
  101. package/src/doc-context.ts +20 -0
  102. package/src/editor.ts +94 -0
  103. package/src/format-error.ts +78 -0
  104. package/src/guards.ts +84 -0
  105. package/src/hooks/use-mobile.ts +21 -0
  106. package/src/html.ts +91 -0
  107. package/src/hydrate/export-index.ts +232 -0
  108. package/src/hydrate/import-scan.ts +169 -0
  109. package/src/hydrate/plugins.ts +118 -0
  110. package/src/hydrate/runtime-module.ts +145 -0
  111. package/src/hydrate-runtime.ts +67 -0
  112. package/src/hydrate.ts +147 -0
  113. package/src/index.ts +16 -0
  114. package/src/init.ts +57 -0
  115. package/src/langs.ts +148 -0
  116. package/src/lines.ts +53 -0
  117. package/src/load-user-module.ts +191 -0
  118. package/src/mdx.ts +248 -0
  119. package/src/paths.ts +36 -0
  120. package/src/rehype/shiki.ts +533 -0
  121. package/src/remark/alerts.ts +53 -0
  122. package/src/remark/ast.ts +96 -0
  123. package/src/remark/callouts.ts +25 -0
  124. package/src/remark/code-file.ts +85 -0
  125. package/src/remark/code-meta.ts +21 -0
  126. package/src/remark/directives.ts +170 -0
  127. package/src/remark/file-paths.ts +64 -0
  128. package/src/remark/headings.ts +131 -0
  129. package/src/remark/no-js.ts +40 -0
  130. package/src/render.ts +337 -0
  131. package/src/serve.ts +322 -0
  132. package/src/styles/globals.css +134 -0
  133. package/src/styles/shadcn.css +641 -0
  134. package/src/tailwind.ts +119 -0
  135. package/src/ui/approvals.tsx +76 -0
  136. package/src/ui/ask-question.tsx +386 -0
  137. package/src/ui/ask.tsx +206 -0
  138. package/src/ui/attrs.ts +51 -0
  139. package/src/ui/audit.tsx +139 -0
  140. package/src/ui/bar-chart.tsx +334 -0
  141. package/src/ui/benchmarks.tsx +143 -0
  142. package/src/ui/bits.tsx +537 -0
  143. package/src/ui/board.tsx +173 -0
  144. package/src/ui/bridge.tsx +207 -0
  145. package/src/ui/bumps.tsx +178 -0
  146. package/src/ui/callout.tsx +106 -0
  147. package/src/ui/changes.tsx +89 -0
  148. package/src/ui/chart-bits.tsx +52 -0
  149. package/src/ui/chart.ts +577 -0
  150. package/src/ui/checks.tsx +203 -0
  151. package/src/ui/child-index.tsx +44 -0
  152. package/src/ui/children.ts +43 -0
  153. package/src/ui/chips.tsx +49 -0
  154. package/src/ui/cmd.tsx +27 -0
  155. package/src/ui/columns.tsx +31 -0
  156. package/src/ui/comments.tsx +544 -0
  157. package/src/ui/compare.tsx +67 -0
  158. package/src/ui/decision.tsx +79 -0
  159. package/src/ui/deps.tsx +78 -0
  160. package/src/ui/details.tsx +43 -0
  161. package/src/ui/diff-parse.ts +307 -0
  162. package/src/ui/diff.tsx +458 -0
  163. package/src/ui/diffstat.tsx +58 -0
  164. package/src/ui/due.tsx +65 -0
  165. package/src/ui/effort.tsx +29 -0
  166. package/src/ui/endpoints.tsx +118 -0
  167. package/src/ui/envvars.tsx +96 -0
  168. package/src/ui/figure.tsx +37 -0
  169. package/src/ui/file-icon.ts +1020 -0
  170. package/src/ui/file-link.ts +32 -0
  171. package/src/ui/file-ref.tsx +39 -0
  172. package/src/ui/files.tsx +112 -0
  173. package/src/ui/findings.tsx +85 -0
  174. package/src/ui/flow.tsx +73 -0
  175. package/src/ui/funnel.tsx +121 -0
  176. package/src/ui/gantt.tsx +443 -0
  177. package/src/ui/gauges.tsx +135 -0
  178. package/src/ui/glossary.tsx +29 -0
  179. package/src/ui/graph-layout.ts +149 -0
  180. package/src/ui/graph-specs.tsx +102 -0
  181. package/src/ui/graph.tsx +278 -0
  182. package/src/ui/grid.tsx +119 -0
  183. package/src/ui/hypothesis.tsx +94 -0
  184. package/src/ui/icon.tsx +80 -0
  185. package/src/ui/incident.tsx +130 -0
  186. package/src/ui/index.ts +342 -0
  187. package/src/ui/ins-del.tsx +41 -0
  188. package/src/ui/json.tsx +190 -0
  189. package/src/ui/layout.ts +9 -0
  190. package/src/ui/line-chart.tsx +251 -0
  191. package/src/ui/matrix.tsx +208 -0
  192. package/src/ui/meta.tsx +73 -0
  193. package/src/ui/option.tsx +64 -0
  194. package/src/ui/owner.tsx +40 -0
  195. package/src/ui/packages.tsx +104 -0
  196. package/src/ui/pathway.tsx +96 -0
  197. package/src/ui/phase.tsx +41 -0
  198. package/src/ui/pie-chart.tsx +170 -0
  199. package/src/ui/plan.tsx +77 -0
  200. package/src/ui/pre.tsx +175 -0
  201. package/src/ui/priority.tsx +51 -0
  202. package/src/ui/props.tsx +77 -0
  203. package/src/ui/quadrant.tsx +172 -0
  204. package/src/ui/radar.tsx +200 -0
  205. package/src/ui/ref.tsx +160 -0
  206. package/src/ui/release.tsx +178 -0
  207. package/src/ui/req.tsx +42 -0
  208. package/src/ui/review.tsx +133 -0
  209. package/src/ui/risk.tsx +67 -0
  210. package/src/ui/sankey.tsx +287 -0
  211. package/src/ui/scatter.tsx +237 -0
  212. package/src/ui/schema.tsx +113 -0
  213. package/src/ui/score.tsx +105 -0
  214. package/src/ui/search.tsx +120 -0
  215. package/src/ui/series.tsx +38 -0
  216. package/src/ui/severity.tsx +69 -0
  217. package/src/ui/shadcn.tsx +216 -0
  218. package/src/ui/spark.tsx +86 -0
  219. package/src/ui/stack.tsx +57 -0
  220. package/src/ui/stats.tsx +63 -0
  221. package/src/ui/status-badge.tsx +66 -0
  222. package/src/ui/statuspage.tsx +238 -0
  223. package/src/ui/steps.tsx +74 -0
  224. package/src/ui/summary.tsx +41 -0
  225. package/src/ui/symbol-ref.tsx +73 -0
  226. package/src/ui/terminal.tsx +117 -0
  227. package/src/ui/tests.tsx +218 -0
  228. package/src/ui/timeline.tsx +63 -0
  229. package/src/ui/toc.tsx +56 -0
  230. package/src/ui/tones.ts +187 -0
  231. package/src/ui/trace.tsx +69 -0
  232. package/src/ui/tree.tsx +281 -0
  233. package/src/ui/treemap.tsx +128 -0
  234. package/src/ui/venn.tsx +258 -0
  235. package/src/ui/verdict.tsx +78 -0
  236. package/src/ui/waterfall.tsx +142 -0
@@ -0,0 +1,87 @@
1
+ import { cn } from "cn";
2
+ import type * as React from "react";
3
+
4
+ export function Frame({
5
+ className,
6
+ ...props
7
+ }: React.ComponentProps<"div">): React.ReactElement {
8
+ return (
9
+ <div
10
+ className={cn(
11
+ "bg-muted/72 relative flex flex-col rounded-2xl p-1",
12
+ "*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:mt-1",
13
+ className
14
+ )}
15
+ data-slot="frame"
16
+ {...props}
17
+ />
18
+ );
19
+ }
20
+
21
+ export function FramePanel({
22
+ className,
23
+ ...props
24
+ }: React.ComponentProps<"div">): React.ReactElement {
25
+ return (
26
+ <div
27
+ className={cn(
28
+ "bg-background relative rounded-xl border bg-clip-padding p-5 shadow-xs/5 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]",
29
+ className
30
+ )}
31
+ data-slot="frame-panel"
32
+ {...props}
33
+ />
34
+ );
35
+ }
36
+
37
+ export function FrameHeader({
38
+ className,
39
+ ...props
40
+ }: React.ComponentProps<"header">): React.ReactElement {
41
+ return (
42
+ <header
43
+ className={cn("flex flex-col px-5 py-4", className)}
44
+ data-slot="frame-panel-header"
45
+ {...props}
46
+ />
47
+ );
48
+ }
49
+
50
+ export function FrameTitle({
51
+ className,
52
+ ...props
53
+ }: React.ComponentProps<"div">): React.ReactElement {
54
+ return (
55
+ <div
56
+ className={cn("text-sm font-semibold", className)}
57
+ data-slot="frame-panel-title"
58
+ {...props}
59
+ />
60
+ );
61
+ }
62
+
63
+ export function FrameDescription({
64
+ className,
65
+ ...props
66
+ }: React.ComponentProps<"div">): React.ReactElement {
67
+ return (
68
+ <div
69
+ className={cn("text-muted-foreground text-sm", className)}
70
+ data-slot="frame-panel-description"
71
+ {...props}
72
+ />
73
+ );
74
+ }
75
+
76
+ export function FrameFooter({
77
+ className,
78
+ ...props
79
+ }: React.ComponentProps<"footer">): React.ReactElement {
80
+ return (
81
+ <footer
82
+ className={cn("px-5 py-4", className)}
83
+ data-slot="frame-panel-footer"
84
+ {...props}
85
+ />
86
+ );
87
+ }
@@ -0,0 +1,50 @@
1
+ "use client";
2
+
3
+ import { PreviewCard as PreviewCardPrimitive } from "@base-ui/react/preview-card";
4
+ import { cn } from "cn";
5
+
6
+ function HoverCard({ ...props }: PreviewCardPrimitive.Root.Props) {
7
+ return <PreviewCardPrimitive.Root data-slot="hover-card" {...props} />;
8
+ }
9
+
10
+ function HoverCardTrigger({ ...props }: PreviewCardPrimitive.Trigger.Props) {
11
+ return (
12
+ <PreviewCardPrimitive.Trigger data-slot="hover-card-trigger" {...props} />
13
+ );
14
+ }
15
+
16
+ function HoverCardContent({
17
+ className,
18
+ side = "bottom",
19
+ sideOffset = 4,
20
+ align = "center",
21
+ alignOffset = 4,
22
+ ...props
23
+ }: PreviewCardPrimitive.Popup.Props &
24
+ Pick<
25
+ PreviewCardPrimitive.Positioner.Props,
26
+ "align" | "alignOffset" | "side" | "sideOffset"
27
+ >) {
28
+ return (
29
+ <PreviewCardPrimitive.Portal data-slot="hover-card-portal">
30
+ <PreviewCardPrimitive.Positioner
31
+ align={align}
32
+ alignOffset={alignOffset}
33
+ side={side}
34
+ sideOffset={sideOffset}
35
+ className="isolate z-50"
36
+ >
37
+ <PreviewCardPrimitive.Popup
38
+ data-slot="hover-card-content"
39
+ className={cn(
40
+ "bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 z-50 w-64 origin-(--transform-origin) rounded-lg p-2.5 text-sm shadow-md ring-1 outline-hidden duration-100",
41
+ className
42
+ )}
43
+ {...props}
44
+ />
45
+ </PreviewCardPrimitive.Positioner>
46
+ </PreviewCardPrimitive.Portal>
47
+ );
48
+ }
49
+
50
+ export { HoverCard, HoverCardTrigger, HoverCardContent };
@@ -0,0 +1,159 @@
1
+ "use client";
2
+
3
+ import { cva } from "class-variance-authority";
4
+ import type { VariantProps } from "class-variance-authority";
5
+ import { cn } from "cn";
6
+ import * as React from "react";
7
+
8
+ import { Button } from "./button.js";
9
+ import { Input } from "./input.js";
10
+ import { Textarea } from "./textarea.js";
11
+
12
+ function InputGroup({ className, ...props }: React.ComponentProps<"div">) {
13
+ return (
14
+ <div
15
+ data-slot="input-group"
16
+ role="group"
17
+ className={cn(
18
+ "group/input-group border-input has-disabled:bg-input/50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 relative flex h-8 w-full min-w-0 items-center rounded-lg border transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-3 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",
19
+ className
20
+ )}
21
+ {...props}
22
+ />
23
+ );
24
+ }
25
+
26
+ const inputGroupAddonVariants = cva(
27
+ "text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",
28
+ {
29
+ defaultVariants: {
30
+ align: "inline-start",
31
+ },
32
+ variants: {
33
+ align: {
34
+ "block-end":
35
+ "order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2",
36
+ "block-start":
37
+ "order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2",
38
+ "inline-end":
39
+ "order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]",
40
+ "inline-start":
41
+ "order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]",
42
+ },
43
+ },
44
+ }
45
+ );
46
+
47
+ function InputGroupAddon({
48
+ className,
49
+ align = "inline-start",
50
+ ...props
51
+ }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>) {
52
+ return (
53
+ <div
54
+ role="group"
55
+ data-slot="input-group-addon"
56
+ data-align={align}
57
+ className={cn(inputGroupAddonVariants({ align }), className)}
58
+ onClick={(e) => {
59
+ if ((e.target as HTMLElement).closest("button")) {
60
+ return;
61
+ }
62
+ e.currentTarget.parentElement?.querySelector("input")?.focus();
63
+ }}
64
+ {...props}
65
+ />
66
+ );
67
+ }
68
+
69
+ const inputGroupButtonVariants = cva(
70
+ "flex items-center gap-2 text-sm shadow-none",
71
+ {
72
+ defaultVariants: {
73
+ size: "xs",
74
+ },
75
+ variants: {
76
+ size: {
77
+ "icon-sm": "size-8 p-0 has-[>svg]:p-0",
78
+ "icon-xs":
79
+ "size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0",
80
+ sm: "",
81
+ xs: "h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",
82
+ },
83
+ },
84
+ }
85
+ );
86
+
87
+ function InputGroupButton({
88
+ className,
89
+ type = "button",
90
+ variant = "ghost",
91
+ size = "xs",
92
+ ...props
93
+ }: Omit<React.ComponentProps<typeof Button>, "size" | "type"> &
94
+ VariantProps<typeof inputGroupButtonVariants> & {
95
+ type?: "button" | "submit" | "reset";
96
+ }) {
97
+ return (
98
+ <Button
99
+ type={type}
100
+ data-size={size}
101
+ variant={variant}
102
+ className={cn(inputGroupButtonVariants({ size }), className)}
103
+ {...props}
104
+ />
105
+ );
106
+ }
107
+
108
+ function InputGroupText({ className, ...props }: React.ComponentProps<"span">) {
109
+ return (
110
+ <span
111
+ className={cn(
112
+ "text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
113
+ className
114
+ )}
115
+ {...props}
116
+ />
117
+ );
118
+ }
119
+
120
+ function InputGroupInput({
121
+ className,
122
+ ...props
123
+ }: React.ComponentProps<"input">) {
124
+ return (
125
+ <Input
126
+ data-slot="input-group-control"
127
+ className={cn(
128
+ "flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent",
129
+ className
130
+ )}
131
+ {...props}
132
+ />
133
+ );
134
+ }
135
+
136
+ function InputGroupTextarea({
137
+ className,
138
+ ...props
139
+ }: React.ComponentProps<"textarea">) {
140
+ return (
141
+ <Textarea
142
+ data-slot="input-group-control"
143
+ className={cn(
144
+ "flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent",
145
+ className
146
+ )}
147
+ {...props}
148
+ />
149
+ );
150
+ }
151
+
152
+ export {
153
+ InputGroup,
154
+ InputGroupAddon,
155
+ InputGroupButton,
156
+ InputGroupText,
157
+ InputGroupInput,
158
+ InputGroupTextarea,
159
+ };
@@ -0,0 +1,83 @@
1
+ import { cn } from "cn";
2
+ import { OTPInput, OTPInputContext } from "input-otp";
3
+ import { MinusIcon } from "lucide-react";
4
+ import * as React from "react";
5
+
6
+ function InputOTP({
7
+ className,
8
+ containerClassName,
9
+ ...props
10
+ }: React.ComponentProps<typeof OTPInput> & {
11
+ containerClassName?: string;
12
+ }) {
13
+ return (
14
+ <OTPInput
15
+ data-slot="input-otp"
16
+ containerClassName={cn(
17
+ "cn-input-otp flex items-center has-disabled:opacity-50",
18
+ containerClassName
19
+ )}
20
+ spellCheck={false}
21
+ className={cn("disabled:cursor-not-allowed", className)}
22
+ {...props}
23
+ />
24
+ );
25
+ }
26
+
27
+ function InputOTPGroup({ className, ...props }: React.ComponentProps<"div">) {
28
+ return (
29
+ <div
30
+ data-slot="input-otp-group"
31
+ className={cn(
32
+ "has-aria-invalid:border-destructive has-aria-invalid:ring-destructive/20 dark:has-aria-invalid:ring-destructive/40 flex items-center rounded-lg has-aria-invalid:ring-3",
33
+ className
34
+ )}
35
+ {...props}
36
+ />
37
+ );
38
+ }
39
+
40
+ function InputOTPSlot({
41
+ index,
42
+ className,
43
+ ...props
44
+ }: React.ComponentProps<"div"> & {
45
+ index: number;
46
+ }) {
47
+ const inputOTPContext = React.useContext(OTPInputContext);
48
+ const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
49
+
50
+ return (
51
+ <div
52
+ data-slot="input-otp-slot"
53
+ data-active={isActive}
54
+ className={cn(
55
+ "border-input aria-invalid:border-destructive data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:border-destructive data-[active=true]:aria-invalid:ring-destructive/20 dark:bg-input/30 dark:data-[active=true]:aria-invalid:ring-destructive/40 relative flex size-8 items-center justify-center border-y border-r text-sm transition-all outline-none first:rounded-l-lg first:border-l last:rounded-r-lg data-[active=true]:z-10 data-[active=true]:ring-3",
56
+ className
57
+ )}
58
+ {...props}
59
+ >
60
+ {char}
61
+ {hasFakeCaret && (
62
+ <div className="pointer-events-none absolute inset-0 flex items-center justify-center">
63
+ <div className="animate-caret-blink bg-foreground h-4 w-px duration-1000" />
64
+ </div>
65
+ )}
66
+ </div>
67
+ );
68
+ }
69
+
70
+ function InputOTPSeparator({ ...props }: React.ComponentProps<"div">) {
71
+ return (
72
+ <div
73
+ data-slot="input-otp-separator"
74
+ className="flex items-center [&_svg:not([class*='size-'])]:size-4"
75
+ role="separator"
76
+ {...props}
77
+ >
78
+ <MinusIcon />
79
+ </div>
80
+ );
81
+ }
82
+
83
+ export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };
@@ -0,0 +1,19 @@
1
+ import { Input as InputPrimitive } from "@base-ui/react/input";
2
+ import { cn } from "cn";
3
+ import * as React from "react";
4
+
5
+ function Input({ className, type, ...props }: React.ComponentProps<"input">) {
6
+ return (
7
+ <InputPrimitive
8
+ type={type}
9
+ data-slot="input"
10
+ className={cn(
11
+ "border-input file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 disabled:bg-input/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 h-8 w-full min-w-0 rounded-lg border bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-3 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3 md:text-sm",
12
+ className
13
+ )}
14
+ {...props}
15
+ />
16
+ );
17
+ }
18
+
19
+ export { Input };
@@ -0,0 +1,202 @@
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 { cn } from "cn";
6
+ import * as React from "react";
7
+
8
+ import { Separator } from "./separator.js";
9
+
10
+ function ItemGroup({ className, ...props }: React.ComponentProps<"div">) {
11
+ return (
12
+ <div
13
+ role="list"
14
+ data-slot="item-group"
15
+ className={cn(
16
+ "group/item-group flex w-full flex-col gap-4 has-data-[size=sm]:gap-2.5 has-data-[size=xs]:gap-2",
17
+ className
18
+ )}
19
+ {...props}
20
+ />
21
+ );
22
+ }
23
+
24
+ function ItemSeparator({
25
+ className,
26
+ ...props
27
+ }: React.ComponentProps<typeof Separator>) {
28
+ return (
29
+ <Separator
30
+ data-slot="item-separator"
31
+ orientation="horizontal"
32
+ className={cn("my-2", className)}
33
+ {...props}
34
+ />
35
+ );
36
+ }
37
+
38
+ const itemVariants = cva(
39
+ "group/item focus-visible:border-ring focus-visible:ring-ring/50 [a]:hover:bg-muted flex w-full flex-wrap items-center rounded-lg border text-sm transition-colors duration-100 outline-none focus-visible:ring-[3px] [a]:transition-colors",
40
+ {
41
+ defaultVariants: {
42
+ size: "default",
43
+ variant: "default",
44
+ },
45
+ variants: {
46
+ size: {
47
+ default: "gap-2.5 px-3 py-2.5",
48
+ sm: "gap-2.5 px-3 py-2.5",
49
+ xs: "gap-2 px-2.5 py-2 in-data-[slot=dropdown-menu-content]:p-0",
50
+ },
51
+ variant: {
52
+ default: "border-transparent",
53
+ muted: "bg-muted/50 border-transparent",
54
+ outline: "border-border",
55
+ },
56
+ },
57
+ }
58
+ );
59
+
60
+ function Item({
61
+ className,
62
+ variant = "default",
63
+ size = "default",
64
+ render,
65
+ ...props
66
+ }: useRender.ComponentProps<"div"> & VariantProps<typeof itemVariants>) {
67
+ return useRender({
68
+ defaultTagName: "div",
69
+ props: mergeProps<"div">(
70
+ {
71
+ className: cn(itemVariants({ className, size, variant })),
72
+ },
73
+ props
74
+ ),
75
+ render,
76
+ state: {
77
+ size,
78
+ slot: "item",
79
+ variant,
80
+ },
81
+ });
82
+ }
83
+
84
+ const itemMediaVariants = cva(
85
+ "flex shrink-0 items-center justify-center gap-2 group-has-data-[slot=item-description]/item:translate-y-0.5 group-has-data-[slot=item-description]/item:self-start [&_svg]:pointer-events-none",
86
+ {
87
+ defaultVariants: {
88
+ variant: "default",
89
+ },
90
+ variants: {
91
+ variant: {
92
+ default: "bg-transparent",
93
+ icon: "[&_svg:not([class*='size-'])]:size-4",
94
+ image:
95
+ "size-10 overflow-hidden rounded-sm group-data-[size=sm]/item:size-8 group-data-[size=xs]/item:size-6 [&_img]:size-full [&_img]:object-cover",
96
+ },
97
+ },
98
+ }
99
+ );
100
+
101
+ function ItemMedia({
102
+ className,
103
+ variant = "default",
104
+ ...props
105
+ }: React.ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>) {
106
+ return (
107
+ <div
108
+ data-slot="item-media"
109
+ data-variant={variant}
110
+ className={cn(itemMediaVariants({ className, variant }))}
111
+ {...props}
112
+ />
113
+ );
114
+ }
115
+
116
+ function ItemContent({ className, ...props }: React.ComponentProps<"div">) {
117
+ return (
118
+ <div
119
+ data-slot="item-content"
120
+ className={cn(
121
+ "flex flex-1 flex-col gap-1 group-data-[size=xs]/item:gap-0 [&+[data-slot=item-content]]:flex-none",
122
+ className
123
+ )}
124
+ {...props}
125
+ />
126
+ );
127
+ }
128
+
129
+ function ItemTitle({ className, ...props }: React.ComponentProps<"div">) {
130
+ return (
131
+ <div
132
+ data-slot="item-title"
133
+ className={cn(
134
+ "line-clamp-1 flex w-fit items-center gap-2 text-sm leading-snug font-medium underline-offset-4",
135
+ className
136
+ )}
137
+ {...props}
138
+ />
139
+ );
140
+ }
141
+
142
+ function ItemDescription({ className, ...props }: React.ComponentProps<"p">) {
143
+ return (
144
+ <p
145
+ data-slot="item-description"
146
+ className={cn(
147
+ "text-muted-foreground [&>a:hover]:text-primary line-clamp-2 text-left text-sm leading-normal font-normal group-data-[size=xs]/item:text-xs [&>a]:underline [&>a]:underline-offset-4",
148
+ className
149
+ )}
150
+ {...props}
151
+ />
152
+ );
153
+ }
154
+
155
+ function ItemActions({ className, ...props }: React.ComponentProps<"div">) {
156
+ return (
157
+ <div
158
+ data-slot="item-actions"
159
+ className={cn("flex items-center gap-2", className)}
160
+ {...props}
161
+ />
162
+ );
163
+ }
164
+
165
+ function ItemHeader({ className, ...props }: React.ComponentProps<"div">) {
166
+ return (
167
+ <div
168
+ data-slot="item-header"
169
+ className={cn(
170
+ "flex basis-full items-center justify-between gap-2",
171
+ className
172
+ )}
173
+ {...props}
174
+ />
175
+ );
176
+ }
177
+
178
+ function ItemFooter({ className, ...props }: React.ComponentProps<"div">) {
179
+ return (
180
+ <div
181
+ data-slot="item-footer"
182
+ className={cn(
183
+ "flex basis-full items-center justify-between gap-2",
184
+ className
185
+ )}
186
+ {...props}
187
+ />
188
+ );
189
+ }
190
+
191
+ export {
192
+ Item,
193
+ ItemMedia,
194
+ ItemContent,
195
+ ItemActions,
196
+ ItemGroup,
197
+ ItemSeparator,
198
+ ItemTitle,
199
+ ItemDescription,
200
+ ItemHeader,
201
+ ItemFooter,
202
+ };
@@ -0,0 +1,26 @@
1
+ import { cn } from "cn";
2
+
3
+ function Kbd({ className, ...props }: React.ComponentProps<"kbd">) {
4
+ return (
5
+ <kbd
6
+ data-slot="kbd"
7
+ className={cn(
8
+ "bg-muted text-muted-foreground in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none [&_svg:not([class*='size-'])]:size-3",
9
+ className
10
+ )}
11
+ {...props}
12
+ />
13
+ );
14
+ }
15
+
16
+ function KbdGroup({ className, ...props }: React.ComponentProps<"div">) {
17
+ return (
18
+ <kbd
19
+ data-slot="kbd-group"
20
+ className={cn("inline-flex items-center gap-1", className)}
21
+ {...props}
22
+ />
23
+ );
24
+ }
25
+
26
+ export { Kbd, KbdGroup };
@@ -0,0 +1,19 @@
1
+ "use client";
2
+
3
+ import { cn } from "cn";
4
+ import * as React from "react";
5
+
6
+ function Label({ className, ...props }: React.ComponentProps<"label">) {
7
+ return (
8
+ <label
9
+ data-slot="label"
10
+ className={cn(
11
+ "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
12
+ className
13
+ )}
14
+ {...props}
15
+ />
16
+ );
17
+ }
18
+
19
+ export { Label };