@middag-io/react 0.45.0 → 0.45.3

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 (321) hide show
  1. package/README.md +4 -3
  2. package/docs/public/schemas/ai-contract-manifest.json +1820 -0
  3. package/docs/public/schemas/blocks.json +445 -0
  4. package/docs/public/schemas/components.json +166 -0
  5. package/docs/public/schemas/connectors.json +97 -0
  6. package/docs/public/schemas/fragment.json +2329 -0
  7. package/docs/public/schemas/manifest.json +119 -0
  8. package/docs/public/schemas/navigation.json +72 -0
  9. package/docs/public/schemas/page-contract.json +2329 -0
  10. package/docs/public/schemas/shared-props.json +118 -0
  11. package/docs/public/schemas/theme-defaults.json +253 -0
  12. package/docs/public/schemas/theme.json +401 -0
  13. package/package.json +109 -3
  14. package/src/assets/lottie/calendar/schedule-1.json +1 -0
  15. package/src/assets/lottie/calendar/schedule-2.json +1 -0
  16. package/src/assets/lottie/celebration/confetti-1.json +1 -0
  17. package/src/assets/lottie/celebration/confetti-2.json +1 -0
  18. package/src/assets/lottie/celebration/confetti-3.json +1 -0
  19. package/src/assets/lottie/cloud/cloud-1.json +1 -0
  20. package/src/assets/lottie/cloud/cloud-2.json +1 -0
  21. package/src/assets/lottie/connection/network-1.json +1 -0
  22. package/src/assets/lottie/connection/network-2.json +1 -0
  23. package/src/assets/lottie/connection/network-3.json +1 -0
  24. package/src/assets/lottie/dashboard/analytics-1.json +1 -0
  25. package/src/assets/lottie/dashboard/analytics-2.json +1 -0
  26. package/src/assets/lottie/dashboard/analytics-3.json +1 -0
  27. package/src/assets/lottie/email/mail-1.json +1 -0
  28. package/src/assets/lottie/email/mail-2.json +1 -0
  29. package/src/assets/lottie/email/mail-3.json +1 -0
  30. package/src/assets/lottie/empty-state/empty-1.json +1 -0
  31. package/src/assets/lottie/empty-state/empty-2.json +1 -0
  32. package/src/assets/lottie/empty-state/empty-3.json +1 -0
  33. package/src/assets/lottie/error/warning-1.json +1 -0
  34. package/src/assets/lottie/error/warning-2.json +1 -0
  35. package/src/assets/lottie/error/warning-3.json +1 -0
  36. package/src/assets/lottie/index.ts +49 -0
  37. package/src/assets/lottie/loading/spinner-1.json +1 -0
  38. package/src/assets/lottie/loading/spinner-2.json +1 -0
  39. package/src/assets/lottie/loading/spinner-3.json +1 -0
  40. package/src/assets/lottie/maintenance/construction-1.json +1 -0
  41. package/src/assets/lottie/maintenance/construction-2.json +1 -0
  42. package/src/assets/lottie/maintenance/construction-3.json +1 -0
  43. package/src/assets/lottie/not-found/404-1.json +1 -0
  44. package/src/assets/lottie/not-found/404-2.json +1 -0
  45. package/src/assets/lottie/not-found/404-3.json +1 -0
  46. package/src/assets/lottie/notification/bell-1.json +1 -0
  47. package/src/assets/lottie/notification/bell-2.json +1 -0
  48. package/src/assets/lottie/notification/bell-3.json +1 -0
  49. package/src/assets/lottie/onboarding/welcome-1.json +1 -0
  50. package/src/assets/lottie/onboarding/welcome-2.json +1 -0
  51. package/src/assets/lottie/onboarding/welcome-3.json +1 -0
  52. package/src/assets/lottie/payment/wallet-1.json +1 -0
  53. package/src/assets/lottie/payment/wallet-2.json +1 -0
  54. package/src/assets/lottie/payment/wallet-3.json +1 -0
  55. package/src/assets/lottie/search/search-1.json +1 -0
  56. package/src/assets/lottie/search/search-2.json +1 -0
  57. package/src/assets/lottie/search/search-3.json +1 -0
  58. package/src/assets/lottie/security/lock-1.json +1 -0
  59. package/src/assets/lottie/security/lock-2.json +1 -0
  60. package/src/assets/lottie/security/lock-3.json +1 -0
  61. package/src/assets/lottie/settings/gear-1.json +1 -0
  62. package/src/assets/lottie/settings/gear-2.json +1 -0
  63. package/src/assets/lottie/settings/gear-3.json +1 -0
  64. package/src/assets/lottie/success/check-1.json +1 -0
  65. package/src/assets/lottie/success/check-2.json +1 -0
  66. package/src/assets/lottie/success/check-3.json +1 -0
  67. package/src/assets/lottie/upload/upload-1.json +1 -0
  68. package/src/assets/lottie/upload/upload-2.json +1 -0
  69. package/src/assets/lottie/upload/upload-3.json +1 -0
  70. package/src/assets/lottie/user/profile-1.json +1 -0
  71. package/src/assets/lottie/user/profile-2.json +1 -0
  72. package/src/assets/lottie/user/profile-3.json +1 -0
  73. package/src/base/blocks/ActionGridBlock.tsx +151 -0
  74. package/src/base/blocks/ActivityTimelineBlock.tsx +180 -0
  75. package/src/base/blocks/CardGridBlock.tsx +384 -0
  76. package/src/base/blocks/ChartBlock.tsx +81 -0
  77. package/src/base/blocks/DenseTableBlock.tsx +403 -0
  78. package/src/base/blocks/DetailPanelBlock.tsx +189 -0
  79. package/src/base/blocks/EmptyStateBlock.tsx +46 -0
  80. package/src/base/blocks/FormPanelBlock.lazy.tsx +38 -0
  81. package/src/base/blocks/FormPanelBlock.tsx +480 -0
  82. package/src/base/blocks/LinkListBlock.tsx +94 -0
  83. package/src/base/blocks/MarkdownPanelBlock.tsx +60 -0
  84. package/src/base/blocks/MetricCardBlock.tsx +128 -0
  85. package/src/base/blocks/StatusStripBlock.tsx +43 -0
  86. package/src/base/blocks/TabsBlock.tsx +94 -0
  87. package/src/base/form/FormField.tsx +607 -0
  88. package/src/base/form/fields/CheckboxField.tsx +56 -0
  89. package/src/base/form/fields/ColorField.tsx +76 -0
  90. package/src/base/form/fields/CurrencyField.tsx +126 -0
  91. package/src/base/form/fields/DateField.tsx +168 -0
  92. package/src/base/form/fields/DateRangeField.tsx +66 -0
  93. package/src/base/form/fields/DocumentField.tsx +222 -0
  94. package/src/base/form/fields/EntityPickerField.tsx +244 -0
  95. package/src/base/form/fields/FileUploadField.tsx +253 -0
  96. package/src/base/form/fields/MultiSelectField.tsx +286 -0
  97. package/src/base/form/fields/NativeSelectField.tsx +67 -0
  98. package/src/base/form/fields/NumberField.tsx +67 -0
  99. package/src/base/form/fields/OtpField.tsx +88 -0
  100. package/src/base/form/fields/PasswordField.tsx +69 -0
  101. package/src/base/form/fields/PhoneField.tsx +64 -0
  102. package/src/base/form/fields/RadioField.tsx +66 -0
  103. package/src/base/form/fields/RatingField.tsx +52 -0
  104. package/src/base/form/fields/SelectField.tsx +76 -0
  105. package/src/base/form/fields/SliderField.tsx +77 -0
  106. package/src/base/form/fields/SlugField.tsx +114 -0
  107. package/src/base/form/fields/StaticField.tsx +25 -0
  108. package/src/base/form/fields/SwitchField.tsx +56 -0
  109. package/src/base/form/fields/TagsField.tsx +128 -0
  110. package/src/base/form/fields/TextField.tsx +55 -0
  111. package/src/base/form/fields/TextareaField.tsx +55 -0
  112. package/src/base/form/fields/document-validation.ts +126 -0
  113. package/src/base/form/fields/field-registry.ts +53 -0
  114. package/src/base/form/fields/register-default-fields.ts +86 -0
  115. package/src/base/form/form-schema-builder.ts +192 -0
  116. package/src/base/form/form-utils.ts +71 -0
  117. package/src/base/hooks/useIsDark.ts +50 -0
  118. package/src/base/hooks/useLazyTabs.ts +98 -0
  119. package/src/base/hooks/usePolling.ts +43 -0
  120. package/src/base/hooks/useRemember.ts +58 -0
  121. package/src/base/hooks/useToast.ts +27 -0
  122. package/src/base/layout/BlockRegion.tsx +39 -0
  123. package/src/base/layout/DashboardLayout.tsx +110 -0
  124. package/src/base/layout/SidebarLayout.tsx +38 -0
  125. package/src/base/layout/StackLayout.tsx +32 -0
  126. package/src/base/layout/WizardLayout.tsx +49 -0
  127. package/src/base/partials/ActionBar/index.tsx +115 -0
  128. package/src/base/partials/ConfirmationDialog/index.tsx +128 -0
  129. package/src/base/partials/DataTable/cell-registry.ts +50 -0
  130. package/src/base/partials/DataTable/cell-renderers.tsx +372 -0
  131. package/src/base/partials/DataTable/index.tsx +1282 -0
  132. package/src/base/partials/DataTable/register-default-cells.ts +37 -0
  133. package/src/base/partials/DataTable/sanitize-html.ts +45 -0
  134. package/src/base/partials/DataTable/types.ts +229 -0
  135. package/src/base/partials/DetailSection/index.tsx +316 -0
  136. package/src/base/partials/EmptyPlaceholder/index.tsx +162 -0
  137. package/src/base/partials/EntityItem/index.tsx +154 -0
  138. package/src/base/partials/FilterBar/index.tsx +256 -0
  139. package/src/base/partials/FormSection/index.tsx +87 -0
  140. package/src/base/partials/LogViewer/JsonBlock.tsx +39 -0
  141. package/src/base/partials/LogViewer/LogEntry.tsx +68 -0
  142. package/src/base/partials/LogViewer/LogViewerToolbar.tsx +71 -0
  143. package/src/base/partials/LogViewer/index.tsx +110 -0
  144. package/src/base/partials/LogViewer/types.ts +28 -0
  145. package/src/base/partials/MarkdownContent/index.tsx +307 -0
  146. package/src/base/partials/MenuBar/index.tsx +80 -0
  147. package/src/base/partials/QuickRecordSheet/index.tsx +59 -0
  148. package/src/base/partials/ResizableSidebar/index.tsx +70 -0
  149. package/src/base/partials/StatRow/index.tsx +28 -0
  150. package/src/base/partials/StatusBar/index.tsx +126 -0
  151. package/src/base/partials/StatusIndicator/index.tsx +61 -0
  152. package/src/base/partials/StepIndicator/index.tsx +63 -0
  153. package/src/base/partials/TableOfContents/index.tsx +78 -0
  154. package/src/base/partials/TimelineList/index.tsx +273 -0
  155. package/src/base/partials/ToggleGroupControl/index.tsx +100 -0
  156. package/src/base/partials/TreeView/index.tsx +75 -0
  157. package/src/base/partials/index.ts +23 -0
  158. package/src/base/shell/AuthShell.tsx +54 -0
  159. package/src/base/shell/BasicShell.tsx +286 -0
  160. package/src/base/shell/ImmersiveShell.tsx +85 -0
  161. package/src/base/shell/partials/EditablePanelContext.tsx +82 -0
  162. package/src/base/shell/partials/EditablePanelProvider.tsx +122 -0
  163. package/src/base/shell/partials/InlineEditablePanel.tsx +239 -0
  164. package/src/base/shell/partials/InspectorContext.tsx +173 -0
  165. package/src/base/shell/partials/InspectorPanel.tsx +65 -0
  166. package/src/base/shell/partials/NavErrorBoundary.tsx +82 -0
  167. package/src/base/shell/partials/OverlayScreen.tsx +67 -0
  168. package/src/base/shell/partials/PageActionButton.tsx +203 -0
  169. package/src/base/theme/appearance.ts +133 -0
  170. package/src/base/theme/host-layout-detector.ts +119 -0
  171. package/src/base/theme/host-theme-detector.ts +146 -0
  172. package/src/base/theme/sidebar-safelist.txt +20 -0
  173. package/src/base/theme/tailwind-theme.css +136 -0
  174. package/src/base/theme/theme-bridge.css +164 -0
  175. package/src/base/theme/theme-context.tsx +142 -0
  176. package/src/base/theme/themes/classic.css +174 -0
  177. package/src/base/theme/tokens.css +290 -0
  178. package/src/base/theme/useHostTheme.ts +95 -0
  179. package/src/base/utils/clipboard.ts +39 -0
  180. package/src/base/utils/conditions.ts +27 -0
  181. package/src/base/utils/icon-registry.ts +78 -0
  182. package/src/base/utils/icons.ts +31 -0
  183. package/src/base/utils/interpolate.ts +9 -0
  184. package/src/base/utils/register-default-icons.ts +163 -0
  185. package/src/base/utils/storage.ts +65 -0
  186. package/src/base/utils/time.ts +139 -0
  187. package/src/contracts/block-data/actions.ts +73 -0
  188. package/src/contracts/block-data/data-display.ts +343 -0
  189. package/src/contracts/block-data/form.ts +164 -0
  190. package/src/contracts/block-data/index.ts +15 -0
  191. package/src/contracts/block-data/interactive.ts +34 -0
  192. package/src/contracts/block-data/shared.ts +44 -0
  193. package/src/contracts/connectors.ts +60 -0
  194. package/src/contracts/generated/contract-schema.ts +1237 -0
  195. package/src/contracts/generated/contract-types.ts +675 -0
  196. package/src/contracts/generated/index.ts +15 -0
  197. package/src/contracts/navigation.ts +59 -0
  198. package/src/contracts/page-contract-schema.ts +40 -0
  199. package/src/contracts/page-contract.ts +79 -0
  200. package/src/contracts/shared-props.ts +92 -0
  201. package/src/engine/ContractPage.tsx +178 -0
  202. package/src/engine/EntityRoutes.tsx +72 -0
  203. package/src/engine/HostSlot.tsx +126 -0
  204. package/src/engine/LazyBlock.tsx +92 -0
  205. package/src/engine/bootstrap.tsx +20 -0
  206. package/src/engine/providers/auth.tsx +87 -0
  207. package/src/engine/providers/error-reporter.tsx +89 -0
  208. package/src/engine/providers/flash.tsx +44 -0
  209. package/src/engine/providers/index.ts +18 -0
  210. package/src/engine/providers/inertia-error-reporter.tsx +61 -0
  211. package/src/engine/providers/progress.tsx +56 -0
  212. package/src/engine/providers/scope.tsx +51 -0
  213. package/src/engine/register-defaults.ts +88 -0
  214. package/src/engine/registries.ts +96 -0
  215. package/src/i18n/I18nProvider.tsx +53 -0
  216. package/src/i18n/MANIFEST.md +101 -0
  217. package/src/i18n/host-resolver.ts +18 -0
  218. package/src/i18n/instance.ts +69 -0
  219. package/src/i18n/locales/en/ui.json +277 -0
  220. package/src/i18n/locales/en/validators.json +13 -0
  221. package/src/i18n/locales/pt-BR/ui.json +277 -0
  222. package/src/i18n/locales/pt-BR/validators.json +13 -0
  223. package/src/i18n/register-strings.ts +10 -0
  224. package/src/i18n/render-label.ts +33 -0
  225. package/src/i18n/resolve-field-error.ts +29 -0
  226. package/src/i18n/useHostString.ts +50 -0
  227. package/src/i18n/useTranslation.ts +83 -0
  228. package/src/lib/actions/resolve-action-target.ts +151 -0
  229. package/src/lib/hooks/use-copy-to-clipboard.ts +37 -0
  230. package/src/lib/hooks/use-file-upload.ts +406 -0
  231. package/src/lib/hooks/use-mobile.ts +21 -0
  232. package/src/lib/host-pending.ts +76 -0
  233. package/src/lib/portal-container.ts +16 -0
  234. package/src/lib/test-ids.ts +40 -0
  235. package/src/lib/utils.ts +6 -0
  236. package/src/primitives/reui/MANIFEST.md +97 -0
  237. package/src/primitives/reui/accordion.tsx +64 -0
  238. package/src/primitives/reui/alert-dialog.tsx +196 -0
  239. package/src/primitives/reui/alert.tsx +92 -0
  240. package/src/primitives/reui/aspect-ratio.tsx +9 -0
  241. package/src/primitives/reui/autocomplete.tsx +343 -0
  242. package/src/primitives/reui/avatar.tsx +109 -0
  243. package/src/primitives/reui/badge.tsx +94 -0
  244. package/src/primitives/reui/breadcrumb.tsx +109 -0
  245. package/src/primitives/reui/button-group.tsx +83 -0
  246. package/src/primitives/reui/button.tsx +64 -0
  247. package/src/primitives/reui/calendar.tsx +220 -0
  248. package/src/primitives/reui/card.tsx +92 -0
  249. package/src/primitives/reui/carousel.tsx +239 -0
  250. package/src/primitives/reui/chart.tsx +388 -0
  251. package/src/primitives/reui/checkbox.tsx +30 -0
  252. package/src/primitives/reui/collapsible.tsx +31 -0
  253. package/src/primitives/reui/combobox.tsx +308 -0
  254. package/src/primitives/reui/command.tsx +182 -0
  255. package/src/primitives/reui/context-menu.tsx +250 -0
  256. package/src/primitives/reui/data-grid/data-grid-column-filter.tsx +172 -0
  257. package/src/primitives/reui/data-grid/data-grid-column-header.tsx +420 -0
  258. package/src/primitives/reui/data-grid/data-grid-column-visibility.tsx +51 -0
  259. package/src/primitives/reui/data-grid/data-grid-pagination.tsx +235 -0
  260. package/src/primitives/reui/data-grid/data-grid-scroll-area.tsx +427 -0
  261. package/src/primitives/reui/data-grid/data-grid-table-dnd-rows.tsx +308 -0
  262. package/src/primitives/reui/data-grid/data-grid-table-dnd.tsx +318 -0
  263. package/src/primitives/reui/data-grid/data-grid-table-virtual.tsx +491 -0
  264. package/src/primitives/reui/data-grid/data-grid-table.tsx +1430 -0
  265. package/src/primitives/reui/data-grid/data-grid.tsx +269 -0
  266. package/src/primitives/reui/data-grid-pagination.tsx +235 -0
  267. package/src/primitives/reui/date-selector.tsx +1353 -0
  268. package/src/primitives/reui/dialog.tsx +158 -0
  269. package/src/primitives/reui/drawer.tsx +133 -0
  270. package/src/primitives/reui/dropdown-menu.tsx +257 -0
  271. package/src/primitives/reui/empty.tsx +104 -0
  272. package/src/primitives/reui/field.tsx +246 -0
  273. package/src/primitives/reui/filters.tsx +1891 -0
  274. package/src/primitives/reui/frame.tsx +170 -0
  275. package/src/primitives/reui/hover-card.tsx +42 -0
  276. package/src/primitives/reui/icon-placeholder.tsx +39 -0
  277. package/src/primitives/reui/index.ts +98 -0
  278. package/src/primitives/reui/input-group.tsx +170 -0
  279. package/src/primitives/reui/input-otp.tsx +75 -0
  280. package/src/primitives/reui/input.tsx +21 -0
  281. package/src/primitives/reui/item.tsx +193 -0
  282. package/src/primitives/reui/kanban.tsx +743 -0
  283. package/src/primitives/reui/kbd.tsx +28 -0
  284. package/src/primitives/reui/label.tsx +22 -0
  285. package/src/primitives/reui/menubar.tsx +274 -0
  286. package/src/primitives/reui/native-select.tsx +62 -0
  287. package/src/primitives/reui/navigation-menu.tsx +168 -0
  288. package/src/primitives/reui/number-field.tsx +250 -0
  289. package/src/primitives/reui/pagination.tsx +127 -0
  290. package/src/primitives/reui/phone-input.tsx +231 -0
  291. package/src/primitives/reui/popover.tsx +87 -0
  292. package/src/primitives/reui/progress.tsx +31 -0
  293. package/src/primitives/reui/radio-group.tsx +43 -0
  294. package/src/primitives/reui/rating.tsx +177 -0
  295. package/src/primitives/reui/resizable.tsx +51 -0
  296. package/src/primitives/reui/scroll-area.tsx +58 -0
  297. package/src/primitives/reui/scrollspy.tsx +240 -0
  298. package/src/primitives/reui/select.tsx +188 -0
  299. package/src/primitives/reui/separator.tsx +28 -0
  300. package/src/primitives/reui/sheet.tsx +141 -0
  301. package/src/primitives/reui/sidebar.tsx +732 -0
  302. package/src/primitives/reui/skeleton.tsx +13 -0
  303. package/src/primitives/reui/slider.tsx +61 -0
  304. package/src/primitives/reui/sonner.tsx +47 -0
  305. package/src/primitives/reui/sortable.tsx +414 -0
  306. package/src/primitives/reui/spinner.tsx +16 -0
  307. package/src/primitives/reui/stepper.tsx +484 -0
  308. package/src/primitives/reui/svgs/claudeAiIcon.tsx +12 -0
  309. package/src/primitives/reui/svgs/gemini.tsx +171 -0
  310. package/src/primitives/reui/svgs/openai.tsx +9 -0
  311. package/src/primitives/reui/svgs/openaiDark.tsx +12 -0
  312. package/src/primitives/reui/switch.tsx +33 -0
  313. package/src/primitives/reui/table.tsx +114 -0
  314. package/src/primitives/reui/tabs.tsx +91 -0
  315. package/src/primitives/reui/textarea.tsx +18 -0
  316. package/src/primitives/reui/timeline.tsx +219 -0
  317. package/src/primitives/reui/toggle-group.tsx +83 -0
  318. package/src/primitives/reui/toggle.tsx +45 -0
  319. package/src/primitives/reui/tooltip.tsx +55 -0
  320. package/src/primitives/reui/tree.tsx +247 -0
  321. package/src/theme.css +71 -0
@@ -0,0 +1,170 @@
1
+ import { cva, type VariantProps } from "class-variance-authority";
2
+
3
+ import { cn } from "@/lib/utils";
4
+
5
+ /**
6
+ * CSS variable architecture for FramePanel theming:
7
+ *
8
+ * The Frame parent sets --frame-panel-bg and --frame-panel-border-color.
9
+ * FramePanel consumes them directly via bg-(--frame-panel-bg) and
10
+ * border-(--frame-panel-border-color). This means:
11
+ *
12
+ * - variant="inverse" overrides those vars on Frame → all panels pick it up
13
+ * - <FramePanel className="bg-blue-50"> adds a direct utility on the element
14
+ * which wins over bg-(--frame-panel-bg) by Tailwind source order — no
15
+ * :not() or !important needed
16
+ */
17
+ const frameVariants = cva(
18
+ [
19
+ "relative flex flex-col bg-muted/50 gap-0.75 p-0.75 rounded-(--frame-radius)",
20
+ "[--frame-radius:var(--radius-2xl)]",
21
+ // Default panel token values — overridden per-variant below
22
+ "[--frame-panel-bg:var(--color-card)] [--frame-panel-border-color:var(--color-border)] [--frame-border-color:var(--color-border)]",
23
+ ],
24
+ {
25
+ variants: {
26
+ variant: {
27
+ default: "border border-[var(--frame-border-color)] bg-clip-padding",
28
+ inverse:
29
+ "[--frame-panel-bg:color-mix(in_oklch,var(--color-muted)_40%,transparent)] border border-[var(--frame-border-color)] bg-background bg-clip-padding",
30
+ ghost: "",
31
+ },
32
+ spacing: {
33
+ xs: "[--frame-panel-p:--spacing(2)] [--frame-panel-header-px:--spacing(2)] [--frame-panel-header-py:--spacing(1)] [--frame-panel-footer-px:--spacing(2)] [--frame-panel-footer-py:--spacing(1)]",
34
+ sm: "[--frame-panel-p:--spacing(3)] [--frame-panel-header-px:--spacing(3)] [--frame-panel-header-py:--spacing(2)] [--frame-panel-footer-px:--spacing(3)] [--frame-panel-footer-py:--spacing(2)]",
35
+ default:
36
+ "[--frame-panel-p:--spacing(4)] [--frame-panel-header-px:--spacing(4)] [--frame-panel-header-py:--spacing(3)] [--frame-panel-footer-px:--spacing(4)] [--frame-panel-footer-py:--spacing(3)]",
37
+ lg: "[--frame-panel-p:--spacing(5)] [--frame-panel-header-px:--spacing(5)] [--frame-panel-header-py:--spacing(4)] [--frame-panel-footer-px:--spacing(5)] [--frame-panel-footer-py:--spacing(4)]",
38
+ },
39
+ stacked: {
40
+ true: [
41
+ "gap-0 *:has-[+[data-slot=frame-panel]]:rounded-b-none",
42
+ "*:has-[+[data-slot=frame-panel]]:before:hidden",
43
+ "*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:rounded-t-none",
44
+ "*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:border-t-0",
45
+ // No FrameHeader present: first panel sits flush against the outer frame border
46
+ "[&:not(:has([data-slot=frame-panel-header]))_[data-slot=frame-panel]:is(:first-child)]:border-t-0",
47
+ ],
48
+ false: [
49
+ "data-[spacing=sm]:*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:mt-0.5",
50
+ "data-[spacing=default]:*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:mt-1",
51
+ "data-[spacing=lg]:*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:mt-2",
52
+ ],
53
+ },
54
+ dense: {
55
+ // Positional rules must stay as parent selectors — cannot be expressed via CSS vars
56
+ true: "p-0 gap-0 border-[var(--frame-border-color)] [&_[data-slot=frame-panel]]:-mx-px [&_[data-slot=frame-panel]]:before:hidden [&_[data-slot=frame-panel]:last-child]:-mb-px",
57
+ false: "",
58
+ },
59
+ },
60
+ defaultVariants: {
61
+ variant: "default",
62
+ spacing: "default",
63
+ stacked: false,
64
+ dense: false,
65
+ },
66
+ },
67
+ );
68
+
69
+ function Frame({
70
+ className,
71
+ variant,
72
+ spacing,
73
+ stacked,
74
+ dense,
75
+ ...props
76
+ }: React.ComponentProps<"div"> & VariantProps<typeof frameVariants>) {
77
+ return (
78
+ <div
79
+ className={cn(
80
+ frameVariants({ variant, spacing, stacked, dense }),
81
+ className,
82
+ )}
83
+ data-slot="frame"
84
+ data-spacing={spacing}
85
+ {...props}
86
+ />
87
+ );
88
+ }
89
+
90
+ function FramePanel({
91
+ className,
92
+ fit,
93
+ ...props
94
+ }: React.ComponentProps<"div"> & { fit?: boolean }) {
95
+ return (
96
+ <div
97
+ className={cn(
98
+ // bg-(--frame-panel-bg) and border-(--frame-panel-border-color) consume the
99
+ // CSS vars set by the Frame parent. Any explicit bg-* or border-* class passed
100
+ // via className overrides these by Tailwind source order — no ! needed.
101
+ "relative grow overflow-hidden rounded-(--frame-radius) border border-(--frame-panel-border-color) bg-(--frame-panel-bg) bg-clip-padding shadow-xs",
102
+ "before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--frame-radius)-1px)] before:shadow-black/5",
103
+ "dark:bg-clip-border dark:before:shadow-white/5",
104
+ "p-(--frame-panel-p)",
105
+ className,
106
+ )}
107
+ data-slot="frame-panel"
108
+ {...props}
109
+ />
110
+ );
111
+ }
112
+
113
+ function FrameHeader({ className, ...props }: React.ComponentProps<"header">) {
114
+ return (
115
+ <header
116
+ className={cn(
117
+ "flex flex-col px-(--frame-panel-header-px) py-(--frame-panel-header-py)",
118
+ className,
119
+ )}
120
+ data-slot="frame-panel-header"
121
+ {...props}
122
+ />
123
+ );
124
+ }
125
+
126
+ function FrameTitle({ className, ...props }: React.ComponentProps<"div">) {
127
+ return (
128
+ <div
129
+ className={cn("text-sm font-semibold", className)}
130
+ data-slot="frame-panel-title"
131
+ {...props}
132
+ />
133
+ );
134
+ }
135
+
136
+ function FrameDescription({
137
+ className,
138
+ ...props
139
+ }: React.ComponentProps<"div">) {
140
+ return (
141
+ <div
142
+ className={cn("text-muted-foreground text-sm", className)}
143
+ data-slot="frame-panel-description"
144
+ {...props}
145
+ />
146
+ );
147
+ }
148
+
149
+ function FrameFooter({ className, ...props }: React.ComponentProps<"footer">) {
150
+ return (
151
+ <footer
152
+ className={cn(
153
+ "flex flex-col gap-1 px-(--frame-panel-footer-px) py-(--frame-panel-footer-py)",
154
+ className,
155
+ )}
156
+ data-slot="frame-panel-footer"
157
+ {...props}
158
+ />
159
+ );
160
+ }
161
+
162
+ export {
163
+ Frame,
164
+ FramePanel,
165
+ FrameHeader,
166
+ FrameTitle,
167
+ FrameDescription,
168
+ FrameFooter,
169
+ frameVariants,
170
+ };
@@ -0,0 +1,42 @@
1
+ import * as React from "react";
2
+ import { HoverCard as HoverCardPrimitive } from "radix-ui";
3
+
4
+ import { cn } from "@/lib/utils";
5
+
6
+ function HoverCard({
7
+ ...props
8
+ }: React.ComponentProps<typeof HoverCardPrimitive.Root>) {
9
+ return <HoverCardPrimitive.Root data-slot="hover-card" {...props} />;
10
+ }
11
+
12
+ function HoverCardTrigger({
13
+ ...props
14
+ }: React.ComponentProps<typeof HoverCardPrimitive.Trigger>) {
15
+ return (
16
+ <HoverCardPrimitive.Trigger data-slot="hover-card-trigger" {...props} />
17
+ );
18
+ }
19
+
20
+ function HoverCardContent({
21
+ className,
22
+ align = "center",
23
+ sideOffset = 4,
24
+ ...props
25
+ }: React.ComponentProps<typeof HoverCardPrimitive.Content>) {
26
+ return (
27
+ <HoverCardPrimitive.Portal data-slot="hover-card-portal">
28
+ <HoverCardPrimitive.Content
29
+ data-slot="hover-card-content"
30
+ align={align}
31
+ sideOffset={sideOffset}
32
+ className={cn(
33
+ "z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-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-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
34
+ className,
35
+ )}
36
+ {...props}
37
+ />
38
+ </HoverCardPrimitive.Portal>
39
+ );
40
+ }
41
+
42
+ export { HoverCard, HoverCardTrigger, HoverCardContent };
@@ -0,0 +1,39 @@
1
+ /**
2
+ * IconPlaceholder — resolves icon by name from Lucide React.
3
+ *
4
+ * ReUI components pass icon names as strings for multiple icon libraries.
5
+ * We resolve the `lucide` prop to the corresponding Lucide React component.
6
+ * Other library props (tabler, hugeicons, phosphor, remixicon) are accepted
7
+ * but ignored — Lucide is our icon library.
8
+ */
9
+
10
+ import * as LucideIcons from "lucide-react";
11
+ import { cn } from "@/lib/utils";
12
+
13
+ interface IconPlaceholderProps extends React.SVGAttributes<SVGSVGElement> {
14
+ lucide?: string;
15
+ tabler?: string;
16
+ hugeicons?: string;
17
+ phosphor?: string;
18
+ remixicon?: string;
19
+ }
20
+
21
+ export function IconPlaceholder({
22
+ lucide,
23
+ tabler: _tabler,
24
+ hugeicons: _hugeicons,
25
+ phosphor: _phosphor,
26
+ remixicon: _remixicon,
27
+ className,
28
+ ...props
29
+ }: IconPlaceholderProps) {
30
+ if (!lucide) return null;
31
+
32
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
+ const Icon = (LucideIcons as any)[lucide] as
34
+ | LucideIcons.LucideIcon
35
+ | undefined;
36
+ if (!Icon) return null;
37
+
38
+ return <Icon className={cn("size-4", className)} {...props} />;
39
+ }
@@ -0,0 +1,98 @@
1
+ /**
2
+ * reui barrel — primitive UI surface for host-runtime consumers.
3
+ *
4
+ * Re-exports the reui primitives promoted to the package root barrel so
5
+ * * consumers import them from "@middag-io/react" (root barrel only) instead
6
+ * of deep "/reui/*" subpaths. Re-exported by ../../index.ts via
7
+ * `export * from "@/primitives/reui"`. The curated reui pieces already exported
8
+ * directly by the root barrel (sidebar, sonner, tooltip, dropdown-menu) stay
9
+ * there to preserve their existing curated surface.
10
+ */
11
+ export { Badge, badgeVariants, type BadgeProps } from "./badge";
12
+ export { Button, buttonVariants } from "./button";
13
+ export { Skeleton } from "./skeleton";
14
+ export { Input } from "./input";
15
+ export {
16
+ Empty,
17
+ EmptyHeader,
18
+ EmptyTitle,
19
+ EmptyDescription,
20
+ EmptyContent,
21
+ EmptyMedia,
22
+ } from "./empty";
23
+ export {
24
+ Select,
25
+ SelectContent,
26
+ SelectGroup,
27
+ SelectItem,
28
+ SelectLabel,
29
+ SelectScrollDownButton,
30
+ SelectScrollUpButton,
31
+ SelectSeparator,
32
+ SelectTrigger,
33
+ SelectValue,
34
+ } from "./select";
35
+ export {
36
+ Card,
37
+ CardHeader,
38
+ CardFooter,
39
+ CardTitle,
40
+ CardAction,
41
+ CardDescription,
42
+ CardContent,
43
+ } from "./card";
44
+ export { Progress } from "./progress";
45
+ export { Alert, AlertTitle, AlertDescription, AlertAction } from "./alert";
46
+ export {
47
+ AlertDialog,
48
+ AlertDialogAction,
49
+ AlertDialogCancel,
50
+ AlertDialogContent,
51
+ AlertDialogDescription,
52
+ AlertDialogFooter,
53
+ AlertDialogHeader,
54
+ AlertDialogMedia,
55
+ AlertDialogOverlay,
56
+ AlertDialogPortal,
57
+ AlertDialogTitle,
58
+ AlertDialogTrigger,
59
+ } from "./alert-dialog";
60
+ export {
61
+ Combobox,
62
+ ComboboxInput,
63
+ ComboboxContent,
64
+ ComboboxList,
65
+ ComboboxItem,
66
+ ComboboxGroup,
67
+ ComboboxLabel,
68
+ ComboboxCollection,
69
+ ComboboxEmpty,
70
+ ComboboxSeparator,
71
+ ComboboxChips,
72
+ ComboboxChip,
73
+ ComboboxChipsInput,
74
+ ComboboxTrigger,
75
+ ComboboxValue,
76
+ useComboboxAnchor,
77
+ } from "./combobox";
78
+ export { Switch } from "./switch";
79
+ export { Textarea } from "./textarea";
80
+ export {
81
+ Dialog,
82
+ DialogClose,
83
+ DialogContent,
84
+ DialogDescription,
85
+ DialogFooter,
86
+ DialogHeader,
87
+ DialogOverlay,
88
+ DialogPortal,
89
+ DialogTitle,
90
+ DialogTrigger,
91
+ } from "./dialog";
92
+ export {
93
+ Collapsible,
94
+ CollapsibleTrigger,
95
+ CollapsibleContent,
96
+ } from "./collapsible";
97
+ export { Spinner } from "./spinner";
98
+ export { Label } from "./label";
@@ -0,0 +1,170 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import { cva, type VariantProps } from "class-variance-authority";
5
+
6
+ import { cn } from "@/lib/utils";
7
+ import { Button } from "@/primitives/reui/button";
8
+ import { Input } from "@/primitives/reui/input";
9
+ import { Textarea } from "@/primitives/reui/textarea";
10
+
11
+ function InputGroup({ className, ...props }: React.ComponentProps<"div">) {
12
+ return (
13
+ <div
14
+ data-slot="input-group"
15
+ role="group"
16
+ className={cn(
17
+ "group/input-group relative flex w-full items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none dark:bg-input/30",
18
+ "h-9 min-w-0 has-[>textarea]:h-auto",
19
+
20
+ // Variants based on alignment.
21
+ "has-[>[data-align=inline-start]]:[&>input]:pl-2",
22
+ "has-[>[data-align=inline-end]]:[&>input]:pr-2",
23
+ "has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3",
24
+ "has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3",
25
+
26
+ // Focus state.
27
+ "has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50",
28
+
29
+ // Error state.
30
+ "has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",
31
+
32
+ className,
33
+ )}
34
+ {...props}
35
+ />
36
+ );
37
+ }
38
+
39
+ const inputGroupAddonVariants = cva(
40
+ "flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",
41
+ {
42
+ variants: {
43
+ align: {
44
+ "inline-start":
45
+ "order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",
46
+ "inline-end":
47
+ "order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]",
48
+ "block-start":
49
+ "order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5 [.border-b]:pb-3",
50
+ "block-end":
51
+ "order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5 [.border-t]:pt-3",
52
+ },
53
+ },
54
+ defaultVariants: {
55
+ align: "inline-start",
56
+ },
57
+ },
58
+ );
59
+
60
+ function InputGroupAddon({
61
+ className,
62
+ align = "inline-start",
63
+ ...props
64
+ }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>) {
65
+ return (
66
+ <div
67
+ role="group"
68
+ data-slot="input-group-addon"
69
+ data-align={align}
70
+ className={cn(inputGroupAddonVariants({ align }), className)}
71
+ onClick={(e) => {
72
+ if ((e.target as HTMLElement).closest("button")) {
73
+ return;
74
+ }
75
+ e.currentTarget.parentElement?.querySelector("input")?.focus();
76
+ }}
77
+ {...props}
78
+ />
79
+ );
80
+ }
81
+
82
+ const inputGroupButtonVariants = cva(
83
+ "flex items-center gap-2 text-sm shadow-none",
84
+ {
85
+ variants: {
86
+ size: {
87
+ xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5",
88
+ sm: "h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5",
89
+ "icon-xs":
90
+ "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
91
+ "icon-sm": "size-8 p-0 has-[>svg]:p-0",
92
+ },
93
+ },
94
+ defaultVariants: {
95
+ size: "xs",
96
+ },
97
+ },
98
+ );
99
+
100
+ function InputGroupButton({
101
+ className,
102
+ type = "button",
103
+ variant = "ghost",
104
+ size = "xs",
105
+ ...props
106
+ }: Omit<React.ComponentProps<typeof Button>, "size"> &
107
+ VariantProps<typeof inputGroupButtonVariants>) {
108
+ return (
109
+ <Button
110
+ type={type}
111
+ data-size={size}
112
+ variant={variant}
113
+ className={cn(inputGroupButtonVariants({ size }), className)}
114
+ {...props}
115
+ />
116
+ );
117
+ }
118
+
119
+ function InputGroupText({ className, ...props }: React.ComponentProps<"span">) {
120
+ return (
121
+ <span
122
+ className={cn(
123
+ "flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
124
+ className,
125
+ )}
126
+ {...props}
127
+ />
128
+ );
129
+ }
130
+
131
+ function InputGroupInput({
132
+ className,
133
+ ...props
134
+ }: React.ComponentProps<"input">) {
135
+ return (
136
+ <Input
137
+ data-slot="input-group-control"
138
+ className={cn(
139
+ "flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent",
140
+ className,
141
+ )}
142
+ {...props}
143
+ />
144
+ );
145
+ }
146
+
147
+ function InputGroupTextarea({
148
+ className,
149
+ ...props
150
+ }: React.ComponentProps<"textarea">) {
151
+ return (
152
+ <Textarea
153
+ data-slot="input-group-control"
154
+ className={cn(
155
+ "flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent",
156
+ className,
157
+ )}
158
+ {...props}
159
+ />
160
+ );
161
+ }
162
+
163
+ export {
164
+ InputGroup,
165
+ InputGroupAddon,
166
+ InputGroupButton,
167
+ InputGroupText,
168
+ InputGroupInput,
169
+ InputGroupTextarea,
170
+ };
@@ -0,0 +1,75 @@
1
+ import * as React from "react";
2
+ import { OTPInput, OTPInputContext } from "input-otp";
3
+ import { MinusIcon } from "lucide-react";
4
+
5
+ import { cn } from "@/lib/utils";
6
+
7
+ function InputOTP({
8
+ className,
9
+ containerClassName,
10
+ ...props
11
+ }: React.ComponentProps<typeof OTPInput> & {
12
+ containerClassName?: string;
13
+ }) {
14
+ return (
15
+ <OTPInput
16
+ data-slot="input-otp"
17
+ containerClassName={cn(
18
+ "flex items-center gap-2 has-disabled:opacity-50",
19
+ containerClassName,
20
+ )}
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("flex items-center", className)}
32
+ {...props}
33
+ />
34
+ );
35
+ }
36
+
37
+ function InputOTPSlot({
38
+ index,
39
+ className,
40
+ ...props
41
+ }: React.ComponentProps<"div"> & {
42
+ index: number;
43
+ }) {
44
+ const inputOTPContext = React.useContext(OTPInputContext);
45
+ const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
46
+
47
+ return (
48
+ <div
49
+ data-slot="input-otp-slot"
50
+ data-active={isActive}
51
+ className={cn(
52
+ "relative flex h-9 w-9 items-center justify-center border-y border-r border-input text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md aria-invalid:border-destructive data-[active=true]:z-10 data-[active=true]:border-ring data-[active=true]:ring-[3px] 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",
53
+ className,
54
+ )}
55
+ {...props}
56
+ >
57
+ {char}
58
+ {hasFakeCaret && (
59
+ <div className="pointer-events-none absolute inset-0 flex items-center justify-center">
60
+ <div className="h-4 w-px animate-caret-blink bg-foreground duration-1000" />
61
+ </div>
62
+ )}
63
+ </div>
64
+ );
65
+ }
66
+
67
+ function InputOTPSeparator({ ...props }: React.ComponentProps<"div">) {
68
+ return (
69
+ <div data-slot="input-otp-separator" role="separator" {...props}>
70
+ <MinusIcon />
71
+ </div>
72
+ );
73
+ }
74
+
75
+ export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };
@@ -0,0 +1,21 @@
1
+ import * as React from "react";
2
+
3
+ import { cn } from "@/lib/utils";
4
+
5
+ function Input({ className, type, ...props }: React.ComponentProps<"input">) {
6
+ return (
7
+ <input
8
+ type={type}
9
+ data-slot="input"
10
+ className={cn(
11
+ "h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30",
12
+ "focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
13
+ "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",
14
+ className,
15
+ )}
16
+ {...props}
17
+ />
18
+ );
19
+ }
20
+
21
+ export { Input };