@terrafirmagreg-team/ui 0.0.0-stage → 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 (215) hide show
  1. package/package.json +93 -3
  2. package/src/components/blocks/button/icon-button.tsx +48 -0
  3. package/src/components/blocks/canvas/chevron-edge.tsx +134 -0
  4. package/src/components/blocks/canvas/flow-canvas.tsx +177 -0
  5. package/src/components/blocks/canvas/flow-toolbar.tsx +32 -0
  6. package/src/components/blocks/canvas/flow-viewport.tsx +243 -0
  7. package/src/components/blocks/git/github-info.tsx +77 -0
  8. package/src/components/blocks/lang/content.tsx +22 -0
  9. package/src/components/blocks/lang/flag.tsx +24 -0
  10. package/src/components/blocks/lang/link.tsx +22 -0
  11. package/src/components/blocks/lang/redirect.tsx +47 -0
  12. package/src/components/blocks/lang/switcher.tsx +53 -0
  13. package/src/components/blocks/lang/untranslated-callout.tsx +28 -0
  14. package/src/components/blocks/link/link-preview.tsx +256 -0
  15. package/src/components/blocks/list/row.tsx +91 -0
  16. package/src/components/blocks/media/glb/model.tsx +243 -0
  17. package/src/components/blocks/media/glb/scene.tsx +372 -0
  18. package/src/components/blocks/media/glb/viewer.tsx +51 -0
  19. package/src/components/blocks/media/image.tsx +135 -0
  20. package/src/components/blocks/media/slideshow.tsx +177 -0
  21. package/src/components/blocks/nav/breadcrumb.tsx +50 -0
  22. package/src/components/blocks/nav/link.tsx +85 -0
  23. package/src/components/blocks/nav/site-menu.tsx +77 -0
  24. package/src/components/blocks/nav/site-title.tsx +60 -0
  25. package/src/components/blocks/nav/switcher.tsx +205 -0
  26. package/src/components/blocks/page/empty-state.tsx +31 -0
  27. package/src/components/blocks/page/heading.tsx +53 -0
  28. package/src/components/blocks/page/pager.tsx +112 -0
  29. package/src/components/blocks/readability/menu.tsx +431 -0
  30. package/src/components/blocks/readability/track.tsx +164 -0
  31. package/src/components/blocks/search/command.tsx +79 -0
  32. package/src/components/blocks/search/dialog.tsx +712 -0
  33. package/src/components/blocks/search/provider.tsx +117 -0
  34. package/src/components/blocks/sidebar.tsx +406 -0
  35. package/src/components/blocks/theme/toggle.tsx +71 -0
  36. package/src/components/blocks/tooltip/hint.tsx +27 -0
  37. package/src/components/blocks/viewer/controls.tsx +279 -0
  38. package/src/components/blocks/viewer/float-bar.tsx +50 -0
  39. package/src/components/layouts/layout.tsx +93 -0
  40. package/src/components/layouts/left-sidebar/content.tsx +62 -0
  41. package/src/components/layouts/left-sidebar/context.tsx +54 -0
  42. package/src/components/layouts/left-sidebar/expand.tsx +22 -0
  43. package/src/components/layouts/left-sidebar/footer.tsx +105 -0
  44. package/src/components/layouts/left-sidebar/index.ts +28 -0
  45. package/src/components/layouts/left-sidebar/items.tsx +102 -0
  46. package/src/components/layouts/left-sidebar/search.tsx +74 -0
  47. package/src/components/layouts/left-sidebar/sidebar.tsx +188 -0
  48. package/src/components/layouts/left-sidebar/tree.tsx +156 -0
  49. package/src/components/layouts/right-sidebar.tsx +95 -0
  50. package/src/components/layouts/tree-context.tsx +41 -0
  51. package/src/components/mdx/accordion.tsx +184 -0
  52. package/src/components/mdx/banner.tsx +154 -0
  53. package/src/components/mdx/callout.tsx +96 -0
  54. package/src/components/mdx/card.tsx +49 -0
  55. package/src/components/mdx/codeblock.tsx +249 -0
  56. package/src/components/mdx/collapsible.tsx +32 -0
  57. package/src/components/mdx/files.tsx +62 -0
  58. package/src/components/mdx/glow-header.tsx +40 -0
  59. package/src/components/mdx/gradient-text.tsx +27 -0
  60. package/src/components/mdx/image-zoom.tsx +314 -0
  61. package/src/components/mdx/mermaid.tsx +16 -0
  62. package/src/components/mdx/multiblock.tsx +18 -0
  63. package/src/components/mdx/preview.tsx +100 -0
  64. package/src/components/mdx/steps.tsx +9 -0
  65. package/src/components/mdx/table.tsx +13 -0
  66. package/src/components/mdx/tabs.tsx +353 -0
  67. package/src/components/mdx/type-table.tsx +170 -0
  68. package/src/components/ui/accordion.tsx +71 -0
  69. package/src/components/ui/alert-dialog.tsx +187 -0
  70. package/src/components/ui/alert.tsx +75 -0
  71. package/src/components/ui/aspect-ratio.tsx +22 -0
  72. package/src/components/ui/attachment.tsx +207 -0
  73. package/src/components/ui/avatar.tsx +108 -0
  74. package/src/components/ui/badge.tsx +51 -0
  75. package/src/components/ui/breadcrumb.tsx +124 -0
  76. package/src/components/ui/bubble.tsx +127 -0
  77. package/src/components/ui/button-group.tsx +87 -0
  78. package/src/components/ui/button.tsx +57 -0
  79. package/src/components/ui/calendar.tsx +221 -0
  80. package/src/components/ui/card.tsx +102 -0
  81. package/src/components/ui/carousel.tsx +242 -0
  82. package/src/components/ui/chart.tsx +371 -0
  83. package/src/components/ui/checkbox.tsx +28 -0
  84. package/src/components/ui/collapsible.tsx +21 -0
  85. package/src/components/ui/combobox.tsx +297 -0
  86. package/src/components/ui/command.tsx +198 -0
  87. package/src/components/ui/context-menu.tsx +270 -0
  88. package/src/components/ui/dialog.tsx +160 -0
  89. package/src/components/ui/direction.tsx +6 -0
  90. package/src/components/ui/drawer.tsx +227 -0
  91. package/src/components/ui/dropdown-menu.tsx +269 -0
  92. package/src/components/ui/empty.tsx +103 -0
  93. package/src/components/ui/field.tsx +238 -0
  94. package/src/components/ui/hover-card.tsx +50 -0
  95. package/src/components/ui/input-group.tsx +158 -0
  96. package/src/components/ui/input-otp.tsx +86 -0
  97. package/src/components/ui/input.tsx +19 -0
  98. package/src/components/ui/item.tsx +201 -0
  99. package/src/components/ui/kbd.tsx +26 -0
  100. package/src/components/ui/label.tsx +19 -0
  101. package/src/components/ui/marker.tsx +70 -0
  102. package/src/components/ui/menubar.tsx +280 -0
  103. package/src/components/ui/message-scroller.tsx +131 -0
  104. package/src/components/ui/message.tsx +91 -0
  105. package/src/components/ui/native-select.tsx +60 -0
  106. package/src/components/ui/navigation-menu.tsx +167 -0
  107. package/src/components/ui/pagination.tsx +130 -0
  108. package/src/components/ui/popover.tsx +91 -0
  109. package/src/components/ui/progress.tsx +82 -0
  110. package/src/components/ui/questionnaire.tsx +324 -0
  111. package/src/components/ui/radio-group.tsx +37 -0
  112. package/src/components/ui/resizable.tsx +49 -0
  113. package/src/components/ui/scroll-area.tsx +54 -0
  114. package/src/components/ui/select.tsx +200 -0
  115. package/src/components/ui/separator.tsx +24 -0
  116. package/src/components/ui/sheet.tsx +138 -0
  117. package/src/components/ui/sidebar.tsx +730 -0
  118. package/src/components/ui/skeleton.tsx +13 -0
  119. package/src/components/ui/slider.tsx +51 -0
  120. package/src/components/ui/spinner.tsx +10 -0
  121. package/src/components/ui/switch.tsx +31 -0
  122. package/src/components/ui/table.tsx +115 -0
  123. package/src/components/ui/tabs.tsx +81 -0
  124. package/src/components/ui/textarea.tsx +17 -0
  125. package/src/components/ui/toast.tsx +234 -0
  126. package/src/components/ui/toggle-group.tsx +89 -0
  127. package/src/components/ui/toggle.tsx +44 -0
  128. package/src/components/ui/tooltip.tsx +65 -0
  129. package/src/hooks/canvas/use-flow-hover.ts +18 -0
  130. package/src/hooks/canvas/use-flow-viewport-persist.ts +33 -0
  131. package/src/hooks/lang.ts +8 -0
  132. package/src/hooks/layout.ts +18 -0
  133. package/src/hooks/page/use-fit-pages.ts +91 -0
  134. package/src/hooks/page/use-location-search.ts +25 -0
  135. package/src/hooks/page/use-page-preview.ts +40 -0
  136. package/src/hooks/page/use-paged-list.ts +20 -0
  137. package/src/hooks/readability/provider.ts +86 -0
  138. package/src/hooks/search/dialog.ts +41 -0
  139. package/src/hooks/search/provider.ts +25 -0
  140. package/src/hooks/search/use-highlight-query.ts +51 -0
  141. package/src/hooks/sidebar.ts +63 -0
  142. package/src/hooks/use-async-value.ts +57 -0
  143. package/src/hooks/use-close-on-scroll.ts +23 -0
  144. package/src/hooks/use-copy-button.ts +46 -0
  145. package/src/hooks/use-cycle-index.ts +75 -0
  146. package/src/hooks/use-document-title.ts +9 -0
  147. package/src/hooks/use-element-size.ts +35 -0
  148. package/src/hooks/use-external-meta.ts +132 -0
  149. package/src/hooks/use-hot-key.ts +33 -0
  150. package/src/hooks/use-hover-follow.ts +54 -0
  151. package/src/hooks/use-in-view.ts +30 -0
  152. package/src/hooks/use-last-value.ts +15 -0
  153. package/src/hooks/use-marquee.ts +51 -0
  154. package/src/hooks/use-media-query.ts +14 -0
  155. package/src/hooks/use-mobile.ts +19 -0
  156. package/src/hooks/use-modifier-keys.ts +31 -0
  157. package/src/hooks/use-on-change.ts +35 -0
  158. package/src/hooks/use-pane-keys.ts +28 -0
  159. package/src/hooks/use-swipe.ts +26 -0
  160. package/src/hooks/use-tree.ts +102 -0
  161. package/src/hooks/viewer/use-in-float-bar.ts +6 -0
  162. package/src/hooks/viewer/use-viewer-prefs.ts +77 -0
  163. package/src/lib/canvas/edge.ts +173 -0
  164. package/src/lib/canvas/geometry.ts +53 -0
  165. package/src/lib/canvas/state.ts +47 -0
  166. package/src/lib/canvas/viewport.ts +37 -0
  167. package/src/lib/canvas/xyflow.ts +1 -0
  168. package/src/lib/config.ts +81 -0
  169. package/src/lib/mdx/callout.ts +20 -0
  170. package/src/lib/mdx/gradient.ts +15 -0
  171. package/src/lib/mdx/mermaid.ts +14 -0
  172. package/src/lib/media/crop-opaque.ts +76 -0
  173. package/src/lib/media/nearby-indexes.ts +6 -0
  174. package/src/lib/media/trim-transparent.ts +117 -0
  175. package/src/lib/readability/config.ts +10 -0
  176. package/src/lib/readability/spotlight.ts +186 -0
  177. package/src/lib/readability/store.ts +146 -0
  178. package/src/lib/tree.ts +92 -0
  179. package/src/lib/utils/async-cache.ts +32 -0
  180. package/src/lib/utils/cn.ts +1 -0
  181. package/src/lib/utils/format.ts +22 -0
  182. package/src/lib/utils/history.ts +9 -0
  183. package/src/lib/utils/merge-refs.ts +13 -0
  184. package/src/lib/utils/nav-active.ts +58 -0
  185. package/src/lib/utils/stored-value.ts +136 -0
  186. package/src/lib/utils/urls.ts +17 -0
  187. package/src/locales/en_us.json +119 -0
  188. package/src/locales/pl_pl.json +35 -0
  189. package/src/locales/ru_ru.json +119 -0
  190. package/src/locales/uk_ua.json +35 -0
  191. package/src/locales/zh_cn.json +17 -0
  192. package/src/locales/zh_tw.json +17 -0
  193. package/src/locales.ts +5 -0
  194. package/src/provider.tsx +141 -0
  195. package/src/types/canvas.ts +49 -0
  196. package/src/types/glb.ts +25 -0
  197. package/src/types/nav.ts +95 -0
  198. package/src/types/preview.ts +9 -0
  199. package/src/types/readability.ts +28 -0
  200. package/src/types/search.ts +56 -0
  201. package/src/types/tree.ts +18 -0
  202. package/src/types/viewer.ts +53 -0
  203. package/styles/content/base.css +194 -0
  204. package/styles/content/default-colors.css +51 -0
  205. package/styles/content/shiki.css +108 -0
  206. package/styles/content/typography.mjs +3941 -0
  207. package/styles/content.css +7 -0
  208. package/styles/image-zoom.css +83 -0
  209. package/styles/layout.css +28 -0
  210. package/styles/left-sidebar.css +140 -0
  211. package/styles/readability.css +50 -0
  212. package/styles/right-sidebar.css +6 -0
  213. package/styles/workspace.css +26 -0
  214. package/styles.css +413 -0
  215. package/README.md +0 -3
@@ -0,0 +1,324 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { Questionnaire as QuestionnairePrimitive } from "@shadcn/react/questionnaire"
5
+ import { cn } from "cn"
6
+
7
+ import { buttonVariants, type Button } from "./button"
8
+ import { CheckIcon } from "lucide-react"
9
+
10
+ function Questionnaire({
11
+ className,
12
+ ...props
13
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Root>) {
14
+ return (
15
+ <QuestionnairePrimitive.Root
16
+ data-slot="questionnaire"
17
+ className={cn("flex w-full min-w-0 flex-col gap-4", className)}
18
+ {...props}
19
+ />
20
+ )
21
+ }
22
+
23
+ function QuestionnaireProgress({
24
+ className,
25
+ ...props
26
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Progress>) {
27
+ return (
28
+ <QuestionnairePrimitive.Progress
29
+ data-slot="questionnaire-progress"
30
+ className={cn(
31
+ "min-h-[1lh] w-fit min-w-[14ch] text-xs font-medium text-muted-foreground tabular-nums",
32
+ className
33
+ )}
34
+ {...props}
35
+ />
36
+ )
37
+ }
38
+
39
+ function QuestionnaireItem({
40
+ className,
41
+ ...props
42
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Item>) {
43
+ return (
44
+ <QuestionnairePrimitive.Item
45
+ data-slot="questionnaire-item"
46
+ className={cn(
47
+ "flex min-w-0 flex-col gap-4 border-0 p-0 outline-none",
48
+ className
49
+ )}
50
+ {...props}
51
+ />
52
+ )
53
+ }
54
+
55
+ function QuestionnaireTitle({
56
+ className,
57
+ ...props
58
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Title>) {
59
+ return (
60
+ <QuestionnairePrimitive.Title
61
+ data-slot="questionnaire-title"
62
+ className={cn(
63
+ "text-base leading-snug font-medium text-pretty [&:not(:has(~[data-slot=questionnaire-description]))]:mb-4",
64
+ className
65
+ )}
66
+ {...props}
67
+ />
68
+ )
69
+ }
70
+
71
+ function QuestionnaireDescription({
72
+ className,
73
+ ...props
74
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Description>) {
75
+ return (
76
+ <QuestionnairePrimitive.Description
77
+ data-slot="questionnaire-description"
78
+ className={cn("text-sm text-pretty text-muted-foreground", className)}
79
+ {...props}
80
+ />
81
+ )
82
+ }
83
+
84
+ function QuestionnaireChoices({
85
+ className,
86
+ ...props
87
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Choices>) {
88
+ return (
89
+ <QuestionnairePrimitive.Choices
90
+ data-slot="questionnaire-choices"
91
+ className={cn(
92
+ "group/questionnaire-choices grid min-w-0 gap-2",
93
+ className
94
+ )}
95
+ {...props}
96
+ />
97
+ )
98
+ }
99
+
100
+ function QuestionnaireChoice({
101
+ children,
102
+ className,
103
+ ...props
104
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Choice>) {
105
+ return (
106
+ <QuestionnairePrimitive.Choice
107
+ data-slot="questionnaire-choice"
108
+ className={cn(
109
+ "group/questionnaire-choice relative flex min-h-11 cursor-pointer items-start gap-2.5 rounded-lg border border-input bg-transparent px-3 py-2.5 text-start text-sm transition-colors outline-none select-none hover:bg-muted/50 has-[>input:focus-visible]:border-ring has-[>input:focus-visible]:ring-3 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",
110
+ "data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-disabled:opacity-50",
111
+ className
112
+ )}
113
+ {...props}
114
+ >
115
+ <QuestionnairePrimitive.ChoiceInput
116
+ data-slot="questionnaire-choice-input"
117
+ className="absolute inset-0 z-10 size-full cursor-pointer opacity-0"
118
+ />
119
+ <span
120
+ aria-hidden="true"
121
+ data-slot="questionnaire-choice-indicator"
122
+ className="pointer-events-none relative flex size-4 shrink-0 translate-y-[--spacing(0.45)] items-center justify-center rounded-[4px] border border-input group-has-data-[slot=questionnaire-choice-description]/questionnaire-choice:translate-y-0.5 group-data-[type=radio]/questionnaire-choice:rounded-full 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"
123
+ >
124
+ <span
125
+ data-slot="questionnaire-choice-indicator-dot"
126
+ className="hidden size-2 rounded-full bg-primary-foreground group-data-[type=checkbox]/questionnaire-choice:hidden group-data-checked/questionnaire-choice:block"
127
+ />
128
+ <CheckIcon data-slot="questionnaire-choice-indicator-check" className="hidden size-3.5 group-data-[type=radio]/questionnaire-choice:hidden group-data-checked/questionnaire-choice:block" />
129
+ </span>
130
+ <QuestionnairePrimitive.ChoiceLabel
131
+ data-slot="questionnaire-choice-label"
132
+ className="flex min-w-0 flex-1 flex-col gap-0.5 leading-snug"
133
+ >
134
+ {children}
135
+ </QuestionnairePrimitive.ChoiceLabel>
136
+ <QuestionnairePrimitive.ChoiceShortcut
137
+ data-slot="questionnaire-choice-shortcut"
138
+ className="pointer-events-none ms-auto hidden size-5 shrink-0 translate-y-[--spacing(0.45)] items-center justify-center rounded-md border border-input bg-background font-mono text-[0.625rem] leading-none font-medium text-muted-foreground group-has-data-[slot=questionnaire-choice-description]/questionnaire-choice:translate-y-0.5 group-data-[shortcut]/questionnaire-choice:inline-flex"
139
+ />
140
+ </QuestionnairePrimitive.Choice>
141
+ )
142
+ }
143
+
144
+ function QuestionnaireChoiceDescription({
145
+ className,
146
+ ...props
147
+ }: React.ComponentProps<"span">) {
148
+ return (
149
+ <span
150
+ data-slot="questionnaire-choice-description"
151
+ className={cn("text-muted-foreground", className)}
152
+ {...props}
153
+ />
154
+ )
155
+ }
156
+
157
+ function QuestionnaireInput({
158
+ className,
159
+ ...props
160
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Input>) {
161
+ return (
162
+ <div
163
+ data-slot="questionnaire-input-wrapper"
164
+ className="group/questionnaire-input relative w-full min-w-0"
165
+ >
166
+ <QuestionnairePrimitive.Input
167
+ data-slot="questionnaire-input"
168
+ className={cn(
169
+ "h-8 min-h-11 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-[color,box-shadow,background-color] outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 sm:min-h-0 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
170
+ "selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground",
171
+ className
172
+ )}
173
+ {...props}
174
+ />
175
+ </div>
176
+ )
177
+ }
178
+
179
+ function QuestionnaireError({
180
+ className,
181
+ ...props
182
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Error>) {
183
+ return (
184
+ <QuestionnairePrimitive.Error
185
+ data-slot="questionnaire-error"
186
+ className={cn("mt-2 text-sm text-destructive", className)}
187
+ {...props}
188
+ />
189
+ )
190
+ }
191
+
192
+ function QuestionnaireActions({
193
+ className,
194
+ ...props
195
+ }: React.ComponentProps<"div">) {
196
+ return (
197
+ <div
198
+ data-slot="questionnaire-actions"
199
+ className={cn(
200
+ "grid min-h-11 w-full grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-2 sm:min-h-8",
201
+ className
202
+ )}
203
+ {...props}
204
+ />
205
+ )
206
+ }
207
+
208
+ function QuestionnairePrevious({
209
+ children,
210
+ className,
211
+ size = "default",
212
+ variant = "outline",
213
+ ...props
214
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Previous> &
215
+ Pick<React.ComponentProps<typeof Button>, "size" | "variant">) {
216
+ return (
217
+ <QuestionnairePrimitive.Previous
218
+ data-slot="questionnaire-previous"
219
+ data-size={size}
220
+ data-variant={variant}
221
+ className={cn(
222
+ buttonVariants({ size, variant }),
223
+ "col-start-1 row-start-1 min-h-11 justify-self-start sm:min-h-0",
224
+ className
225
+ )}
226
+ {...props}
227
+ >
228
+ {children ?? "Previous"}
229
+ </QuestionnairePrimitive.Previous>
230
+ )
231
+ }
232
+
233
+ function QuestionnaireSkip({
234
+ children,
235
+ className,
236
+ size = "default",
237
+ variant = "outline",
238
+ ...props
239
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Skip> &
240
+ Pick<React.ComponentProps<typeof Button>, "size" | "variant">) {
241
+ return (
242
+ <QuestionnairePrimitive.Skip
243
+ data-slot="questionnaire-skip"
244
+ data-size={size}
245
+ data-variant={variant}
246
+ className={cn(
247
+ buttonVariants({ size, variant }),
248
+ "col-start-2 row-start-1 min-h-11 justify-self-end sm:min-h-0",
249
+ className
250
+ )}
251
+ {...props}
252
+ >
253
+ {children ?? "Skip"}
254
+ </QuestionnairePrimitive.Skip>
255
+ )
256
+ }
257
+
258
+ function QuestionnaireNext({
259
+ children,
260
+ className,
261
+ size = "default",
262
+ variant = "default",
263
+ ...props
264
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Next> &
265
+ Pick<React.ComponentProps<typeof Button>, "size" | "variant">) {
266
+ return (
267
+ <QuestionnairePrimitive.Next
268
+ data-slot="questionnaire-next"
269
+ data-size={size}
270
+ data-variant={variant}
271
+ className={cn(
272
+ buttonVariants({ size, variant }),
273
+ "col-start-3 row-start-1 min-h-11 justify-self-end sm:min-h-0",
274
+ className
275
+ )}
276
+ {...props}
277
+ >
278
+ {children ?? "Next"}
279
+ </QuestionnairePrimitive.Next>
280
+ )
281
+ }
282
+
283
+ function QuestionnaireSubmit({
284
+ children,
285
+ className,
286
+ size = "default",
287
+ variant = "default",
288
+ ...props
289
+ }: React.ComponentProps<typeof QuestionnairePrimitive.Submit> &
290
+ Pick<React.ComponentProps<typeof Button>, "size" | "variant">) {
291
+ return (
292
+ <QuestionnairePrimitive.Submit
293
+ data-slot="questionnaire-submit"
294
+ data-size={size}
295
+ data-variant={variant}
296
+ className={cn(
297
+ buttonVariants({ size, variant }),
298
+ "col-start-3 row-start-1 min-h-11 justify-self-end sm:min-h-0",
299
+ className
300
+ )}
301
+ {...props}
302
+ >
303
+ {children ?? "Submit"}
304
+ </QuestionnairePrimitive.Submit>
305
+ )
306
+ }
307
+
308
+ export {
309
+ Questionnaire,
310
+ QuestionnaireActions,
311
+ QuestionnaireChoice,
312
+ QuestionnaireChoiceDescription,
313
+ QuestionnaireChoices,
314
+ QuestionnaireDescription,
315
+ QuestionnaireError,
316
+ QuestionnaireInput,
317
+ QuestionnaireItem,
318
+ QuestionnaireNext,
319
+ QuestionnairePrevious,
320
+ QuestionnaireProgress,
321
+ QuestionnaireSkip,
322
+ QuestionnaireSubmit,
323
+ QuestionnaireTitle,
324
+ }
@@ -0,0 +1,37 @@
1
+ "use client"
2
+
3
+ import { Radio as RadioPrimitive } from "@base-ui/react/radio"
4
+ import { RadioGroup as RadioGroupPrimitive } from "@base-ui/react/radio-group"
5
+ import { cn } from "cn"
6
+
7
+ function RadioGroup({ className, ...props }: RadioGroupPrimitive.Props) {
8
+ return (
9
+ <RadioGroupPrimitive
10
+ data-slot="radio-group"
11
+ className={cn("grid w-full gap-2", className)}
12
+ {...props}
13
+ />
14
+ )
15
+ }
16
+
17
+ function RadioGroupItem({ className, ...props }: RadioPrimitive.Root.Props) {
18
+ return (
19
+ <RadioPrimitive.Root
20
+ data-slot="radio-group-item"
21
+ className={cn(
22
+ "group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 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",
23
+ className
24
+ )}
25
+ {...props}
26
+ >
27
+ <RadioPrimitive.Indicator
28
+ data-slot="radio-group-indicator"
29
+ className="flex size-4 items-center justify-center"
30
+ >
31
+ <span className="absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground" />
32
+ </RadioPrimitive.Indicator>
33
+ </RadioPrimitive.Root>
34
+ )
35
+ }
36
+
37
+ 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
+ "relative flex w-px items-center justify-center bg-border ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring 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="z-10 flex h-6 w-1 shrink-0 rounded-lg bg-border" />
44
+ )}
45
+ </ResizablePrimitive.Separator>
46
+ )
47
+ }
48
+
49
+ export { ResizableHandle, ResizablePanel, ResizablePanelGroup }
@@ -0,0 +1,54 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { ScrollArea as ScrollAreaPrimitive } from "@base-ui/react/scroll-area"
5
+ import { cn } from "cn"
6
+
7
+ function ScrollArea({
8
+ className,
9
+ children,
10
+ ...props
11
+ }: ScrollAreaPrimitive.Root.Props) {
12
+ return (
13
+ <ScrollAreaPrimitive.Root
14
+ data-slot="scroll-area"
15
+ className={cn("relative", className)}
16
+ {...props}
17
+ >
18
+ <ScrollAreaPrimitive.Viewport
19
+ data-slot="scroll-area-viewport"
20
+ className="size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1"
21
+ >
22
+ {children}
23
+ </ScrollAreaPrimitive.Viewport>
24
+ <ScrollBar />
25
+ <ScrollAreaPrimitive.Corner />
26
+ </ScrollAreaPrimitive.Root>
27
+ )
28
+ }
29
+
30
+ function ScrollBar({
31
+ className,
32
+ orientation = "vertical",
33
+ ...props
34
+ }: ScrollAreaPrimitive.Scrollbar.Props) {
35
+ return (
36
+ <ScrollAreaPrimitive.Scrollbar
37
+ data-slot="scroll-area-scrollbar"
38
+ data-orientation={orientation}
39
+ orientation={orientation}
40
+ className={cn(
41
+ "flex touch-none p-px transition-colors select-none data-[orientation=horizontal]:h-2.5 data-[orientation=horizontal]:flex-col data-[orientation=horizontal]:border-t data-[orientation=horizontal]:border-t-transparent data-[orientation=vertical]:h-full data-[orientation=vertical]:w-2.5 data-[orientation=vertical]:border-l data-[orientation=vertical]:border-l-transparent",
42
+ className
43
+ )}
44
+ {...props}
45
+ >
46
+ <ScrollAreaPrimitive.Thumb
47
+ data-slot="scroll-area-thumb"
48
+ className="relative flex-1 rounded-full bg-border"
49
+ />
50
+ </ScrollAreaPrimitive.Scrollbar>
51
+ )
52
+ }
53
+
54
+ export { ScrollArea, ScrollBar }
@@ -0,0 +1,200 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { Select as SelectPrimitive } from "@base-ui/react/select"
5
+ import { cn } from "cn"
6
+ import { ChevronDownIcon, CheckIcon, ChevronUpIcon } from "lucide-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
+ "flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground 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 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_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="pointer-events-none size-4 text-muted-foreground" />
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-overlay"
81
+ >
82
+ <SelectPrimitive.Popup
83
+ data-slot="select-content"
84
+ data-align-trigger={alignItemWithTrigger}
85
+ className={cn("relative isolate z-overlay max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none 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", className )}
86
+ {...props}
87
+ >
88
+ <SelectScrollUpButton />
89
+ <SelectPrimitive.List>{children}</SelectPrimitive.List>
90
+ <SelectScrollDownButton />
91
+ </SelectPrimitive.Popup>
92
+ </SelectPrimitive.Positioner>
93
+ </SelectPrimitive.Portal>
94
+ )
95
+ }
96
+
97
+ function SelectLabel({
98
+ className,
99
+ ...props
100
+ }: SelectPrimitive.GroupLabel.Props) {
101
+ return (
102
+ <SelectPrimitive.GroupLabel
103
+ data-slot="select-label"
104
+ className={cn("px-1.5 py-1 text-xs text-muted-foreground", className)}
105
+ {...props}
106
+ />
107
+ )
108
+ }
109
+
110
+ function SelectItem({
111
+ className,
112
+ children,
113
+ ...props
114
+ }: SelectPrimitive.Item.Props) {
115
+ return (
116
+ <SelectPrimitive.Item
117
+ data-slot="select-item"
118
+ className={cn(
119
+ "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 focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground 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",
120
+ className
121
+ )}
122
+ {...props}
123
+ >
124
+ <SelectPrimitive.ItemText className="flex flex-1 shrink-0 gap-2 whitespace-nowrap">
125
+ {children}
126
+ </SelectPrimitive.ItemText>
127
+ <SelectPrimitive.ItemIndicator
128
+ render={
129
+ <span className="pointer-events-none absolute right-2 flex size-4 items-center justify-center" />
130
+ }
131
+ >
132
+ <CheckIcon className="pointer-events-none" />
133
+ </SelectPrimitive.ItemIndicator>
134
+ </SelectPrimitive.Item>
135
+ )
136
+ }
137
+
138
+ function SelectSeparator({
139
+ className,
140
+ ...props
141
+ }: SelectPrimitive.Separator.Props) {
142
+ return (
143
+ <SelectPrimitive.Separator
144
+ data-slot="select-separator"
145
+ className={cn("pointer-events-none -mx-1 my-1 h-px bg-border", className)}
146
+ {...props}
147
+ />
148
+ )
149
+ }
150
+
151
+ function SelectScrollUpButton({
152
+ className,
153
+ ...props
154
+ }: React.ComponentProps<typeof SelectPrimitive.ScrollUpArrow>) {
155
+ return (
156
+ <SelectPrimitive.ScrollUpArrow
157
+ data-slot="select-scroll-up-button"
158
+ className={cn(
159
+ "top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",
160
+ className
161
+ )}
162
+ {...props}
163
+ >
164
+ <ChevronUpIcon
165
+ />
166
+ </SelectPrimitive.ScrollUpArrow>
167
+ )
168
+ }
169
+
170
+ function SelectScrollDownButton({
171
+ className,
172
+ ...props
173
+ }: React.ComponentProps<typeof SelectPrimitive.ScrollDownArrow>) {
174
+ return (
175
+ <SelectPrimitive.ScrollDownArrow
176
+ data-slot="select-scroll-down-button"
177
+ className={cn(
178
+ "bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",
179
+ className
180
+ )}
181
+ {...props}
182
+ >
183
+ <ChevronDownIcon
184
+ />
185
+ </SelectPrimitive.ScrollDownArrow>
186
+ )
187
+ }
188
+
189
+ export {
190
+ Select,
191
+ SelectContent,
192
+ SelectGroup,
193
+ SelectItem,
194
+ SelectLabel,
195
+ SelectScrollDownButton,
196
+ SelectScrollUpButton,
197
+ SelectSeparator,
198
+ SelectTrigger,
199
+ SelectValue,
200
+ }
@@ -0,0 +1,24 @@
1
+ "use client"
2
+
3
+ import { Separator as SeparatorPrimitive } from "@base-ui/react/separator"
4
+ import { cn } from "cn"
5
+
6
+ function Separator({
7
+ className,
8
+ orientation = "horizontal",
9
+ ...props
10
+ }: SeparatorPrimitive.Props) {
11
+ return (
12
+ <SeparatorPrimitive
13
+ data-slot="separator"
14
+ orientation={orientation}
15
+ className={cn(
16
+ "shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch",
17
+ className
18
+ )}
19
+ {...props}
20
+ />
21
+ )
22
+ }
23
+
24
+ export { Separator }