@middag-io/react 0.45.0 → 0.45.2

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 (320) hide show
  1. package/docs/public/schemas/ai-contract-manifest.json +1820 -0
  2. package/docs/public/schemas/blocks.json +445 -0
  3. package/docs/public/schemas/components.json +166 -0
  4. package/docs/public/schemas/connectors.json +97 -0
  5. package/docs/public/schemas/fragment.json +2329 -0
  6. package/docs/public/schemas/manifest.json +119 -0
  7. package/docs/public/schemas/navigation.json +72 -0
  8. package/docs/public/schemas/page-contract.json +2329 -0
  9. package/docs/public/schemas/shared-props.json +118 -0
  10. package/docs/public/schemas/theme-defaults.json +253 -0
  11. package/docs/public/schemas/theme.json +401 -0
  12. package/package.json +109 -3
  13. package/src/assets/lottie/calendar/schedule-1.json +1 -0
  14. package/src/assets/lottie/calendar/schedule-2.json +1 -0
  15. package/src/assets/lottie/celebration/confetti-1.json +1 -0
  16. package/src/assets/lottie/celebration/confetti-2.json +1 -0
  17. package/src/assets/lottie/celebration/confetti-3.json +1 -0
  18. package/src/assets/lottie/cloud/cloud-1.json +1 -0
  19. package/src/assets/lottie/cloud/cloud-2.json +1 -0
  20. package/src/assets/lottie/connection/network-1.json +1 -0
  21. package/src/assets/lottie/connection/network-2.json +1 -0
  22. package/src/assets/lottie/connection/network-3.json +1 -0
  23. package/src/assets/lottie/dashboard/analytics-1.json +1 -0
  24. package/src/assets/lottie/dashboard/analytics-2.json +1 -0
  25. package/src/assets/lottie/dashboard/analytics-3.json +1 -0
  26. package/src/assets/lottie/email/mail-1.json +1 -0
  27. package/src/assets/lottie/email/mail-2.json +1 -0
  28. package/src/assets/lottie/email/mail-3.json +1 -0
  29. package/src/assets/lottie/empty-state/empty-1.json +1 -0
  30. package/src/assets/lottie/empty-state/empty-2.json +1 -0
  31. package/src/assets/lottie/empty-state/empty-3.json +1 -0
  32. package/src/assets/lottie/error/warning-1.json +1 -0
  33. package/src/assets/lottie/error/warning-2.json +1 -0
  34. package/src/assets/lottie/error/warning-3.json +1 -0
  35. package/src/assets/lottie/index.ts +49 -0
  36. package/src/assets/lottie/loading/spinner-1.json +1 -0
  37. package/src/assets/lottie/loading/spinner-2.json +1 -0
  38. package/src/assets/lottie/loading/spinner-3.json +1 -0
  39. package/src/assets/lottie/maintenance/construction-1.json +1 -0
  40. package/src/assets/lottie/maintenance/construction-2.json +1 -0
  41. package/src/assets/lottie/maintenance/construction-3.json +1 -0
  42. package/src/assets/lottie/not-found/404-1.json +1 -0
  43. package/src/assets/lottie/not-found/404-2.json +1 -0
  44. package/src/assets/lottie/not-found/404-3.json +1 -0
  45. package/src/assets/lottie/notification/bell-1.json +1 -0
  46. package/src/assets/lottie/notification/bell-2.json +1 -0
  47. package/src/assets/lottie/notification/bell-3.json +1 -0
  48. package/src/assets/lottie/onboarding/welcome-1.json +1 -0
  49. package/src/assets/lottie/onboarding/welcome-2.json +1 -0
  50. package/src/assets/lottie/onboarding/welcome-3.json +1 -0
  51. package/src/assets/lottie/payment/wallet-1.json +1 -0
  52. package/src/assets/lottie/payment/wallet-2.json +1 -0
  53. package/src/assets/lottie/payment/wallet-3.json +1 -0
  54. package/src/assets/lottie/search/search-1.json +1 -0
  55. package/src/assets/lottie/search/search-2.json +1 -0
  56. package/src/assets/lottie/search/search-3.json +1 -0
  57. package/src/assets/lottie/security/lock-1.json +1 -0
  58. package/src/assets/lottie/security/lock-2.json +1 -0
  59. package/src/assets/lottie/security/lock-3.json +1 -0
  60. package/src/assets/lottie/settings/gear-1.json +1 -0
  61. package/src/assets/lottie/settings/gear-2.json +1 -0
  62. package/src/assets/lottie/settings/gear-3.json +1 -0
  63. package/src/assets/lottie/success/check-1.json +1 -0
  64. package/src/assets/lottie/success/check-2.json +1 -0
  65. package/src/assets/lottie/success/check-3.json +1 -0
  66. package/src/assets/lottie/upload/upload-1.json +1 -0
  67. package/src/assets/lottie/upload/upload-2.json +1 -0
  68. package/src/assets/lottie/upload/upload-3.json +1 -0
  69. package/src/assets/lottie/user/profile-1.json +1 -0
  70. package/src/assets/lottie/user/profile-2.json +1 -0
  71. package/src/assets/lottie/user/profile-3.json +1 -0
  72. package/src/base/blocks/ActionGridBlock.tsx +151 -0
  73. package/src/base/blocks/ActivityTimelineBlock.tsx +180 -0
  74. package/src/base/blocks/CardGridBlock.tsx +384 -0
  75. package/src/base/blocks/ChartBlock.tsx +81 -0
  76. package/src/base/blocks/DenseTableBlock.tsx +403 -0
  77. package/src/base/blocks/DetailPanelBlock.tsx +189 -0
  78. package/src/base/blocks/EmptyStateBlock.tsx +46 -0
  79. package/src/base/blocks/FormPanelBlock.lazy.tsx +38 -0
  80. package/src/base/blocks/FormPanelBlock.tsx +480 -0
  81. package/src/base/blocks/LinkListBlock.tsx +94 -0
  82. package/src/base/blocks/MarkdownPanelBlock.tsx +60 -0
  83. package/src/base/blocks/MetricCardBlock.tsx +128 -0
  84. package/src/base/blocks/StatusStripBlock.tsx +43 -0
  85. package/src/base/blocks/TabsBlock.tsx +94 -0
  86. package/src/base/form/FormField.tsx +607 -0
  87. package/src/base/form/fields/CheckboxField.tsx +56 -0
  88. package/src/base/form/fields/ColorField.tsx +76 -0
  89. package/src/base/form/fields/CurrencyField.tsx +126 -0
  90. package/src/base/form/fields/DateField.tsx +168 -0
  91. package/src/base/form/fields/DateRangeField.tsx +66 -0
  92. package/src/base/form/fields/DocumentField.tsx +222 -0
  93. package/src/base/form/fields/EntityPickerField.tsx +244 -0
  94. package/src/base/form/fields/FileUploadField.tsx +253 -0
  95. package/src/base/form/fields/MultiSelectField.tsx +286 -0
  96. package/src/base/form/fields/NativeSelectField.tsx +67 -0
  97. package/src/base/form/fields/NumberField.tsx +67 -0
  98. package/src/base/form/fields/OtpField.tsx +88 -0
  99. package/src/base/form/fields/PasswordField.tsx +69 -0
  100. package/src/base/form/fields/PhoneField.tsx +64 -0
  101. package/src/base/form/fields/RadioField.tsx +66 -0
  102. package/src/base/form/fields/RatingField.tsx +52 -0
  103. package/src/base/form/fields/SelectField.tsx +76 -0
  104. package/src/base/form/fields/SliderField.tsx +77 -0
  105. package/src/base/form/fields/SlugField.tsx +114 -0
  106. package/src/base/form/fields/StaticField.tsx +25 -0
  107. package/src/base/form/fields/SwitchField.tsx +56 -0
  108. package/src/base/form/fields/TagsField.tsx +128 -0
  109. package/src/base/form/fields/TextField.tsx +55 -0
  110. package/src/base/form/fields/TextareaField.tsx +55 -0
  111. package/src/base/form/fields/document-validation.ts +126 -0
  112. package/src/base/form/fields/field-registry.ts +53 -0
  113. package/src/base/form/fields/register-default-fields.ts +86 -0
  114. package/src/base/form/form-schema-builder.ts +192 -0
  115. package/src/base/form/form-utils.ts +71 -0
  116. package/src/base/hooks/useIsDark.ts +50 -0
  117. package/src/base/hooks/useLazyTabs.ts +98 -0
  118. package/src/base/hooks/usePolling.ts +43 -0
  119. package/src/base/hooks/useRemember.ts +58 -0
  120. package/src/base/hooks/useToast.ts +27 -0
  121. package/src/base/layout/BlockRegion.tsx +39 -0
  122. package/src/base/layout/DashboardLayout.tsx +110 -0
  123. package/src/base/layout/SidebarLayout.tsx +38 -0
  124. package/src/base/layout/StackLayout.tsx +32 -0
  125. package/src/base/layout/WizardLayout.tsx +49 -0
  126. package/src/base/partials/ActionBar/index.tsx +115 -0
  127. package/src/base/partials/ConfirmationDialog/index.tsx +128 -0
  128. package/src/base/partials/DataTable/cell-registry.ts +50 -0
  129. package/src/base/partials/DataTable/cell-renderers.tsx +372 -0
  130. package/src/base/partials/DataTable/index.tsx +1282 -0
  131. package/src/base/partials/DataTable/register-default-cells.ts +37 -0
  132. package/src/base/partials/DataTable/sanitize-html.ts +45 -0
  133. package/src/base/partials/DataTable/types.ts +229 -0
  134. package/src/base/partials/DetailSection/index.tsx +316 -0
  135. package/src/base/partials/EmptyPlaceholder/index.tsx +162 -0
  136. package/src/base/partials/EntityItem/index.tsx +154 -0
  137. package/src/base/partials/FilterBar/index.tsx +256 -0
  138. package/src/base/partials/FormSection/index.tsx +87 -0
  139. package/src/base/partials/LogViewer/JsonBlock.tsx +39 -0
  140. package/src/base/partials/LogViewer/LogEntry.tsx +68 -0
  141. package/src/base/partials/LogViewer/LogViewerToolbar.tsx +71 -0
  142. package/src/base/partials/LogViewer/index.tsx +110 -0
  143. package/src/base/partials/LogViewer/types.ts +28 -0
  144. package/src/base/partials/MarkdownContent/index.tsx +307 -0
  145. package/src/base/partials/MenuBar/index.tsx +80 -0
  146. package/src/base/partials/QuickRecordSheet/index.tsx +59 -0
  147. package/src/base/partials/ResizableSidebar/index.tsx +70 -0
  148. package/src/base/partials/StatRow/index.tsx +28 -0
  149. package/src/base/partials/StatusBar/index.tsx +126 -0
  150. package/src/base/partials/StatusIndicator/index.tsx +61 -0
  151. package/src/base/partials/StepIndicator/index.tsx +63 -0
  152. package/src/base/partials/TableOfContents/index.tsx +78 -0
  153. package/src/base/partials/TimelineList/index.tsx +273 -0
  154. package/src/base/partials/ToggleGroupControl/index.tsx +100 -0
  155. package/src/base/partials/TreeView/index.tsx +75 -0
  156. package/src/base/partials/index.ts +23 -0
  157. package/src/base/shell/AuthShell.tsx +54 -0
  158. package/src/base/shell/BasicShell.tsx +286 -0
  159. package/src/base/shell/ImmersiveShell.tsx +85 -0
  160. package/src/base/shell/partials/EditablePanelContext.tsx +82 -0
  161. package/src/base/shell/partials/EditablePanelProvider.tsx +122 -0
  162. package/src/base/shell/partials/InlineEditablePanel.tsx +239 -0
  163. package/src/base/shell/partials/InspectorContext.tsx +173 -0
  164. package/src/base/shell/partials/InspectorPanel.tsx +65 -0
  165. package/src/base/shell/partials/NavErrorBoundary.tsx +82 -0
  166. package/src/base/shell/partials/OverlayScreen.tsx +67 -0
  167. package/src/base/shell/partials/PageActionButton.tsx +203 -0
  168. package/src/base/theme/appearance.ts +133 -0
  169. package/src/base/theme/host-layout-detector.ts +119 -0
  170. package/src/base/theme/host-theme-detector.ts +146 -0
  171. package/src/base/theme/sidebar-safelist.txt +20 -0
  172. package/src/base/theme/tailwind-theme.css +136 -0
  173. package/src/base/theme/theme-bridge.css +164 -0
  174. package/src/base/theme/theme-context.tsx +142 -0
  175. package/src/base/theme/themes/classic.css +174 -0
  176. package/src/base/theme/tokens.css +290 -0
  177. package/src/base/theme/useHostTheme.ts +95 -0
  178. package/src/base/utils/clipboard.ts +39 -0
  179. package/src/base/utils/conditions.ts +27 -0
  180. package/src/base/utils/icon-registry.ts +78 -0
  181. package/src/base/utils/icons.ts +31 -0
  182. package/src/base/utils/interpolate.ts +9 -0
  183. package/src/base/utils/register-default-icons.ts +163 -0
  184. package/src/base/utils/storage.ts +65 -0
  185. package/src/base/utils/time.ts +139 -0
  186. package/src/contracts/block-data/actions.ts +73 -0
  187. package/src/contracts/block-data/data-display.ts +343 -0
  188. package/src/contracts/block-data/form.ts +164 -0
  189. package/src/contracts/block-data/index.ts +15 -0
  190. package/src/contracts/block-data/interactive.ts +34 -0
  191. package/src/contracts/block-data/shared.ts +44 -0
  192. package/src/contracts/connectors.ts +60 -0
  193. package/src/contracts/generated/contract-schema.ts +1237 -0
  194. package/src/contracts/generated/contract-types.ts +675 -0
  195. package/src/contracts/generated/index.ts +15 -0
  196. package/src/contracts/navigation.ts +59 -0
  197. package/src/contracts/page-contract-schema.ts +40 -0
  198. package/src/contracts/page-contract.ts +79 -0
  199. package/src/contracts/shared-props.ts +92 -0
  200. package/src/engine/ContractPage.tsx +178 -0
  201. package/src/engine/EntityRoutes.tsx +72 -0
  202. package/src/engine/HostSlot.tsx +126 -0
  203. package/src/engine/LazyBlock.tsx +92 -0
  204. package/src/engine/bootstrap.tsx +20 -0
  205. package/src/engine/providers/auth.tsx +87 -0
  206. package/src/engine/providers/error-reporter.tsx +89 -0
  207. package/src/engine/providers/flash.tsx +44 -0
  208. package/src/engine/providers/index.ts +18 -0
  209. package/src/engine/providers/inertia-error-reporter.tsx +61 -0
  210. package/src/engine/providers/progress.tsx +56 -0
  211. package/src/engine/providers/scope.tsx +51 -0
  212. package/src/engine/register-defaults.ts +88 -0
  213. package/src/engine/registries.ts +96 -0
  214. package/src/i18n/I18nProvider.tsx +53 -0
  215. package/src/i18n/MANIFEST.md +101 -0
  216. package/src/i18n/host-resolver.ts +18 -0
  217. package/src/i18n/instance.ts +69 -0
  218. package/src/i18n/locales/en/ui.json +277 -0
  219. package/src/i18n/locales/en/validators.json +13 -0
  220. package/src/i18n/locales/pt-BR/ui.json +277 -0
  221. package/src/i18n/locales/pt-BR/validators.json +13 -0
  222. package/src/i18n/register-strings.ts +10 -0
  223. package/src/i18n/render-label.ts +33 -0
  224. package/src/i18n/resolve-field-error.ts +29 -0
  225. package/src/i18n/useHostString.ts +50 -0
  226. package/src/i18n/useTranslation.ts +83 -0
  227. package/src/lib/actions/resolve-action-target.ts +151 -0
  228. package/src/lib/hooks/use-copy-to-clipboard.ts +37 -0
  229. package/src/lib/hooks/use-file-upload.ts +406 -0
  230. package/src/lib/hooks/use-mobile.ts +21 -0
  231. package/src/lib/host-pending.ts +76 -0
  232. package/src/lib/portal-container.ts +16 -0
  233. package/src/lib/test-ids.ts +40 -0
  234. package/src/lib/utils.ts +6 -0
  235. package/src/primitives/reui/MANIFEST.md +97 -0
  236. package/src/primitives/reui/accordion.tsx +64 -0
  237. package/src/primitives/reui/alert-dialog.tsx +196 -0
  238. package/src/primitives/reui/alert.tsx +92 -0
  239. package/src/primitives/reui/aspect-ratio.tsx +9 -0
  240. package/src/primitives/reui/autocomplete.tsx +343 -0
  241. package/src/primitives/reui/avatar.tsx +109 -0
  242. package/src/primitives/reui/badge.tsx +94 -0
  243. package/src/primitives/reui/breadcrumb.tsx +109 -0
  244. package/src/primitives/reui/button-group.tsx +83 -0
  245. package/src/primitives/reui/button.tsx +64 -0
  246. package/src/primitives/reui/calendar.tsx +220 -0
  247. package/src/primitives/reui/card.tsx +92 -0
  248. package/src/primitives/reui/carousel.tsx +239 -0
  249. package/src/primitives/reui/chart.tsx +388 -0
  250. package/src/primitives/reui/checkbox.tsx +30 -0
  251. package/src/primitives/reui/collapsible.tsx +31 -0
  252. package/src/primitives/reui/combobox.tsx +308 -0
  253. package/src/primitives/reui/command.tsx +182 -0
  254. package/src/primitives/reui/context-menu.tsx +250 -0
  255. package/src/primitives/reui/data-grid/data-grid-column-filter.tsx +172 -0
  256. package/src/primitives/reui/data-grid/data-grid-column-header.tsx +420 -0
  257. package/src/primitives/reui/data-grid/data-grid-column-visibility.tsx +51 -0
  258. package/src/primitives/reui/data-grid/data-grid-pagination.tsx +235 -0
  259. package/src/primitives/reui/data-grid/data-grid-scroll-area.tsx +427 -0
  260. package/src/primitives/reui/data-grid/data-grid-table-dnd-rows.tsx +308 -0
  261. package/src/primitives/reui/data-grid/data-grid-table-dnd.tsx +318 -0
  262. package/src/primitives/reui/data-grid/data-grid-table-virtual.tsx +491 -0
  263. package/src/primitives/reui/data-grid/data-grid-table.tsx +1430 -0
  264. package/src/primitives/reui/data-grid/data-grid.tsx +269 -0
  265. package/src/primitives/reui/data-grid-pagination.tsx +235 -0
  266. package/src/primitives/reui/date-selector.tsx +1353 -0
  267. package/src/primitives/reui/dialog.tsx +158 -0
  268. package/src/primitives/reui/drawer.tsx +133 -0
  269. package/src/primitives/reui/dropdown-menu.tsx +257 -0
  270. package/src/primitives/reui/empty.tsx +104 -0
  271. package/src/primitives/reui/field.tsx +246 -0
  272. package/src/primitives/reui/filters.tsx +1891 -0
  273. package/src/primitives/reui/frame.tsx +170 -0
  274. package/src/primitives/reui/hover-card.tsx +42 -0
  275. package/src/primitives/reui/icon-placeholder.tsx +39 -0
  276. package/src/primitives/reui/index.ts +98 -0
  277. package/src/primitives/reui/input-group.tsx +170 -0
  278. package/src/primitives/reui/input-otp.tsx +75 -0
  279. package/src/primitives/reui/input.tsx +21 -0
  280. package/src/primitives/reui/item.tsx +193 -0
  281. package/src/primitives/reui/kanban.tsx +743 -0
  282. package/src/primitives/reui/kbd.tsx +28 -0
  283. package/src/primitives/reui/label.tsx +22 -0
  284. package/src/primitives/reui/menubar.tsx +274 -0
  285. package/src/primitives/reui/native-select.tsx +62 -0
  286. package/src/primitives/reui/navigation-menu.tsx +168 -0
  287. package/src/primitives/reui/number-field.tsx +250 -0
  288. package/src/primitives/reui/pagination.tsx +127 -0
  289. package/src/primitives/reui/phone-input.tsx +231 -0
  290. package/src/primitives/reui/popover.tsx +87 -0
  291. package/src/primitives/reui/progress.tsx +31 -0
  292. package/src/primitives/reui/radio-group.tsx +43 -0
  293. package/src/primitives/reui/rating.tsx +177 -0
  294. package/src/primitives/reui/resizable.tsx +51 -0
  295. package/src/primitives/reui/scroll-area.tsx +58 -0
  296. package/src/primitives/reui/scrollspy.tsx +240 -0
  297. package/src/primitives/reui/select.tsx +188 -0
  298. package/src/primitives/reui/separator.tsx +28 -0
  299. package/src/primitives/reui/sheet.tsx +141 -0
  300. package/src/primitives/reui/sidebar.tsx +732 -0
  301. package/src/primitives/reui/skeleton.tsx +13 -0
  302. package/src/primitives/reui/slider.tsx +61 -0
  303. package/src/primitives/reui/sonner.tsx +47 -0
  304. package/src/primitives/reui/sortable.tsx +414 -0
  305. package/src/primitives/reui/spinner.tsx +16 -0
  306. package/src/primitives/reui/stepper.tsx +484 -0
  307. package/src/primitives/reui/svgs/claudeAiIcon.tsx +12 -0
  308. package/src/primitives/reui/svgs/gemini.tsx +171 -0
  309. package/src/primitives/reui/svgs/openai.tsx +9 -0
  310. package/src/primitives/reui/svgs/openaiDark.tsx +12 -0
  311. package/src/primitives/reui/switch.tsx +33 -0
  312. package/src/primitives/reui/table.tsx +114 -0
  313. package/src/primitives/reui/tabs.tsx +91 -0
  314. package/src/primitives/reui/textarea.tsx +18 -0
  315. package/src/primitives/reui/timeline.tsx +219 -0
  316. package/src/primitives/reui/toggle-group.tsx +83 -0
  317. package/src/primitives/reui/toggle.tsx +45 -0
  318. package/src/primitives/reui/tooltip.tsx +55 -0
  319. package/src/primitives/reui/tree.tsx +247 -0
  320. package/src/theme.css +71 -0
@@ -0,0 +1,445 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://ui-docs.middag.io/schemas/blocks.json",
4
+ "title": "MIDDAG React Block Types",
5
+ "description": "Schema describing all available block types, their data shapes, and layout regions. Used by AI to generate PageContracts.",
6
+ "type": "object",
7
+ "properties": {
8
+ "blocks": {
9
+ "type": "array",
10
+ "items": {
11
+ "$ref": "#/$defs/BlockDefinition"
12
+ }
13
+ }
14
+ },
15
+ "$defs": {
16
+ "BlockDefinition": {
17
+ "type": "object",
18
+ "required": [
19
+ "type",
20
+ "description",
21
+ "regions"
22
+ ],
23
+ "properties": {
24
+ "type": {
25
+ "type": "string",
26
+ "description": "Block type key used in PageContract"
27
+ },
28
+ "description": {
29
+ "type": "string",
30
+ "description": "What this block renders"
31
+ },
32
+ "regions": {
33
+ "type": "array",
34
+ "items": {
35
+ "type": "string"
36
+ },
37
+ "description": "Layout regions where this block can be placed"
38
+ },
39
+ "dataShape": {
40
+ "type": "object",
41
+ "description": "JSON schema of the block's data property",
42
+ "additionalProperties": true
43
+ },
44
+ "options": {
45
+ "type": "object",
46
+ "description": "Customization options available in the block's meta property",
47
+ "additionalProperties": true
48
+ }
49
+ }
50
+ }
51
+ },
52
+ "const": {
53
+ "blocks": [
54
+ {
55
+ "type": "dense_table",
56
+ "tier": "community",
57
+ "description": "Sortable data table with pagination, filters, row actions, and bulk selection. Primary data display block.",
58
+ "regions": [
59
+ "content",
60
+ "main"
61
+ ],
62
+ "dataShape": {
63
+ "columns": "DataTableColumn[] — key, label, sortable?, hideable? (default true), visible? (default true), minWidth?, variant? (status|boolean|timestamp|progress|link|actions|rich_status|html|link_group), timestampFormat? (relative|datetime|date|time|iso — applies when variant=timestamp)",
64
+ "progressCell": "when variant=progress the cell value is { value, max?, label?, appearance? } (a bare number is treated as a percent out of 100)",
65
+ "rows": "Record<string, unknown>[] — each row keyed by column.key",
66
+ "pagination": "{ page, perPage, total, lastPage }",
67
+ "sort": "{ column, direction: asc|desc }",
68
+ "filters": "{ available: FilterDef[], applied: Record<string, unknown> }",
69
+ "bulkActions?": "{ id, label, intent?, icon?, confirmMessage? }[]",
70
+ "rowActions?": "{ id, label, intent?, icon?, variant?: button|icon }[]"
71
+ },
72
+ "options": {
73
+ "searchable": "boolean — show search input (default: true)",
74
+ "selectable": "boolean — enable row checkboxes (default: false)",
75
+ "compact": "boolean — reduce row height",
76
+ "columnVisibility": "toolbar dropdown toggles hideable columns; a density toggle switches row height. Both are client-only view prefs, persisted across Inertia history navigation when the block descriptor sets remember: true."
77
+ }
78
+ },
79
+ {
80
+ "type": "metric_card",
81
+ "tier": "community",
82
+ "description": "KPI card with value, delta, and trend icon. Used in dashboard metrics region.",
83
+ "regions": [
84
+ "metrics"
85
+ ],
86
+ "dataShape": {
87
+ "label": "string",
88
+ "value": "string | number",
89
+ "delta?": "string — e.g. '+12%'",
90
+ "deltaDirection?": "positive | negative | neutral",
91
+ "icon?": "string — Lucide icon name"
92
+ }
93
+ },
94
+ {
95
+ "type": "status_strip",
96
+ "tier": "community",
97
+ "description": "Health overview with score and status items. Compact status display for aside panels.",
98
+ "regions": [
99
+ "aside",
100
+ "content"
101
+ ],
102
+ "dataShape": {
103
+ "score?": "number (0-100)",
104
+ "tone?": "success | warning | destructive | info",
105
+ "items": "{ key, label, value, appearance: success|warning|destructive|info|neutral }[]"
106
+ }
107
+ },
108
+ {
109
+ "type": "detail_panel",
110
+ "tier": "community",
111
+ "description": "Sectioned key-value detail view with field kinds (text, status, timestamp, boolean, link, code, email).",
112
+ "regions": [
113
+ "aside",
114
+ "content",
115
+ "main"
116
+ ],
117
+ "dataShape": {
118
+ "sections": "{ id, title, fields: DetailField[] }[]",
119
+ "DetailField": "{ key, label, value, kind?: text|status|timestamp|boolean|link|code|email, copyable?, href? }"
120
+ },
121
+ "options": {
122
+ "copyableText": "string — enables 'Copy Report' button with this text"
123
+ }
124
+ },
125
+ {
126
+ "type": "activity_timeline",
127
+ "tier": "community",
128
+ "description": "Chronological event timeline with actors, actions, and expandable details.",
129
+ "regions": [
130
+ "content",
131
+ "aside"
132
+ ],
133
+ "dataShape": {
134
+ "entries": "{ id, actor, action, timestamp, details?, icon?, tone? }[]"
135
+ }
136
+ },
137
+ {
138
+ "type": "form_panel",
139
+ "tier": "community",
140
+ "description": "Schema-driven form with react-hook-form + Zod client validation and Inertia server submission.",
141
+ "regions": [
142
+ "content",
143
+ "main"
144
+ ],
145
+ "dataShape": {
146
+ "action": "string — form submit URL",
147
+ "method": "post | put | patch",
148
+ "schema": "FormSchemaNode[] — recursive tree of field, section, group, header nodes",
149
+ "FormFieldNode": "{ kind: field, key, component, props: { label, placeholder?, helpText?, required?, validation?, documentType?, documentScope?, defaultCountry?, fixedCountry?, currency?, autocompleteHref?, entityAvatarField?, entitySubtitleField?, visible_when?, hidden_when?, ... } }",
150
+ "values": "Record<string, unknown>",
151
+ "errors": "Record<string, string>",
152
+ "meta": "{ submitLabel?, cancelLabel?, cancelHref?, validation?: client | server | both }"
153
+ },
154
+ "options": {
155
+ "components": "text | email | url | textarea | password | select | multiselect | radio | int | float | checkbox | switch | date | datetime | phone | document | currency | color | slug | tags | entity_picker | file | static | header | hidden"
156
+ }
157
+ },
158
+ {
159
+ "type": "card_grid",
160
+ "tier": "community",
161
+ "description": "Grid of cards with icon, title, and metadata. Used for connector/integration listings.",
162
+ "regions": [
163
+ "content",
164
+ "main"
165
+ ],
166
+ "dataShape": {
167
+ "variant?": "string",
168
+ "columns": "{ key, label, kind?: status }[]",
169
+ "rows": "{ id, icon?, href?, ...columnValues }[]"
170
+ }
171
+ },
172
+ {
173
+ "type": "action_grid",
174
+ "tier": "community",
175
+ "description": "Grid of action buttons/cards that trigger server operations.",
176
+ "regions": [
177
+ "content"
178
+ ],
179
+ "dataShape": {
180
+ "actions": "{ id, label, description?, icon?, intent?: primary|danger, endpoint, method?, confirmMessage? }[]"
181
+ }
182
+ },
183
+ {
184
+ "type": "link_list",
185
+ "tier": "community",
186
+ "description": "Navigation link list with icons and descriptions.",
187
+ "regions": [
188
+ "content",
189
+ "aside"
190
+ ],
191
+ "dataShape": {
192
+ "items": "{ label, href, icon?, description? }[]"
193
+ }
194
+ },
195
+ {
196
+ "type": "tabs",
197
+ "tier": "community",
198
+ "description": "Tabbed container with nested blocks per tab.",
199
+ "regions": [
200
+ "content"
201
+ ],
202
+ "dataShape": {
203
+ "defaultTab": "string — key of initially active tab",
204
+ "tabs": "{ id, label, icon?, blocks: BlockDescriptor[] }[]"
205
+ }
206
+ },
207
+ {
208
+ "type": "chart",
209
+ "tier": "community",
210
+ "description": "Line, bar, or area chart rendering categorical series over a shared x-axis.",
211
+ "regions": [
212
+ "content",
213
+ "main"
214
+ ],
215
+ "dataShape": {
216
+ "chartType": "line | bar | area",
217
+ "categoryKey": "string — field key on each data row used for the x-axis category",
218
+ "series": "{ key, label, color? }[]",
219
+ "data": "Record<string, unknown>[]",
220
+ "options?": "{ showLegend?, showGrid? }"
221
+ }
222
+ },
223
+ {
224
+ "type": "empty_state",
225
+ "tier": "community",
226
+ "description": "Placeholder for empty data states with optional action button.",
227
+ "regions": [
228
+ "content",
229
+ "main"
230
+ ],
231
+ "dataShape": {
232
+ "title?": "string",
233
+ "description?": "string",
234
+ "icon?": "string",
235
+ "action?": "{ label, href?, onClick? }"
236
+ }
237
+ },
238
+ {
239
+ "type": "markdown_panel",
240
+ "tier": "community",
241
+ "description": "Rendered markdown content with syntax highlighting and copy buttons.",
242
+ "regions": [
243
+ "content",
244
+ "main",
245
+ "aside"
246
+ ],
247
+ "dataShape": {
248
+ "content": "string — markdown text"
249
+ }
250
+ },
251
+ {
252
+ "type": "condition_tree",
253
+ "tier": "pro",
254
+ "description": "Nested AND/OR condition tree for rule builders (segments, workflows).",
255
+ "regions": [
256
+ "content"
257
+ ],
258
+ "dataShape": {
259
+ "operator": "and | or",
260
+ "rules": "{ id, field, operator, value }[]",
261
+ "groups": "ConditionGroup[] (recursive)"
262
+ }
263
+ },
264
+ {
265
+ "type": "sentence_builder",
266
+ "tier": "pro",
267
+ "description": "Natural language segment rule builder. Renders rules as human-readable sentences.",
268
+ "regions": [
269
+ "content"
270
+ ],
271
+ "dataShape": {
272
+ "groups": "{ id, rules: { id, field, operator, value }[] }[]",
273
+ "audienceEstimate?": "{ matched: number, total: number }"
274
+ }
275
+ },
276
+ {
277
+ "type": "flow_editor",
278
+ "tier": "pro",
279
+ "description": "Visual workflow editor with nodes and edges (React Flow).",
280
+ "regions": [
281
+ "content"
282
+ ],
283
+ "dataShape": {
284
+ "nodes": "ReactFlow Node[]",
285
+ "edges": "ReactFlow Edge[]"
286
+ }
287
+ },
288
+ {
289
+ "type": "customform_render",
290
+ "tier": "pro",
291
+ "description": "Public fill surface for a form authored with form_builder.",
292
+ "regions": [
293
+ "content"
294
+ ],
295
+ "dataShape": {
296
+ "formName": "string",
297
+ "steps": "{ id, code, title, fields[] }[]",
298
+ "submitHref": "string (POST target for the answers)",
299
+ "uploadHref": "string? (draft-area endpoint for file fields)"
300
+ }
301
+ },
302
+ {
303
+ "type": "form_builder",
304
+ "tier": "pro",
305
+ "description": "Drag-and-drop form builder with field palette and preview.",
306
+ "regions": [
307
+ "content"
308
+ ],
309
+ "dataShape": {
310
+ "fields": "{ id, type, label, required? }[]",
311
+ "palette": "{ type, label, icon? }[]"
312
+ }
313
+ },
314
+ {
315
+ "type": "workflow_progress",
316
+ "tier": "pro",
317
+ "description": "Linear workflow state indicator with timestamps. Shows ordered states and highlights the current one.",
318
+ "regions": [
319
+ "content",
320
+ "header"
321
+ ],
322
+ "dataShape": {
323
+ "states": "{ key, label, timestamp? }[] — ordered list of workflow states",
324
+ "currentState": "string — key of the currently active state"
325
+ }
326
+ },
327
+ {
328
+ "type": "chart_panel",
329
+ "tier": "pro",
330
+ "description": "Multi-series chart supporting bar, line, area, and pie chart types. Uses Recharts under the hood (lazy-loaded, ~555 KB).",
331
+ "regions": [
332
+ "content",
333
+ "main"
334
+ ],
335
+ "dataShape": {
336
+ "chartType": "'bar' | 'line' | 'area' | 'pie'",
337
+ "data": "Record<string, unknown>[] — data points with category key + numeric values per series",
338
+ "series": "{ key, label, color?, type? }[] — series definitions",
339
+ "categoryKey": "string — key for X-axis category",
340
+ "showGrid": "boolean? — show Cartesian grid lines",
341
+ "showLegend": "boolean? — show legend below chart"
342
+ },
343
+ "options": {
344
+ "x-ai-lazy-loaded": true,
345
+ "x-ai-use-when": "Analytics dashboards, trend visualization, data comparison",
346
+ "x-ai-avoid-when": "Simple numeric KPIs (use metric_card instead)"
347
+ }
348
+ },
349
+ {
350
+ "type": "kanban_board",
351
+ "tier": "pro",
352
+ "description": "Drag-and-drop kanban board with columns and cards. Cards can be moved between columns via Inertia endpoint. Uses @dnd-kit (lazy-loaded, ~15 KB).",
353
+ "regions": [
354
+ "content",
355
+ "main"
356
+ ],
357
+ "dataShape": {
358
+ "columns": "{ id, title, cards: KanbanCard[] }[] — board columns",
359
+ "moveEndpoint": "string? — Inertia POST URL for card move operations"
360
+ },
361
+ "options": {
362
+ "x-ai-lazy-loaded": true,
363
+ "x-ai-use-when": "Task management, pipeline views, status boards",
364
+ "x-ai-avoid-when": "Simple lists (use dense_table) or non-draggable views (use card_grid)"
365
+ }
366
+ },
367
+ {
368
+ "type": "gradebook",
369
+ "tier": "pro",
370
+ "description": "Editable row × column data matrix (virtualized grid). Cells are edited in place and saved as a batch with an optimistic-concurrency revision.",
371
+ "regions": [
372
+ "content",
373
+ "main"
374
+ ],
375
+ "dataShape": {
376
+ "columns": "{ id, label, type, editable, options? }[] — grid columns",
377
+ "rows": "{ id, label }[] — row headers",
378
+ "cells": "{ rowId, columnId, value: number|string|null }[] — cell values",
379
+ "revision": "string — optimistic-concurrency token (required)",
380
+ "aggregations?": "{ columnId, value, label? }[] — footer totals",
381
+ "saveEndpoint?": "string — Inertia POST URL for the changed-cell batch save",
382
+ "editableStructure?": "boolean — allow add/remove of rows and columns"
383
+ }
384
+ },
385
+ {
386
+ "type": "report_composer",
387
+ "tier": "pro",
388
+ "description": "Drag-drop canvas of chart | metric | table widgets on a fixed column grid. The layout persists as a full { revision, widgets } snapshot.",
389
+ "regions": [
390
+ "content",
391
+ "main"
392
+ ],
393
+ "dataShape": {
394
+ "widgets": "{ id, type: chart|metric|table, layout: { x, y, w, h }, title?, chart?, metric?, table? }[]",
395
+ "revision": "string — optimistic-concurrency token (required)",
396
+ "columns?": "number — grid column count (default 12)",
397
+ "reportId?": "string",
398
+ "saveEndpoint?": "string — Inertia POST URL for the snapshot save",
399
+ "editable?": "boolean — false renders a static report (no chrome)"
400
+ }
401
+ },
402
+ {
403
+ "type": "rich_document",
404
+ "tier": "pro",
405
+ "description": "Lexical WYSIWYG document editor. content is opaque serialized editor state; the client never emits HTML. Uses Lexical (lazy-loaded, ~300 KB).",
406
+ "regions": [
407
+ "content",
408
+ "main"
409
+ ],
410
+ "dataShape": {
411
+ "content": "object — serialized Lexical editor state (opaque)",
412
+ "revision": "string — optimistic-concurrency token (required)",
413
+ "documentId?": "string",
414
+ "mergeTags?": "{ key, label, sample? }[] — insertable placeholders",
415
+ "editable?": "boolean — false renders the editor locked",
416
+ "saveEndpoint?": "string — Inertia POST URL for { revision, content }",
417
+ "previewEndpoint?": "string — server-rendered HTML preview (adds Write/Preview tabs)"
418
+ },
419
+ "options": {
420
+ "x-ai-lazy-loaded": true
421
+ }
422
+ },
423
+ {
424
+ "type": "scheduler",
425
+ "tier": "pro",
426
+ "description": "Event calendar across month, week, agenda and resource-lane views. Every change POSTs immediately (save-on-drop) with an optimistic-concurrency revision.",
427
+ "regions": [
428
+ "content",
429
+ "main"
430
+ ],
431
+ "dataShape": {
432
+ "events": "{ id, title, start, end, allDay?, resourceId?, color?, href?, editable?, recurrence? }[] — start/end are ISO strings",
433
+ "revision": "string — optimistic-concurrency token (required)",
434
+ "resources?": "{ id, label, color? }[] — enable the resource-lanes view",
435
+ "view?": "month | week | agenda | resources — initial view",
436
+ "date?": "string — ISO date the view centers on",
437
+ "moveEndpoint?": "string — enables drag/resize",
438
+ "createEndpoint?": "string — enables the add-event dialog + empty-slot clicks",
439
+ "updateEndpoint?": "string — enables event edits",
440
+ "deleteEndpoint?": "string — enables the per-event remove"
441
+ }
442
+ }
443
+ ]
444
+ }
445
+ }
@@ -0,0 +1,166 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://ui-docs.middag.io/schemas/components.json",
4
+ "title": "MIDDAG React Components",
5
+ "description": "Schema describing all ReUI components, their variants, sizes, and customization options. Used by AI to generate themed UIs.",
6
+ "type": "object",
7
+ "properties": {
8
+ "components": {
9
+ "type": "array",
10
+ "items": { "$ref": "#/$defs/ComponentDefinition" }
11
+ }
12
+ },
13
+ "$defs": {
14
+ "ComponentDefinition": {
15
+ "type": "object",
16
+ "required": ["name", "variants"],
17
+ "properties": {
18
+ "name": { "type": "string" },
19
+ "description": { "type": "string" },
20
+ "importPath": { "type": "string", "description": "Import from @middag-io/react" },
21
+ "variants": {
22
+ "type": "array",
23
+ "items": { "type": "string" }
24
+ },
25
+ "sizes": {
26
+ "type": "array",
27
+ "items": { "type": "string" }
28
+ },
29
+ "defaultVariant": { "type": "string" },
30
+ "defaultSize": { "type": "string" },
31
+ "props": {
32
+ "type": "object",
33
+ "additionalProperties": { "type": "string" }
34
+ }
35
+ }
36
+ }
37
+ },
38
+ "const": {
39
+ "components": [
40
+ {
41
+ "name": "Button",
42
+ "description": "Primary action trigger with multiple intents and sizes.",
43
+ "importPath": "@/components/reui/button",
44
+ "variants": ["default", "destructive", "outline", "secondary", "ghost", "link"],
45
+ "sizes": ["default", "xs", "sm", "lg", "icon", "icon-xs", "icon-sm", "icon-lg"],
46
+ "defaultVariant": "default",
47
+ "defaultSize": "default",
48
+ "props": {
49
+ "asChild": "boolean — render as child element (Slot pattern)",
50
+ "disabled": "boolean"
51
+ }
52
+ },
53
+ {
54
+ "name": "Badge",
55
+ "description": "Status indicator with semantic color variants.",
56
+ "importPath": "@/components/reui/badge",
57
+ "variants": [
58
+ "default", "outline", "secondary",
59
+ "info", "success", "warning", "destructive", "invert",
60
+ "info-light", "success-light", "warning-light", "destructive-light", "invert-light",
61
+ "info-outline", "success-outline", "warning-outline", "destructive-outline"
62
+ ],
63
+ "sizes": ["xs", "sm", "default", "lg", "xl"],
64
+ "defaultVariant": "default",
65
+ "defaultSize": "default",
66
+ "props": {
67
+ "radius": "default | full — pill shape vs. default rounding"
68
+ }
69
+ },
70
+ {
71
+ "name": "Alert",
72
+ "description": "Contextual feedback banner.",
73
+ "importPath": "@/components/reui/alert",
74
+ "variants": ["default", "destructive", "info", "success", "warning", "invert"],
75
+ "defaultVariant": "default"
76
+ },
77
+ {
78
+ "name": "Toggle",
79
+ "description": "On/off toggle button (toolbar actions).",
80
+ "importPath": "@/components/reui/toggle",
81
+ "variants": ["default", "outline"],
82
+ "sizes": ["default", "sm", "lg"],
83
+ "defaultVariant": "default",
84
+ "defaultSize": "default"
85
+ },
86
+ {
87
+ "name": "Tabs / TabsList",
88
+ "description": "Tab container with switchable content panels.",
89
+ "importPath": "@/components/reui/tabs",
90
+ "variants": ["default", "line"],
91
+ "defaultVariant": "default"
92
+ },
93
+ {
94
+ "name": "Frame",
95
+ "description": "Content container with header, title, and panel areas.",
96
+ "importPath": "@/components/reui/frame",
97
+ "variants": ["default", "inverse", "ghost"],
98
+ "defaultVariant": "default",
99
+ "props": {
100
+ "spacing": "xs | sm | default | lg",
101
+ "stacked": "boolean — stack children vertically",
102
+ "dense": "boolean — reduce internal padding"
103
+ }
104
+ },
105
+ {
106
+ "name": "Input",
107
+ "description": "Text input field.",
108
+ "importPath": "@/components/reui/input"
109
+ },
110
+ {
111
+ "name": "Select",
112
+ "description": "Dropdown select (Radix). Components: Select, SelectTrigger, SelectValue, SelectContent, SelectItem.",
113
+ "importPath": "@/components/reui/select"
114
+ },
115
+ {
116
+ "name": "Checkbox",
117
+ "description": "Checkbox input (Radix).",
118
+ "importPath": "@/components/reui/checkbox"
119
+ },
120
+ {
121
+ "name": "Switch",
122
+ "description": "Toggle switch (Radix).",
123
+ "importPath": "@/components/reui/switch"
124
+ },
125
+ {
126
+ "name": "Skeleton",
127
+ "description": "Loading placeholder with pulse animation.",
128
+ "importPath": "@/components/reui/skeleton"
129
+ },
130
+ {
131
+ "name": "Sidebar",
132
+ "description": "Collapsible sidebar container. Components: Sidebar, SidebarHeader, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupLabel, SidebarMenu, SidebarMenuItem.",
133
+ "importPath": "@/components/reui/sidebar",
134
+ "props": {
135
+ "collapsible": "offcanvas | icon | none",
136
+ "side": "left | right"
137
+ }
138
+ },
139
+ {
140
+ "name": "DropdownMenu",
141
+ "description": "Context menu (Radix). Components: DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem.",
142
+ "importPath": "@/components/reui/dropdown-menu"
143
+ },
144
+ {
145
+ "name": "Dialog",
146
+ "description": "Modal dialog (Radix). Components: Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter.",
147
+ "importPath": "@/components/reui/dialog"
148
+ },
149
+ {
150
+ "name": "Popover",
151
+ "description": "Floating panel (Radix). Components: Popover, PopoverTrigger, PopoverContent.",
152
+ "importPath": "@/components/reui/popover"
153
+ },
154
+ {
155
+ "name": "Tooltip",
156
+ "description": "Hover tooltip (Radix). Components: TooltipProvider, Tooltip, TooltipTrigger, TooltipContent.",
157
+ "importPath": "@/components/reui/tooltip"
158
+ },
159
+ {
160
+ "name": "Label",
161
+ "description": "Form label (Radix).",
162
+ "importPath": "@/components/reui/label"
163
+ }
164
+ ]
165
+ }
166
+ }