@foresthubai/workflow-builder 0.4.2 → 0.4.4

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 (123) hide show
  1. package/LICENSE +661 -661
  2. package/NOTICE +16 -16
  3. package/README.md +110 -110
  4. package/dist/components/ui/command.d.ts +2 -2
  5. package/dist/components/ui/input.d.ts +1 -1
  6. package/dist/components/ui/resizable.d.ts +1 -1
  7. package/dist/components/ui/textarea.d.ts +1 -1
  8. package/dist/graph/BaseNode.js +10 -10
  9. package/dist/graph/reactFlowRegistry.d.ts.map +1 -1
  10. package/dist/hooks/useWorkflowSerialization.d.ts.map +1 -1
  11. package/dist/hooks/useWorkflowSerialization.js +8 -11
  12. package/dist/hooks/useWorkflowSerialization.js.map +1 -1
  13. package/package.json +2 -2
  14. package/src/BuilderLayout.tsx +345 -345
  15. package/src/Canvas.tsx +261 -261
  16. package/src/CanvasEditor.tsx +142 -142
  17. package/src/CanvasTabsToolbar.tsx +176 -176
  18. package/src/RightConfigPanel.tsx +266 -266
  19. package/src/WorkflowBuilder.tsx +408 -408
  20. package/src/cn.ts +6 -6
  21. package/src/components/ui/add-button.tsx +39 -39
  22. package/src/components/ui/alert-dialog.tsx +141 -141
  23. package/src/components/ui/alert.tsx +59 -59
  24. package/src/components/ui/badge.tsx +36 -36
  25. package/src/components/ui/button.tsx +85 -85
  26. package/src/components/ui/card.tsx +79 -79
  27. package/src/components/ui/checkbox.tsx +28 -28
  28. package/src/components/ui/collapsible.tsx +9 -9
  29. package/src/components/ui/command.tsx +153 -153
  30. package/src/components/ui/delete-button.tsx +23 -23
  31. package/src/components/ui/dialog.tsx +125 -125
  32. package/src/components/ui/dropdown-menu.tsx +198 -198
  33. package/src/components/ui/input.tsx +55 -55
  34. package/src/components/ui/label.tsx +24 -24
  35. package/src/components/ui/readonly-banner.tsx +15 -15
  36. package/src/components/ui/resizable.tsx +43 -43
  37. package/src/components/ui/scroll-area.tsx +102 -102
  38. package/src/components/ui/select.tsx +160 -160
  39. package/src/components/ui/separator.tsx +29 -29
  40. package/src/components/ui/switch.tsx +27 -27
  41. package/src/components/ui/textarea.tsx +51 -51
  42. package/src/components/ui/toast.tsx +127 -127
  43. package/src/components/ui/toaster.tsx +33 -33
  44. package/src/components/ui/toggle-group.tsx +59 -59
  45. package/src/components/ui/toggle.tsx +43 -43
  46. package/src/components/ui/tooltip.tsx +32 -32
  47. package/src/dialogs/NodePickerDialog.tsx +84 -84
  48. package/src/dialogs/ValidationDialog.tsx +184 -184
  49. package/src/graph/BaseNode.tsx +557 -557
  50. package/src/graph/CustomEdge.tsx +185 -185
  51. package/src/graph/CustomNode.tsx +16 -16
  52. package/src/graph/FunctionCallNode.tsx +30 -30
  53. package/src/graph/PortHandle.tsx +189 -189
  54. package/src/graph/reactFlowRegistry.ts +26 -26
  55. package/src/hooks/use-toast.ts +125 -125
  56. package/src/hooks/useAvailableVariables.ts +20 -20
  57. package/src/hooks/useCanvasHistory.ts +22 -22
  58. package/src/hooks/useCanvasTabs.ts +168 -168
  59. package/src/hooks/useFunctionDiagnosticsSync.ts +40 -40
  60. package/src/hooks/useFunctionRegistry.ts +26 -26
  61. package/src/hooks/useFunctions.ts +44 -44
  62. package/src/hooks/useGraph.ts +161 -161
  63. package/src/hooks/useNodeDefinitions.ts +82 -82
  64. package/src/hooks/useParamErrors.ts +26 -26
  65. package/src/hooks/useResolvedTheme.ts +30 -30
  66. package/src/hooks/useResourceDiagnosticsSync.ts +58 -58
  67. package/src/hooks/useSuppressThemeTransition.ts +79 -79
  68. package/src/hooks/useWorkflowSerialization.ts +141 -144
  69. package/src/i18n/index.ts +53 -53
  70. package/src/i18n/locales/de.json +501 -501
  71. package/src/i18n/locales/en.json +557 -557
  72. package/src/index.ts +27 -27
  73. package/src/inputs/ExpressionInput.tsx +297 -297
  74. package/src/inputs/ParameterEditor.tsx +515 -515
  75. package/src/inputs/PortSection.tsx +144 -144
  76. package/src/panels/BuilderSidebar.tsx +301 -301
  77. package/src/panels/ChannelConfigPanel.tsx +49 -49
  78. package/src/panels/ChannelsPanel.tsx +28 -28
  79. package/src/panels/DebugConsolePanel.tsx +73 -73
  80. package/src/panels/DebugContextPanel.tsx +77 -77
  81. package/src/panels/DebugExternalIOPanel.tsx +180 -180
  82. package/src/panels/DiagnosticsPanel.tsx +170 -170
  83. package/src/panels/EdgeConfigPanel.tsx +104 -104
  84. package/src/panels/FunctionConfigPanel.tsx +179 -179
  85. package/src/panels/FunctionListPanel.tsx +45 -45
  86. package/src/panels/MemoryConfigPanel.tsx +55 -55
  87. package/src/panels/MemoryPanel.tsx +40 -40
  88. package/src/panels/ModelConfigPanel.tsx +41 -41
  89. package/src/panels/ModelsPanel.tsx +36 -36
  90. package/src/panels/NodeConfigPanel.tsx +630 -630
  91. package/src/panels/NodeLibrary.tsx +288 -288
  92. package/src/panels/ResourceConfigPanel.tsx +132 -132
  93. package/src/panels/ResourceListPanel.tsx +113 -113
  94. package/src/panels/VariableConfigPanel.tsx +161 -161
  95. package/src/panels/VariablesPanel.tsx +145 -145
  96. package/src/stores/canvasStore.test.ts +44 -44
  97. package/src/stores/canvasStore.ts +245 -245
  98. package/src/stores/debugStore.ts +74 -74
  99. package/src/stores/diagnosticsStore.ts +130 -130
  100. package/src/stores/editorStore.ts +190 -190
  101. package/src/styles/index.css +526 -526
  102. package/src/utils/categoryConstants.ts +26 -26
  103. package/src/utils/channelOperations.ts +86 -86
  104. package/src/utils/connectionRules.ts +137 -137
  105. package/src/utils/functionOperations.ts +179 -179
  106. package/src/utils/graphOperations.ts +550 -550
  107. package/src/utils/history.ts +207 -207
  108. package/src/utils/memoryOperations.ts +57 -57
  109. package/src/utils/migrateFunctionNodes.ts +107 -107
  110. package/src/utils/modelOperations.ts +55 -55
  111. package/src/utils/paramDisplay.ts +71 -71
  112. package/src/utils/resourceHelpers.ts +32 -32
  113. package/src/utils/translation.ts +28 -28
  114. package/src/utils/variableOperations.ts +75 -75
  115. package/tailwind-preset.ts +166 -166
  116. package/dist/lib/utils.d.ts +0 -3
  117. package/dist/lib/utils.d.ts.map +0 -1
  118. package/dist/lib/utils.js +0 -6
  119. package/dist/lib/utils.js.map +0 -1
  120. package/dist/toolbars/CanvasTabsToolbar.d.ts +0 -11
  121. package/dist/toolbars/CanvasTabsToolbar.d.ts.map +0 -1
  122. package/dist/toolbars/CanvasTabsToolbar.js +0 -101
  123. package/dist/toolbars/CanvasTabsToolbar.js.map +0 -1
@@ -1,198 +1,198 @@
1
- import * as React from "react"
2
- import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
3
- import { Check, ChevronRight, Circle } from "lucide-react"
4
-
5
- import { cn } from "../../cn"
6
-
7
- const DropdownMenu = DropdownMenuPrimitive.Root
8
-
9
- const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger
10
-
11
- const DropdownMenuGroup = DropdownMenuPrimitive.Group
12
-
13
- const DropdownMenuPortal = DropdownMenuPrimitive.Portal
14
-
15
- const DropdownMenuSub = DropdownMenuPrimitive.Sub
16
-
17
- const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup
18
-
19
- const DropdownMenuSubTrigger = React.forwardRef<
20
- React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
21
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
22
- inset?: boolean
23
- }
24
- >(({ className, inset, children, ...props }, ref) => (
25
- <DropdownMenuPrimitive.SubTrigger
26
- ref={ref}
27
- className={cn(
28
- "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
29
- inset && "pl-8",
30
- className
31
- )}
32
- {...props}
33
- >
34
- {children}
35
- <ChevronRight className="ml-auto h-4 w-4" />
36
- </DropdownMenuPrimitive.SubTrigger>
37
- ))
38
- DropdownMenuSubTrigger.displayName =
39
- DropdownMenuPrimitive.SubTrigger.displayName
40
-
41
- const DropdownMenuSubContent = React.forwardRef<
42
- React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
43
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
44
- >(({ className, ...props }, ref) => (
45
- <DropdownMenuPrimitive.SubContent
46
- ref={ref}
47
- className={cn(
48
- "fh-builder-portal font-sans z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",
49
- className
50
- )}
51
- {...props}
52
- />
53
- ))
54
- DropdownMenuSubContent.displayName =
55
- DropdownMenuPrimitive.SubContent.displayName
56
-
57
- const DropdownMenuContent = React.forwardRef<
58
- React.ElementRef<typeof DropdownMenuPrimitive.Content>,
59
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
60
- >(({ className, sideOffset = 4, ...props }, ref) => (
61
- <DropdownMenuPrimitive.Portal>
62
- <DropdownMenuPrimitive.Content
63
- ref={ref}
64
- sideOffset={sideOffset}
65
- className={cn(
66
- "fh-builder-portal font-sans z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 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",
67
- className
68
- )}
69
- {...props}
70
- />
71
- </DropdownMenuPrimitive.Portal>
72
- ))
73
- DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName
74
-
75
- const DropdownMenuItem = React.forwardRef<
76
- React.ElementRef<typeof DropdownMenuPrimitive.Item>,
77
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
78
- inset?: boolean
79
- }
80
- >(({ className, inset, ...props }, ref) => (
81
- <DropdownMenuPrimitive.Item
82
- ref={ref}
83
- className={cn(
84
- "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
85
- inset && "pl-8",
86
- className
87
- )}
88
- {...props}
89
- />
90
- ))
91
- DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName
92
-
93
- const DropdownMenuCheckboxItem = React.forwardRef<
94
- React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,
95
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>
96
- >(({ className, children, checked, ...props }, ref) => (
97
- <DropdownMenuPrimitive.CheckboxItem
98
- ref={ref}
99
- className={cn(
100
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
101
- className
102
- )}
103
- checked={checked}
104
- {...props}
105
- >
106
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
107
- <DropdownMenuPrimitive.ItemIndicator>
108
- <Check className="h-4 w-4" />
109
- </DropdownMenuPrimitive.ItemIndicator>
110
- </span>
111
- {children}
112
- </DropdownMenuPrimitive.CheckboxItem>
113
- ))
114
- DropdownMenuCheckboxItem.displayName =
115
- DropdownMenuPrimitive.CheckboxItem.displayName
116
-
117
- const DropdownMenuRadioItem = React.forwardRef<
118
- React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,
119
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>
120
- >(({ className, children, ...props }, ref) => (
121
- <DropdownMenuPrimitive.RadioItem
122
- ref={ref}
123
- className={cn(
124
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
125
- className
126
- )}
127
- {...props}
128
- >
129
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
130
- <DropdownMenuPrimitive.ItemIndicator>
131
- <Circle className="h-2 w-2 fill-current" />
132
- </DropdownMenuPrimitive.ItemIndicator>
133
- </span>
134
- {children}
135
- </DropdownMenuPrimitive.RadioItem>
136
- ))
137
- DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName
138
-
139
- const DropdownMenuLabel = React.forwardRef<
140
- React.ElementRef<typeof DropdownMenuPrimitive.Label>,
141
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
142
- inset?: boolean
143
- }
144
- >(({ className, inset, ...props }, ref) => (
145
- <DropdownMenuPrimitive.Label
146
- ref={ref}
147
- className={cn(
148
- "px-2 py-1.5 text-sm font-semibold",
149
- inset && "pl-8",
150
- className
151
- )}
152
- {...props}
153
- />
154
- ))
155
- DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName
156
-
157
- const DropdownMenuSeparator = React.forwardRef<
158
- React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
159
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
160
- >(({ className, ...props }, ref) => (
161
- <DropdownMenuPrimitive.Separator
162
- ref={ref}
163
- className={cn("-mx-1 my-1 h-px bg-muted", className)}
164
- {...props}
165
- />
166
- ))
167
- DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName
168
-
169
- const DropdownMenuShortcut = ({
170
- className,
171
- ...props
172
- }: React.HTMLAttributes<HTMLSpanElement>) => {
173
- return (
174
- <span
175
- className={cn("ml-auto text-xs tracking-widest opacity-60", className)}
176
- {...props}
177
- />
178
- )
179
- }
180
- DropdownMenuShortcut.displayName = "DropdownMenuShortcut"
181
-
182
- export {
183
- DropdownMenu,
184
- DropdownMenuTrigger,
185
- DropdownMenuContent,
186
- DropdownMenuItem,
187
- DropdownMenuCheckboxItem,
188
- DropdownMenuRadioItem,
189
- DropdownMenuLabel,
190
- DropdownMenuSeparator,
191
- DropdownMenuShortcut,
192
- DropdownMenuGroup,
193
- DropdownMenuPortal,
194
- DropdownMenuSub,
195
- DropdownMenuSubContent,
196
- DropdownMenuSubTrigger,
197
- DropdownMenuRadioGroup,
198
- }
1
+ import * as React from "react"
2
+ import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
3
+ import { Check, ChevronRight, Circle } from "lucide-react"
4
+
5
+ import { cn } from "../../cn"
6
+
7
+ const DropdownMenu = DropdownMenuPrimitive.Root
8
+
9
+ const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger
10
+
11
+ const DropdownMenuGroup = DropdownMenuPrimitive.Group
12
+
13
+ const DropdownMenuPortal = DropdownMenuPrimitive.Portal
14
+
15
+ const DropdownMenuSub = DropdownMenuPrimitive.Sub
16
+
17
+ const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup
18
+
19
+ const DropdownMenuSubTrigger = React.forwardRef<
20
+ React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
21
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
22
+ inset?: boolean
23
+ }
24
+ >(({ className, inset, children, ...props }, ref) => (
25
+ <DropdownMenuPrimitive.SubTrigger
26
+ ref={ref}
27
+ className={cn(
28
+ "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
29
+ inset && "pl-8",
30
+ className
31
+ )}
32
+ {...props}
33
+ >
34
+ {children}
35
+ <ChevronRight className="ml-auto h-4 w-4" />
36
+ </DropdownMenuPrimitive.SubTrigger>
37
+ ))
38
+ DropdownMenuSubTrigger.displayName =
39
+ DropdownMenuPrimitive.SubTrigger.displayName
40
+
41
+ const DropdownMenuSubContent = React.forwardRef<
42
+ React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
43
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
44
+ >(({ className, ...props }, ref) => (
45
+ <DropdownMenuPrimitive.SubContent
46
+ ref={ref}
47
+ className={cn(
48
+ "fh-builder-portal font-sans z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",
49
+ className
50
+ )}
51
+ {...props}
52
+ />
53
+ ))
54
+ DropdownMenuSubContent.displayName =
55
+ DropdownMenuPrimitive.SubContent.displayName
56
+
57
+ const DropdownMenuContent = React.forwardRef<
58
+ React.ElementRef<typeof DropdownMenuPrimitive.Content>,
59
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
60
+ >(({ className, sideOffset = 4, ...props }, ref) => (
61
+ <DropdownMenuPrimitive.Portal>
62
+ <DropdownMenuPrimitive.Content
63
+ ref={ref}
64
+ sideOffset={sideOffset}
65
+ className={cn(
66
+ "fh-builder-portal font-sans z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 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",
67
+ className
68
+ )}
69
+ {...props}
70
+ />
71
+ </DropdownMenuPrimitive.Portal>
72
+ ))
73
+ DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName
74
+
75
+ const DropdownMenuItem = React.forwardRef<
76
+ React.ElementRef<typeof DropdownMenuPrimitive.Item>,
77
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
78
+ inset?: boolean
79
+ }
80
+ >(({ className, inset, ...props }, ref) => (
81
+ <DropdownMenuPrimitive.Item
82
+ ref={ref}
83
+ className={cn(
84
+ "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
85
+ inset && "pl-8",
86
+ className
87
+ )}
88
+ {...props}
89
+ />
90
+ ))
91
+ DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName
92
+
93
+ const DropdownMenuCheckboxItem = React.forwardRef<
94
+ React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,
95
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>
96
+ >(({ className, children, checked, ...props }, ref) => (
97
+ <DropdownMenuPrimitive.CheckboxItem
98
+ ref={ref}
99
+ className={cn(
100
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
101
+ className
102
+ )}
103
+ checked={checked}
104
+ {...props}
105
+ >
106
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
107
+ <DropdownMenuPrimitive.ItemIndicator>
108
+ <Check className="h-4 w-4" />
109
+ </DropdownMenuPrimitive.ItemIndicator>
110
+ </span>
111
+ {children}
112
+ </DropdownMenuPrimitive.CheckboxItem>
113
+ ))
114
+ DropdownMenuCheckboxItem.displayName =
115
+ DropdownMenuPrimitive.CheckboxItem.displayName
116
+
117
+ const DropdownMenuRadioItem = React.forwardRef<
118
+ React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,
119
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>
120
+ >(({ className, children, ...props }, ref) => (
121
+ <DropdownMenuPrimitive.RadioItem
122
+ ref={ref}
123
+ className={cn(
124
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
125
+ className
126
+ )}
127
+ {...props}
128
+ >
129
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
130
+ <DropdownMenuPrimitive.ItemIndicator>
131
+ <Circle className="h-2 w-2 fill-current" />
132
+ </DropdownMenuPrimitive.ItemIndicator>
133
+ </span>
134
+ {children}
135
+ </DropdownMenuPrimitive.RadioItem>
136
+ ))
137
+ DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName
138
+
139
+ const DropdownMenuLabel = React.forwardRef<
140
+ React.ElementRef<typeof DropdownMenuPrimitive.Label>,
141
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
142
+ inset?: boolean
143
+ }
144
+ >(({ className, inset, ...props }, ref) => (
145
+ <DropdownMenuPrimitive.Label
146
+ ref={ref}
147
+ className={cn(
148
+ "px-2 py-1.5 text-sm font-semibold",
149
+ inset && "pl-8",
150
+ className
151
+ )}
152
+ {...props}
153
+ />
154
+ ))
155
+ DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName
156
+
157
+ const DropdownMenuSeparator = React.forwardRef<
158
+ React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
159
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
160
+ >(({ className, ...props }, ref) => (
161
+ <DropdownMenuPrimitive.Separator
162
+ ref={ref}
163
+ className={cn("-mx-1 my-1 h-px bg-muted", className)}
164
+ {...props}
165
+ />
166
+ ))
167
+ DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName
168
+
169
+ const DropdownMenuShortcut = ({
170
+ className,
171
+ ...props
172
+ }: React.HTMLAttributes<HTMLSpanElement>) => {
173
+ return (
174
+ <span
175
+ className={cn("ml-auto text-xs tracking-widest opacity-60", className)}
176
+ {...props}
177
+ />
178
+ )
179
+ }
180
+ DropdownMenuShortcut.displayName = "DropdownMenuShortcut"
181
+
182
+ export {
183
+ DropdownMenu,
184
+ DropdownMenuTrigger,
185
+ DropdownMenuContent,
186
+ DropdownMenuItem,
187
+ DropdownMenuCheckboxItem,
188
+ DropdownMenuRadioItem,
189
+ DropdownMenuLabel,
190
+ DropdownMenuSeparator,
191
+ DropdownMenuShortcut,
192
+ DropdownMenuGroup,
193
+ DropdownMenuPortal,
194
+ DropdownMenuSub,
195
+ DropdownMenuSubContent,
196
+ DropdownMenuSubTrigger,
197
+ DropdownMenuRadioGroup,
198
+ }
@@ -1,55 +1,55 @@
1
- import * as React from "react"
2
- import { cva, type VariantProps } from "class-variance-authority"
3
-
4
- import { cn } from "../../cn"
5
-
6
- const inputVariants = cva(
7
- "flex w-full bg-field border border-input rounded-2xl placeholder:text-muted-foreground/60 disabled:cursor-not-allowed disabled:opacity-50 aria-[invalid=true]:border-destructive file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground transition-all duration-300",
8
- {
9
- variants: {
10
- size: {
11
- sm: "h-9 px-3 py-1.5 text-sm",
12
- md: "h-10 px-4 py-2 text-sm",
13
- lg: "h-11 px-5 py-2.5 text-base",
14
- },
15
- variant: {
16
- default: "",
17
- subtle: "bg-muted/30 border-transparent backdrop-blur-md",
18
- ghost: "bg-transparent border-transparent hover:bg-card/40 hover:backdrop-blur-lg",
19
- },
20
- status: {
21
- none: "",
22
- success: "border-success focus:border-success focus:shadow-[0_0_0_3px_rgba(50,166,118,0.1)]",
23
- error: "border-destructive focus:border-destructive focus:shadow-[0_0_0_3px_rgba(220,38,38,0.1)]",
24
- },
25
- },
26
- defaultVariants: {
27
- size: "md",
28
- variant: "default",
29
- status: "none",
30
- },
31
- }
32
- )
33
-
34
- export interface InputProps
35
- extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'>,
36
- VariantProps<typeof inputVariants> {
37
- htmlSize?: number
38
- }
39
-
40
- const Input = React.forwardRef<HTMLInputElement, InputProps>(
41
- ({ className, type, size, variant, status, htmlSize, ...props }, ref) => {
42
- return (
43
- <input
44
- type={type}
45
- size={htmlSize}
46
- className={cn(inputVariants({ size, variant, status }), className)}
47
- ref={ref}
48
- {...props}
49
- />
50
- )
51
- }
52
- )
53
- Input.displayName = "Input"
54
-
55
- export { Input, inputVariants }
1
+ import * as React from "react"
2
+ import { cva, type VariantProps } from "class-variance-authority"
3
+
4
+ import { cn } from "../../cn"
5
+
6
+ const inputVariants = cva(
7
+ "flex w-full bg-field border border-input rounded-2xl placeholder:text-muted-foreground/60 disabled:cursor-not-allowed disabled:opacity-50 aria-[invalid=true]:border-destructive file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground transition-all duration-300",
8
+ {
9
+ variants: {
10
+ size: {
11
+ sm: "h-9 px-3 py-1.5 text-sm",
12
+ md: "h-10 px-4 py-2 text-sm",
13
+ lg: "h-11 px-5 py-2.5 text-base",
14
+ },
15
+ variant: {
16
+ default: "",
17
+ subtle: "bg-muted/30 border-transparent backdrop-blur-md",
18
+ ghost: "bg-transparent border-transparent hover:bg-card/40 hover:backdrop-blur-lg",
19
+ },
20
+ status: {
21
+ none: "",
22
+ success: "border-success focus:border-success focus:shadow-[0_0_0_3px_rgba(50,166,118,0.1)]",
23
+ error: "border-destructive focus:border-destructive focus:shadow-[0_0_0_3px_rgba(220,38,38,0.1)]",
24
+ },
25
+ },
26
+ defaultVariants: {
27
+ size: "md",
28
+ variant: "default",
29
+ status: "none",
30
+ },
31
+ }
32
+ )
33
+
34
+ export interface InputProps
35
+ extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'>,
36
+ VariantProps<typeof inputVariants> {
37
+ htmlSize?: number
38
+ }
39
+
40
+ const Input = React.forwardRef<HTMLInputElement, InputProps>(
41
+ ({ className, type, size, variant, status, htmlSize, ...props }, ref) => {
42
+ return (
43
+ <input
44
+ type={type}
45
+ size={htmlSize}
46
+ className={cn(inputVariants({ size, variant, status }), className)}
47
+ ref={ref}
48
+ {...props}
49
+ />
50
+ )
51
+ }
52
+ )
53
+ Input.displayName = "Input"
54
+
55
+ export { Input, inputVariants }
@@ -1,24 +1,24 @@
1
- import * as React from "react"
2
- import * as LabelPrimitive from "@radix-ui/react-label"
3
- import { cva, type VariantProps } from "class-variance-authority"
4
-
5
- import { cn } from "../../cn"
6
-
7
- const labelVariants = cva(
8
- "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
9
- )
10
-
11
- const Label = React.forwardRef<
12
- React.ElementRef<typeof LabelPrimitive.Root>,
13
- React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
14
- VariantProps<typeof labelVariants>
15
- >(({ className, ...props }, ref) => (
16
- <LabelPrimitive.Root
17
- ref={ref}
18
- className={cn(labelVariants(), className)}
19
- {...props}
20
- />
21
- ))
22
- Label.displayName = LabelPrimitive.Root.displayName
23
-
24
- export { Label }
1
+ import * as React from "react"
2
+ import * as LabelPrimitive from "@radix-ui/react-label"
3
+ import { cva, type VariantProps } from "class-variance-authority"
4
+
5
+ import { cn } from "../../cn"
6
+
7
+ const labelVariants = cva(
8
+ "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
9
+ )
10
+
11
+ const Label = React.forwardRef<
12
+ React.ElementRef<typeof LabelPrimitive.Root>,
13
+ React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
14
+ VariantProps<typeof labelVariants>
15
+ >(({ className, ...props }, ref) => (
16
+ <LabelPrimitive.Root
17
+ ref={ref}
18
+ className={cn(labelVariants(), className)}
19
+ {...props}
20
+ />
21
+ ))
22
+ Label.displayName = LabelPrimitive.Root.displayName
23
+
24
+ export { Label }
@@ -1,15 +1,15 @@
1
- import { useTranslation } from "react-i18next";
2
-
3
- /**
4
- * The "view only" notice shown at the top of every config panel when the builder
5
- * is in a read-only mode (preview/debug). Callers gate it with their own
6
- * `{readOnly && <ReadOnlyBanner />}` so the visibility logic stays local.
7
- */
8
- export function ReadOnlyBanner() {
9
- const { t } = useTranslation();
10
- return (
11
- <div className="text-xs font-medium text-muted-foreground bg-muted/50 rounded px-2 py-1">
12
- {t("preview.viewOnly")}
13
- </div>
14
- );
15
- }
1
+ import { useTranslation } from "react-i18next";
2
+
3
+ /**
4
+ * The "view only" notice shown at the top of every config panel when the builder
5
+ * is in a read-only mode (preview/debug). Callers gate it with their own
6
+ * `{readOnly && <ReadOnlyBanner />}` so the visibility logic stays local.
7
+ */
8
+ export function ReadOnlyBanner() {
9
+ const { t } = useTranslation();
10
+ return (
11
+ <div className="text-xs font-medium text-muted-foreground bg-muted/50 rounded px-2 py-1">
12
+ {t("preview.viewOnly")}
13
+ </div>
14
+ );
15
+ }