forked from bbycroft/llm-viz
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
105 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from "react"; | ||
import { faPlus } from "@fortawesome/free-solid-svg-icons"; | ||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||
import { ToolbarButton } from "./toolbars/ToolbarBasics"; | ||
|
||
export const ComponentAdder: React.FC<{ | ||
}> = () => { | ||
|
||
return <> | ||
<ToolbarButton className="px-4"> | ||
<FontAwesomeIcon icon={faPlus} className="mr-2" /> | ||
Add Component | ||
</ToolbarButton> | ||
</>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
.guide-style code { | ||
padding: 2px 4px; | ||
margin: 0 1px; | ||
background-color: #f0f0f0; | ||
border-radius: 4px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Tooltip } from '@/src/utils/Tooltip'; | ||
import { IBaseEvent } from '@/src/utils/pointer'; | ||
import { IconProp } from '@fortawesome/fontawesome-svg-core'; | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
import clsx from 'clsx'; | ||
import React from 'react'; | ||
|
||
export const ToolbarDivider: React.FC<{ className?: string }> = ({ className }) => { | ||
return <div className={clsx(className, 'w-[1px] bg-slate-300 my-1 mx-2')} />; | ||
}; | ||
|
||
|
||
export const ToolbarButton: React.FC<{ | ||
className?: string, | ||
icon?: IconProp, | ||
text?: string, | ||
disabled?: boolean; | ||
notImpl?: boolean; | ||
tip?: React.ReactNode, | ||
children?: React.ReactNode, | ||
onClick?: (ev: IBaseEvent) => void, | ||
}> = ({ className, icon, text, disabled, notImpl, tip, children, onClick }) => { | ||
|
||
let btn = <button | ||
className={clsx(className, 'group self-stretch min-w-[3rem] flex items-center justify-center disabled:opacity-40 rounded-md my-1', !disabled && "hover:bg-blue-300 active:bg-blue-400", notImpl && "bg-red-100")} | ||
disabled={disabled} | ||
onClick={onClick} | ||
> | ||
{text} | ||
{icon && <FontAwesomeIcon icon={icon} className={clsx('text-gray-600 disabled:text-gray-300', text && 'ml-3')} />} | ||
{children} | ||
</button>; | ||
|
||
return tip ? <Tooltip tip={tip}>{btn}</Tooltip> : btn; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters