@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,328 @@
1
+ "use client";
2
+
3
+ import { Questionnaire as QuestionnairePrimitive } from "@shadcn/react/questionnaire";
4
+ import { cn } from "cn";
5
+ import { CheckIcon } from "lucide-react";
6
+ import * as React from "react";
7
+
8
+ import { buttonVariants } from "./button.js";
9
+ import type { Button } from "./button.js";
10
+
11
+ function Questionnaire({
12
+ className,
13
+ ...props
14
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Root>) {
15
+ return (
16
+ <QuestionnairePrimitive.Root
17
+ data-slot="questionnaire"
18
+ className={cn("flex w-full min-w-0 flex-col gap-4", className)}
19
+ {...props}
20
+ />
21
+ );
22
+ }
23
+
24
+ function QuestionnaireProgress({
25
+ className,
26
+ ...props
27
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Progress>) {
28
+ return (
29
+ <QuestionnairePrimitive.Progress
30
+ data-slot="questionnaire-progress"
31
+ className={cn(
32
+ "text-muted-foreground min-h-[1lh] w-fit min-w-[14ch] text-xs font-medium tabular-nums",
33
+ className
34
+ )}
35
+ {...props}
36
+ />
37
+ );
38
+ }
39
+
40
+ function QuestionnaireItem({
41
+ className,
42
+ ...props
43
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Item>) {
44
+ return (
45
+ <QuestionnairePrimitive.Item
46
+ data-slot="questionnaire-item"
47
+ className={cn(
48
+ "flex min-w-0 flex-col gap-4 border-0 p-0 outline-none",
49
+ className
50
+ )}
51
+ {...props}
52
+ />
53
+ );
54
+ }
55
+
56
+ function QuestionnaireTitle({
57
+ className,
58
+ ...props
59
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Title>) {
60
+ return (
61
+ <QuestionnairePrimitive.Title
62
+ data-slot="questionnaire-title"
63
+ className={cn(
64
+ "font-heading text-base leading-snug font-medium text-pretty [&:not(:has(~[data-slot=questionnaire-description]))]:mb-4",
65
+ className
66
+ )}
67
+ {...props}
68
+ />
69
+ );
70
+ }
71
+
72
+ function QuestionnaireDescription({
73
+ className,
74
+ ...props
75
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Description>) {
76
+ return (
77
+ <QuestionnairePrimitive.Description
78
+ data-slot="questionnaire-description"
79
+ className={cn("text-muted-foreground text-sm text-pretty", className)}
80
+ {...props}
81
+ />
82
+ );
83
+ }
84
+
85
+ function QuestionnaireChoices({
86
+ className,
87
+ ...props
88
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Choices>) {
89
+ return (
90
+ <QuestionnairePrimitive.Choices
91
+ data-slot="questionnaire-choices"
92
+ className={cn(
93
+ "group/questionnaire-choices grid min-w-0 gap-2",
94
+ className
95
+ )}
96
+ {...props}
97
+ />
98
+ );
99
+ }
100
+
101
+ function QuestionnaireChoice({
102
+ children,
103
+ className,
104
+ ...props
105
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Choice>) {
106
+ return (
107
+ <QuestionnairePrimitive.Choice
108
+ data-slot="questionnaire-choice"
109
+ className={cn(
110
+ "group/questionnaire-choice border-input hover:bg-muted/50 has-[>input:focus-visible]:border-ring has-[>input:focus-visible]:ring-ring/50 data-invalid:border-destructive dark:bg-input/20 data-checked:border-primary/40 data-checked:bg-muted dark:data-checked:bg-muted relative flex min-h-11 cursor-pointer items-start gap-2.5 rounded-lg border bg-transparent px-3 py-2.5 text-start text-sm transition-colors outline-none select-none has-[>input:focus-visible]:ring-3",
111
+ "data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-disabled:opacity-50",
112
+ className
113
+ )}
114
+ {...props}
115
+ >
116
+ <QuestionnairePrimitive.ChoiceInput
117
+ data-slot="questionnaire-choice-input"
118
+ className="absolute inset-0 z-10 size-full cursor-pointer opacity-0"
119
+ />
120
+ <span
121
+ aria-hidden="true"
122
+ data-slot="questionnaire-choice-indicator"
123
+ className="border-input group-data-checked/questionnaire-choice:border-primary group-data-checked/questionnaire-choice:bg-primary group-data-checked/questionnaire-choice:text-primary-foreground dark:bg-input/30 dark:group-data-checked/questionnaire-choice:bg-primary pointer-events-none relative flex size-4 shrink-0 translate-y-[--spacing(0.45)] items-center justify-center rounded-[4px] border group-has-data-[slot=questionnaire-choice-description]/questionnaire-choice:translate-y-0.5 group-data-[type=radio]/questionnaire-choice:rounded-full"
124
+ >
125
+ <span
126
+ data-slot="questionnaire-choice-indicator-dot"
127
+ className="bg-primary-foreground hidden size-2 rounded-full group-data-checked/questionnaire-choice:block group-data-[type=checkbox]/questionnaire-choice:hidden"
128
+ />
129
+ <CheckIcon
130
+ data-slot="questionnaire-choice-indicator-check"
131
+ className="hidden size-3.5 group-data-checked/questionnaire-choice:block group-data-[type=radio]/questionnaire-choice:hidden"
132
+ />
133
+ </span>
134
+ <QuestionnairePrimitive.ChoiceLabel
135
+ data-slot="questionnaire-choice-label"
136
+ className="flex min-w-0 flex-1 flex-col gap-0.5 leading-snug"
137
+ >
138
+ {children}
139
+ </QuestionnairePrimitive.ChoiceLabel>
140
+ <QuestionnairePrimitive.ChoiceShortcut
141
+ data-slot="questionnaire-choice-shortcut"
142
+ className="border-input bg-background text-muted-foreground pointer-events-none ms-auto hidden size-5 shrink-0 translate-y-[--spacing(0.45)] items-center justify-center rounded-md border font-mono text-[0.625rem] leading-none font-medium group-has-data-[slot=questionnaire-choice-description]/questionnaire-choice:translate-y-0.5 group-data-[shortcut]/questionnaire-choice:inline-flex"
143
+ />
144
+ </QuestionnairePrimitive.Choice>
145
+ );
146
+ }
147
+
148
+ function QuestionnaireChoiceDescription({
149
+ className,
150
+ ...props
151
+ }: React.ComponentProps<"span">) {
152
+ return (
153
+ <span
154
+ data-slot="questionnaire-choice-description"
155
+ className={cn("text-muted-foreground", className)}
156
+ {...props}
157
+ />
158
+ );
159
+ }
160
+
161
+ function QuestionnaireInput({
162
+ className,
163
+ ...props
164
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Input>) {
165
+ return (
166
+ <div
167
+ data-slot="questionnaire-input-wrapper"
168
+ className="group/questionnaire-input relative w-full min-w-0"
169
+ >
170
+ <QuestionnairePrimitive.Input
171
+ data-slot="questionnaire-input"
172
+ className={cn(
173
+ "border-input 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 min-h-11 w-full min-w-0 rounded-lg border bg-transparent px-2.5 py-1 text-base transition-[color,box-shadow,background-color] outline-none focus-visible:ring-3 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3 sm:min-h-0 md:text-sm",
174
+ "selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground",
175
+ className
176
+ )}
177
+ {...props}
178
+ />
179
+ </div>
180
+ );
181
+ }
182
+
183
+ function QuestionnaireError({
184
+ className,
185
+ ...props
186
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Error>) {
187
+ return (
188
+ <QuestionnairePrimitive.Error
189
+ data-slot="questionnaire-error"
190
+ className={cn("text-destructive mt-2 text-sm", className)}
191
+ {...props}
192
+ />
193
+ );
194
+ }
195
+
196
+ function QuestionnaireActions({
197
+ className,
198
+ ...props
199
+ }: React.ComponentProps<"div">) {
200
+ return (
201
+ <div
202
+ data-slot="questionnaire-actions"
203
+ className={cn(
204
+ "grid min-h-11 w-full grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-2 sm:min-h-8",
205
+ className
206
+ )}
207
+ {...props}
208
+ />
209
+ );
210
+ }
211
+
212
+ function QuestionnairePrevious({
213
+ children,
214
+ className,
215
+ size = "default",
216
+ variant = "outline",
217
+ ...props
218
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Previous> &
219
+ Pick<React.ComponentProps<typeof Button>, "size" | "variant">) {
220
+ return (
221
+ <QuestionnairePrimitive.Previous
222
+ data-slot="questionnaire-previous"
223
+ data-size={size}
224
+ data-variant={variant}
225
+ className={cn(
226
+ buttonVariants({ size, variant }),
227
+ "col-start-1 row-start-1 min-h-11 justify-self-start sm:min-h-0",
228
+ className
229
+ )}
230
+ {...props}
231
+ >
232
+ {children ?? "Previous"}
233
+ </QuestionnairePrimitive.Previous>
234
+ );
235
+ }
236
+
237
+ function QuestionnaireSkip({
238
+ children,
239
+ className,
240
+ size = "default",
241
+ variant = "outline",
242
+ ...props
243
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Skip> &
244
+ Pick<React.ComponentProps<typeof Button>, "size" | "variant">) {
245
+ return (
246
+ <QuestionnairePrimitive.Skip
247
+ data-slot="questionnaire-skip"
248
+ data-size={size}
249
+ data-variant={variant}
250
+ className={cn(
251
+ buttonVariants({ size, variant }),
252
+ "col-start-2 row-start-1 min-h-11 justify-self-end sm:min-h-0",
253
+ className
254
+ )}
255
+ {...props}
256
+ >
257
+ {children ?? "Skip"}
258
+ </QuestionnairePrimitive.Skip>
259
+ );
260
+ }
261
+
262
+ function QuestionnaireNext({
263
+ children,
264
+ className,
265
+ size = "default",
266
+ variant = "default",
267
+ ...props
268
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Next> &
269
+ Pick<React.ComponentProps<typeof Button>, "size" | "variant">) {
270
+ return (
271
+ <QuestionnairePrimitive.Next
272
+ data-slot="questionnaire-next"
273
+ data-size={size}
274
+ data-variant={variant}
275
+ className={cn(
276
+ buttonVariants({ size, variant }),
277
+ "col-start-3 row-start-1 min-h-11 justify-self-end sm:min-h-0",
278
+ className
279
+ )}
280
+ {...props}
281
+ >
282
+ {children ?? "Next"}
283
+ </QuestionnairePrimitive.Next>
284
+ );
285
+ }
286
+
287
+ function QuestionnaireSubmit({
288
+ children,
289
+ className,
290
+ size = "default",
291
+ variant = "default",
292
+ ...props
293
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Submit> &
294
+ Pick<React.ComponentProps<typeof Button>, "size" | "variant">) {
295
+ return (
296
+ <QuestionnairePrimitive.Submit
297
+ data-slot="questionnaire-submit"
298
+ data-size={size}
299
+ data-variant={variant}
300
+ className={cn(
301
+ buttonVariants({ size, variant }),
302
+ "col-start-3 row-start-1 min-h-11 justify-self-end sm:min-h-0",
303
+ className
304
+ )}
305
+ {...props}
306
+ >
307
+ {children ?? "Submit"}
308
+ </QuestionnairePrimitive.Submit>
309
+ );
310
+ }
311
+
312
+ export {
313
+ Questionnaire,
314
+ QuestionnaireActions,
315
+ QuestionnaireChoice,
316
+ QuestionnaireChoiceDescription,
317
+ QuestionnaireChoices,
318
+ QuestionnaireDescription,
319
+ QuestionnaireError,
320
+ QuestionnaireInput,
321
+ QuestionnaireItem,
322
+ QuestionnaireNext,
323
+ QuestionnairePrevious,
324
+ QuestionnaireProgress,
325
+ QuestionnaireSkip,
326
+ QuestionnaireSubmit,
327
+ QuestionnaireTitle,
328
+ };
@@ -0,0 +1,35 @@
1
+ import { Radio as RadioPrimitive } from "@base-ui/react/radio";
2
+ import { RadioGroup as RadioGroupPrimitive } from "@base-ui/react/radio-group";
3
+ import { cn } from "cn";
4
+
5
+ function RadioGroup({ className, ...props }: RadioGroupPrimitive.Props) {
6
+ return (
7
+ <RadioGroupPrimitive
8
+ data-slot="radio-group"
9
+ className={cn("grid w-full gap-2", className)}
10
+ {...props}
11
+ />
12
+ );
13
+ }
14
+
15
+ function RadioGroupItem({ className, ...props }: RadioPrimitive.Root.Props) {
16
+ return (
17
+ <RadioPrimitive.Root
18
+ data-slot="radio-group-item"
19
+ className={cn(
20
+ "group/radio-group-item peer border-input group-has-[:focus-visible]/field-label:not-data-checked:border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary relative flex aspect-square size-4 shrink-0 rounded-full border outline-none group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3",
21
+ className
22
+ )}
23
+ {...props}
24
+ >
25
+ <RadioPrimitive.Indicator
26
+ data-slot="radio-group-indicator"
27
+ className="flex size-4 items-center justify-center"
28
+ >
29
+ <span className="bg-primary-foreground absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full" />
30
+ </RadioPrimitive.Indicator>
31
+ </RadioPrimitive.Root>
32
+ );
33
+ }
34
+
35
+ export { RadioGroup, RadioGroupItem };
@@ -0,0 +1,49 @@
1
+ "use client";
2
+
3
+ import { cn } from "cn";
4
+ import * as ResizablePrimitive from "react-resizable-panels";
5
+
6
+ function ResizablePanelGroup({
7
+ className,
8
+ ...props
9
+ }: ResizablePrimitive.GroupProps) {
10
+ return (
11
+ <ResizablePrimitive.Group
12
+ data-slot="resizable-panel-group"
13
+ className={cn(
14
+ "flex h-full w-full aria-[orientation=vertical]:flex-col",
15
+ className
16
+ )}
17
+ {...props}
18
+ />
19
+ );
20
+ }
21
+
22
+ function ResizablePanel({ ...props }: ResizablePrimitive.PanelProps) {
23
+ return <ResizablePrimitive.Panel data-slot="resizable-panel" {...props} />;
24
+ }
25
+
26
+ function ResizableHandle({
27
+ withHandle,
28
+ className,
29
+ ...props
30
+ }: ResizablePrimitive.SeparatorProps & {
31
+ withHandle?: boolean;
32
+ }) {
33
+ return (
34
+ <ResizablePrimitive.Separator
35
+ data-slot="resizable-handle"
36
+ className={cn(
37
+ "bg-border ring-offset-background focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90",
38
+ className
39
+ )}
40
+ {...props}
41
+ >
42
+ {withHandle && (
43
+ <div className="bg-border z-10 flex h-6 w-1 shrink-0 rounded-lg" />
44
+ )}
45
+ </ResizablePrimitive.Separator>
46
+ );
47
+ }
48
+
49
+ export { ResizableHandle, ResizablePanel, ResizablePanelGroup };
@@ -0,0 +1,50 @@
1
+ import { ScrollArea as ScrollAreaPrimitive } from "@base-ui/react/scroll-area";
2
+ import { cn } from "cn";
3
+ import * as React from "react";
4
+
5
+ function ScrollArea({
6
+ className,
7
+ children,
8
+ ...props
9
+ }: ScrollAreaPrimitive.Root.Props) {
10
+ return (
11
+ <ScrollAreaPrimitive.Root
12
+ data-slot="scroll-area"
13
+ className={cn("relative", className)}
14
+ {...props}
15
+ >
16
+ <ScrollAreaPrimitive.Viewport
17
+ data-slot="scroll-area-viewport"
18
+ className="focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1"
19
+ >
20
+ {children}
21
+ </ScrollAreaPrimitive.Viewport>
22
+ </ScrollAreaPrimitive.Root>
23
+ );
24
+ }
25
+
26
+ function ScrollBar({
27
+ className,
28
+ orientation = "vertical",
29
+ ...props
30
+ }: ScrollAreaPrimitive.Scrollbar.Props) {
31
+ return (
32
+ <ScrollAreaPrimitive.Scrollbar
33
+ data-slot="scroll-area-scrollbar"
34
+ data-orientation={orientation}
35
+ orientation={orientation}
36
+ className={cn(
37
+ "flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent",
38
+ className
39
+ )}
40
+ {...props}
41
+ >
42
+ <ScrollAreaPrimitive.Thumb
43
+ data-slot="scroll-area-thumb"
44
+ className="bg-border relative flex-1 rounded-full"
45
+ />
46
+ </ScrollAreaPrimitive.Scrollbar>
47
+ );
48
+ }
49
+
50
+ export { ScrollArea, ScrollBar };
@@ -0,0 +1,201 @@
1
+ "use client";
2
+
3
+ import { Select as SelectPrimitive } from "@base-ui/react/select";
4
+ import { cn } from "cn";
5
+ import { ChevronDownIcon, CheckIcon, ChevronUpIcon } from "lucide-react";
6
+ import * as React from "react";
7
+
8
+ const Select = SelectPrimitive.Root;
9
+
10
+ function SelectGroup({ className, ...props }: SelectPrimitive.Group.Props) {
11
+ return (
12
+ <SelectPrimitive.Group
13
+ data-slot="select-group"
14
+ className={cn("scroll-my-1 p-1", className)}
15
+ {...props}
16
+ />
17
+ );
18
+ }
19
+
20
+ function SelectValue({ className, ...props }: SelectPrimitive.Value.Props) {
21
+ return (
22
+ <SelectPrimitive.Value
23
+ data-slot="select-value"
24
+ className={cn("flex flex-1 text-left", className)}
25
+ {...props}
26
+ />
27
+ );
28
+ }
29
+
30
+ function SelectTrigger({
31
+ className,
32
+ size = "default",
33
+ children,
34
+ ...props
35
+ }: SelectPrimitive.Trigger.Props & {
36
+ size?: "sm" | "default";
37
+ }) {
38
+ return (
39
+ <SelectPrimitive.Trigger
40
+ data-slot="select-trigger"
41
+ data-size={size}
42
+ className={cn(
43
+ "border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 flex w-fit items-center justify-between gap-1.5 rounded-lg border bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
44
+ className
45
+ )}
46
+ {...props}
47
+ >
48
+ {children}
49
+ <SelectPrimitive.Icon
50
+ render={
51
+ <ChevronDownIcon className="text-muted-foreground pointer-events-none size-4" />
52
+ }
53
+ />
54
+ </SelectPrimitive.Trigger>
55
+ );
56
+ }
57
+
58
+ function SelectContent({
59
+ className,
60
+ children,
61
+ side = "bottom",
62
+ sideOffset = 4,
63
+ align = "center",
64
+ alignOffset = 0,
65
+ alignItemWithTrigger = true,
66
+ ...props
67
+ }: SelectPrimitive.Popup.Props &
68
+ Pick<
69
+ SelectPrimitive.Positioner.Props,
70
+ "align" | "alignOffset" | "side" | "sideOffset" | "alignItemWithTrigger"
71
+ >) {
72
+ return (
73
+ <SelectPrimitive.Portal>
74
+ <SelectPrimitive.Positioner
75
+ side={side}
76
+ sideOffset={sideOffset}
77
+ align={align}
78
+ alignOffset={alignOffset}
79
+ alignItemWithTrigger={alignItemWithTrigger}
80
+ className="isolate z-50"
81
+ >
82
+ <SelectPrimitive.Popup
83
+ data-slot="select-content"
84
+ data-align-trigger={alignItemWithTrigger}
85
+ className={cn(
86
+ "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 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg shadow-md ring-1 duration-100 data-[align-trigger=true]:animate-none",
87
+ className
88
+ )}
89
+ {...props}
90
+ >
91
+ <SelectScrollUpButton />
92
+ <SelectPrimitive.List>{children}</SelectPrimitive.List>
93
+ <SelectScrollDownButton />
94
+ </SelectPrimitive.Popup>
95
+ </SelectPrimitive.Positioner>
96
+ </SelectPrimitive.Portal>
97
+ );
98
+ }
99
+
100
+ function SelectLabel({
101
+ className,
102
+ ...props
103
+ }: SelectPrimitive.GroupLabel.Props) {
104
+ return (
105
+ <SelectPrimitive.GroupLabel
106
+ data-slot="select-label"
107
+ className={cn("text-muted-foreground px-1.5 py-1 text-xs", className)}
108
+ {...props}
109
+ />
110
+ );
111
+ }
112
+
113
+ function SelectItem({
114
+ className,
115
+ children,
116
+ ...props
117
+ }: SelectPrimitive.Item.Props) {
118
+ return (
119
+ <SelectPrimitive.Item
120
+ data-slot="select-item"
121
+ className={cn(
122
+ "focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
123
+ className
124
+ )}
125
+ {...props}
126
+ >
127
+ <SelectPrimitive.ItemText className="flex flex-1 shrink-0 gap-2 whitespace-nowrap">
128
+ {children}
129
+ </SelectPrimitive.ItemText>
130
+ <SelectPrimitive.ItemIndicator
131
+ render={
132
+ <span className="pointer-events-none absolute right-2 flex size-4 items-center justify-center" />
133
+ }
134
+ >
135
+ <CheckIcon className="pointer-events-none" />
136
+ </SelectPrimitive.ItemIndicator>
137
+ </SelectPrimitive.Item>
138
+ );
139
+ }
140
+
141
+ function SelectSeparator({
142
+ className,
143
+ ...props
144
+ }: SelectPrimitive.Separator.Props) {
145
+ return (
146
+ <SelectPrimitive.Separator
147
+ data-slot="select-separator"
148
+ className={cn("bg-border pointer-events-none -mx-1 my-1 h-px", className)}
149
+ {...props}
150
+ />
151
+ );
152
+ }
153
+
154
+ function SelectScrollUpButton({
155
+ className,
156
+ ...props
157
+ }: React.ComponentProps<typeof SelectPrimitive.ScrollUpArrow>) {
158
+ return (
159
+ <SelectPrimitive.ScrollUpArrow
160
+ data-slot="select-scroll-up-button"
161
+ className={cn(
162
+ "bg-popover top-0 z-10 flex w-full cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4",
163
+ className
164
+ )}
165
+ {...props}
166
+ >
167
+ <ChevronUpIcon />
168
+ </SelectPrimitive.ScrollUpArrow>
169
+ );
170
+ }
171
+
172
+ function SelectScrollDownButton({
173
+ className,
174
+ ...props
175
+ }: React.ComponentProps<typeof SelectPrimitive.ScrollDownArrow>) {
176
+ return (
177
+ <SelectPrimitive.ScrollDownArrow
178
+ data-slot="select-scroll-down-button"
179
+ className={cn(
180
+ "bg-popover bottom-0 z-10 flex w-full cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4",
181
+ className
182
+ )}
183
+ {...props}
184
+ >
185
+ <ChevronDownIcon />
186
+ </SelectPrimitive.ScrollDownArrow>
187
+ );
188
+ }
189
+
190
+ export {
191
+ Select,
192
+ SelectContent,
193
+ SelectGroup,
194
+ SelectItem,
195
+ SelectLabel,
196
+ SelectScrollDownButton,
197
+ SelectScrollUpButton,
198
+ SelectSeparator,
199
+ SelectTrigger,
200
+ SelectValue,
201
+ };
@@ -0,0 +1,22 @@
1
+ import { Separator as SeparatorPrimitive } from "@base-ui/react/separator";
2
+ import { cn } from "cn";
3
+
4
+ function Separator({
5
+ className,
6
+ orientation = "horizontal",
7
+ ...props
8
+ }: SeparatorPrimitive.Props) {
9
+ return (
10
+ <SeparatorPrimitive
11
+ data-slot="separator"
12
+ orientation={orientation}
13
+ className={cn(
14
+ "bg-border shrink-0 data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",
15
+ className
16
+ )}
17
+ {...props}
18
+ />
19
+ );
20
+ }
21
+
22
+ export { Separator };