File tree Expand file tree Collapse file tree
canvas/nodetypes/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,7 +39,8 @@ export default function Dropdown({
3939 } , [ optionsArray , selectedValue ] )
4040
4141 const getSelectedLabel = ( ) => {
42- return selectedValue ? options [ selectedValue ] : placeholder
42+ if ( selectedValue !== undefined && selectedValue in options ) return options [ selectedValue ]
43+ return placeholder
4344 }
4445
4546 const toggleDropdown = useCallback ( ( ) => {
@@ -179,7 +180,7 @@ export default function Dropdown({
179180 < div
180181 onClick = { toggleDropdown }
181182 className = { clsx (
182- 'border-border bg-backdrop flex items-center justify-between rounded-md border px-3 py-2' ,
183+ 'border-border bg-backdrop flex items-center justify-between rounded-md border px-3 py-2 transition-colors ' ,
183184 disabled ? 'cursor-not-allowed' : 'cursor-pointer' ,
184185 isOpen ? 'bg-selected' : 'hover:bg-hover' ,
185186 ) }
Original file line number Diff line number Diff line change @@ -14,10 +14,8 @@ export default function SegmentedButton({
1414 return (
1515 < button
1616 className = { clsx (
17- 'text-foreground cursor-pointer px-3 py-1 text-sm' ,
18- isActive
19- ? 'bg-selected font-medium'
20- : 'text-foreground-muted hover:bg-hover active:bg-selected' ,
17+ 'text-foreground cursor-pointer px-3 py-1 text-sm transition-colors' ,
18+ isActive ? 'bg-selected font-medium' : 'text-foreground-muted hover:bg-hover active:bg-selected' ,
2119 className ,
2220 ) }
2321 { ...properties }
Original file line number Diff line number Diff line change @@ -177,12 +177,12 @@ export default function ConfigurationOverview() {
177177
178178 return (
179179 < div className = "bg-background flex h-full w-full flex-col p-6" >
180- < div className = "hover:bg-hover flex w-fit hover:cursor-pointer py-2 px-4 rounded " onClick = { ( ) => navigate ( '/' ) } >
180+ < div className = "hover:bg-hover flex w-fit rounded px-4 py-2 hover:cursor-pointer " onClick = { ( ) => navigate ( '/' ) } >
181181 < ArrowLeftIcon className = "h-6 w-auto fill-current hover:cursor-pointer" />
182182 < p > Switch configuration</ p >
183183 </ div >
184184
185- < h1 className = "ml-2 text-2xl font-bold mt-4 " > Configuration Overview</ h1 >
185+ < h1 className = "mt-4 ml-2 text-2xl font-bold" > Configuration Overview</ h1 >
186186 < div className = "mb-4 flex items-center justify-between" >
187187 < p className = "ml-2" >
188188 Configuration files within src/main/configurations/
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ type ITextModel = Monaco['editor']['ITextModel']
44type FindMatch = Monaco [ 'editor' ] [ 'FindMatch' ]
55type IModelDeltaDecoration = Monaco [ 'editor' ] [ 'IModelDeltaDecoration' ]
66type IEditorDecorationsCollection = Monaco [ 'editor' ] [ 'IEditorDecorationsCollection' ]
7- import clsx from 'clsx'
87import XsdFeatures from 'monaco-xsd-code-completion/esm/XsdFeatures'
98import 'monaco-xsd-code-completion/src/style.css'
109import XsdManager from 'monaco-xsd-code-completion/esm/XsdManager'
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ export default function HandleMenuItem({
1313} : Readonly < HandleMenuItemProperties > ) {
1414 return (
1515 < li
16- className = { `hover:bg-border border-border flex h-10 cursor-pointer items-center justify-between p-2 ${
16+ className = { `hover:bg-hover border-border flex h-10 cursor-pointer items-center justify-between p-2 transition-colors ${
1717 isLast ? '' : 'border-b'
1818 } `}
1919 onClick = { onClick }
Original file line number Diff line number Diff line change @@ -57,14 +57,16 @@ export default function HandleMenu({
5757 return createPortal (
5858 < div
5959 ref = { menuRef }
60- className = "nodrag bg-background border-border absolute border shadow-md"
60+ className = "nodrag bg-background border-border absolute rounded border shadow-md"
6161 style = { {
6262 left : `${ position . x + 10 } px` , // offset to the right of cursor
6363 top : `${ position . y - 5 } px` ,
6464 } }
6565 >
6666 < div className = "w-70" >
67- < div className = "border-border bg-muted h-10 border-b px-3 py-1 font-bold" > { title } </ div >
67+ < div className = "border-border text-foreground-muted flex h-10 items-center border-b px-3 py-1 text-xs font-semibold tracking-wide uppercase" >
68+ { title }
69+ </ div >
6870 < ul className = "w-full" >
6971 { handleTypes . map ( ( type , index ) => (
7072 < HandleMenuItem
Original file line number Diff line number Diff line change 1- // ContextInputField.tsx
21import React from 'react'
2+ import Dropdown from '~/components/inputs/dropdown'
33import Toggle from '~/components/inputs/toggle'
44import ValidatedInput from '~/components/inputs/validatedInput'
55import Input from '~/components/inputs/input'
@@ -24,20 +24,14 @@ export default function ContextInputField({
2424 // Render enum dropdown
2525 if ( enumOptions ) {
2626 return (
27- < select
27+ < Dropdown
2828 id = { id }
2929 value = { value }
30- onChange = { ( event ) => onChange ( event . currentTarget . value ) }
31- onKeyDown = { onKeyDown }
32- className = "border-border bg-background focus:border-border focus:ring-border mt-1 w-full rounded-md border px-3 py-2 shadow-sm sm:text-sm"
33- >
34- < option value = "" > Select option…</ option >
35- { Object . keys ( enumOptions ) . map ( ( optKey ) => (
36- < option key = { optKey } value = { optKey } >
37- { optKey }
38- </ option >
39- ) ) }
40- </ select >
30+ onChange = { onChange }
31+ options = { Object . fromEntries ( Object . keys ( enumOptions ) . map ( ( key ) => [ key , key ] ) ) }
32+ placeholder = "Select option…"
33+ className = "mt-1"
34+ />
4135 )
4236 }
4337
Original file line number Diff line number Diff line change 11import useFlowStore , { isFrankNode , isStickyNote } from '~/stores/flow-store'
22import { STICKY_NOTE_COLORS } from '~/routes/studio/canvas/nodetypes/sticky-note'
33import { useShallow } from 'zustand/react/shallow'
4+ import Dropdown from '~/components/inputs/dropdown'
45
56export default function StickyNoteContext ( { nodeId } : Readonly < { nodeId : string } > ) {
67 const node = useFlowStore ( ( flowState ) => flowState . nodes . find ( ( node ) => node . id === nodeId ) )
@@ -46,20 +47,14 @@ export default function StickyNoteContext({ nodeId }: Readonly<{ nodeId: string
4647
4748 < div className = "flex flex-col gap-1" >
4849 < label className = "text-foreground-muted text-xs font-semibold tracking-wide uppercase" > Attach to node</ label >
49- < select
50+ < Dropdown
5051 value = { attachedToNodeId ?? '' }
51- onChange = { ( changeEvent ) =>
52- useFlowStore . getState ( ) . setStickyAttachment ( nodeId , changeEvent . target . value || null )
53- }
54- className = "border-border bg-background text-foreground focus:ring-ring w-full rounded border px-3 py-2 text-sm focus:ring-1 focus:outline-none"
55- >
56- < option value = "" > None</ option >
57- { frankNodes . map ( ( node ) => (
58- < option key = { node . id } value = { node . id } >
59- { node . data . name }
60- </ option >
61- ) ) }
62- </ select >
52+ onChange = { ( value ) => useFlowStore . getState ( ) . setStickyAttachment ( nodeId , value || null ) }
53+ options = { {
54+ '' : 'None' ,
55+ ...Object . fromEntries ( frankNodes . map ( ( node ) => [ node . id , node . data . name ] ) ) ,
56+ } }
57+ />
6358 </ div >
6459 </ div >
6560 )
You can’t perform that action at this time.
0 commit comments