@middag-io/react 0.44.1 → 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 (362) hide show
  1. package/README.md +7 -0
  2. package/dist-lib/{FormField-Bj43PjHH.js → FormField-Csx8hGAW.js} +1956 -1936
  3. package/dist-lib/{FormPanelBlock-C6eDfGoI.js → FormPanelBlock-Bmd0DpiX.js} +337 -337
  4. package/dist-lib/base/blocks/DenseTableBlock.d.ts.map +1 -1
  5. package/dist-lib/base/blocks/LinkListBlock.d.ts +2 -1
  6. package/dist-lib/base/blocks/LinkListBlock.d.ts.map +1 -1
  7. package/dist-lib/base/form/FormField.d.ts.map +1 -1
  8. package/dist-lib/base/layout/DashboardLayout.d.ts.map +1 -1
  9. package/dist-lib/base/partials/ConfirmationDialog/index.d.ts.map +1 -1
  10. package/dist-lib/base/partials/DataTable/cell-renderers.d.ts +1 -1
  11. package/dist-lib/base/partials/DataTable/cell-renderers.d.ts.map +1 -1
  12. package/dist-lib/base/partials/DataTable/index.d.ts +1 -1
  13. package/dist-lib/base/partials/DataTable/index.d.ts.map +1 -1
  14. package/dist-lib/base/partials/DataTable/sanitize-html.d.ts +17 -0
  15. package/dist-lib/base/partials/DataTable/sanitize-html.d.ts.map +1 -0
  16. package/dist-lib/base/partials/DataTable/types.d.ts +15 -0
  17. package/dist-lib/base/partials/DataTable/types.d.ts.map +1 -1
  18. package/dist-lib/base/partials/FilterBar/index.d.ts.map +1 -1
  19. package/dist-lib/base/shell/BasicShell.js +1 -1
  20. package/dist-lib/base/shell/partials/InlineEditablePanel.js +38 -24
  21. package/dist-lib/base/shell/partials/PageActionButton.d.ts.map +1 -1
  22. package/dist-lib/base/shell/partials/PageActionButton.js +1 -1
  23. package/dist-lib/chunks/subpath-Bh1MAmBT.js +165 -0
  24. package/dist-lib/chunks/{subpath-AeMdleNB.js → subpath-fEhy6n_U.js} +10 -6
  25. package/dist-lib/contracts/block-data/data-display.d.ts +51 -2
  26. package/dist-lib/contracts/block-data/data-display.d.ts.map +1 -1
  27. package/dist-lib/contracts/generated/contract-schema.d.ts +1 -1
  28. package/dist-lib/contracts/generated/contract-types.d.ts +4 -2
  29. package/dist-lib/contracts/generated/contract-types.d.ts.map +1 -1
  30. package/dist-lib/contracts/generated/index.d.ts +1 -1
  31. package/dist-lib/i18n/I18nProvider.js +1 -1
  32. package/dist-lib/i18n/instance.js +1 -1
  33. package/dist-lib/i18n/locales/en/ui.json +5 -3
  34. package/dist-lib/i18n/locales/pt-BR/ui.json +5 -3
  35. package/dist-lib/i18n/register-strings.js +1 -1
  36. package/dist-lib/index.d.ts +1 -1
  37. package/dist-lib/index.d.ts.map +1 -1
  38. package/dist-lib/middag-react.css +1 -1
  39. package/dist-lib/middag-react.js +18641 -13317
  40. package/dist-lib/primitives/reui/chart.d.ts.map +1 -1
  41. package/dist-lib/primitives/reui/chart.js +35 -31
  42. package/docs/public/schemas/ai-contract-manifest.json +1820 -0
  43. package/docs/public/schemas/blocks.json +445 -0
  44. package/docs/public/schemas/components.json +166 -0
  45. package/docs/public/schemas/connectors.json +97 -0
  46. package/docs/public/schemas/fragment.json +2329 -0
  47. package/docs/public/schemas/manifest.json +119 -0
  48. package/docs/public/schemas/navigation.json +72 -0
  49. package/docs/public/schemas/page-contract.json +2329 -0
  50. package/docs/public/schemas/shared-props.json +118 -0
  51. package/docs/public/schemas/theme-defaults.json +253 -0
  52. package/docs/public/schemas/theme.json +401 -0
  53. package/package.json +109 -3
  54. package/src/assets/lottie/calendar/schedule-1.json +1 -0
  55. package/src/assets/lottie/calendar/schedule-2.json +1 -0
  56. package/src/assets/lottie/celebration/confetti-1.json +1 -0
  57. package/src/assets/lottie/celebration/confetti-2.json +1 -0
  58. package/src/assets/lottie/celebration/confetti-3.json +1 -0
  59. package/src/assets/lottie/cloud/cloud-1.json +1 -0
  60. package/src/assets/lottie/cloud/cloud-2.json +1 -0
  61. package/src/assets/lottie/connection/network-1.json +1 -0
  62. package/src/assets/lottie/connection/network-2.json +1 -0
  63. package/src/assets/lottie/connection/network-3.json +1 -0
  64. package/src/assets/lottie/dashboard/analytics-1.json +1 -0
  65. package/src/assets/lottie/dashboard/analytics-2.json +1 -0
  66. package/src/assets/lottie/dashboard/analytics-3.json +1 -0
  67. package/src/assets/lottie/email/mail-1.json +1 -0
  68. package/src/assets/lottie/email/mail-2.json +1 -0
  69. package/src/assets/lottie/email/mail-3.json +1 -0
  70. package/src/assets/lottie/empty-state/empty-1.json +1 -0
  71. package/src/assets/lottie/empty-state/empty-2.json +1 -0
  72. package/src/assets/lottie/empty-state/empty-3.json +1 -0
  73. package/src/assets/lottie/error/warning-1.json +1 -0
  74. package/src/assets/lottie/error/warning-2.json +1 -0
  75. package/src/assets/lottie/error/warning-3.json +1 -0
  76. package/src/assets/lottie/index.ts +49 -0
  77. package/src/assets/lottie/loading/spinner-1.json +1 -0
  78. package/src/assets/lottie/loading/spinner-2.json +1 -0
  79. package/src/assets/lottie/loading/spinner-3.json +1 -0
  80. package/src/assets/lottie/maintenance/construction-1.json +1 -0
  81. package/src/assets/lottie/maintenance/construction-2.json +1 -0
  82. package/src/assets/lottie/maintenance/construction-3.json +1 -0
  83. package/src/assets/lottie/not-found/404-1.json +1 -0
  84. package/src/assets/lottie/not-found/404-2.json +1 -0
  85. package/src/assets/lottie/not-found/404-3.json +1 -0
  86. package/src/assets/lottie/notification/bell-1.json +1 -0
  87. package/src/assets/lottie/notification/bell-2.json +1 -0
  88. package/src/assets/lottie/notification/bell-3.json +1 -0
  89. package/src/assets/lottie/onboarding/welcome-1.json +1 -0
  90. package/src/assets/lottie/onboarding/welcome-2.json +1 -0
  91. package/src/assets/lottie/onboarding/welcome-3.json +1 -0
  92. package/src/assets/lottie/payment/wallet-1.json +1 -0
  93. package/src/assets/lottie/payment/wallet-2.json +1 -0
  94. package/src/assets/lottie/payment/wallet-3.json +1 -0
  95. package/src/assets/lottie/search/search-1.json +1 -0
  96. package/src/assets/lottie/search/search-2.json +1 -0
  97. package/src/assets/lottie/search/search-3.json +1 -0
  98. package/src/assets/lottie/security/lock-1.json +1 -0
  99. package/src/assets/lottie/security/lock-2.json +1 -0
  100. package/src/assets/lottie/security/lock-3.json +1 -0
  101. package/src/assets/lottie/settings/gear-1.json +1 -0
  102. package/src/assets/lottie/settings/gear-2.json +1 -0
  103. package/src/assets/lottie/settings/gear-3.json +1 -0
  104. package/src/assets/lottie/success/check-1.json +1 -0
  105. package/src/assets/lottie/success/check-2.json +1 -0
  106. package/src/assets/lottie/success/check-3.json +1 -0
  107. package/src/assets/lottie/upload/upload-1.json +1 -0
  108. package/src/assets/lottie/upload/upload-2.json +1 -0
  109. package/src/assets/lottie/upload/upload-3.json +1 -0
  110. package/src/assets/lottie/user/profile-1.json +1 -0
  111. package/src/assets/lottie/user/profile-2.json +1 -0
  112. package/src/assets/lottie/user/profile-3.json +1 -0
  113. package/src/base/blocks/ActionGridBlock.tsx +151 -0
  114. package/src/base/blocks/ActivityTimelineBlock.tsx +180 -0
  115. package/src/base/blocks/CardGridBlock.tsx +384 -0
  116. package/src/base/blocks/ChartBlock.tsx +81 -0
  117. package/src/base/blocks/DenseTableBlock.tsx +403 -0
  118. package/src/base/blocks/DetailPanelBlock.tsx +189 -0
  119. package/src/base/blocks/EmptyStateBlock.tsx +46 -0
  120. package/src/base/blocks/FormPanelBlock.lazy.tsx +38 -0
  121. package/src/base/blocks/FormPanelBlock.tsx +480 -0
  122. package/src/base/blocks/LinkListBlock.tsx +94 -0
  123. package/src/base/blocks/MarkdownPanelBlock.tsx +60 -0
  124. package/src/base/blocks/MetricCardBlock.tsx +128 -0
  125. package/src/base/blocks/StatusStripBlock.tsx +43 -0
  126. package/src/base/blocks/TabsBlock.tsx +94 -0
  127. package/src/base/form/FormField.tsx +607 -0
  128. package/src/base/form/fields/CheckboxField.tsx +56 -0
  129. package/src/base/form/fields/ColorField.tsx +76 -0
  130. package/src/base/form/fields/CurrencyField.tsx +126 -0
  131. package/src/base/form/fields/DateField.tsx +168 -0
  132. package/src/base/form/fields/DateRangeField.tsx +66 -0
  133. package/src/base/form/fields/DocumentField.tsx +222 -0
  134. package/src/base/form/fields/EntityPickerField.tsx +244 -0
  135. package/src/base/form/fields/FileUploadField.tsx +253 -0
  136. package/src/base/form/fields/MultiSelectField.tsx +286 -0
  137. package/src/base/form/fields/NativeSelectField.tsx +67 -0
  138. package/src/base/form/fields/NumberField.tsx +67 -0
  139. package/src/base/form/fields/OtpField.tsx +88 -0
  140. package/src/base/form/fields/PasswordField.tsx +69 -0
  141. package/src/base/form/fields/PhoneField.tsx +64 -0
  142. package/src/base/form/fields/RadioField.tsx +66 -0
  143. package/src/base/form/fields/RatingField.tsx +52 -0
  144. package/src/base/form/fields/SelectField.tsx +76 -0
  145. package/src/base/form/fields/SliderField.tsx +77 -0
  146. package/src/base/form/fields/SlugField.tsx +114 -0
  147. package/src/base/form/fields/StaticField.tsx +25 -0
  148. package/src/base/form/fields/SwitchField.tsx +56 -0
  149. package/src/base/form/fields/TagsField.tsx +128 -0
  150. package/src/base/form/fields/TextField.tsx +55 -0
  151. package/src/base/form/fields/TextareaField.tsx +55 -0
  152. package/src/base/form/fields/document-validation.ts +126 -0
  153. package/src/base/form/fields/field-registry.ts +53 -0
  154. package/src/base/form/fields/register-default-fields.ts +86 -0
  155. package/src/base/form/form-schema-builder.ts +192 -0
  156. package/src/base/form/form-utils.ts +71 -0
  157. package/src/base/hooks/useIsDark.ts +50 -0
  158. package/src/base/hooks/useLazyTabs.ts +98 -0
  159. package/src/base/hooks/usePolling.ts +43 -0
  160. package/src/base/hooks/useRemember.ts +58 -0
  161. package/src/base/hooks/useToast.ts +27 -0
  162. package/src/base/layout/BlockRegion.tsx +39 -0
  163. package/src/base/layout/DashboardLayout.tsx +110 -0
  164. package/src/base/layout/SidebarLayout.tsx +38 -0
  165. package/src/base/layout/StackLayout.tsx +32 -0
  166. package/src/base/layout/WizardLayout.tsx +49 -0
  167. package/src/base/partials/ActionBar/index.tsx +115 -0
  168. package/src/base/partials/ConfirmationDialog/index.tsx +128 -0
  169. package/src/base/partials/DataTable/cell-registry.ts +50 -0
  170. package/src/base/partials/DataTable/cell-renderers.tsx +372 -0
  171. package/src/base/partials/DataTable/index.tsx +1282 -0
  172. package/src/base/partials/DataTable/register-default-cells.ts +37 -0
  173. package/src/base/partials/DataTable/sanitize-html.ts +45 -0
  174. package/src/base/partials/DataTable/types.ts +229 -0
  175. package/src/base/partials/DetailSection/index.tsx +316 -0
  176. package/src/base/partials/EmptyPlaceholder/index.tsx +162 -0
  177. package/src/base/partials/EntityItem/index.tsx +154 -0
  178. package/src/base/partials/FilterBar/index.tsx +256 -0
  179. package/src/base/partials/FormSection/index.tsx +87 -0
  180. package/src/base/partials/LogViewer/JsonBlock.tsx +39 -0
  181. package/src/base/partials/LogViewer/LogEntry.tsx +68 -0
  182. package/src/base/partials/LogViewer/LogViewerToolbar.tsx +71 -0
  183. package/src/base/partials/LogViewer/index.tsx +110 -0
  184. package/src/base/partials/LogViewer/types.ts +28 -0
  185. package/src/base/partials/MarkdownContent/index.tsx +307 -0
  186. package/src/base/partials/MenuBar/index.tsx +80 -0
  187. package/src/base/partials/QuickRecordSheet/index.tsx +59 -0
  188. package/src/base/partials/ResizableSidebar/index.tsx +70 -0
  189. package/src/base/partials/StatRow/index.tsx +28 -0
  190. package/src/base/partials/StatusBar/index.tsx +126 -0
  191. package/src/base/partials/StatusIndicator/index.tsx +61 -0
  192. package/src/base/partials/StepIndicator/index.tsx +63 -0
  193. package/src/base/partials/TableOfContents/index.tsx +78 -0
  194. package/src/base/partials/TimelineList/index.tsx +273 -0
  195. package/src/base/partials/ToggleGroupControl/index.tsx +100 -0
  196. package/src/base/partials/TreeView/index.tsx +75 -0
  197. package/src/base/partials/index.ts +23 -0
  198. package/src/base/shell/AuthShell.tsx +54 -0
  199. package/src/base/shell/BasicShell.tsx +286 -0
  200. package/src/base/shell/ImmersiveShell.tsx +85 -0
  201. package/src/base/shell/partials/EditablePanelContext.tsx +82 -0
  202. package/src/base/shell/partials/EditablePanelProvider.tsx +122 -0
  203. package/src/base/shell/partials/InlineEditablePanel.tsx +239 -0
  204. package/src/base/shell/partials/InspectorContext.tsx +173 -0
  205. package/src/base/shell/partials/InspectorPanel.tsx +65 -0
  206. package/src/base/shell/partials/NavErrorBoundary.tsx +82 -0
  207. package/src/base/shell/partials/OverlayScreen.tsx +67 -0
  208. package/src/base/shell/partials/PageActionButton.tsx +203 -0
  209. package/src/base/theme/appearance.ts +133 -0
  210. package/src/base/theme/host-layout-detector.ts +119 -0
  211. package/src/base/theme/host-theme-detector.ts +146 -0
  212. package/src/base/theme/sidebar-safelist.txt +20 -0
  213. package/src/base/theme/tailwind-theme.css +136 -0
  214. package/src/base/theme/theme-bridge.css +164 -0
  215. package/src/base/theme/theme-context.tsx +142 -0
  216. package/src/base/theme/themes/classic.css +174 -0
  217. package/src/base/theme/tokens.css +290 -0
  218. package/src/base/theme/useHostTheme.ts +95 -0
  219. package/src/base/utils/clipboard.ts +39 -0
  220. package/src/base/utils/conditions.ts +27 -0
  221. package/src/base/utils/icon-registry.ts +78 -0
  222. package/src/base/utils/icons.ts +31 -0
  223. package/src/base/utils/interpolate.ts +9 -0
  224. package/src/base/utils/register-default-icons.ts +163 -0
  225. package/src/base/utils/storage.ts +65 -0
  226. package/src/base/utils/time.ts +139 -0
  227. package/src/contracts/block-data/actions.ts +73 -0
  228. package/src/contracts/block-data/data-display.ts +343 -0
  229. package/src/contracts/block-data/form.ts +164 -0
  230. package/src/contracts/block-data/index.ts +15 -0
  231. package/src/contracts/block-data/interactive.ts +34 -0
  232. package/src/contracts/block-data/shared.ts +44 -0
  233. package/src/contracts/connectors.ts +60 -0
  234. package/src/contracts/generated/contract-schema.ts +1237 -0
  235. package/src/contracts/generated/contract-types.ts +675 -0
  236. package/src/contracts/generated/index.ts +15 -0
  237. package/src/contracts/navigation.ts +59 -0
  238. package/src/contracts/page-contract-schema.ts +40 -0
  239. package/src/contracts/page-contract.ts +79 -0
  240. package/src/contracts/shared-props.ts +92 -0
  241. package/src/engine/ContractPage.tsx +178 -0
  242. package/src/engine/EntityRoutes.tsx +72 -0
  243. package/src/engine/HostSlot.tsx +126 -0
  244. package/src/engine/LazyBlock.tsx +92 -0
  245. package/src/engine/bootstrap.tsx +20 -0
  246. package/src/engine/providers/auth.tsx +87 -0
  247. package/src/engine/providers/error-reporter.tsx +89 -0
  248. package/src/engine/providers/flash.tsx +44 -0
  249. package/src/engine/providers/index.ts +18 -0
  250. package/src/engine/providers/inertia-error-reporter.tsx +61 -0
  251. package/src/engine/providers/progress.tsx +56 -0
  252. package/src/engine/providers/scope.tsx +51 -0
  253. package/src/engine/register-defaults.ts +88 -0
  254. package/src/engine/registries.ts +96 -0
  255. package/src/i18n/I18nProvider.tsx +53 -0
  256. package/src/i18n/MANIFEST.md +101 -0
  257. package/src/i18n/host-resolver.ts +18 -0
  258. package/src/i18n/instance.ts +69 -0
  259. package/src/i18n/locales/en/ui.json +277 -0
  260. package/src/i18n/locales/en/validators.json +13 -0
  261. package/src/i18n/locales/pt-BR/ui.json +277 -0
  262. package/src/i18n/locales/pt-BR/validators.json +13 -0
  263. package/src/i18n/register-strings.ts +10 -0
  264. package/src/i18n/render-label.ts +33 -0
  265. package/src/i18n/resolve-field-error.ts +29 -0
  266. package/src/i18n/useHostString.ts +50 -0
  267. package/src/i18n/useTranslation.ts +83 -0
  268. package/src/lib/actions/resolve-action-target.ts +151 -0
  269. package/src/lib/hooks/use-copy-to-clipboard.ts +37 -0
  270. package/src/lib/hooks/use-file-upload.ts +406 -0
  271. package/src/lib/hooks/use-mobile.ts +21 -0
  272. package/src/lib/host-pending.ts +76 -0
  273. package/src/lib/portal-container.ts +16 -0
  274. package/src/lib/test-ids.ts +40 -0
  275. package/src/lib/utils.ts +6 -0
  276. package/src/primitives/reui/MANIFEST.md +97 -0
  277. package/src/primitives/reui/accordion.tsx +64 -0
  278. package/src/primitives/reui/alert-dialog.tsx +196 -0
  279. package/src/primitives/reui/alert.tsx +92 -0
  280. package/src/primitives/reui/aspect-ratio.tsx +9 -0
  281. package/src/primitives/reui/autocomplete.tsx +343 -0
  282. package/src/primitives/reui/avatar.tsx +109 -0
  283. package/src/primitives/reui/badge.tsx +94 -0
  284. package/src/primitives/reui/breadcrumb.tsx +109 -0
  285. package/src/primitives/reui/button-group.tsx +83 -0
  286. package/src/primitives/reui/button.tsx +64 -0
  287. package/src/primitives/reui/calendar.tsx +220 -0
  288. package/src/primitives/reui/card.tsx +92 -0
  289. package/src/primitives/reui/carousel.tsx +239 -0
  290. package/src/primitives/reui/chart.tsx +388 -0
  291. package/src/primitives/reui/checkbox.tsx +30 -0
  292. package/src/primitives/reui/collapsible.tsx +31 -0
  293. package/src/primitives/reui/combobox.tsx +308 -0
  294. package/src/primitives/reui/command.tsx +182 -0
  295. package/src/primitives/reui/context-menu.tsx +250 -0
  296. package/src/primitives/reui/data-grid/data-grid-column-filter.tsx +172 -0
  297. package/src/primitives/reui/data-grid/data-grid-column-header.tsx +420 -0
  298. package/src/primitives/reui/data-grid/data-grid-column-visibility.tsx +51 -0
  299. package/src/primitives/reui/data-grid/data-grid-pagination.tsx +235 -0
  300. package/src/primitives/reui/data-grid/data-grid-scroll-area.tsx +427 -0
  301. package/src/primitives/reui/data-grid/data-grid-table-dnd-rows.tsx +308 -0
  302. package/src/primitives/reui/data-grid/data-grid-table-dnd.tsx +318 -0
  303. package/src/primitives/reui/data-grid/data-grid-table-virtual.tsx +491 -0
  304. package/src/primitives/reui/data-grid/data-grid-table.tsx +1430 -0
  305. package/src/primitives/reui/data-grid/data-grid.tsx +269 -0
  306. package/src/primitives/reui/data-grid-pagination.tsx +235 -0
  307. package/src/primitives/reui/date-selector.tsx +1353 -0
  308. package/src/primitives/reui/dialog.tsx +158 -0
  309. package/src/primitives/reui/drawer.tsx +133 -0
  310. package/src/primitives/reui/dropdown-menu.tsx +257 -0
  311. package/src/primitives/reui/empty.tsx +104 -0
  312. package/src/primitives/reui/field.tsx +246 -0
  313. package/src/primitives/reui/filters.tsx +1891 -0
  314. package/src/primitives/reui/frame.tsx +170 -0
  315. package/src/primitives/reui/hover-card.tsx +42 -0
  316. package/src/primitives/reui/icon-placeholder.tsx +39 -0
  317. package/src/primitives/reui/index.ts +98 -0
  318. package/src/primitives/reui/input-group.tsx +170 -0
  319. package/src/primitives/reui/input-otp.tsx +75 -0
  320. package/src/primitives/reui/input.tsx +21 -0
  321. package/src/primitives/reui/item.tsx +193 -0
  322. package/src/primitives/reui/kanban.tsx +743 -0
  323. package/src/primitives/reui/kbd.tsx +28 -0
  324. package/src/primitives/reui/label.tsx +22 -0
  325. package/src/primitives/reui/menubar.tsx +274 -0
  326. package/src/primitives/reui/native-select.tsx +62 -0
  327. package/src/primitives/reui/navigation-menu.tsx +168 -0
  328. package/src/primitives/reui/number-field.tsx +250 -0
  329. package/src/primitives/reui/pagination.tsx +127 -0
  330. package/src/primitives/reui/phone-input.tsx +231 -0
  331. package/src/primitives/reui/popover.tsx +87 -0
  332. package/src/primitives/reui/progress.tsx +31 -0
  333. package/src/primitives/reui/radio-group.tsx +43 -0
  334. package/src/primitives/reui/rating.tsx +177 -0
  335. package/src/primitives/reui/resizable.tsx +51 -0
  336. package/src/primitives/reui/scroll-area.tsx +58 -0
  337. package/src/primitives/reui/scrollspy.tsx +240 -0
  338. package/src/primitives/reui/select.tsx +188 -0
  339. package/src/primitives/reui/separator.tsx +28 -0
  340. package/src/primitives/reui/sheet.tsx +141 -0
  341. package/src/primitives/reui/sidebar.tsx +732 -0
  342. package/src/primitives/reui/skeleton.tsx +13 -0
  343. package/src/primitives/reui/slider.tsx +61 -0
  344. package/src/primitives/reui/sonner.tsx +47 -0
  345. package/src/primitives/reui/sortable.tsx +414 -0
  346. package/src/primitives/reui/spinner.tsx +16 -0
  347. package/src/primitives/reui/stepper.tsx +484 -0
  348. package/src/primitives/reui/svgs/claudeAiIcon.tsx +12 -0
  349. package/src/primitives/reui/svgs/gemini.tsx +171 -0
  350. package/src/primitives/reui/svgs/openai.tsx +9 -0
  351. package/src/primitives/reui/svgs/openaiDark.tsx +12 -0
  352. package/src/primitives/reui/switch.tsx +33 -0
  353. package/src/primitives/reui/table.tsx +114 -0
  354. package/src/primitives/reui/tabs.tsx +91 -0
  355. package/src/primitives/reui/textarea.tsx +18 -0
  356. package/src/primitives/reui/timeline.tsx +219 -0
  357. package/src/primitives/reui/toggle-group.tsx +83 -0
  358. package/src/primitives/reui/toggle.tsx +45 -0
  359. package/src/primitives/reui/tooltip.tsx +55 -0
  360. package/src/primitives/reui/tree.tsx +247 -0
  361. package/src/theme.css +71 -0
  362. package/dist-lib/chunks/subpath-q4Q2zg_p.js +0 -153
@@ -0,0 +1,13 @@
1
+ import { cn } from "@/lib/utils";
2
+
3
+ function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
4
+ return (
5
+ <div
6
+ data-slot="skeleton"
7
+ className={cn("animate-pulse rounded-md bg-accent", className)}
8
+ {...props}
9
+ />
10
+ );
11
+ }
12
+
13
+ export { Skeleton };
@@ -0,0 +1,61 @@
1
+ import * as React from "react";
2
+ import { Slider as SliderPrimitive } from "radix-ui";
3
+
4
+ import { cn } from "@/lib/utils";
5
+
6
+ function Slider({
7
+ className,
8
+ defaultValue,
9
+ value,
10
+ min = 0,
11
+ max = 100,
12
+ ...props
13
+ }: React.ComponentProps<typeof SliderPrimitive.Root>) {
14
+ const _values = React.useMemo(
15
+ () =>
16
+ Array.isArray(value)
17
+ ? value
18
+ : Array.isArray(defaultValue)
19
+ ? defaultValue
20
+ : [min, max],
21
+ [value, defaultValue, min, max],
22
+ );
23
+
24
+ return (
25
+ <SliderPrimitive.Root
26
+ data-slot="slider"
27
+ defaultValue={defaultValue}
28
+ value={value}
29
+ min={min}
30
+ max={max}
31
+ className={cn(
32
+ "relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
33
+ className,
34
+ )}
35
+ {...props}
36
+ >
37
+ <SliderPrimitive.Track
38
+ data-slot="slider-track"
39
+ className={cn(
40
+ "relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5",
41
+ )}
42
+ >
43
+ <SliderPrimitive.Range
44
+ data-slot="slider-range"
45
+ className={cn(
46
+ "absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full",
47
+ )}
48
+ />
49
+ </SliderPrimitive.Track>
50
+ {Array.from({ length: _values.length }, (_, index) => (
51
+ <SliderPrimitive.Thumb
52
+ data-slot="slider-thumb"
53
+ key={index}
54
+ className="block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
55
+ />
56
+ ))}
57
+ </SliderPrimitive.Root>
58
+ );
59
+ }
60
+
61
+ export { Slider };
@@ -0,0 +1,47 @@
1
+ "use client";
2
+
3
+ import {
4
+ CircleCheckIcon,
5
+ InfoIcon,
6
+ Loader2Icon,
7
+ OctagonXIcon,
8
+ TriangleAlertIcon,
9
+ } from "lucide-react";
10
+ import { createPortal } from "react-dom";
11
+ import { Toaster as Sonner, type ToasterProps } from "sonner";
12
+ import {
13
+ getStoredAppearance,
14
+ getEffectiveTheme,
15
+ } from "@/base/theme/appearance";
16
+ import { getPortalContainer } from "@/lib/portal-container";
17
+
18
+ const Toaster = ({ ...props }: ToasterProps) => {
19
+ const theme = getEffectiveTheme(getStoredAppearance());
20
+
21
+ const toaster = (
22
+ <Sonner
23
+ theme={theme as ToasterProps["theme"]}
24
+ className="toaster group"
25
+ icons={{
26
+ success: <CircleCheckIcon className="size-4" />,
27
+ info: <InfoIcon className="size-4" />,
28
+ warning: <TriangleAlertIcon className="size-4" />,
29
+ error: <OctagonXIcon className="size-4" />,
30
+ loading: <Loader2Icon className="size-4 animate-spin" />,
31
+ }}
32
+ style={
33
+ {
34
+ "--normal-bg": "var(--popover)",
35
+ "--normal-text": "var(--popover-foreground)",
36
+ "--normal-border": "var(--border)",
37
+ "--border-radius": "var(--radius)",
38
+ } as React.CSSProperties
39
+ }
40
+ {...props}
41
+ />
42
+ );
43
+
44
+ return createPortal(toaster, getPortalContainer());
45
+ };
46
+
47
+ export { Toaster };
@@ -0,0 +1,414 @@
1
+ import * as React from "react";
2
+ import {
3
+ Children,
4
+ cloneElement,
5
+ createContext,
6
+ CSSProperties,
7
+ HTMLAttributes,
8
+ isValidElement,
9
+ ReactElement,
10
+ ReactNode,
11
+ useCallback,
12
+ useContext,
13
+ useLayoutEffect,
14
+ useMemo,
15
+ useState,
16
+ } from "react";
17
+ import {
18
+ defaultDropAnimationSideEffects,
19
+ DndContext,
20
+ DragEndEvent,
21
+ DragOverlay,
22
+ DragStartEvent,
23
+ DropAnimation,
24
+ KeyboardSensor,
25
+ MeasuringStrategy,
26
+ Modifiers,
27
+ MouseSensor,
28
+ TouchSensor,
29
+ UniqueIdentifier,
30
+ useSensor,
31
+ useSensors,
32
+ type DraggableSyntheticListeners,
33
+ } from "@dnd-kit/core";
34
+ import {
35
+ arrayMove,
36
+ defaultAnimateLayoutChanges,
37
+ rectSortingStrategy,
38
+ SortableContext,
39
+ sortableKeyboardCoordinates,
40
+ useSortable,
41
+ verticalListSortingStrategy,
42
+ type AnimateLayoutChanges,
43
+ } from "@dnd-kit/sortable";
44
+ import { CSS } from "@dnd-kit/utilities";
45
+ import { Slot } from "radix-ui";
46
+ import { createPortal } from "react-dom";
47
+
48
+ import { cn } from "@/lib/utils";
49
+
50
+ // Sortable Item Context
51
+ const SortableItemContext = createContext<{
52
+ listeners: DraggableSyntheticListeners | undefined;
53
+ isDragging?: boolean;
54
+ disabled?: boolean;
55
+ }>({
56
+ listeners: undefined,
57
+ isDragging: false,
58
+ disabled: false,
59
+ });
60
+
61
+ const IsOverlayContext = createContext(false);
62
+
63
+ const SortableInternalContext = createContext<{
64
+ activeId: UniqueIdentifier | null;
65
+ modifiers?: Modifiers;
66
+ }>({
67
+ activeId: null,
68
+ modifiers: undefined,
69
+ });
70
+
71
+ const animateLayoutChanges: AnimateLayoutChanges = (args) =>
72
+ defaultAnimateLayoutChanges({ ...args, wasDragging: true });
73
+
74
+ const dropAnimationConfig: DropAnimation = {
75
+ sideEffects: defaultDropAnimationSideEffects({
76
+ styles: {
77
+ active: {
78
+ opacity: "0.4",
79
+ },
80
+ },
81
+ }),
82
+ };
83
+
84
+ // Multipurpose Sortable Component
85
+ export interface SortableRootProps<T> extends Omit<
86
+ HTMLAttributes<HTMLDivElement>,
87
+ "onDragStart" | "onDragEnd"
88
+ > {
89
+ value: T[];
90
+ onValueChange: (value: T[]) => void;
91
+ getItemValue: (item: T) => string;
92
+ children: ReactNode;
93
+ onMove?: (event: {
94
+ event: DragEndEvent;
95
+ activeIndex: number;
96
+ overIndex: number;
97
+ }) => void;
98
+ strategy?: "horizontal" | "vertical" | "grid";
99
+ onDragStart?: (event: DragStartEvent) => void;
100
+ onDragEnd?: (event: DragEndEvent) => void;
101
+ modifiers?: Modifiers;
102
+ asChild?: boolean;
103
+ }
104
+
105
+ function Sortable<T>({
106
+ value,
107
+ onValueChange,
108
+ getItemValue,
109
+ className,
110
+ asChild = false,
111
+ onMove,
112
+ strategy = "vertical",
113
+ onDragStart,
114
+ onDragEnd,
115
+ modifiers,
116
+ children,
117
+ ...props
118
+ }: SortableRootProps<T>) {
119
+ const [activeId, setActiveId] = useState<UniqueIdentifier | null>(null);
120
+ const [mounted, setMounted] = useState(false);
121
+
122
+ useLayoutEffect(() => setMounted(true), []);
123
+
124
+ const sensors = useSensors(
125
+ useSensor(MouseSensor, {
126
+ activationConstraint: {
127
+ distance: 10,
128
+ },
129
+ }),
130
+ useSensor(TouchSensor, {
131
+ activationConstraint: {
132
+ delay: 250,
133
+ tolerance: 5,
134
+ },
135
+ }),
136
+ useSensor(KeyboardSensor, {
137
+ coordinateGetter: sortableKeyboardCoordinates,
138
+ }),
139
+ );
140
+
141
+ const handleDragStart = useCallback(
142
+ (event: DragStartEvent) => {
143
+ setActiveId(event.active.id);
144
+ onDragStart?.(event);
145
+ },
146
+ [onDragStart],
147
+ );
148
+
149
+ const handleDragEnd = useCallback(
150
+ (event: DragEndEvent) => {
151
+ const { active, over } = event;
152
+ setActiveId(null);
153
+ onDragEnd?.(event);
154
+
155
+ if (!over) return;
156
+
157
+ // Handle item reordering
158
+ const activeIndex = value.findIndex(
159
+ (item: T) => getItemValue(item) === active.id,
160
+ );
161
+ const overIndex = value.findIndex(
162
+ (item: T) => getItemValue(item) === over.id,
163
+ );
164
+
165
+ if (activeIndex !== overIndex) {
166
+ if (onMove) {
167
+ onMove({ event, activeIndex, overIndex });
168
+ } else {
169
+ const newValue = arrayMove(value, activeIndex, overIndex);
170
+ onValueChange(newValue);
171
+ }
172
+ }
173
+ },
174
+ [value, getItemValue, onValueChange, onMove, onDragEnd],
175
+ );
176
+
177
+ const handleDragCancel = useCallback(() => {
178
+ setActiveId(null);
179
+ }, []);
180
+
181
+ const getStrategy = () => {
182
+ switch (strategy) {
183
+ case "horizontal":
184
+ return rectSortingStrategy;
185
+ case "grid":
186
+ return rectSortingStrategy;
187
+ case "vertical":
188
+ default:
189
+ return verticalListSortingStrategy;
190
+ }
191
+ };
192
+
193
+ const itemIds = useMemo(() => value.map(getItemValue), [value, getItemValue]);
194
+
195
+ const contextValue = useMemo(
196
+ () => ({ activeId, modifiers }),
197
+ [activeId, modifiers],
198
+ );
199
+
200
+ // Find the active child for the overlay
201
+ const overlayContent = useMemo(() => {
202
+ if (!activeId) return null;
203
+ let result: ReactNode = null;
204
+ Children.forEach(children, (child) => {
205
+ if (isValidElement(child) && (child.props as any).value === activeId) {
206
+ result = cloneElement(child as ReactElement<any>, {
207
+ ...(child.props as any),
208
+ className: cn((child.props as any).className, "z-50"),
209
+ });
210
+ }
211
+ });
212
+ return result;
213
+ }, [activeId, children]);
214
+
215
+ const Comp = asChild ? Slot.Root : "div";
216
+
217
+ return (
218
+ <SortableInternalContext.Provider value={contextValue}>
219
+ <DndContext
220
+ sensors={sensors}
221
+ modifiers={modifiers}
222
+ measuring={{
223
+ droppable: {
224
+ strategy: MeasuringStrategy.Always,
225
+ },
226
+ }}
227
+ onDragStart={handleDragStart}
228
+ onDragEnd={handleDragEnd}
229
+ onDragCancel={handleDragCancel}
230
+ >
231
+ <SortableContext items={itemIds} strategy={getStrategy()}>
232
+ <Comp
233
+ data-slot="sortable"
234
+ data-dragging={activeId !== null}
235
+ className={cn(activeId !== null && "cursor-grabbing!", className)}
236
+ {...props}
237
+ >
238
+ {children}
239
+ </Comp>
240
+ </SortableContext>
241
+ {mounted &&
242
+ createPortal(
243
+ <DragOverlay
244
+ dropAnimation={dropAnimationConfig}
245
+ modifiers={modifiers}
246
+ className={cn("z-50", activeId && "cursor-grabbing")}
247
+ >
248
+ <IsOverlayContext.Provider value={true}>
249
+ {overlayContent}
250
+ </IsOverlayContext.Provider>
251
+ </DragOverlay>,
252
+ document.body,
253
+ )}
254
+ </DndContext>
255
+ </SortableInternalContext.Provider>
256
+ );
257
+ }
258
+
259
+ export interface SortableItemProps extends HTMLAttributes<HTMLDivElement> {
260
+ value: string;
261
+ disabled?: boolean;
262
+ asChild?: boolean;
263
+ }
264
+
265
+ function SortableItem({
266
+ value,
267
+ className,
268
+ asChild = false,
269
+ disabled,
270
+ children,
271
+ ...props
272
+ }: SortableItemProps) {
273
+ const isOverlay = useContext(IsOverlayContext);
274
+
275
+ const {
276
+ setNodeRef,
277
+ transform,
278
+ transition,
279
+ attributes,
280
+ listeners,
281
+ isDragging: isSortableDragging,
282
+ } = useSortable({
283
+ id: value,
284
+ disabled: disabled || isOverlay,
285
+ animateLayoutChanges,
286
+ });
287
+
288
+ if (isOverlay) {
289
+ const Comp = asChild ? Slot.Root : "div";
290
+
291
+ return (
292
+ <SortableItemContext.Provider
293
+ value={{ listeners: undefined, isDragging: true, disabled: false }}
294
+ >
295
+ <Comp
296
+ data-slot="sortable-item"
297
+ data-value={value}
298
+ data-dragging={true}
299
+ className={cn(className)}
300
+ {...props}
301
+ >
302
+ {children}
303
+ </Comp>
304
+ </SortableItemContext.Provider>
305
+ );
306
+ }
307
+
308
+ const style = {
309
+ transition,
310
+ transform: CSS.Transform.toString(transform),
311
+ } as CSSProperties;
312
+
313
+ const Comp = asChild ? Slot.Root : "div";
314
+
315
+ return (
316
+ <SortableItemContext.Provider
317
+ value={{ listeners, isDragging: isSortableDragging, disabled }}
318
+ >
319
+ <Comp
320
+ data-slot="sortable-item"
321
+ data-value={value}
322
+ data-dragging={isSortableDragging}
323
+ data-disabled={disabled}
324
+ ref={setNodeRef}
325
+ style={style}
326
+ {...attributes}
327
+ className={cn(
328
+ isSortableDragging && "z-50 opacity-50",
329
+ disabled && "opacity-50",
330
+ className,
331
+ )}
332
+ {...props}
333
+ >
334
+ {children}
335
+ </Comp>
336
+ </SortableItemContext.Provider>
337
+ );
338
+ }
339
+
340
+ export interface SortableItemHandleProps extends HTMLAttributes<HTMLDivElement> {
341
+ cursor?: boolean;
342
+ asChild?: boolean;
343
+ }
344
+
345
+ function SortableItemHandle({
346
+ className,
347
+ asChild = false,
348
+ cursor = true,
349
+ children,
350
+ ...props
351
+ }: SortableItemHandleProps) {
352
+ const { listeners, isDragging, disabled } = useContext(SortableItemContext);
353
+
354
+ const Comp = asChild ? Slot.Root : "div";
355
+
356
+ return (
357
+ <Comp
358
+ data-slot="sortable-item-handle"
359
+ data-dragging={isDragging}
360
+ data-disabled={disabled}
361
+ {...listeners}
362
+ className={cn(
363
+ cursor && (isDragging ? "cursor-grabbing!" : "cursor-grab!"),
364
+ className,
365
+ )}
366
+ {...props}
367
+ >
368
+ {children}
369
+ </Comp>
370
+ );
371
+ }
372
+
373
+ export interface SortableOverlayProps extends Omit<
374
+ React.ComponentProps<typeof DragOverlay>,
375
+ "children"
376
+ > {
377
+ children?: ReactNode | ((params: { value: UniqueIdentifier }) => ReactNode);
378
+ }
379
+
380
+ function SortableOverlay({
381
+ children,
382
+ className,
383
+ ...props
384
+ }: SortableOverlayProps) {
385
+ const { activeId, modifiers } = useContext(SortableInternalContext);
386
+ const [mounted, setMounted] = useState(false);
387
+
388
+ useLayoutEffect(() => setMounted(true), []);
389
+
390
+ const content =
391
+ activeId && children
392
+ ? typeof children === "function"
393
+ ? children({ value: activeId })
394
+ : children
395
+ : null;
396
+
397
+ if (!mounted) return null;
398
+
399
+ return createPortal(
400
+ <DragOverlay
401
+ dropAnimation={dropAnimationConfig}
402
+ modifiers={modifiers}
403
+ className={cn("z-50", activeId && "cursor-grabbing", className)}
404
+ {...props}
405
+ >
406
+ <IsOverlayContext.Provider value={true}>
407
+ {content}
408
+ </IsOverlayContext.Provider>
409
+ </DragOverlay>,
410
+ document.body,
411
+ );
412
+ }
413
+
414
+ export { Sortable, SortableItem, SortableItemHandle, SortableOverlay };
@@ -0,0 +1,16 @@
1
+ import { Loader2Icon } from "lucide-react";
2
+
3
+ import { cn } from "@/lib/utils";
4
+
5
+ function Spinner({ className, ...props }: React.ComponentProps<"svg">) {
6
+ return (
7
+ <Loader2Icon
8
+ role="status"
9
+ aria-label="Loading"
10
+ className={cn("size-4 animate-spin", className)}
11
+ {...props}
12
+ />
13
+ );
14
+ }
15
+
16
+ export { Spinner };