@motiadev/workbench 0.0.6 → 0.0.7-build.20250529212805

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 (295) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +95 -40
  3. package/dist/README.md +105 -0
  4. package/dist/index.d.ts +1 -2
  5. package/dist/index.html +31 -0
  6. package/dist/index.js +0 -1
  7. package/dist/middleware.d.ts +2 -2
  8. package/dist/middleware.js +10 -17
  9. package/dist/postcss.config.mjs +9 -0
  10. package/dist/src/components/app-sidebar.d.ts +0 -1
  11. package/dist/src/components/app-sidebar.js +15 -8
  12. package/dist/src/components/endpoints/endpoint-badge.d.ts +10 -0
  13. package/dist/src/components/endpoints/endpoint-badge.js +22 -0
  14. package/dist/src/components/endpoints/endpoint-call.d.ts +8 -0
  15. package/dist/src/components/endpoints/endpoint-call.js +57 -0
  16. package/dist/src/components/endpoints/endpoints.d.ts +1 -0
  17. package/dist/src/components/endpoints/endpoints.js +34 -0
  18. package/dist/src/components/endpoints/hooks/use-get-endpoints.d.ts +15 -0
  19. package/dist/src/components/endpoints/hooks/use-get-endpoints.js +8 -0
  20. package/dist/src/components/endpoints/hooks/use-json-schema-to-json.d.ts +4 -0
  21. package/dist/src/components/endpoints/hooks/use-json-schema-to-json.js +11 -0
  22. package/dist/src/components/endpoints/hooks/use-path-params.d.ts +1 -0
  23. package/dist/src/components/endpoints/hooks/use-path-params.js +4 -0
  24. package/dist/src/components/endpoints/hooks/use-state-stream.d.ts +4 -0
  25. package/dist/src/components/endpoints/hooks/use-state-stream.js +8 -0
  26. package/dist/src/components/endpoints/hooks/utils.d.ts +1 -0
  27. package/dist/src/components/endpoints/hooks/utils.js +29 -0
  28. package/dist/src/components/endpoints/response-body.d.ts +7 -0
  29. package/dist/src/components/endpoints/response-body.js +6 -0
  30. package/dist/src/components/endpoints/selected-endpoint.d.ts +7 -0
  31. package/dist/src/components/endpoints/selected-endpoint.js +7 -0
  32. package/dist/src/components/{log-console.d.ts → logs/log-console.d.ts} +0 -1
  33. package/dist/src/components/logs/log-console.js +69 -0
  34. package/dist/src/components/logs/log-detail.d.ts +8 -0
  35. package/dist/src/components/logs/log-detail.js +15 -0
  36. package/dist/src/components/logs/log-field.d.ts +8 -0
  37. package/dist/src/components/logs/log-field.js +20 -0
  38. package/dist/src/components/{log-level-badge.d.ts → logs/log-level-badge.d.ts} +2 -1
  39. package/dist/src/components/{log-level-badge.js → logs/log-level-badge.js} +2 -2
  40. package/dist/src/components/logs/log-level-dot.d.ts +4 -0
  41. package/dist/src/components/logs/log-level-dot.js +17 -0
  42. package/dist/src/components/logs/logs.d.ts +1 -0
  43. package/dist/src/components/logs/logs.js +18 -0
  44. package/dist/src/components/root-motia.d.ts +2 -0
  45. package/dist/src/components/root-motia.js +5 -0
  46. package/dist/src/components/states/hooks/states-hooks.d.ts +3 -0
  47. package/dist/src/components/states/hooks/states-hooks.js +36 -0
  48. package/dist/src/components/states/state-detail.d.ts +7 -0
  49. package/dist/src/components/states/state-detail.js +12 -0
  50. package/dist/src/components/states/state-value.d.ts +8 -0
  51. package/dist/src/components/states/state-value.js +51 -0
  52. package/dist/src/components/states/states.d.ts +1 -0
  53. package/dist/src/components/states/states.js +21 -0
  54. package/dist/src/components/ui/badge.d.ts +3 -4
  55. package/dist/src/components/ui/badge.js +4 -4
  56. package/dist/src/components/ui/button.d.ts +2 -3
  57. package/dist/src/components/ui/button.js +2 -3
  58. package/dist/src/components/ui/collapsible.d.ts +1 -2
  59. package/dist/src/components/ui/collapsible.js +1 -1
  60. package/dist/src/components/ui/dialog.d.ts +2 -3
  61. package/dist/src/components/ui/dialog.js +12 -12
  62. package/dist/src/components/ui/dropdown-menu.d.ts +25 -0
  63. package/dist/src/components/ui/dropdown-menu.js +50 -0
  64. package/dist/src/components/ui/input.d.ts +0 -1
  65. package/dist/src/components/ui/label.d.ts +3 -4
  66. package/dist/src/components/ui/label.js +6 -6
  67. package/dist/src/components/ui/select.d.ts +2 -3
  68. package/dist/src/components/ui/select.js +14 -15
  69. package/dist/src/components/ui/separator.d.ts +0 -1
  70. package/dist/src/components/ui/sheet.d.ts +1 -2
  71. package/dist/src/components/ui/sheet.js +2 -2
  72. package/dist/src/components/ui/sidebar.d.ts +12 -67
  73. package/dist/src/components/ui/sidebar.js +14 -219
  74. package/dist/src/components/ui/skeleton.d.ts +1 -1
  75. package/dist/src/components/ui/switch.d.ts +2 -3
  76. package/dist/src/components/ui/switch.js +4 -4
  77. package/dist/src/components/ui/table.d.ts +0 -1
  78. package/dist/src/components/ui/table.js +1 -1
  79. package/dist/src/components/ui/textarea.d.ts +1 -2
  80. package/dist/src/components/ui/textarea.js +4 -4
  81. package/dist/src/components/ui/theme-toggle.d.ts +2 -0
  82. package/dist/src/components/ui/theme-toggle.js +11 -0
  83. package/dist/src/components/ui/tooltip.d.ts +0 -1
  84. package/dist/src/hooks/use-debounced.d.ts +1 -0
  85. package/dist/src/hooks/use-debounced.js +18 -0
  86. package/dist/src/hooks/use-list-flows.d.ts +0 -2
  87. package/dist/src/hooks/use-list-flows.js +6 -10
  88. package/dist/src/hooks/use-log-listener.d.ts +1 -6
  89. package/dist/src/hooks/use-log-listener.js +3 -18
  90. package/dist/src/hooks/use-mobile.d.ts +0 -1
  91. package/dist/src/hooks/use-theme.d.ts +6 -0
  92. package/dist/src/hooks/use-theme.js +28 -0
  93. package/dist/src/index.css +169 -0
  94. package/dist/src/lib/utils.d.ts +0 -1
  95. package/dist/src/main.d.ts +0 -8
  96. package/dist/src/main.js +11 -7
  97. package/dist/src/publicComponents/api-node.d.ts +2 -5
  98. package/dist/src/publicComponents/api-node.js +3 -3
  99. package/dist/src/publicComponents/base-handle.d.ts +1 -1
  100. package/dist/src/publicComponents/base-handle.js +5 -2
  101. package/dist/src/publicComponents/base-node.d.ts +5 -5
  102. package/dist/src/publicComponents/base-node.js +13 -8
  103. package/dist/src/publicComponents/colorMap.d.ts +6 -0
  104. package/dist/src/publicComponents/colorMap.js +6 -0
  105. package/dist/src/publicComponents/components/header-bar.d.ts +11 -0
  106. package/dist/src/publicComponents/components/header-bar.js +15 -0
  107. package/dist/src/publicComponents/cron-node.d.ts +2 -0
  108. package/dist/src/publicComponents/cron-node.js +7 -0
  109. package/dist/src/publicComponents/emits.d.ts +1 -1
  110. package/dist/src/publicComponents/emits.js +2 -2
  111. package/dist/src/publicComponents/event-node.d.ts +0 -2
  112. package/dist/src/publicComponents/event-node.js +3 -5
  113. package/dist/src/publicComponents/node-details.d.ts +17 -0
  114. package/dist/src/publicComponents/node-details.js +19 -0
  115. package/dist/src/publicComponents/node-props.d.ts +5 -3
  116. package/dist/src/publicComponents/noop-node.d.ts +0 -1
  117. package/dist/src/publicComponents/noop-node.js +1 -1
  118. package/dist/src/publicComponents/subscribe.d.ts +2 -3
  119. package/dist/src/publicComponents/subscribe.js +2 -2
  120. package/dist/src/route-wrapper.d.ts +2 -4
  121. package/dist/src/route-wrapper.js +2 -2
  122. package/dist/src/routes/endpoints-page.d.ts +1 -0
  123. package/dist/src/routes/endpoints-page.js +5 -0
  124. package/dist/src/routes/flow.d.ts +1 -0
  125. package/dist/src/routes/flow.js +22 -0
  126. package/dist/src/routes/index.d.ts +1 -2
  127. package/dist/src/routes/index.js +5 -8
  128. package/dist/src/routes/logs-page.d.ts +1 -0
  129. package/dist/src/routes/logs-page.js +12 -0
  130. package/dist/src/routes/states-page.d.ts +1 -0
  131. package/dist/src/routes/states-page.js +5 -0
  132. package/dist/src/stores/use-logs.d.ts +3 -2
  133. package/dist/src/stores/use-logs.js +52 -6
  134. package/dist/src/views/flow/arrow-head.d.ts +2 -2
  135. package/dist/src/views/flow/arrow-head.js +5 -1
  136. package/dist/src/views/flow/base-edge.d.ts +0 -1
  137. package/dist/src/views/flow/base-edge.js +25 -10
  138. package/dist/src/views/flow/flow-loader.d.ts +0 -1
  139. package/dist/src/views/flow/flow-loader.js +1 -1
  140. package/dist/src/views/flow/flow-view.d.ts +7 -2
  141. package/dist/src/views/flow/flow-view.js +44 -20
  142. package/dist/src/views/flow/hooks/use-get-flow-state.d.ts +14 -5
  143. package/dist/src/views/flow/hooks/use-get-flow-state.js +17 -8
  144. package/dist/src/views/flow/hooks/use-organize-nodes.d.ts +0 -1
  145. package/dist/src/views/flow/hooks/use-save-workflow-config.d.ts +9 -0
  146. package/dist/src/views/flow/hooks/use-save-workflow-config.js +23 -0
  147. package/dist/src/views/flow/legend.d.ts +3 -3
  148. package/dist/src/views/flow/legend.js +49 -39
  149. package/dist/src/views/flow/node-organizer.d.ts +1 -1
  150. package/dist/src/views/flow/node-organizer.js +4 -2
  151. package/dist/src/views/flow/nodes/api-flow-node.d.ts +0 -1
  152. package/dist/src/views/flow/nodes/event-flow-node.d.ts +0 -1
  153. package/dist/src/views/flow/nodes/language-indicator.d.ts +0 -1
  154. package/dist/src/views/flow/nodes/language-indicator.js +7 -7
  155. package/dist/src/views/flow/nodes/nodes.types.d.ts +39 -6
  156. package/dist/src/views/flow/nodes/noop-flow-node.d.ts +0 -1
  157. package/dist/tailwind.config.js +9 -77
  158. package/dist/tsconfig.app.tsbuildinfo +1 -1
  159. package/dist/tsconfig.node.tsbuildinfo +1 -1
  160. package/package.json +36 -42
  161. package/postcss.config.mjs +9 -0
  162. package/dist/index.d.ts.map +0 -1
  163. package/dist/middleware.d.ts.map +0 -1
  164. package/dist/src/components/app-sidebar.d.ts.map +0 -1
  165. package/dist/src/components/log-console.d.ts.map +0 -1
  166. package/dist/src/components/log-console.js +0 -20
  167. package/dist/src/components/log-level-badge.d.ts.map +0 -1
  168. package/dist/src/components/ui/badge.d.ts.map +0 -1
  169. package/dist/src/components/ui/button.d.ts.map +0 -1
  170. package/dist/src/components/ui/collapsible.d.ts.map +0 -1
  171. package/dist/src/components/ui/dialog.d.ts.map +0 -1
  172. package/dist/src/components/ui/input.d.ts.map +0 -1
  173. package/dist/src/components/ui/label.d.ts.map +0 -1
  174. package/dist/src/components/ui/select.d.ts.map +0 -1
  175. package/dist/src/components/ui/separator.d.ts.map +0 -1
  176. package/dist/src/components/ui/sheet.d.ts.map +0 -1
  177. package/dist/src/components/ui/sidebar.d.ts.map +0 -1
  178. package/dist/src/components/ui/skeleton.d.ts.map +0 -1
  179. package/dist/src/components/ui/switch.d.ts.map +0 -1
  180. package/dist/src/components/ui/table.d.ts.map +0 -1
  181. package/dist/src/components/ui/textarea.d.ts.map +0 -1
  182. package/dist/src/components/ui/tooltip.d.ts.map +0 -1
  183. package/dist/src/hooks/use-list-flows.d.ts.map +0 -1
  184. package/dist/src/hooks/use-log-listener.d.ts.map +0 -1
  185. package/dist/src/hooks/use-mobile.d.ts.map +0 -1
  186. package/dist/src/lib/utils.d.ts.map +0 -1
  187. package/dist/src/main.d.ts.map +0 -1
  188. package/dist/src/publicComponents/api-node.d.ts.map +0 -1
  189. package/dist/src/publicComponents/base-handle.d.ts.map +0 -1
  190. package/dist/src/publicComponents/base-node.d.ts.map +0 -1
  191. package/dist/src/publicComponents/emits.d.ts.map +0 -1
  192. package/dist/src/publicComponents/event-node.d.ts.map +0 -1
  193. package/dist/src/publicComponents/node-props.d.ts.map +0 -1
  194. package/dist/src/publicComponents/noop-node.d.ts.map +0 -1
  195. package/dist/src/publicComponents/subscribe.d.ts.map +0 -1
  196. package/dist/src/route-wrapper.d.ts.map +0 -1
  197. package/dist/src/routeTree.gen.d.ts +0 -53
  198. package/dist/src/routeTree.gen.d.ts.map +0 -1
  199. package/dist/src/routeTree.gen.js +0 -45
  200. package/dist/src/routes/__root.d.ts +0 -2
  201. package/dist/src/routes/__root.d.ts.map +0 -1
  202. package/dist/src/routes/__root.js +0 -15
  203. package/dist/src/routes/flow/$id.d.ts +0 -4
  204. package/dist/src/routes/flow/$id.d.ts.map +0 -1
  205. package/dist/src/routes/flow/$id.js +0 -15
  206. package/dist/src/routes/index.d.ts.map +0 -1
  207. package/dist/src/stores/use-logs.d.ts.map +0 -1
  208. package/dist/src/views/flow/arrow-head.d.ts.map +0 -1
  209. package/dist/src/views/flow/base-edge.d.ts.map +0 -1
  210. package/dist/src/views/flow/flow-loader.d.ts.map +0 -1
  211. package/dist/src/views/flow/flow-view.d.ts.map +0 -1
  212. package/dist/src/views/flow/hooks/use-get-flow-state.d.ts.map +0 -1
  213. package/dist/src/views/flow/hooks/use-organize-nodes.d.ts.map +0 -1
  214. package/dist/src/views/flow/legend.d.ts.map +0 -1
  215. package/dist/src/views/flow/node-organizer.d.ts.map +0 -1
  216. package/dist/src/views/flow/nodes/api-flow-node.d.ts.map +0 -1
  217. package/dist/src/views/flow/nodes/event-flow-node.d.ts.map +0 -1
  218. package/dist/src/views/flow/nodes/json-schema-form.d.ts +0 -9
  219. package/dist/src/views/flow/nodes/json-schema-form.d.ts.map +0 -1
  220. package/dist/src/views/flow/nodes/json-schema-form.js +0 -35
  221. package/dist/src/views/flow/nodes/language-indicator.d.ts.map +0 -1
  222. package/dist/src/views/flow/nodes/nodes.types.d.ts.map +0 -1
  223. package/dist/src/views/flow/nodes/noop-flow-node.d.ts.map +0 -1
  224. package/dist/tailwind.config.d.ts +0 -4
  225. package/dist/tailwind.config.d.ts.map +0 -1
  226. package/dist/vite.config.d.ts +0 -11
  227. package/dist/vite.config.d.ts.map +0 -1
  228. package/dist/vite.config.js +0 -18
  229. package/eslint.config.js +0 -28
  230. package/index.html +0 -19
  231. package/index.tsx +0 -10
  232. package/middleware.ts +0 -48
  233. package/postcss.config.js +0 -6
  234. package/src/assets/.empty +0 -0
  235. package/src/components/app-sidebar.tsx +0 -55
  236. package/src/components/log-console.tsx +0 -76
  237. package/src/components/log-level-badge.tsx +0 -12
  238. package/src/components/ui/badge.tsx +0 -31
  239. package/src/components/ui/button.tsx +0 -47
  240. package/src/components/ui/collapsible.tsx +0 -9
  241. package/src/components/ui/dialog.tsx +0 -120
  242. package/src/components/ui/input.tsx +0 -21
  243. package/src/components/ui/label.tsx +0 -26
  244. package/src/components/ui/select.tsx +0 -157
  245. package/src/components/ui/separator.tsx +0 -22
  246. package/src/components/ui/sheet.tsx +0 -106
  247. package/src/components/ui/sidebar.tsx +0 -637
  248. package/src/components/ui/skeleton.tsx +0 -7
  249. package/src/components/ui/switch.tsx +0 -27
  250. package/src/components/ui/table.tsx +0 -76
  251. package/src/components/ui/textarea.tsx +0 -22
  252. package/src/components/ui/tooltip.tsx +0 -32
  253. package/src/hooks/use-list-flows.tsx +0 -20
  254. package/src/hooks/use-log-listener.tsx +0 -32
  255. package/src/hooks/use-mobile.tsx +0 -19
  256. package/src/index.css +0 -190
  257. package/src/lib/utils.ts +0 -6
  258. package/src/main.tsx +0 -28
  259. package/src/publicComponents/api-node.tsx +0 -28
  260. package/src/publicComponents/base-handle.tsx +0 -43
  261. package/src/publicComponents/base-node.tsx +0 -57
  262. package/src/publicComponents/emits.tsx +0 -22
  263. package/src/publicComponents/event-node.tsx +0 -36
  264. package/src/publicComponents/node-props.tsx +0 -15
  265. package/src/publicComponents/noop-node.tsx +0 -21
  266. package/src/publicComponents/subscribe.tsx +0 -19
  267. package/src/route-wrapper.tsx +0 -9
  268. package/src/routeTree.gen.ts +0 -109
  269. package/src/routes/__root.tsx +0 -26
  270. package/src/routes/flow/$id.tsx +0 -21
  271. package/src/routes/index.tsx +0 -13
  272. package/src/stores/use-logs.ts +0 -22
  273. package/src/views/flow/arrow-head.tsx +0 -13
  274. package/src/views/flow/base-edge.tsx +0 -31
  275. package/src/views/flow/flow-loader.tsx +0 -3
  276. package/src/views/flow/flow-view.tsx +0 -72
  277. package/src/views/flow/hooks/use-get-flow-state.tsx +0 -93
  278. package/src/views/flow/hooks/use-organize-nodes.ts +0 -60
  279. package/src/views/flow/legend.tsx +0 -96
  280. package/src/views/flow/node-organizer.tsx +0 -70
  281. package/src/views/flow/nodes/api-flow-node.tsx +0 -6
  282. package/src/views/flow/nodes/event-flow-node.tsx +0 -6
  283. package/src/views/flow/nodes/json-schema-form.tsx +0 -110
  284. package/src/views/flow/nodes/language-indicator.tsx +0 -74
  285. package/src/views/flow/nodes/nodes.types.ts +0 -36
  286. package/src/views/flow/nodes/noop-flow-node.tsx +0 -6
  287. package/src/vite-env.d.ts +0 -1
  288. package/tailwind.config.ts +0 -75
  289. package/tsconfig.app.json +0 -32
  290. package/tsconfig.json +0 -14
  291. package/tsconfig.node.json +0 -32
  292. package/tsconfig.node.tsbuildinfo +0 -1
  293. package/vite.config.ts +0 -14
  294. /package/{components.json → dist/components.json} +0 -0
  295. /package/{public → dist/public}/.empty +0 -0
@@ -0,0 +1 @@
1
+ export declare const convertJsonSchemaToJson: (schema: Record<string, any>) => any;
@@ -0,0 +1,29 @@
1
+ export const convertJsonSchemaToJson = (schema) => {
2
+ if (!schema)
3
+ return {};
4
+ if (schema.type === 'object') {
5
+ const result = {};
6
+ if (schema.properties) {
7
+ Object.entries(schema.properties).forEach(([key, value]) => {
8
+ result[key] = convertJsonSchemaToJson(value);
9
+ });
10
+ }
11
+ return result;
12
+ }
13
+ switch (schema.type) {
14
+ case 'array':
15
+ return [convertJsonSchemaToJson(schema.items)];
16
+ case 'string':
17
+ return schema.description ?? 'string';
18
+ case 'number':
19
+ return schema.description ?? 0;
20
+ case 'integer':
21
+ return 0;
22
+ case 'boolean':
23
+ return schema.description ?? false;
24
+ case 'null':
25
+ return schema.description ?? null;
26
+ default:
27
+ return undefined;
28
+ }
29
+ };
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ type Props = {
3
+ status: string;
4
+ body: Record<string, any>;
5
+ };
6
+ export declare const ResponseBody: React.FC<Props>;
7
+ export {};
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useJsonSchemaToJson } from './hooks/use-json-schema-to-json';
3
+ export const ResponseBody = ({ status, body }) => {
4
+ const { body: responseBody } = useJsonSchemaToJson(body);
5
+ return (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("span", { className: "text-xs font-bold", children: status }), _jsx("span", { className: "text-xs font-mono dark:bg-black/50 bg-white/50 p-2 rounded-lg whitespace-pre-wrap", children: responseBody })] }));
6
+ };
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { ApiEndpoint } from './hooks/use-get-endpoints';
3
+ type Props = {
4
+ endpoint: ApiEndpoint;
5
+ };
6
+ export declare const SelectedEndpoint: React.FC<Props>;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useJsonSchemaToJson } from './hooks/use-json-schema-to-json';
3
+ import { ResponseBody } from './response-body';
4
+ export const SelectedEndpoint = ({ endpoint }) => {
5
+ const { body: requestBody } = useJsonSchemaToJson(endpoint.bodySchema);
6
+ return (_jsxs(_Fragment, { children: [endpoint.queryParams && (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("span", { className: "text-xs font-bold", children: "Query Params" }), _jsx("div", { className: "flex flex-col gap-2 flex-1 p-2 rounded-lg bg-muted table", children: endpoint.queryParams.map((param) => (_jsxs("span", { className: "text-xs table-row", children: [_jsx("span", { className: "font-bold table-cell", children: param.name }), _jsx("span", { className: "text-xs table-cell", children: param.description })] }, param.name))) })] })), requestBody && (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("span", { className: "text-xs font-bold", children: "Request Body" }), _jsx("span", { className: "text-xs font-mono dark:bg-black/50 bg-white/50 p-2 rounded-lg whitespace-pre-wrap", children: requestBody })] })), endpoint.responseSchema && (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("span", { className: "text-xs font-bold", children: "Response" }), Object.entries(endpoint.responseSchema).map(([status, schema]) => (_jsx(ResponseBody, { status: status, body: schema }, status)))] }))] }));
7
+ };
@@ -1,2 +1 @@
1
1
  export declare const LogConsole: () => import("react/jsx-runtime").JSX.Element;
2
- //# sourceMappingURL=log-console.d.ts.map
@@ -0,0 +1,69 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useLogs } from '@/stores/use-logs';
3
+ import { ChevronDown, ChevronUp, Trash2 } from 'lucide-react';
4
+ import { useState, useCallback, useRef, useEffect } from 'react';
5
+ import { Button } from '../ui/button';
6
+ import { cn } from '@/lib/utils';
7
+ import { Logs } from './logs';
8
+ const MIN_HEIGHT = 100;
9
+ const DEFAULT_HEIGHT = 200;
10
+ const ClearLogsButton = () => {
11
+ const hasLog = useLogs((state) => state.logs.length > 0);
12
+ const resetLogs = useLogs((state) => state.resetLogs);
13
+ if (!hasLog) {
14
+ return null;
15
+ }
16
+ return (_jsxs(Button, { variant: "outline", onClick: resetLogs, children: [_jsx(Trash2, { className: "w-4 h-4" }), "Clear logs"] }));
17
+ };
18
+ export const LogConsole = () => {
19
+ const [isExpanded, setIsExpanded] = useState(false);
20
+ const [height, setHeight] = useState(DEFAULT_HEIGHT);
21
+ const dragRef = useRef(null);
22
+ const [isDragging, setIsDragging] = useState(false);
23
+ const contentRef = useRef(null);
24
+ const setUnreadLogsCount = useLogs((state) => state.setUnreadLogsCount);
25
+ const toggleExpand = useCallback(() => {
26
+ setIsExpanded((prev) => !prev);
27
+ setUnreadLogsCount(0);
28
+ }, [setUnreadLogsCount]);
29
+ const handleMouseDown = useCallback((e) => {
30
+ e.preventDefault();
31
+ setIsDragging(true);
32
+ }, []);
33
+ useEffect(() => {
34
+ const handleMouseUp = () => {
35
+ setIsDragging(false);
36
+ };
37
+ const handleMouseMove = (e) => {
38
+ if (!isDragging)
39
+ return;
40
+ const windowHeight = window.innerHeight;
41
+ const mouseY = e.clientY;
42
+ const newHeight = windowHeight - mouseY;
43
+ if (newHeight >= MIN_HEIGHT) {
44
+ setHeight(newHeight);
45
+ }
46
+ };
47
+ document.addEventListener('mousemove', handleMouseMove);
48
+ document.addEventListener('mouseup', handleMouseUp);
49
+ return () => {
50
+ document.removeEventListener('mousemove', handleMouseMove);
51
+ document.removeEventListener('mouseup', handleMouseUp);
52
+ };
53
+ }, [isDragging]);
54
+ useEffect(() => {
55
+ if (contentRef.current) {
56
+ if (isExpanded) {
57
+ contentRef.current.style.height = `${height}px`;
58
+ }
59
+ else {
60
+ contentRef.current.style.height = '0px';
61
+ }
62
+ }
63
+ }, [isExpanded, height]);
64
+ return (_jsxs("div", { className: "absolute bottom-0 left-0 right-0 bg-background/80 border border-solid border-border m-4 rounded-lg", children: [_jsx("div", { ref: dragRef, onMouseDown: handleMouseDown, className: cn('absolute -top-1 left-0 right-0 h-1 cursor-ns-resize hover:bg-background/40', isDragging && 'bg-background/40') }), _jsxs("div", { className: "text-muted-foreground flex justify-between w-full items-center p-4 gap-2", children: [_jsx("label", { className: "w-full text-left justify-start h-full text-md uppercase", children: "Logs" }), _jsx(ClearLogsButton, {}), _jsx(Button, { variant: "outline", onClick: toggleExpand, children: isExpanded ? _jsx(ChevronDown, { className: "w-4 h-4" }) : _jsx(ChevronUp, { className: "w-4 h-4" }) })] }), _jsx("div", { ref: contentRef, style: {
65
+ overflow: 'hidden',
66
+ transition: 'height 0.2s ease-out',
67
+ height: isExpanded ? `${height}px` : '0px',
68
+ }, children: _jsx(Logs, {}) })] }));
69
+ };
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { Log } from '../../stores/use-logs';
3
+ type Props = {
4
+ log?: Log;
5
+ onClose: () => void;
6
+ };
7
+ export declare const LogDetail: React.FC<Props>;
8
+ export {};
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { LogLevelBadge } from './log-level-badge';
3
+ import { LogField } from './log-field';
4
+ import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from '../ui/sheet';
5
+ const defaultProps = ['msg', 'time', 'level', 'step', 'flows', 'traceId'];
6
+ export const LogDetail = ({ log, onClose }) => {
7
+ const isOpen = !!log;
8
+ const onOpenChange = (open) => {
9
+ if (!open) {
10
+ onClose();
11
+ }
12
+ };
13
+ const otherProps = Object.keys(log ?? {}).filter((key) => !defaultProps.includes(key));
14
+ return (_jsx(Sheet, { open: isOpen, onOpenChange: onOpenChange, children: _jsxs(SheetContent, { className: "flex flex-col h-full", children: [_jsxs(SheetHeader, { children: [_jsx(SheetTitle, { children: "Logs details" }), _jsx(SheetDescription, { children: "Log details and application." })] }), _jsx("div", { className: "font-mono overflow-y-auto", children: log && (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsxs("div", { className: "flex flex-row gap-2", children: [_jsx(LogField, { label: "Level", value: _jsx(LogLevelBadge, { level: log.level }), className: "flex-1" }), _jsx(LogField, { label: "Time", value: new Date(log.time).toLocaleString(), className: "flex-1" })] }), _jsxs("div", { className: "flex flex-row gap-2", children: [_jsx(LogField, { label: "Step", value: log.step, className: "flex-1" }), _jsx(LogField, { label: "Flows", value: log.flows.join(', '), className: "flex-1" })] }), _jsx(LogField, { label: "Trace ID", value: log.traceId }), _jsx(LogField, { label: "Message", value: log.msg }), otherProps.map((key) => (_jsx(LogField, { label: key, value: log[key] }, key)))] })) })] }) }));
15
+ };
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ type Props = {
3
+ label: string;
4
+ value: string | React.ReactNode;
5
+ className?: string;
6
+ };
7
+ export declare const LogField: ({ label, value, className }: Props) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import { cn } from '../../lib/utils';
4
+ const Value = ({ value }) => {
5
+ const displayValue = typeof value === 'string' ? value : JSON.stringify(value);
6
+ return (_jsx("div", { className: "dark:text-gray-400 text-md", "aria-label": displayValue, children: displayValue }));
7
+ };
8
+ const LogValue = ({ value }) => {
9
+ if (React.isValidElement(value)) {
10
+ return value;
11
+ }
12
+ if (typeof value === 'object') {
13
+ const valueObject = value;
14
+ return (_jsx("div", { className: "flex flex-col gap-4", children: Object.keys(valueObject).map((key) => (_jsxs("div", { className: "ml-4 flex flex-col gap-2", children: [_jsx("span", { className: "text-md font-semibold", children: key }), _jsx("span", { className: "text-md", children: value ? (_jsx(LogValue, { value: valueObject[key] })) : (_jsx(Value, { value: valueObject[key] })) })] }, key))) }));
15
+ }
16
+ return _jsx(Value, { value: value });
17
+ };
18
+ export const LogField = ({ label, value, className }) => {
19
+ return (_jsx("div", { className: cn('flex row text-foreground p-2', className), children: _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("span", { className: "text-md font-semibold", children: label }), _jsx("span", { className: "", children: value ? _jsx(LogValue, { value: value }) : _jsx(Value, { value: value }) })] }) }));
20
+ };
@@ -1,4 +1,5 @@
1
+ import React from 'react';
1
2
  export declare const LogLevelBadge: React.FC<{
2
3
  level: string;
4
+ className?: string;
3
5
  }>;
4
- //# sourceMappingURL=log-level-badge.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Badge } from './ui/badge';
2
+ import { Badge } from '../ui/badge';
3
3
  export const LogLevelBadge = (props) => {
4
4
  const map = {
5
5
  info: 'info',
@@ -7,5 +7,5 @@ export const LogLevelBadge = (props) => {
7
7
  warn: 'warning',
8
8
  debug: 'info',
9
9
  };
10
- return _jsx(Badge, { variant: map[props.level], children: props.level });
10
+ return (_jsx(Badge, { variant: map[props.level], className: props.className, children: props.level }));
11
11
  };
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ export declare const LogLevelDot: React.FC<{
3
+ level: string;
4
+ }>;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cva } from 'class-variance-authority';
3
+ const badgeVariants = cva('text-xs font-medium tracking-wide w-2 h-2 rounded-full mx-1', {
4
+ variants: {
5
+ variant: {
6
+ info: 'bg-sky-500',
7
+ trace: 'bg-sky-500',
8
+ debug: 'bg-sky-500',
9
+ error: 'bg-rose-500',
10
+ fatal: 'bg-rose-500',
11
+ warn: 'bg-amber-500',
12
+ },
13
+ },
14
+ });
15
+ export const LogLevelDot = ({ level }) => {
16
+ return _jsx("div", { className: badgeVariants({ variant: level }) });
17
+ };
@@ -0,0 +1 @@
1
+ export declare const Logs: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Table, TableBody, TableCell, TableRow } from '@/components/ui/table';
3
+ import { useLogs } from '@/stores/use-logs';
4
+ import { useState } from 'react';
5
+ import { LogDetail } from './log-detail';
6
+ import { LogLevelDot } from './log-level-dot';
7
+ const timestamp = (time) => {
8
+ const date = new Date(Number(time));
9
+ return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
10
+ };
11
+ export const Logs = () => {
12
+ const logs = useLogs((state) => state.logs);
13
+ const [selectedLog, setSelectedLog] = useState();
14
+ const handleLogClick = (log) => {
15
+ setSelectedLog(log);
16
+ };
17
+ return (_jsxs("div", { className: "overflow-y-auto h-full text-bold p-4", children: [_jsx(LogDetail, { log: selectedLog, onClose: () => setSelectedLog(undefined) }), _jsx(Table, { children: _jsx(TableBody, { className: "text-md font-mono", children: logs.map((log, index) => (_jsxs(TableRow, { className: "cursor-pointer even:bg-muted/50 border-0", onClick: () => handleLogClick(log), children: [_jsxs(TableCell, { "data-testid": `time-${index}`, className: "whitespace-nowrap flex items-center gap-2", children: [_jsx(LogLevelDot, { level: log.level }), timestamp(log.time)] }), _jsx(TableCell, { "data-testid": `trace-${log.traceId}`, className: "whitespace-nowrap text-md cursor-pointer hover:text-primary text-muted-foreground text-xs font-mono", children: log.traceId }), _jsx(TableCell, { "data-testid": `step-${index}`, "aria-label": log.step, className: "whitespace-nowrap text-md font-mono", children: log.step }), _jsx(TableCell, { "data-testid": `msg-${index}`, "aria-label": log.msg, className: "whitespace-nowrap text-md font-mono max-w-[500px] truncate w-full", children: log.msg })] }, index))) }) })] }));
18
+ };
@@ -0,0 +1,2 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ export declare const RootMotia: React.FC<PropsWithChildren>;
@@ -0,0 +1,5 @@
1
+ import { useLogListener } from '../hooks/use-log-listener';
2
+ export const RootMotia = ({ children }) => {
3
+ useLogListener();
4
+ return children;
5
+ };
@@ -0,0 +1,3 @@
1
+ export declare const useGetTraces: () => string[];
2
+ export declare const useGetFields: (traceId: string | undefined) => string[];
3
+ export declare const useGetValues: (traceId: string | undefined, field: string | undefined) => any;
@@ -0,0 +1,36 @@
1
+ import { useEffect, useState } from 'react';
2
+ export const useGetTraces = () => {
3
+ const [traces, setTraces] = useState([]);
4
+ useEffect(() => {
5
+ fetch('/motia/state')
6
+ .then((res) => res.json())
7
+ .then((data) => setTraces(data));
8
+ }, []);
9
+ return traces;
10
+ };
11
+ export const useGetFields = (traceId) => {
12
+ const [fields, setFields] = useState([]);
13
+ useEffect(() => {
14
+ if (!traceId) {
15
+ setFields([]);
16
+ }
17
+ else {
18
+ fetch(`/motia/state/${traceId}`)
19
+ .then((res) => res.json())
20
+ .then((data) => setFields(data));
21
+ }
22
+ }, [traceId]);
23
+ return fields;
24
+ };
25
+ export const useGetValues = (traceId, field) => {
26
+ const [values, setValues] = useState();
27
+ useEffect(() => {
28
+ setValues(undefined);
29
+ if (traceId && field) {
30
+ fetch(`/motia/state/${traceId}/${field}`)
31
+ .then((res) => res.json())
32
+ .then((data) => setValues(data));
33
+ }
34
+ }, [traceId, field]);
35
+ return values;
36
+ };
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ type Props = {
3
+ state?: any;
4
+ onClose: () => void;
5
+ };
6
+ export declare const StateDetail: React.FC<Props>;
7
+ export {};
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { StateValue } from './state-value';
3
+ import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from '../ui/sheet';
4
+ export const StateDetail = ({ state, onClose }) => {
5
+ const isOpen = !!state;
6
+ const onOpenChange = (open) => {
7
+ if (!open) {
8
+ onClose();
9
+ }
10
+ };
11
+ return (_jsx(Sheet, { open: isOpen, onOpenChange: onOpenChange, children: _jsxs(SheetContent, { className: "flex flex-col h-full", children: [_jsxs(SheetHeader, { children: [_jsx(SheetTitle, { children: "State details" }), _jsx(SheetDescription, { children: "State details and application." })] }), _jsx("div", { className: "font-mono overflow-y-auto", children: state && (_jsx("div", { className: "flex flex-col gap-2", children: _jsx(StateValue, { value: state, isRoot: true }) })) })] }) }));
12
+ };
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ type Props = {
3
+ value: unknown;
4
+ isRoot?: boolean;
5
+ label?: string;
6
+ };
7
+ export declare const StateValue: React.FC<Props>;
8
+ export {};
@@ -0,0 +1,51 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cva } from 'class-variance-authority';
3
+ import { SquareMinus, SquarePlus } from 'lucide-react';
4
+ import React, { useState } from 'react';
5
+ import { cn } from '../../lib/utils';
6
+ const valueVariants = cva('text-muted-foreground text-sm py-2', {
7
+ variants: {
8
+ variant: {
9
+ boolean: 'text-sky-400',
10
+ number: 'text-teal-400',
11
+ undefined: 'text-muted-foreground',
12
+ string: 'text-muted-foreground',
13
+ object: 'text-gray-800',
14
+ },
15
+ },
16
+ defaultVariants: {
17
+ variant: 'string',
18
+ },
19
+ });
20
+ const Value = ({ value, variant, label, }) => {
21
+ const displayValue = typeof value === 'string' ? value : JSON.stringify(value);
22
+ return (_jsxs("div", { className: "flex flex-col gap-1", children: [label && _jsx("div", { className: "text-md font-semibold py-2", children: label }), _jsx("div", { className: valueVariants({ variant }), children: displayValue })] }));
23
+ };
24
+ export const StateValue = ({ value, label, isRoot = false }) => {
25
+ const [isOpen, setIsOpen] = useState(true);
26
+ const toggle = () => setIsOpen(!isOpen);
27
+ if (React.isValidElement(value)) {
28
+ return value;
29
+ }
30
+ if (typeof value === 'boolean') {
31
+ return _jsx(Value, { label: label, variant: "boolean", value: value ? 'true' : 'false' });
32
+ }
33
+ if (typeof value === 'number') {
34
+ return _jsx(Value, { label: label, variant: "number", value: value });
35
+ }
36
+ if (typeof value === 'undefined') {
37
+ return _jsx(Value, { label: label, variant: "undefined", value: value });
38
+ }
39
+ if (typeof value === 'string') {
40
+ return _jsx(Value, { label: label, variant: "string", value: value });
41
+ }
42
+ const isArray = Array.isArray(value);
43
+ const [openBracket, closeBracket] = isRoot ? [] : isArray ? ['[', ']'] : ['{', '}'];
44
+ if (typeof value === 'object' && !!value) {
45
+ const valueObject = value;
46
+ return (_jsxs("div", { className: "flex flex-col gap-2", children: [(label || openBracket) && (_jsxs("div", { className: "flex gap-1 items-center text-md font-semibold hover:bg-gray-800 rounded-md py-2", onClick: toggle, children: [isOpen ? (_jsx(SquareMinus, { className: "w-4 h-4 text-muted-foreground" })) : (_jsx(SquarePlus, { className: "w-4 h-4 text-muted-foreground" })), label, ' ', !isRoot && (_jsxs("span", { className: "text-muted-foreground text-sm", children: [openBracket, !isOpen && ` ... ${closeBracket}`] }))] })), isOpen &&
47
+ !!valueObject &&
48
+ Object.keys(valueObject).map((key) => (_jsx("div", { className: cn('flex flex-col gap-2', !isRoot && 'ml-4'), children: _jsx("span", { className: "text-md", children: _jsx(StateValue, { label: isArray ? undefined : key, value: valueObject[key] }) }) }, key))), !isRoot && isOpen && _jsx("span", { className: "text-muted-foreground text-sm", children: closeBracket })] }));
49
+ }
50
+ return _jsx(Value, { value: undefined, variant: "object" });
51
+ };
@@ -0,0 +1 @@
1
+ export declare const States: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '../ui/table';
3
+ import { useState } from 'react';
4
+ import { useGetFields, useGetTraces, useGetValues } from './hooks/states-hooks';
5
+ import { StateDetail } from './state-detail';
6
+ export const States = () => {
7
+ const [selectedTraceId, setSelectedTraceId] = useState();
8
+ const [selectedState, setSelectedState] = useState(); // eslint-disable-line @typescript-eslint/no-explicit-any
9
+ const traces = useGetTraces();
10
+ const fields = useGetFields(selectedTraceId);
11
+ const values = useGetValues(selectedTraceId, selectedState);
12
+ const handleTraceClick = (traceId) => {
13
+ setSelectedTraceId(traceId);
14
+ setSelectedState(undefined);
15
+ };
16
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17
+ const handleStateClick = (state) => {
18
+ setSelectedState(state);
19
+ };
20
+ return (_jsxs("div", { className: "flex flex-row gap-4 h-full", children: [_jsx(StateDetail, { state: values, onClose: () => setSelectedState(undefined) }), _jsx("div", { className: "flex flex-col gap-2 flex-1 pl-4 py-4", children: _jsxs(Table, { children: [_jsx(TableHeader, { className: "sticky top-0", children: _jsx(TableRow, { children: _jsx(TableHead, { children: "Root Field (Trace ID)" }) }) }), _jsx(TableBody, { children: traces.map((trace) => (_jsx(TableRow, { "data-testid": `trace-${trace}`, onClick: () => handleTraceClick(trace), children: _jsx(TableCell, { className: `rounded-lg font-mono font-semibold ${selectedTraceId === trace ? 'bg-indigo-900/50 hover:bg-indigo-900/30' : ''}`, children: trace }) }, trace))) })] }) }), _jsx("div", { className: "flex flex-col gap-2 flex-1 pr-4 py-4", children: _jsxs(Table, { children: [_jsx(TableHeader, { className: "sticky top-0", children: _jsx(TableRow, { children: _jsx(TableHead, { children: "Fields" }) }) }), _jsx(TableBody, { children: fields.map((field) => (_jsx(TableRow, { "data-testid": `field-${field}`, className: `font-semibold font-mono ${selectedState === field ? 'bg-indigo-900/50 hover:bg-indigo-900/30' : ''}`, onClick: () => handleStateClick(field), children: _jsx(TableCell, { children: field }) }, field))) })] }) })] }));
21
+ };
@@ -1,10 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import { type VariantProps } from 'class-variance-authority';
3
3
  declare const badgeVariants: (props?: ({
4
- variant?: "default" | "destructive" | "outline" | "secondary" | "error" | "info" | "warning" | null | undefined;
4
+ variant?: "default" | "destructive" | "outline" | "secondary" | "info" | "error" | "warning" | "red-rounded" | null | undefined;
5
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
6
  export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
7
7
  }
8
- declare function Badge({ className, variant, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
9
- export { Badge, badgeVariants };
10
- //# sourceMappingURL=badge.d.ts.map
8
+ export declare function Badge({ className, variant, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -1,15 +1,16 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { cva } from 'class-variance-authority';
3
3
  import { cn } from '@/lib/utils';
4
- const badgeVariants = cva('inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2', {
4
+ const badgeVariants = cva('inline-flex items-center rounded-lg border px-2 py-1 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2', {
5
5
  variants: {
6
6
  variant: {
7
7
  default: 'border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80',
8
8
  secondary: 'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80',
9
- info: 'border-transparent bg-sky-500 text-black hover:bg-sky/80',
9
+ info: 'border-transparent bg-[#47B2FF33] text-[#47B2FF] hover:bg-sky/80',
10
10
  error: 'border-transparent bg-rose-500 text-black shadow hover:bg-rose/80',
11
11
  warning: 'border-transparent bg-amber-300 text-amber-950 hover:bg-amber/80',
12
12
  destructive: 'border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80',
13
+ 'red-rounded': 'border-transparent bg-red-500 text-red-950 hover:bg-red/80 rounded-full',
13
14
  outline: 'text-foreground',
14
15
  },
15
16
  },
@@ -17,7 +18,6 @@ const badgeVariants = cva('inline-flex items-center rounded-md border px-2.5 py-
17
18
  variant: 'default',
18
19
  },
19
20
  });
20
- function Badge({ className, variant, ...props }) {
21
+ export function Badge({ className, variant, ...props }) {
21
22
  return _jsx("div", { className: cn(badgeVariants({ variant }), className), ...props });
22
23
  }
23
- export { Badge, badgeVariants };
@@ -7,6 +7,5 @@ declare const buttonVariants: (props?: ({
7
7
  export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
8
8
  asChild?: boolean;
9
9
  }
10
- declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
11
- export { Button, buttonVariants };
12
- //# sourceMappingURL=button.d.ts.map
10
+ export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
11
+ export {};
@@ -3,7 +3,7 @@ import * as React from 'react';
3
3
  import { Slot } from '@radix-ui/react-slot';
4
4
  import { cva } from 'class-variance-authority';
5
5
  import { cn } from '@/lib/utils';
6
- const buttonVariants = cva('inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', {
6
+ const buttonVariants = cva('inline-flex items-center cursor-pointer justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', {
7
7
  variants: {
8
8
  variant: {
9
9
  default: 'bg-primary text-primary-foreground shadow hover:bg-primary/90',
@@ -26,9 +26,8 @@ const buttonVariants = cva('inline-flex items-center justify-center gap-2 whites
26
26
  size: 'default',
27
27
  },
28
28
  });
29
- const Button = React.forwardRef(({ className, variant, size, asChild = false, ...props }, ref) => {
29
+ export const Button = React.forwardRef(({ className, variant, size, asChild = false, ...props }, ref) => {
30
30
  const Comp = asChild ? Slot : 'button';
31
31
  return _jsx(Comp, { className: cn(buttonVariants({ variant, size, className })), ref: ref, ...props });
32
32
  });
33
33
  Button.displayName = 'Button';
34
- export { Button, buttonVariants };
@@ -1,6 +1,5 @@
1
- import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
1
+ import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
2
2
  declare const Collapsible: import("react").ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleProps & import("react").RefAttributes<HTMLDivElement>>;
3
3
  declare const CollapsibleTrigger: import("react").ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
4
4
  declare const CollapsibleContent: import("react").ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleContentProps & import("react").RefAttributes<HTMLDivElement>>;
5
5
  export { Collapsible, CollapsibleTrigger, CollapsibleContent };
6
- //# sourceMappingURL=collapsible.d.ts.map
@@ -1,4 +1,4 @@
1
- import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
1
+ import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
2
2
  const Collapsible = CollapsiblePrimitive.Root;
3
3
  const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;
4
4
  const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;
@@ -1,5 +1,5 @@
1
- import * as React from "react";
2
- import * as DialogPrimitive from "@radix-ui/react-dialog";
1
+ import * as React from 'react';
2
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
3
3
  declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
4
4
  declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
5
  declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
@@ -17,4 +17,3 @@ declare const DialogFooter: {
17
17
  declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
18
18
  declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
19
19
  export { Dialog, DialogPortal, DialogOverlay, DialogTrigger, DialogClose, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
20
- //# sourceMappingURL=dialog.d.ts.map
@@ -1,22 +1,22 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import * as React from "react";
3
- import * as DialogPrimitive from "@radix-ui/react-dialog";
4
- import { X } from "lucide-react";
5
- import { cn } from "@/lib/utils";
2
+ import * as React from 'react';
3
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
4
+ import { X } from 'lucide-react';
5
+ import { cn } from '@/lib/utils';
6
6
  const Dialog = DialogPrimitive.Root;
7
7
  const DialogTrigger = DialogPrimitive.Trigger;
8
8
  const DialogPortal = DialogPrimitive.Portal;
9
9
  const DialogClose = DialogPrimitive.Close;
10
- const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Overlay, { ref: ref, className: cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className), ...props })));
10
+ const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Overlay, { ref: ref, className: cn('fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0', className), ...props })));
11
11
  DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
12
- const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { ref: ref, className: cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", className), ...props, children: [children, _jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [_jsx(X, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "Close" })] })] })] })));
12
+ const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { ref: ref, className: cn('fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg', className), ...props, children: [children, _jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [_jsx(X, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "Close" })] })] })] })));
13
13
  DialogContent.displayName = DialogPrimitive.Content.displayName;
14
- const DialogHeader = ({ className, ...props }) => (_jsx("div", { className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className), ...props }));
15
- DialogHeader.displayName = "DialogHeader";
16
- const DialogFooter = ({ className, ...props }) => (_jsx("div", { className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className), ...props }));
17
- DialogFooter.displayName = "DialogFooter";
18
- const DialogTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Title, { ref: ref, className: cn("text-lg font-semibold leading-none tracking-tight", className), ...props })));
14
+ const DialogHeader = ({ className, ...props }) => (_jsx("div", { className: cn('flex flex-col space-y-1.5 text-center sm:text-left', className), ...props }));
15
+ DialogHeader.displayName = 'DialogHeader';
16
+ const DialogFooter = ({ className, ...props }) => (_jsx("div", { className: cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className), ...props }));
17
+ DialogFooter.displayName = 'DialogFooter';
18
+ const DialogTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Title, { ref: ref, className: cn('text-lg font-semibold leading-none tracking-tight', className), ...props })));
19
19
  DialogTitle.displayName = DialogPrimitive.Title.displayName;
20
- const DialogDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Description, { ref: ref, className: cn("text-sm text-muted-foreground", className), ...props })));
20
+ const DialogDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Description, { ref: ref, className: cn('text-sm text-muted-foreground', className), ...props })));
21
21
  DialogDescription.displayName = DialogPrimitive.Description.displayName;
22
22
  export { Dialog, DialogPortal, DialogOverlay, DialogTrigger, DialogClose, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
@@ -0,0 +1,25 @@
1
+ import * as React from 'react';
2
+ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
3
+ declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
5
+ declare function DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
6
+ declare function DropdownMenuContent({ className, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
7
+ declare function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
8
+ declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
9
+ inset?: boolean;
10
+ variant?: 'default' | 'destructive';
11
+ }): import("react/jsx-runtime").JSX.Element;
12
+ declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>): import("react/jsx-runtime").JSX.Element;
13
+ declare function DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): import("react/jsx-runtime").JSX.Element;
14
+ declare function DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>): import("react/jsx-runtime").JSX.Element;
15
+ declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
16
+ inset?: boolean;
17
+ }): import("react/jsx-runtime").JSX.Element;
18
+ declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
19
+ declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>): import("react/jsx-runtime").JSX.Element;
20
+ declare function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>): import("react/jsx-runtime").JSX.Element;
21
+ declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
22
+ inset?: boolean;
23
+ }): import("react/jsx-runtime").JSX.Element;
24
+ declare function DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): import("react/jsx-runtime").JSX.Element;
25
+ export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };