@motiadev/workbench 0.0.6 → 0.0.8

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 (192) hide show
  1. package/dist/README.md +50 -0
  2. package/dist/index.d.ts +0 -1
  3. package/{index.html → dist/index.html} +1 -1
  4. package/dist/middleware.d.ts +2 -2
  5. package/dist/middleware.js +10 -12
  6. package/dist/package.json +58 -0
  7. package/dist/src/components/app-sidebar.d.ts +0 -1
  8. package/dist/src/components/app-sidebar.js +5 -6
  9. package/dist/src/components/log-console.d.ts +0 -1
  10. package/dist/src/components/log-level-badge.d.ts +0 -1
  11. package/dist/src/components/ui/badge.d.ts +1 -2
  12. package/dist/src/components/ui/button.d.ts +1 -2
  13. package/dist/src/components/ui/collapsible.d.ts +0 -1
  14. package/dist/src/components/ui/dialog.d.ts +0 -1
  15. package/dist/src/components/ui/input.d.ts +0 -1
  16. package/dist/src/components/ui/label.d.ts +0 -1
  17. package/dist/src/components/ui/select.d.ts +0 -1
  18. package/dist/src/components/ui/separator.d.ts +0 -1
  19. package/dist/src/components/ui/sheet.d.ts +1 -2
  20. package/dist/src/components/ui/sidebar.d.ts +0 -1
  21. package/dist/src/components/ui/skeleton.d.ts +0 -1
  22. package/dist/src/components/ui/switch.d.ts +0 -1
  23. package/dist/src/components/ui/table.d.ts +0 -1
  24. package/dist/src/components/ui/textarea.d.ts +0 -1
  25. package/dist/src/components/ui/tooltip.d.ts +0 -1
  26. package/dist/src/hooks/use-list-flows.d.ts +0 -1
  27. package/dist/src/hooks/use-log-listener.d.ts +0 -1
  28. package/dist/src/hooks/use-mobile.d.ts +0 -1
  29. package/dist/src/lib/utils.d.ts +0 -1
  30. package/dist/src/main.d.ts +0 -8
  31. package/dist/src/main.js +6 -7
  32. package/dist/src/publicComponents/api-node.d.ts +0 -1
  33. package/dist/src/publicComponents/base-handle.d.ts +0 -1
  34. package/dist/src/publicComponents/base-node.d.ts +0 -1
  35. package/dist/src/publicComponents/emits.d.ts +0 -1
  36. package/dist/src/publicComponents/event-node.d.ts +0 -1
  37. package/dist/src/publicComponents/node-props.d.ts +0 -1
  38. package/dist/src/publicComponents/noop-node.d.ts +0 -1
  39. package/dist/src/publicComponents/subscribe.d.ts +0 -1
  40. package/dist/src/route-wrapper.d.ts +0 -1
  41. package/dist/src/routes/flow.d.ts +1 -0
  42. package/dist/src/routes/flow.js +16 -0
  43. package/dist/src/routes/index.d.ts +1 -2
  44. package/dist/src/routes/index.js +2 -6
  45. package/dist/src/stores/use-logs.d.ts +0 -1
  46. package/dist/src/views/flow/arrow-head.d.ts +0 -1
  47. package/dist/src/views/flow/base-edge.d.ts +0 -1
  48. package/dist/src/views/flow/flow-loader.d.ts +0 -1
  49. package/dist/src/views/flow/flow-view.d.ts +0 -1
  50. package/dist/src/views/flow/hooks/use-get-flow-state.d.ts +0 -1
  51. package/dist/src/views/flow/hooks/use-organize-nodes.d.ts +0 -1
  52. package/dist/src/views/flow/legend.d.ts +0 -1
  53. package/dist/src/views/flow/node-organizer.d.ts +0 -1
  54. package/dist/src/views/flow/nodes/api-flow-node.d.ts +0 -1
  55. package/dist/src/views/flow/nodes/event-flow-node.d.ts +0 -1
  56. package/dist/src/views/flow/nodes/json-schema-form.d.ts +0 -1
  57. package/dist/src/views/flow/nodes/language-indicator.d.ts +0 -1
  58. package/dist/src/views/flow/nodes/nodes.types.d.ts +0 -1
  59. package/dist/src/views/flow/nodes/noop-flow-node.d.ts +0 -1
  60. package/dist/tailwind.config.d.ts +0 -1
  61. package/dist/tsconfig.app.tsbuildinfo +1 -1
  62. package/dist/tsconfig.node.tsbuildinfo +1 -1
  63. package/dist/vite.config.d.ts +1 -10
  64. package/dist/vite.config.js +4 -5
  65. package/package.json +3 -3
  66. package/dist/index.d.ts.map +0 -1
  67. package/dist/middleware.d.ts.map +0 -1
  68. package/dist/src/components/app-sidebar.d.ts.map +0 -1
  69. package/dist/src/components/log-console.d.ts.map +0 -1
  70. package/dist/src/components/log-level-badge.d.ts.map +0 -1
  71. package/dist/src/components/ui/badge.d.ts.map +0 -1
  72. package/dist/src/components/ui/button.d.ts.map +0 -1
  73. package/dist/src/components/ui/collapsible.d.ts.map +0 -1
  74. package/dist/src/components/ui/dialog.d.ts.map +0 -1
  75. package/dist/src/components/ui/input.d.ts.map +0 -1
  76. package/dist/src/components/ui/label.d.ts.map +0 -1
  77. package/dist/src/components/ui/select.d.ts.map +0 -1
  78. package/dist/src/components/ui/separator.d.ts.map +0 -1
  79. package/dist/src/components/ui/sheet.d.ts.map +0 -1
  80. package/dist/src/components/ui/sidebar.d.ts.map +0 -1
  81. package/dist/src/components/ui/skeleton.d.ts.map +0 -1
  82. package/dist/src/components/ui/switch.d.ts.map +0 -1
  83. package/dist/src/components/ui/table.d.ts.map +0 -1
  84. package/dist/src/components/ui/textarea.d.ts.map +0 -1
  85. package/dist/src/components/ui/tooltip.d.ts.map +0 -1
  86. package/dist/src/hooks/use-list-flows.d.ts.map +0 -1
  87. package/dist/src/hooks/use-log-listener.d.ts.map +0 -1
  88. package/dist/src/hooks/use-mobile.d.ts.map +0 -1
  89. package/dist/src/lib/utils.d.ts.map +0 -1
  90. package/dist/src/main.d.ts.map +0 -1
  91. package/dist/src/publicComponents/api-node.d.ts.map +0 -1
  92. package/dist/src/publicComponents/base-handle.d.ts.map +0 -1
  93. package/dist/src/publicComponents/base-node.d.ts.map +0 -1
  94. package/dist/src/publicComponents/emits.d.ts.map +0 -1
  95. package/dist/src/publicComponents/event-node.d.ts.map +0 -1
  96. package/dist/src/publicComponents/node-props.d.ts.map +0 -1
  97. package/dist/src/publicComponents/noop-node.d.ts.map +0 -1
  98. package/dist/src/publicComponents/subscribe.d.ts.map +0 -1
  99. package/dist/src/route-wrapper.d.ts.map +0 -1
  100. package/dist/src/routeTree.gen.d.ts +0 -53
  101. package/dist/src/routeTree.gen.d.ts.map +0 -1
  102. package/dist/src/routeTree.gen.js +0 -45
  103. package/dist/src/routes/__root.d.ts +0 -2
  104. package/dist/src/routes/__root.d.ts.map +0 -1
  105. package/dist/src/routes/__root.js +0 -15
  106. package/dist/src/routes/flow/$id.d.ts +0 -4
  107. package/dist/src/routes/flow/$id.d.ts.map +0 -1
  108. package/dist/src/routes/flow/$id.js +0 -15
  109. package/dist/src/routes/index.d.ts.map +0 -1
  110. package/dist/src/stores/use-logs.d.ts.map +0 -1
  111. package/dist/src/views/flow/arrow-head.d.ts.map +0 -1
  112. package/dist/src/views/flow/base-edge.d.ts.map +0 -1
  113. package/dist/src/views/flow/flow-loader.d.ts.map +0 -1
  114. package/dist/src/views/flow/flow-view.d.ts.map +0 -1
  115. package/dist/src/views/flow/hooks/use-get-flow-state.d.ts.map +0 -1
  116. package/dist/src/views/flow/hooks/use-organize-nodes.d.ts.map +0 -1
  117. package/dist/src/views/flow/legend.d.ts.map +0 -1
  118. package/dist/src/views/flow/node-organizer.d.ts.map +0 -1
  119. package/dist/src/views/flow/nodes/api-flow-node.d.ts.map +0 -1
  120. package/dist/src/views/flow/nodes/event-flow-node.d.ts.map +0 -1
  121. package/dist/src/views/flow/nodes/json-schema-form.d.ts.map +0 -1
  122. package/dist/src/views/flow/nodes/language-indicator.d.ts.map +0 -1
  123. package/dist/src/views/flow/nodes/nodes.types.d.ts.map +0 -1
  124. package/dist/src/views/flow/nodes/noop-flow-node.d.ts.map +0 -1
  125. package/dist/tailwind.config.d.ts.map +0 -1
  126. package/dist/vite.config.d.ts.map +0 -1
  127. package/eslint.config.js +0 -28
  128. package/index.tsx +0 -10
  129. package/middleware.ts +0 -48
  130. package/src/assets/.empty +0 -0
  131. package/src/components/app-sidebar.tsx +0 -55
  132. package/src/components/log-console.tsx +0 -76
  133. package/src/components/log-level-badge.tsx +0 -12
  134. package/src/components/ui/badge.tsx +0 -31
  135. package/src/components/ui/button.tsx +0 -47
  136. package/src/components/ui/collapsible.tsx +0 -9
  137. package/src/components/ui/dialog.tsx +0 -120
  138. package/src/components/ui/input.tsx +0 -21
  139. package/src/components/ui/label.tsx +0 -26
  140. package/src/components/ui/select.tsx +0 -157
  141. package/src/components/ui/separator.tsx +0 -22
  142. package/src/components/ui/sheet.tsx +0 -106
  143. package/src/components/ui/sidebar.tsx +0 -637
  144. package/src/components/ui/skeleton.tsx +0 -7
  145. package/src/components/ui/switch.tsx +0 -27
  146. package/src/components/ui/table.tsx +0 -76
  147. package/src/components/ui/textarea.tsx +0 -22
  148. package/src/components/ui/tooltip.tsx +0 -32
  149. package/src/hooks/use-list-flows.tsx +0 -20
  150. package/src/hooks/use-log-listener.tsx +0 -32
  151. package/src/hooks/use-mobile.tsx +0 -19
  152. package/src/lib/utils.ts +0 -6
  153. package/src/main.tsx +0 -28
  154. package/src/publicComponents/api-node.tsx +0 -28
  155. package/src/publicComponents/base-handle.tsx +0 -43
  156. package/src/publicComponents/base-node.tsx +0 -57
  157. package/src/publicComponents/emits.tsx +0 -22
  158. package/src/publicComponents/event-node.tsx +0 -36
  159. package/src/publicComponents/node-props.tsx +0 -15
  160. package/src/publicComponents/noop-node.tsx +0 -21
  161. package/src/publicComponents/subscribe.tsx +0 -19
  162. package/src/route-wrapper.tsx +0 -9
  163. package/src/routeTree.gen.ts +0 -109
  164. package/src/routes/__root.tsx +0 -26
  165. package/src/routes/flow/$id.tsx +0 -21
  166. package/src/routes/index.tsx +0 -13
  167. package/src/stores/use-logs.ts +0 -22
  168. package/src/views/flow/arrow-head.tsx +0 -13
  169. package/src/views/flow/base-edge.tsx +0 -31
  170. package/src/views/flow/flow-loader.tsx +0 -3
  171. package/src/views/flow/flow-view.tsx +0 -72
  172. package/src/views/flow/hooks/use-get-flow-state.tsx +0 -93
  173. package/src/views/flow/hooks/use-organize-nodes.ts +0 -60
  174. package/src/views/flow/legend.tsx +0 -96
  175. package/src/views/flow/node-organizer.tsx +0 -70
  176. package/src/views/flow/nodes/api-flow-node.tsx +0 -6
  177. package/src/views/flow/nodes/event-flow-node.tsx +0 -6
  178. package/src/views/flow/nodes/json-schema-form.tsx +0 -110
  179. package/src/views/flow/nodes/language-indicator.tsx +0 -74
  180. package/src/views/flow/nodes/nodes.types.ts +0 -36
  181. package/src/views/flow/nodes/noop-flow-node.tsx +0 -6
  182. package/src/vite-env.d.ts +0 -1
  183. package/tailwind.config.ts +0 -75
  184. package/tsconfig.app.json +0 -32
  185. package/tsconfig.json +0 -14
  186. package/tsconfig.node.json +0 -32
  187. package/tsconfig.node.tsbuildinfo +0 -1
  188. package/vite.config.ts +0 -14
  189. /package/{components.json → dist/components.json} +0 -0
  190. /package/{postcss.config.js → dist/postcss.config.js} +0 -0
  191. /package/{public → dist/public}/.empty +0 -0
  192. /package/{src → dist/src}/index.css +0 -0
@@ -1,53 +0,0 @@
1
- import { Route as rootRoute } from './routes/__root';
2
- import { Route as IndexImport } from './routes/index';
3
- import { Route as FlowIdImport } from './routes/flow/$id';
4
- declare const IndexRoute: import("@tanstack/react-router").Route<import("@tanstack/react-router").RootRoute<undefined, {}, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, {}, undefined, unknown, unknown>, "/", "/", "/", "/", undefined, Record<never, string>, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, {}, undefined, unknown>;
5
- declare const FlowIdRoute: import("@tanstack/react-router").Route<import("@tanstack/react-router").RootRoute<undefined, {}, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, {}, undefined, unknown, unknown>, "/flow/$id", "/flow/$id", "/flow/$id", "/flow/$id", undefined, Record<"id", string>, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, {}, ({ params }: import("@tanstack/react-router").LoaderFnContext<import("@tanstack/react-router").RootRoute<undefined, {}, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, {}, undefined, unknown, unknown>, "/flow/$id", Record<"id", string>, {}, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext>) => Promise<{
6
- flow: any;
7
- }>, unknown>;
8
- declare module '@tanstack/react-router' {
9
- interface FileRoutesByPath {
10
- '/': {
11
- id: '/';
12
- path: '/';
13
- fullPath: '/';
14
- preLoaderRoute: typeof IndexImport;
15
- parentRoute: typeof rootRoute;
16
- };
17
- '/flow/$id': {
18
- id: '/flow/$id';
19
- path: '/flow/$id';
20
- fullPath: '/flow/$id';
21
- preLoaderRoute: typeof FlowIdImport;
22
- parentRoute: typeof rootRoute;
23
- };
24
- }
25
- }
26
- export interface FileRoutesByFullPath {
27
- '/': typeof IndexRoute;
28
- '/flow/$id': typeof FlowIdRoute;
29
- }
30
- export interface FileRoutesByTo {
31
- '/': typeof IndexRoute;
32
- '/flow/$id': typeof FlowIdRoute;
33
- }
34
- export interface FileRoutesById {
35
- __root__: typeof rootRoute;
36
- '/': typeof IndexRoute;
37
- '/flow/$id': typeof FlowIdRoute;
38
- }
39
- export interface FileRouteTypes {
40
- fileRoutesByFullPath: FileRoutesByFullPath;
41
- fullPaths: '/' | '/flow/$id';
42
- fileRoutesByTo: FileRoutesByTo;
43
- to: '/' | '/flow/$id';
44
- id: '__root__' | '/' | '/flow/$id';
45
- fileRoutesById: FileRoutesById;
46
- }
47
- export interface RootRouteChildren {
48
- IndexRoute: typeof IndexRoute;
49
- FlowIdRoute: typeof FlowIdRoute;
50
- }
51
- export declare const routeTree: import("@tanstack/react-router").RootRoute<undefined, {}, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, {}, undefined, RootRouteChildren, FileRouteTypes>;
52
- export {};
53
- //# sourceMappingURL=routeTree.gen.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"routeTree.gen.d.ts","sourceRoot":"","sources":["../../src/routeTree.gen.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAIzD,QAAA,MAAM,UAAU,mbAIP,CAAA;AAET,QAAA,MAAM,WAAW;;YAIR,CAAA;AAIT,OAAO,QAAQ,wBAAwB,CAAC;IACtC,UAAU,gBAAgB;QACxB,GAAG,EAAE;YACH,EAAE,EAAE,GAAG,CAAA;YACP,IAAI,EAAE,GAAG,CAAA;YACT,QAAQ,EAAE,GAAG,CAAA;YACb,cAAc,EAAE,OAAO,WAAW,CAAA;YAClC,WAAW,EAAE,OAAO,SAAS,CAAA;SAC9B,CAAA;QACD,WAAW,EAAE;YACX,EAAE,EAAE,WAAW,CAAA;YACf,IAAI,EAAE,WAAW,CAAA;YACjB,QAAQ,EAAE,WAAW,CAAA;YACrB,cAAc,EAAE,OAAO,YAAY,CAAA;YACnC,WAAW,EAAE,OAAO,SAAS,CAAA;SAC9B,CAAA;KACF;CACF;AAID,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,OAAO,UAAU,CAAA;IACtB,WAAW,EAAE,OAAO,WAAW,CAAA;CAChC;AAED,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,OAAO,UAAU,CAAA;IACtB,WAAW,EAAE,OAAO,WAAW,CAAA;CAChC;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,OAAO,SAAS,CAAA;IAC1B,GAAG,EAAE,OAAO,UAAU,CAAA;IACtB,WAAW,EAAE,OAAO,WAAW,CAAA;CAChC;AAED,MAAM,WAAW,cAAc;IAC7B,oBAAoB,EAAE,oBAAoB,CAAA;IAC1C,SAAS,EAAE,GAAG,GAAG,WAAW,CAAA;IAC5B,cAAc,EAAE,cAAc,CAAA;IAC9B,EAAE,EAAE,GAAG,GAAG,WAAW,CAAA;IACrB,EAAE,EAAE,UAAU,GAAG,GAAG,GAAG,WAAW,CAAA;IAClC,cAAc,EAAE,cAAc,CAAA;CAC/B;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,OAAO,UAAU,CAAA;IAC7B,WAAW,EAAE,OAAO,WAAW,CAAA;CAChC;AAOD,eAAO,MAAM,SAAS,uMAAgF,CAAA"}
@@ -1,45 +0,0 @@
1
- /* eslint-disable */
2
- // @ts-nocheck
3
- // noinspection JSUnusedGlobalSymbols
4
- // This file was automatically generated by TanStack Router.
5
- // You should NOT make any changes in this file as it will be overwritten.
6
- // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
7
- // Import Routes
8
- import { Route as rootRoute } from './routes/__root';
9
- import { Route as IndexImport } from './routes/index';
10
- import { Route as FlowIdImport } from './routes/flow/$id';
11
- // Create/Update Routes
12
- const IndexRoute = IndexImport.update({
13
- id: '/',
14
- path: '/',
15
- getParentRoute: () => rootRoute,
16
- });
17
- const FlowIdRoute = FlowIdImport.update({
18
- id: '/flow/$id',
19
- path: '/flow/$id',
20
- getParentRoute: () => rootRoute,
21
- });
22
- const rootRouteChildren = {
23
- IndexRoute: IndexRoute,
24
- FlowIdRoute: FlowIdRoute,
25
- };
26
- export const routeTree = rootRoute._addFileChildren(rootRouteChildren)._addFileTypes();
27
- /* ROUTE_MANIFEST_START
28
- {
29
- "routes": {
30
- "__root__": {
31
- "filePath": "__root.tsx",
32
- "children": [
33
- "/",
34
- "/flow/$id"
35
- ]
36
- },
37
- "/": {
38
- "filePath": "index.tsx"
39
- },
40
- "/flow/$id": {
41
- "filePath": "flow/$id.tsx"
42
- }
43
- }
44
- }
45
- ROUTE_MANIFEST_END */
@@ -1,2 +0,0 @@
1
- export declare const Route: import("@tanstack/react-router").RootRoute<undefined, {}, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, {}, undefined, unknown, unknown>;
2
- //# sourceMappingURL=__root.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"__root.d.ts","sourceRoot":"","sources":["../../../src/routes/__root.tsx"],"names":[],"mappings":"AAyBA,eAAO,MAAM,KAAK,sLAAiD,CAAA"}
@@ -1,15 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { RouteWrapper } from '@/route-wrapper';
3
- import { createRootRoute, Outlet } from '@tanstack/react-router';
4
- import React, { Suspense } from 'react';
5
- const TanStackRouterDevtools = process.env.NODE_ENV === 'production'
6
- ? () => null // Render nothing in production
7
- : React.lazy(() =>
8
- // Lazy load in development
9
- import('@tanstack/router-devtools').then((res) => ({
10
- default: res.TanStackRouterDevtools,
11
- // For Embedded Mode
12
- // default: res.TanStackRouterDevtoolsPanel
13
- })));
14
- const RouteComponent = () => (_jsxs(RouteWrapper, { children: [_jsx(Outlet, {}), _jsx(Suspense, { children: _jsx(TanStackRouterDevtools, {}) })] }));
15
- export const Route = createRootRoute({ component: RouteComponent });
@@ -1,4 +0,0 @@
1
- export declare const Route: import("@tanstack/react-router").Route<import("@tanstack/react-router").RootRoute<undefined, {}, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, {}, undefined, unknown, unknown>, "/flow/$id", "/flow/$id", "/flow/$id", "/flow/$id", undefined, Record<"id", string>, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, {}, ({ params }: import("@tanstack/react-router").LoaderFnContext<import("@tanstack/react-router").RootRoute<undefined, {}, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, {}, undefined, unknown, unknown>, "/flow/$id", Record<"id", string>, {}, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext, import("@tanstack/react-router").AnyContext>) => Promise<{
2
- flow: any;
3
- }>, unknown>;
4
- //# sourceMappingURL=$id.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"$id.d.ts","sourceRoot":"","sources":["../../../../src/routes/flow/$id.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK;;YAOhB,CAAA"}
@@ -1,15 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { FlowView } from '@/views/flow/flow-view';
3
- import { createFileRoute } from '@tanstack/react-router';
4
- export const Route = createFileRoute('/flow/$id')({
5
- component: Flow,
6
- loader: async ({ params }) => {
7
- return fetch(`/flows/${params.id}`)
8
- .then((res) => res.json())
9
- .then((flow) => ({ flow }));
10
- },
11
- });
12
- function Flow() {
13
- const { flow } = Route.useLoaderData();
14
- return (_jsx("div", { className: "w-screen h-screen", children: _jsx(FlowView, { flow: flow }) }));
15
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/routes/index.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,mbAEhB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-logs.d.ts","sourceRoot":"","sources":["../../../src/stores/use-logs.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAG,GAAG;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,GAAG,EAAE,CAAA;IACX,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAA;IAC1B,SAAS,EAAE,MAAM,IAAI,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,OAAO,wEAIjB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"arrow-head.d.ts","sourceRoot":"","sources":["../../../../src/views/flow/arrow-head.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,CAAA;IACb,EAAE,EAAE,MAAM,CAAA;CACX,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAKrC,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"base-edge.d.ts","sourceRoot":"","sources":["../../../../src/views/flow/base-edge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiC,SAAS,EAAqB,MAAM,eAAe,CAAA;AAC3F,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CA2BxC,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"flow-loader.d.ts","sourceRoot":"","sources":["../../../../src/views/flow/flow-loader.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,+CAEtB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"flow-view.d.ts","sourceRoot":"","sources":["../../../../src/views/flow/flow-view.tsx"],"names":[],"mappings":"AACA,OAAO,8BAA8B,CAAA;AAGrC,OAAO,EAAmB,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAY1E,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,YAAY,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAmDpC,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-get-flow-state.d.ts","sourceRoot":"","sources":["../../../../../src/views/flow/hooks/use-get-flow-state.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAgC,MAAM,eAAe,CAAA;AAExE,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAK9D,KAAK,IAAI,GAAG,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAErD,KAAK,QAAQ,GAAG;IACd,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAAA;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,YAAY,CAAC,EAAE,IAAI,EAAE,CAAA;IACrB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,QAAQ,EAAE,CAAA;IACjB,KAAK,EAAE,QAAQ,EAAE,CAAA;CAClB,CAAA;AAED,KAAK,QAAQ,GAAG;IACd,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,QAAQ,CAAA;CACf,CAAA;AAyCD,eAAO,MAAM,eAAe,SAAU,YAAY;;;;;;CAgBjD,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-organize-nodes.d.ts","sourceRoot":"","sources":["../../../../../src/views/flow/hooks/use-organize-nodes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAG1C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AA0C3E,eAAO,MAAM,gBAAgB,UACpB,IAAI,CAAC,aAAa,GAAG,WAAW,CAAC,EAAE,SACnC,IAAI,CAAC,QAAQ,CAAC,EAAE,YACb,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,GAAG,WAAW,CAAC,EAAE,KAAK,IAAI,SAW/D,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"legend.d.ts","sourceRoot":"","sources":["../../../../src/views/flow/legend.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,gBAAiB;IAAE,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;CAAE,4CA+F7E,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"node-organizer.d.ts","sourceRoot":"","sources":["../../../../src/views/flow/node-organizer.tsx"],"names":[],"mappings":"AA6CA,KAAK,KAAK,GAAG;IACX,aAAa,EAAE,MAAM,IAAI,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAoBzC,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"api-flow-node.d.ts","sourceRoot":"","sources":["../../../../../src/views/flow/nodes/api-flow-node.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,eAAO,MAAM,WAAW,aAAc;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,4CAE1D,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"event-flow-node.d.ts","sourceRoot":"","sources":["../../../../../src/views/flow/nodes/event-flow-node.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAA;AAErE,eAAO,MAAM,aAAa,aAAc,cAAc,4CAErD,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"json-schema-form.d.ts","sourceRoot":"","sources":["../../../../../src/views/flow/nodes/json-schema-form.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAOzC,UAAU,mBAAmB;IAC3B,MAAM,EAAE,WAAW,CAAA;IACnB,QAAQ,CAAC,EAAE,GAAG,CAAA;IACd,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAA;CAC/B;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA+FxD,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"language-indicator.d.ts","sourceRoot":"","sources":["../../../../../src/views/flow/nodes/language-indicator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAE7C,KAAK,KAAK,GAAG;IAAE,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,CAAA;CAAE,CAAA;AAEpD,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,KAAK,CAoEvC,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"nodes.types.d.ts","sourceRoot":"","sources":["../../../../../src/views/flow/nodes/nodes.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAEzC,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,KAAK,EAAE,KAAK,CAAC,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACvD,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,UAAU,EAAE,MAAM,EAAE,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,KAAK,CAAC,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACvD,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,WAAW,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG,aAAa,GAAG,WAAW,GAAG,YAAY,CAAA;AAGjE,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,OAAO,GAAG,SAAS,CAAA;CAC7B,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"noop-flow-node.d.ts","sourceRoot":"","sources":["../../../../../src/views/flow/nodes/noop-flow-node.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAE5C,eAAO,MAAM,YAAY,aAAc;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,4CAE5D,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"tailwind.config.d.ts","sourceRoot":"","sources":["../tailwind.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGpC,QAAA,MAAM,MAAM,EAAE,MAqEb,CAAA;AAED,eAAe,MAAM,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"vite.config.d.ts","sourceRoot":"","sources":["../vite.config.ts"],"names":[],"mappings":"AAKA,wCAAwC;;;;;;;;;AACxC,wBAOC"}
package/eslint.config.js DELETED
@@ -1,28 +0,0 @@
1
- import js from '@eslint/js'
2
- import globals from 'globals'
3
- import reactHooks from 'eslint-plugin-react-hooks'
4
- import reactRefresh from 'eslint-plugin-react-refresh'
5
- import tseslint from 'typescript-eslint'
6
-
7
- export default tseslint.config(
8
- { ignores: ['dist'] },
9
- {
10
- extends: [js.configs.recommended, ...tseslint.configs.recommended],
11
- files: ['**/*.{ts,tsx}'],
12
- languageOptions: {
13
- ecmaVersion: 2020,
14
- globals: globals.browser,
15
- },
16
- plugins: {
17
- 'react-hooks': reactHooks,
18
- 'react-refresh': reactRefresh,
19
- },
20
- rules: {
21
- ...reactHooks.configs.recommended.rules,
22
- 'react-refresh/only-export-components': [
23
- 'warn',
24
- { allowConstantExport: true },
25
- ],
26
- },
27
- },
28
- )
package/index.tsx DELETED
@@ -1,10 +0,0 @@
1
- export { EventNode } from './src/publicComponents/event-node'
2
- export { ApiNode } from './src/publicComponents/api-node'
3
- export { NoopNode } from './src/publicComponents/noop-node'
4
- export { BaseNode } from './src/publicComponents/base-node'
5
- export { BaseHandle } from './src/publicComponents/base-handle'
6
-
7
- export { Position } from '@xyflow/react'
8
- export type { EventNodeData, ApiNodeData } from './src/views/flow/nodes/nodes.types'
9
- export * from './src/publicComponents/node-props'
10
- export { Button } from './src/components/ui/button'
package/middleware.ts DELETED
@@ -1,48 +0,0 @@
1
- import tailwindcssConfig from './tailwind.config'
2
-
3
- export const applyMiddleware = async (app: any) => {
4
- // NOTE: this is needed since vite is an ESM https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated
5
- const fs = await import('fs')
6
- const path = await import('path')
7
- const { default: Express } = await import('express')
8
- const { createServer } = await import('vite')
9
- const { default: autoprefixer } = await import('autoprefixer')
10
- const { default: tailwindcss } = await import('tailwindcss')
11
-
12
- const vite = await createServer({
13
- appType: 'spa',
14
- root: __dirname,
15
-
16
- server: {
17
- middlewareMode: true,
18
- fs: {
19
- allow: [__dirname, path.join(process.cwd(), './steps')],
20
- },
21
- },
22
- resolve: {
23
- alias: { '@': path.resolve(__dirname, './src') },
24
- },
25
- css: {
26
- postcss: {
27
- plugins: [autoprefixer(), tailwindcss(tailwindcssConfig)],
28
- },
29
- },
30
- })
31
-
32
- app.use(vite.middlewares)
33
-
34
- app.use('*', async (req: typeof Express.request, res: typeof Express.response, next: any) => {
35
- const url = req.originalUrl
36
-
37
- console.log('[UI] Request', { url })
38
-
39
- try {
40
- const index = fs.readFileSync(path.resolve(__dirname, 'index.html'), 'utf-8')
41
- const html = await vite.transformIndexHtml(url, index)
42
-
43
- res.status(200).set({ 'Content-Type': 'text/html' }).end(html)
44
- } catch (e) {
45
- next(e)
46
- }
47
- })
48
- }
package/src/assets/.empty DELETED
File without changes
@@ -1,55 +0,0 @@
1
- import { useListFlows } from '@/hooks/use-list-flows'
2
- import {
3
- Sidebar,
4
- SidebarContent,
5
- SidebarFooter,
6
- SidebarGroup,
7
- SidebarGroupContent,
8
- SidebarGroupLabel,
9
- SidebarHeader,
10
- SidebarMenu,
11
- SidebarMenuButton,
12
- SidebarMenuItem,
13
- } from './ui/sidebar'
14
- import { Workflow } from 'lucide-react'
15
- import { Link, useMatchRoute } from '@tanstack/react-router'
16
-
17
- export const AppSidebar = () => {
18
- const { flows } = useListFlows()
19
- const matchRoute = useMatchRoute()
20
-
21
- const isActive = (flowId: string) => {
22
- return !!matchRoute({ to: '/flow/$id', params: { id: flowId } })
23
- }
24
-
25
- return (
26
- <Sidebar>
27
- <SidebarHeader />
28
- <SidebarContent>
29
- <SidebarGroup>
30
- <SidebarGroupLabel>Flows</SidebarGroupLabel>
31
- <SidebarGroupContent>
32
- <SidebarMenu>
33
- {flows.map((flow) => (
34
- <SidebarMenuItem key={flow.id}>
35
- <SidebarMenuButton asChild className="cursor-pointer" isActive={isActive(flow.id)}>
36
- <Link
37
- to="/flow/$id"
38
- params={{ id: flow.id }}
39
- className="flex items-center gap-2"
40
- data-testid={`flow-link-${flow.id}`}
41
- >
42
- <Workflow />
43
- <span>{flow.name}</span>
44
- </Link>
45
- </SidebarMenuButton>
46
- </SidebarMenuItem>
47
- ))}
48
- </SidebarMenu>
49
- </SidebarGroupContent>
50
- </SidebarGroup>
51
- </SidebarContent>
52
- <SidebarFooter />
53
- </Sidebar>
54
- )
55
- }
@@ -1,76 +0,0 @@
1
- import { Collapsible, CollapsibleContent } from '@/components/ui/collapsible'
2
- import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table'
3
- import { useLogs } from '@/stores/use-logs'
4
- import { motion } from 'framer-motion'
5
- import { ChevronDown, ChevronUp, Trash2 } from 'lucide-react'
6
- import { useState } from 'react'
7
- import { LogLevelBadge } from './log-level-badge'
8
- import { Button } from './ui/button'
9
-
10
- const timestamp = (time: number) => {
11
- const date = new Date(Number(time))
12
- return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`
13
- }
14
-
15
- export const LogConsole = () => {
16
- const [isExpanded, setIsExpanded] = useState(false)
17
- const logs = useLogs((state) => state.logs)
18
- const resetLogs = useLogs((state) => state.resetLogs)
19
- const toggleExpand = () => setIsExpanded((prev) => !prev)
20
-
21
- return (
22
- <div className="absolute bottom-0 left-0 right-0 w-full bg-black h-fit z-40">
23
- <div className="flex justify-between w-full items-center p-2">
24
- <label className="text-green-500 w-full text-left justify-start h-full text-lg font-bold">Logs</label>
25
- {logs.length > 0 && (
26
- <Button variant="link" onClick={resetLogs} className="text-green-500">
27
- <Trash2 className="w-4 h-4 text-green-500" />
28
- Clear logs
29
- </Button>
30
- )}
31
- <Button variant="link" onClick={toggleExpand} className="text-green-500">
32
- {isExpanded && <ChevronDown className="w-4 h-4 text-green-500" />}
33
- {!isExpanded && <ChevronUp className="w-4 h-4 text-green-500" />}
34
- </Button>
35
- </div>
36
- {isExpanded && <div className="divide-solid divide-green-500 divide-y" />}
37
- <Collapsible open={isExpanded} className={`w-full`}>
38
- <CollapsibleContent>
39
- <motion.div
40
- className="overflow-y-auto h-[25vh] flex flex-col gap-2 py-2"
41
- initial={{ height: 0 }}
42
- animate={{ height: '25vh' }}
43
- transition={{ duration: 0.3 }}
44
- >
45
- <Table>
46
- <TableHeader className="sticky top-0 bg-black">
47
- <TableRow>
48
- <TableHead>Time</TableHead>
49
- <TableHead>Level</TableHead>
50
- <TableHead>Trace</TableHead>
51
- <TableHead>Flow</TableHead>
52
- <TableHead>Message</TableHead>
53
- <TableHead>File</TableHead>
54
- </TableRow>
55
- </TableHeader>
56
- <TableBody className="text-md font-mono font-bold">
57
- {logs.map((log, index) => (
58
- <TableRow key={index}>
59
- <TableCell className="text-green-500">{timestamp(log.time)}</TableCell>
60
- <TableCell>
61
- <LogLevelBadge level={log.level} />
62
- </TableCell>
63
- <TableCell>{log.traceId.split('-').pop()}</TableCell>
64
- <TableCell>{log.flows?.join?.(', ')}</TableCell>
65
- <TableCell>{log.msg}</TableCell>
66
- <TableCell>{log.file}</TableCell>
67
- </TableRow>
68
- ))}
69
- </TableBody>
70
- </Table>
71
- </motion.div>
72
- </CollapsibleContent>
73
- </Collapsible>
74
- </div>
75
- )
76
- }
@@ -1,12 +0,0 @@
1
- import { Badge, BadgeProps } from './ui/badge'
2
-
3
- export const LogLevelBadge: React.FC<{ level: string }> = (props) => {
4
- const map: Record<string, BadgeProps['variant']> = {
5
- info: 'info',
6
- error: 'error',
7
- warn: 'warning',
8
- debug: 'info',
9
- }
10
-
11
- return <Badge variant={map[props.level] as BadgeProps['variant']}>{props.level}</Badge>
12
- }
@@ -1,31 +0,0 @@
1
- import * as React from 'react'
2
- import { cva, type VariantProps } from 'class-variance-authority'
3
- import { cn } from '@/lib/utils'
4
-
5
- const badgeVariants = cva(
6
- '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',
7
- {
8
- variants: {
9
- variant: {
10
- default: 'border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80',
11
- secondary: 'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80',
12
- info: 'border-transparent bg-sky-500 text-black hover:bg-sky/80',
13
- error: 'border-transparent bg-rose-500 text-black shadow hover:bg-rose/80',
14
- warning: 'border-transparent bg-amber-300 text-amber-950 hover:bg-amber/80',
15
- destructive: 'border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80',
16
- outline: 'text-foreground',
17
- },
18
- },
19
- defaultVariants: {
20
- variant: 'default',
21
- },
22
- },
23
- )
24
-
25
- export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {}
26
-
27
- function Badge({ className, variant, ...props }: BadgeProps) {
28
- return <div className={cn(badgeVariants({ variant }), className)} {...props} />
29
- }
30
-
31
- export { Badge, badgeVariants }
@@ -1,47 +0,0 @@
1
- import * as React from 'react'
2
- import { Slot } from '@radix-ui/react-slot'
3
- import { cva, type VariantProps } from 'class-variance-authority'
4
- import { cn } from '@/lib/utils'
5
-
6
- const buttonVariants = cva(
7
- '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',
8
- {
9
- variants: {
10
- variant: {
11
- default: 'bg-primary text-primary-foreground shadow hover:bg-primary/90',
12
- destructive: 'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',
13
- outline: 'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground',
14
- secondary: 'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',
15
- ghost: 'hover:bg-accent hover:text-accent-foreground',
16
- link: 'text-primary underline-offset-4 hover:underline',
17
- none: '',
18
- },
19
- size: {
20
- default: 'h-9 px-4 py-2',
21
- sm: 'h-8 rounded-md px-3 text-xs',
22
- lg: 'h-10 rounded-md px-8',
23
- icon: 'h-9 w-9',
24
- },
25
- },
26
- defaultVariants: {
27
- variant: 'default',
28
- size: 'default',
29
- },
30
- },
31
- )
32
-
33
- export interface ButtonProps
34
- extends React.ButtonHTMLAttributes<HTMLButtonElement>,
35
- VariantProps<typeof buttonVariants> {
36
- asChild?: boolean
37
- }
38
-
39
- const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
40
- ({ className, variant, size, asChild = false, ...props }, ref) => {
41
- const Comp = asChild ? Slot : 'button'
42
- return <Comp className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />
43
- },
44
- )
45
- Button.displayName = 'Button'
46
-
47
- export { Button, buttonVariants }
@@ -1,9 +0,0 @@
1
- import * as CollapsiblePrimitive from "@radix-ui/react-collapsible"
2
-
3
- const Collapsible = CollapsiblePrimitive.Root
4
-
5
- const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger
6
-
7
- const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent
8
-
9
- export { Collapsible, CollapsibleTrigger, CollapsibleContent }