@@ -18,6 +18,8 @@ import { OnChange } from "./app";
18
18
import CountdownTimer from "./components/countdown" ;
19
19
import GooeySelect from "./components/GooeySelect" ;
20
20
import { lazyImport } from "./lazyImports" ;
21
+ import Tippy from "@tippyjs/react" ;
22
+ import GooeyPopover from "./components/GooeyPopover" ;
21
23
22
24
const { DataTable, DataTableRaw } = lazyImport ( ( ) => import ( "~/dataTable" ) ) ;
23
25
@@ -42,7 +44,7 @@ const Plot = lazyImport(
42
44
43
45
const CodeEditor = lazyImport ( ( ) => import ( "./components/CodeEditor" ) ) . default ;
44
46
45
- type TreeNode = {
47
+ export type TreeNode = {
46
48
name : string ;
47
49
props : Record < string , any > ;
48
50
children : Array < TreeNode > ;
@@ -355,27 +357,16 @@ function RenderedTreeNode({
355
357
}
356
358
}
357
359
case "gui-button" : {
358
- const { label, className , ...args } = props ;
360
+ const { label, ...args } = props ;
359
361
return (
360
- < button
361
- type = "button"
362
- className = { `btn btn-theme ${ className ?? "" } ` }
363
- { ...args }
364
- >
362
+ < button type = "button" { ...args } >
365
363
< RenderedMarkdown body = { label } />
366
364
</ button >
367
365
) ;
368
366
}
369
367
case "download-button" : {
370
- const { label, className, url, ...args } = props ;
371
- return (
372
- < DownloadButton
373
- label = { label }
374
- className = { className }
375
- url = { url }
376
- { ...args }
377
- />
378
- ) ;
368
+ const { label, url, ...args } = props ;
369
+ return < DownloadButton label = { label } url = { url } { ...args } /> ;
379
370
}
380
371
case "select" :
381
372
return < GooeySelect props = { props } onChange = { onChange } state = { state } /> ;
@@ -439,6 +430,18 @@ function RenderedTreeNode({
439
430
const { chart, ...args } = props ;
440
431
return < Plot { ...chart } style = { { width : "100%" } } /> ;
441
432
}
433
+ case "popover" : {
434
+ const { content, ...args } = props ;
435
+ return (
436
+ < GooeyPopover
437
+ content = { content }
438
+ children = { children }
439
+ onChange = { onChange }
440
+ state = { state }
441
+ { ...args }
442
+ />
443
+ ) ;
444
+ }
442
445
default :
443
446
return (
444
447
< div >
0 commit comments