@motiadev/workbench 0.0.6 → 0.0.7

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 (191) hide show
  1. package/dist/README.md +50 -0
  2. package/dist/index.d.ts +0 -1
  3. package/dist/middleware.d.ts +2 -2
  4. package/dist/middleware.js +10 -12
  5. package/dist/src/components/app-sidebar.d.ts +0 -1
  6. package/dist/src/components/app-sidebar.js +5 -6
  7. package/dist/src/components/log-console.d.ts +0 -1
  8. package/dist/src/components/log-level-badge.d.ts +0 -1
  9. package/dist/src/components/ui/badge.d.ts +1 -2
  10. package/dist/src/components/ui/button.d.ts +1 -2
  11. package/dist/src/components/ui/collapsible.d.ts +0 -1
  12. package/dist/src/components/ui/dialog.d.ts +0 -1
  13. package/dist/src/components/ui/input.d.ts +0 -1
  14. package/dist/src/components/ui/label.d.ts +0 -1
  15. package/dist/src/components/ui/select.d.ts +0 -1
  16. package/dist/src/components/ui/separator.d.ts +0 -1
  17. package/dist/src/components/ui/sheet.d.ts +1 -2
  18. package/dist/src/components/ui/sidebar.d.ts +0 -1
  19. package/dist/src/components/ui/skeleton.d.ts +0 -1
  20. package/dist/src/components/ui/switch.d.ts +0 -1
  21. package/dist/src/components/ui/table.d.ts +0 -1
  22. package/dist/src/components/ui/textarea.d.ts +0 -1
  23. package/dist/src/components/ui/tooltip.d.ts +0 -1
  24. package/dist/src/hooks/use-list-flows.d.ts +0 -1
  25. package/dist/src/hooks/use-log-listener.d.ts +0 -1
  26. package/dist/src/hooks/use-mobile.d.ts +0 -1
  27. package/dist/src/lib/utils.d.ts +0 -1
  28. package/dist/src/main.d.ts +0 -8
  29. package/dist/src/main.js +6 -7
  30. package/dist/src/publicComponents/api-node.d.ts +0 -1
  31. package/dist/src/publicComponents/base-handle.d.ts +0 -1
  32. package/dist/src/publicComponents/base-node.d.ts +0 -1
  33. package/dist/src/publicComponents/emits.d.ts +0 -1
  34. package/dist/src/publicComponents/event-node.d.ts +0 -1
  35. package/dist/src/publicComponents/node-props.d.ts +0 -1
  36. package/dist/src/publicComponents/noop-node.d.ts +0 -1
  37. package/dist/src/publicComponents/subscribe.d.ts +0 -1
  38. package/dist/src/route-wrapper.d.ts +0 -1
  39. package/dist/src/routes/flow.d.ts +1 -0
  40. package/dist/src/routes/flow.js +16 -0
  41. package/dist/src/routes/index.d.ts +1 -2
  42. package/dist/src/routes/index.js +2 -6
  43. package/dist/src/stores/use-logs.d.ts +0 -1
  44. package/dist/src/views/flow/arrow-head.d.ts +0 -1
  45. package/dist/src/views/flow/base-edge.d.ts +0 -1
  46. package/dist/src/views/flow/flow-loader.d.ts +0 -1
  47. package/dist/src/views/flow/flow-view.d.ts +0 -1
  48. package/dist/src/views/flow/hooks/use-get-flow-state.d.ts +0 -1
  49. package/dist/src/views/flow/hooks/use-organize-nodes.d.ts +0 -1
  50. package/dist/src/views/flow/legend.d.ts +0 -1
  51. package/dist/src/views/flow/node-organizer.d.ts +0 -1
  52. package/dist/src/views/flow/nodes/api-flow-node.d.ts +0 -1
  53. package/dist/src/views/flow/nodes/event-flow-node.d.ts +0 -1
  54. package/dist/src/views/flow/nodes/json-schema-form.d.ts +0 -1
  55. package/dist/src/views/flow/nodes/language-indicator.d.ts +0 -1
  56. package/dist/src/views/flow/nodes/nodes.types.d.ts +0 -1
  57. package/dist/src/views/flow/nodes/noop-flow-node.d.ts +0 -1
  58. package/dist/tailwind.config.d.ts +0 -1
  59. package/dist/vite.config.d.ts +1 -10
  60. package/dist/vite.config.js +4 -5
  61. package/package.json +3 -3
  62. package/components.json +0 -21
  63. package/dist/index.d.ts.map +0 -1
  64. package/dist/middleware.d.ts.map +0 -1
  65. package/dist/src/components/app-sidebar.d.ts.map +0 -1
  66. package/dist/src/components/log-console.d.ts.map +0 -1
  67. package/dist/src/components/log-level-badge.d.ts.map +0 -1
  68. package/dist/src/components/ui/badge.d.ts.map +0 -1
  69. package/dist/src/components/ui/button.d.ts.map +0 -1
  70. package/dist/src/components/ui/collapsible.d.ts.map +0 -1
  71. package/dist/src/components/ui/dialog.d.ts.map +0 -1
  72. package/dist/src/components/ui/input.d.ts.map +0 -1
  73. package/dist/src/components/ui/label.d.ts.map +0 -1
  74. package/dist/src/components/ui/select.d.ts.map +0 -1
  75. package/dist/src/components/ui/separator.d.ts.map +0 -1
  76. package/dist/src/components/ui/sheet.d.ts.map +0 -1
  77. package/dist/src/components/ui/sidebar.d.ts.map +0 -1
  78. package/dist/src/components/ui/skeleton.d.ts.map +0 -1
  79. package/dist/src/components/ui/switch.d.ts.map +0 -1
  80. package/dist/src/components/ui/table.d.ts.map +0 -1
  81. package/dist/src/components/ui/textarea.d.ts.map +0 -1
  82. package/dist/src/components/ui/tooltip.d.ts.map +0 -1
  83. package/dist/src/hooks/use-list-flows.d.ts.map +0 -1
  84. package/dist/src/hooks/use-log-listener.d.ts.map +0 -1
  85. package/dist/src/hooks/use-mobile.d.ts.map +0 -1
  86. package/dist/src/lib/utils.d.ts.map +0 -1
  87. package/dist/src/main.d.ts.map +0 -1
  88. package/dist/src/publicComponents/api-node.d.ts.map +0 -1
  89. package/dist/src/publicComponents/base-handle.d.ts.map +0 -1
  90. package/dist/src/publicComponents/base-node.d.ts.map +0 -1
  91. package/dist/src/publicComponents/emits.d.ts.map +0 -1
  92. package/dist/src/publicComponents/event-node.d.ts.map +0 -1
  93. package/dist/src/publicComponents/node-props.d.ts.map +0 -1
  94. package/dist/src/publicComponents/noop-node.d.ts.map +0 -1
  95. package/dist/src/publicComponents/subscribe.d.ts.map +0 -1
  96. package/dist/src/route-wrapper.d.ts.map +0 -1
  97. package/dist/src/routeTree.gen.d.ts +0 -53
  98. package/dist/src/routeTree.gen.d.ts.map +0 -1
  99. package/dist/src/routeTree.gen.js +0 -45
  100. package/dist/src/routes/__root.d.ts +0 -2
  101. package/dist/src/routes/__root.d.ts.map +0 -1
  102. package/dist/src/routes/__root.js +0 -15
  103. package/dist/src/routes/flow/$id.d.ts +0 -4
  104. package/dist/src/routes/flow/$id.d.ts.map +0 -1
  105. package/dist/src/routes/flow/$id.js +0 -15
  106. package/dist/src/routes/index.d.ts.map +0 -1
  107. package/dist/src/stores/use-logs.d.ts.map +0 -1
  108. package/dist/src/views/flow/arrow-head.d.ts.map +0 -1
  109. package/dist/src/views/flow/base-edge.d.ts.map +0 -1
  110. package/dist/src/views/flow/flow-loader.d.ts.map +0 -1
  111. package/dist/src/views/flow/flow-view.d.ts.map +0 -1
  112. package/dist/src/views/flow/hooks/use-get-flow-state.d.ts.map +0 -1
  113. package/dist/src/views/flow/hooks/use-organize-nodes.d.ts.map +0 -1
  114. package/dist/src/views/flow/legend.d.ts.map +0 -1
  115. package/dist/src/views/flow/node-organizer.d.ts.map +0 -1
  116. package/dist/src/views/flow/nodes/api-flow-node.d.ts.map +0 -1
  117. package/dist/src/views/flow/nodes/event-flow-node.d.ts.map +0 -1
  118. package/dist/src/views/flow/nodes/json-schema-form.d.ts.map +0 -1
  119. package/dist/src/views/flow/nodes/language-indicator.d.ts.map +0 -1
  120. package/dist/src/views/flow/nodes/nodes.types.d.ts.map +0 -1
  121. package/dist/src/views/flow/nodes/noop-flow-node.d.ts.map +0 -1
  122. package/dist/tailwind.config.d.ts.map +0 -1
  123. package/dist/tsconfig.app.tsbuildinfo +0 -1
  124. package/dist/tsconfig.node.tsbuildinfo +0 -1
  125. package/dist/vite.config.d.ts.map +0 -1
  126. package/eslint.config.js +0 -28
  127. package/index.html +0 -19
  128. package/index.tsx +0 -10
  129. package/middleware.ts +0 -48
  130. package/postcss.config.js +0 -6
  131. package/src/assets/.empty +0 -0
  132. package/src/components/app-sidebar.tsx +0 -55
  133. package/src/components/log-console.tsx +0 -76
  134. package/src/components/log-level-badge.tsx +0 -12
  135. package/src/components/ui/badge.tsx +0 -31
  136. package/src/components/ui/button.tsx +0 -47
  137. package/src/components/ui/collapsible.tsx +0 -9
  138. package/src/components/ui/dialog.tsx +0 -120
  139. package/src/components/ui/input.tsx +0 -21
  140. package/src/components/ui/label.tsx +0 -26
  141. package/src/components/ui/select.tsx +0 -157
  142. package/src/components/ui/separator.tsx +0 -22
  143. package/src/components/ui/sheet.tsx +0 -106
  144. package/src/components/ui/sidebar.tsx +0 -637
  145. package/src/components/ui/skeleton.tsx +0 -7
  146. package/src/components/ui/switch.tsx +0 -27
  147. package/src/components/ui/table.tsx +0 -76
  148. package/src/components/ui/textarea.tsx +0 -22
  149. package/src/components/ui/tooltip.tsx +0 -32
  150. package/src/hooks/use-list-flows.tsx +0 -20
  151. package/src/hooks/use-log-listener.tsx +0 -32
  152. package/src/hooks/use-mobile.tsx +0 -19
  153. package/src/lib/utils.ts +0 -6
  154. package/src/main.tsx +0 -28
  155. package/src/publicComponents/api-node.tsx +0 -28
  156. package/src/publicComponents/base-handle.tsx +0 -43
  157. package/src/publicComponents/base-node.tsx +0 -57
  158. package/src/publicComponents/emits.tsx +0 -22
  159. package/src/publicComponents/event-node.tsx +0 -36
  160. package/src/publicComponents/node-props.tsx +0 -15
  161. package/src/publicComponents/noop-node.tsx +0 -21
  162. package/src/publicComponents/subscribe.tsx +0 -19
  163. package/src/route-wrapper.tsx +0 -9
  164. package/src/routeTree.gen.ts +0 -109
  165. package/src/routes/__root.tsx +0 -26
  166. package/src/routes/flow/$id.tsx +0 -21
  167. package/src/routes/index.tsx +0 -13
  168. package/src/stores/use-logs.ts +0 -22
  169. package/src/views/flow/arrow-head.tsx +0 -13
  170. package/src/views/flow/base-edge.tsx +0 -31
  171. package/src/views/flow/flow-loader.tsx +0 -3
  172. package/src/views/flow/flow-view.tsx +0 -72
  173. package/src/views/flow/hooks/use-get-flow-state.tsx +0 -93
  174. package/src/views/flow/hooks/use-organize-nodes.ts +0 -60
  175. package/src/views/flow/legend.tsx +0 -96
  176. package/src/views/flow/node-organizer.tsx +0 -70
  177. package/src/views/flow/nodes/api-flow-node.tsx +0 -6
  178. package/src/views/flow/nodes/event-flow-node.tsx +0 -6
  179. package/src/views/flow/nodes/json-schema-form.tsx +0 -110
  180. package/src/views/flow/nodes/language-indicator.tsx +0 -74
  181. package/src/views/flow/nodes/nodes.types.ts +0 -36
  182. package/src/views/flow/nodes/noop-flow-node.tsx +0 -6
  183. package/src/vite-env.d.ts +0 -1
  184. package/tailwind.config.ts +0 -75
  185. package/tsconfig.app.json +0 -32
  186. package/tsconfig.json +0 -14
  187. package/tsconfig.node.json +0 -32
  188. package/tsconfig.node.tsbuildinfo +0 -1
  189. package/vite.config.ts +0 -14
  190. /package/{public → dist/public}/.empty +0 -0
  191. /package/{src → dist/src}/index.css +0 -0
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/postcss.config.js DELETED
@@ -1,6 +0,0 @@
1
- module.exports = {
2
- plugins: {
3
- tailwindcss: {},
4
- autoprefixer: {},
5
- },
6
- }
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 }
@@ -1,120 +0,0 @@
1
- import * as React from "react"
2
- import * as DialogPrimitive from "@radix-ui/react-dialog"
3
- import { X } from "lucide-react"
4
-
5
- import { cn } from "@/lib/utils"
6
-
7
- const Dialog = DialogPrimitive.Root
8
-
9
- const DialogTrigger = DialogPrimitive.Trigger
10
-
11
- const DialogPortal = DialogPrimitive.Portal
12
-
13
- const DialogClose = DialogPrimitive.Close
14
-
15
- const DialogOverlay = React.forwardRef<
16
- React.ElementRef<typeof DialogPrimitive.Overlay>,
17
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
18
- >(({ className, ...props }, ref) => (
19
- <DialogPrimitive.Overlay
20
- ref={ref}
21
- className={cn(
22
- "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",
23
- className
24
- )}
25
- {...props}
26
- />
27
- ))
28
- DialogOverlay.displayName = DialogPrimitive.Overlay.displayName
29
-
30
- const DialogContent = React.forwardRef<
31
- React.ElementRef<typeof DialogPrimitive.Content>,
32
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
33
- >(({ className, children, ...props }, ref) => (
34
- <DialogPortal>
35
- <DialogOverlay />
36
- <DialogPrimitive.Content
37
- ref={ref}
38
- className={cn(
39
- "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",
40
- className
41
- )}
42
- {...props}
43
- >
44
- {children}
45
- <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">
46
- <X className="h-4 w-4" />
47
- <span className="sr-only">Close</span>
48
- </DialogPrimitive.Close>
49
- </DialogPrimitive.Content>
50
- </DialogPortal>
51
- ))
52
- DialogContent.displayName = DialogPrimitive.Content.displayName
53
-
54
- const DialogHeader = ({
55
- className,
56
- ...props
57
- }: React.HTMLAttributes<HTMLDivElement>) => (
58
- <div
59
- className={cn(
60
- "flex flex-col space-y-1.5 text-center sm:text-left",
61
- className
62
- )}
63
- {...props}
64
- />
65
- )
66
- DialogHeader.displayName = "DialogHeader"
67
-
68
- const DialogFooter = ({
69
- className,
70
- ...props
71
- }: React.HTMLAttributes<HTMLDivElement>) => (
72
- <div
73
- className={cn(
74
- "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
75
- className
76
- )}
77
- {...props}
78
- />
79
- )
80
- DialogFooter.displayName = "DialogFooter"
81
-
82
- const DialogTitle = React.forwardRef<
83
- React.ElementRef<typeof DialogPrimitive.Title>,
84
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
85
- >(({ className, ...props }, ref) => (
86
- <DialogPrimitive.Title
87
- ref={ref}
88
- className={cn(
89
- "text-lg font-semibold leading-none tracking-tight",
90
- className
91
- )}
92
- {...props}
93
- />
94
- ))
95
- DialogTitle.displayName = DialogPrimitive.Title.displayName
96
-
97
- const DialogDescription = React.forwardRef<
98
- React.ElementRef<typeof DialogPrimitive.Description>,
99
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
100
- >(({ className, ...props }, ref) => (
101
- <DialogPrimitive.Description
102
- ref={ref}
103
- className={cn("text-sm text-muted-foreground", className)}
104
- {...props}
105
- />
106
- ))
107
- DialogDescription.displayName = DialogPrimitive.Description.displayName
108
-
109
- export {
110
- Dialog,
111
- DialogPortal,
112
- DialogOverlay,
113
- DialogTrigger,
114
- DialogClose,
115
- DialogContent,
116
- DialogHeader,
117
- DialogFooter,
118
- DialogTitle,
119
- DialogDescription,
120
- }
@@ -1,21 +0,0 @@
1
- import * as React from 'react'
2
- import { cn } from '@/lib/utils'
3
-
4
- const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<'input'>>(
5
- ({ className, type, ...props }, ref) => {
6
- return (
7
- <input
8
- type={type}
9
- className={cn(
10
- 'flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',
11
- className,
12
- )}
13
- ref={ref}
14
- {...props}
15
- />
16
- )
17
- },
18
- )
19
- Input.displayName = 'Input'
20
-
21
- export { Input }
@@ -1,26 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as LabelPrimitive from "@radix-ui/react-label"
5
- import { cva, type VariantProps } from "class-variance-authority"
6
-
7
- import { cn } from "@/lib/utils"
8
-
9
- const labelVariants = cva(
10
- "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
11
- )
12
-
13
- const Label = React.forwardRef<
14
- React.ElementRef<typeof LabelPrimitive.Root>,
15
- React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
16
- VariantProps<typeof labelVariants>
17
- >(({ className, ...props }, ref) => (
18
- <LabelPrimitive.Root
19
- ref={ref}
20
- className={cn(labelVariants(), className)}
21
- {...props}
22
- />
23
- ))
24
- Label.displayName = LabelPrimitive.Root.displayName
25
-
26
- export { Label }
@@ -1,157 +0,0 @@
1
- import * as React from "react"
2
- import * as SelectPrimitive from "@radix-ui/react-select"
3
- import { Check, ChevronDown, ChevronUp } from "lucide-react"
4
-
5
- import { cn } from "@/lib/utils"
6
-
7
- const Select = SelectPrimitive.Root
8
-
9
- const SelectGroup = SelectPrimitive.Group
10
-
11
- const SelectValue = SelectPrimitive.Value
12
-
13
- const SelectTrigger = React.forwardRef<
14
- React.ElementRef<typeof SelectPrimitive.Trigger>,
15
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
16
- >(({ className, children, ...props }, ref) => (
17
- <SelectPrimitive.Trigger
18
- ref={ref}
19
- className={cn(
20
- "flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
21
- className
22
- )}
23
- {...props}
24
- >
25
- {children}
26
- <SelectPrimitive.Icon asChild>
27
- <ChevronDown className="h-4 w-4 opacity-50" />
28
- </SelectPrimitive.Icon>
29
- </SelectPrimitive.Trigger>
30
- ))
31
- SelectTrigger.displayName = SelectPrimitive.Trigger.displayName
32
-
33
- const SelectScrollUpButton = React.forwardRef<
34
- React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
35
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
36
- >(({ className, ...props }, ref) => (
37
- <SelectPrimitive.ScrollUpButton
38
- ref={ref}
39
- className={cn(
40
- "flex cursor-default items-center justify-center py-1",
41
- className
42
- )}
43
- {...props}
44
- >
45
- <ChevronUp className="h-4 w-4" />
46
- </SelectPrimitive.ScrollUpButton>
47
- ))
48
- SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName
49
-
50
- const SelectScrollDownButton = React.forwardRef<
51
- React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
52
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
53
- >(({ className, ...props }, ref) => (
54
- <SelectPrimitive.ScrollDownButton
55
- ref={ref}
56
- className={cn(
57
- "flex cursor-default items-center justify-center py-1",
58
- className
59
- )}
60
- {...props}
61
- >
62
- <ChevronDown className="h-4 w-4" />
63
- </SelectPrimitive.ScrollDownButton>
64
- ))
65
- SelectScrollDownButton.displayName =
66
- SelectPrimitive.ScrollDownButton.displayName
67
-
68
- const SelectContent = React.forwardRef<
69
- React.ElementRef<typeof SelectPrimitive.Content>,
70
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
71
- >(({ className, children, position = "popper", ...props }, ref) => (
72
- <SelectPrimitive.Portal>
73
- <SelectPrimitive.Content
74
- ref={ref}
75
- className={cn(
76
- "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
77
- position === "popper" &&
78
- "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
79
- className
80
- )}
81
- position={position}
82
- {...props}
83
- >
84
- <SelectScrollUpButton />
85
- <SelectPrimitive.Viewport
86
- className={cn(
87
- "p-1",
88
- position === "popper" &&
89
- "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
90
- )}
91
- >
92
- {children}
93
- </SelectPrimitive.Viewport>
94
- <SelectScrollDownButton />
95
- </SelectPrimitive.Content>
96
- </SelectPrimitive.Portal>
97
- ))
98
- SelectContent.displayName = SelectPrimitive.Content.displayName
99
-
100
- const SelectLabel = React.forwardRef<
101
- React.ElementRef<typeof SelectPrimitive.Label>,
102
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
103
- >(({ className, ...props }, ref) => (
104
- <SelectPrimitive.Label
105
- ref={ref}
106
- className={cn("px-2 py-1.5 text-sm font-semibold", className)}
107
- {...props}
108
- />
109
- ))
110
- SelectLabel.displayName = SelectPrimitive.Label.displayName
111
-
112
- const SelectItem = React.forwardRef<
113
- React.ElementRef<typeof SelectPrimitive.Item>,
114
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
115
- >(({ className, children, ...props }, ref) => (
116
- <SelectPrimitive.Item
117
- ref={ref}
118
- className={cn(
119
- "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
120
- className
121
- )}
122
- {...props}
123
- >
124
- <span className="absolute right-2 flex h-3.5 w-3.5 items-center justify-center">
125
- <SelectPrimitive.ItemIndicator>
126
- <Check className="h-4 w-4" />
127
- </SelectPrimitive.ItemIndicator>
128
- </span>
129
- <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
130
- </SelectPrimitive.Item>
131
- ))
132
- SelectItem.displayName = SelectPrimitive.Item.displayName
133
-
134
- const SelectSeparator = React.forwardRef<
135
- React.ElementRef<typeof SelectPrimitive.Separator>,
136
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
137
- >(({ className, ...props }, ref) => (
138
- <SelectPrimitive.Separator
139
- ref={ref}
140
- className={cn("-mx-1 my-1 h-px bg-muted", className)}
141
- {...props}
142
- />
143
- ))
144
- SelectSeparator.displayName = SelectPrimitive.Separator.displayName
145
-
146
- export {
147
- Select,
148
- SelectGroup,
149
- SelectValue,
150
- SelectTrigger,
151
- SelectContent,
152
- SelectLabel,
153
- SelectItem,
154
- SelectSeparator,
155
- SelectScrollUpButton,
156
- SelectScrollDownButton,
157
- }
@@ -1,22 +0,0 @@
1
- 'use client'
2
-
3
- import * as React from 'react'
4
- import * as SeparatorPrimitive from '@radix-ui/react-separator'
5
-
6
- import { cn } from '@/lib/utils'
7
-
8
- const Separator = React.forwardRef<
9
- React.ElementRef<typeof SeparatorPrimitive.Root>,
10
- React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
11
- >(({ className, orientation = 'horizontal', decorative = true, ...props }, ref) => (
12
- <SeparatorPrimitive.Root
13
- ref={ref}
14
- decorative={decorative}
15
- orientation={orientation}
16
- className={cn('shrink-0 bg-border', orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]', className)}
17
- {...props}
18
- />
19
- ))
20
- Separator.displayName = SeparatorPrimitive.Root.displayName
21
-
22
- export { Separator }