Make ML branding more inline & more prominent (#5815)
* Make changes to ML button * A snapshot a day keeps the bugs away! 📷🐛 * A snapshot a day keeps the bugs away! 📷🐛 * A snapshot a day keeps the bugs away! 📷🐛 --------- Co-authored-by: Zookeeper Lee <lee@zoo.dev> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 143 KiB After Width: | Height: | Size: 143 KiB |
Before Width: | Height: | Size: 126 KiB After Width: | Height: | Size: 126 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 69 KiB |
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
@ -206,9 +206,12 @@ export function Toolbar({
|
|||||||
id={maybeIconConfig[0].id + '-dropdown'}
|
id={maybeIconConfig[0].id + '-dropdown'}
|
||||||
name={maybeIconConfig[0].title}
|
name={maybeIconConfig[0].title}
|
||||||
className={
|
className={
|
||||||
|
(maybeIconConfig[0].alwaysDark
|
||||||
|
? 'dark bg-chalkboard-90 '
|
||||||
|
: '!bg-transparent ') +
|
||||||
'group/wrapper ' +
|
'group/wrapper ' +
|
||||||
buttonBorderClassName +
|
buttonBorderClassName +
|
||||||
' !bg-transparent relative group !gap-0'
|
' relative group !gap-0'
|
||||||
}
|
}
|
||||||
splitMenuItems={maybeIconConfig.map((itemConfig) => ({
|
splitMenuItems={maybeIconConfig.map((itemConfig) => ({
|
||||||
id: itemConfig.id,
|
id: itemConfig.id,
|
||||||
@ -234,6 +237,7 @@ export function Toolbar({
|
|||||||
data-testid={maybeIconConfig[0].id}
|
data-testid={maybeIconConfig[0].id}
|
||||||
iconStart={{
|
iconStart={{
|
||||||
icon: maybeIconConfig[0].icon,
|
icon: maybeIconConfig[0].icon,
|
||||||
|
iconColor: maybeIconConfig[0].iconColor,
|
||||||
className: iconClassName,
|
className: iconClassName,
|
||||||
bgClassName: bgClassName,
|
bgClassName: bgClassName,
|
||||||
}}
|
}}
|
||||||
@ -301,6 +305,7 @@ export function Toolbar({
|
|||||||
data-testid={itemConfig.id}
|
data-testid={itemConfig.id}
|
||||||
iconStart={{
|
iconStart={{
|
||||||
icon: itemConfig.icon,
|
icon: itemConfig.icon,
|
||||||
|
iconColor: itemConfig.iconColor,
|
||||||
className: iconClassName,
|
className: iconClassName,
|
||||||
bgClassName: bgClassName,
|
bgClassName: bgClassName,
|
||||||
}}
|
}}
|
||||||
@ -438,7 +443,11 @@ const ToolbarItemTooltipRichContent = ({
|
|||||||
<>
|
<>
|
||||||
<div className="rounded-top flex items-center gap-2 pt-3 pb-2 px-2 bg-chalkboard-20/50 dark:bg-chalkboard-80/50">
|
<div className="rounded-top flex items-center gap-2 pt-3 pb-2 px-2 bg-chalkboard-20/50 dark:bg-chalkboard-80/50">
|
||||||
{itemConfig.icon && (
|
{itemConfig.icon && (
|
||||||
<CustomIcon className="w-5 h-5" name={itemConfig.icon} />
|
<CustomIcon
|
||||||
|
className="w-5 h-5"
|
||||||
|
style={{ color: itemConfig.iconColor }}
|
||||||
|
name={itemConfig.icon}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
<span
|
<span
|
||||||
className={`text-sm flex-1 ${
|
className={`text-sm flex-1 ${
|
||||||
|
@ -15,6 +15,7 @@ const iconSizes = {
|
|||||||
|
|
||||||
export interface ActionIconProps extends React.PropsWithChildren {
|
export interface ActionIconProps extends React.PropsWithChildren {
|
||||||
icon?: SolidIconDefinition | BrandIconDefinition | CustomIconName
|
icon?: SolidIconDefinition | BrandIconDefinition | CustomIconName
|
||||||
|
iconColor?: string
|
||||||
className?: string
|
className?: string
|
||||||
bgClassName?: string
|
bgClassName?: string
|
||||||
iconClassName?: string
|
iconClassName?: string
|
||||||
@ -25,6 +26,7 @@ export interface ActionIconProps extends React.PropsWithChildren {
|
|||||||
export const ActionIcon = (props: ActionIconProps) => {
|
export const ActionIcon = (props: ActionIconProps) => {
|
||||||
const {
|
const {
|
||||||
icon = faCircleExclamation,
|
icon = faCircleExclamation,
|
||||||
|
iconColor,
|
||||||
className,
|
className,
|
||||||
bgClassName,
|
bgClassName,
|
||||||
iconClassName,
|
iconClassName,
|
||||||
@ -36,30 +38,32 @@ export const ActionIcon = (props: ActionIconProps) => {
|
|||||||
const computedBgClassName = `bg-chalkboard-20 dark:bg-chalkboard-80 group-disabled:bg-chalkboard-30 dark:group-disabled:bg-chalkboard-80 ${bgClassName}`
|
const computedBgClassName = `bg-chalkboard-20 dark:bg-chalkboard-80 group-disabled:bg-chalkboard-30 dark:group-disabled:bg-chalkboard-80 ${bgClassName}`
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<span style={{ color: iconColor }}>
|
||||||
data-testid={props['data-testid']}
|
<div
|
||||||
className={
|
data-testid={props['data-testid']}
|
||||||
`w-fit self-stretch inline-grid place-content-center ${className} ` +
|
className={
|
||||||
computedBgClassName
|
`w-fit self-stretch inline-grid place-content-center ${className} ` +
|
||||||
}
|
computedBgClassName
|
||||||
>
|
}
|
||||||
{children ? (
|
>
|
||||||
children
|
{children ? (
|
||||||
) : typeof icon === 'string' ? (
|
children
|
||||||
<CustomIcon
|
) : typeof icon === 'string' ? (
|
||||||
name={icon}
|
<CustomIcon
|
||||||
width={iconSizes[size]}
|
name={icon}
|
||||||
height={iconSizes[size]}
|
width={iconSizes[size]}
|
||||||
className={computedIconClassName}
|
height={iconSizes[size]}
|
||||||
/>
|
className={computedIconClassName}
|
||||||
) : (
|
/>
|
||||||
<FontAwesomeIcon
|
) : (
|
||||||
icon={icon}
|
<FontAwesomeIcon
|
||||||
width={iconSizes[size]}
|
icon={icon}
|
||||||
height={iconSizes[size]}
|
width={iconSizes[size]}
|
||||||
className={computedIconClassName}
|
height={iconSizes[size]}
|
||||||
/>
|
className={computedIconClassName}
|
||||||
)}
|
/>
|
||||||
</div>
|
)}
|
||||||
|
</div>
|
||||||
|
</span>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,8 @@ export type ToolbarItem = {
|
|||||||
id: string
|
id: string
|
||||||
onClick: (props: ToolbarItemCallbackProps) => void
|
onClick: (props: ToolbarItemCallbackProps) => void
|
||||||
icon?: CustomIconName
|
icon?: CustomIconName
|
||||||
|
iconColor?: string
|
||||||
|
alwaysDark?: true
|
||||||
status: 'available' | 'unavailable' | 'kcl-only'
|
status: 'available' | 'unavailable' | 'kcl-only'
|
||||||
disabled?: (state: StateFrom<typeof modelingMachine>) => boolean
|
disabled?: (state: StateFrom<typeof modelingMachine>) => boolean
|
||||||
disableHotkey?: (state: StateFrom<typeof modelingMachine>) => boolean
|
disableHotkey?: (state: StateFrom<typeof modelingMachine>) => boolean
|
||||||
@ -308,9 +310,11 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
|||||||
data: { name: 'Text-to-CAD', groupId: 'modeling' },
|
data: { name: 'Text-to-CAD', groupId: 'modeling' },
|
||||||
}),
|
}),
|
||||||
icon: 'sparkles',
|
icon: 'sparkles',
|
||||||
|
iconColor: '#29FFA4',
|
||||||
|
alwaysDark: true,
|
||||||
status: 'available',
|
status: 'available',
|
||||||
title: 'Create with AI',
|
title: 'Create with Zoo Text-to-CAD',
|
||||||
description: 'Generate geometry from a text prompt.',
|
description: 'Create geometry with AI / ML.',
|
||||||
links: [
|
links: [
|
||||||
{
|
{
|
||||||
label: 'API docs',
|
label: 'API docs',
|
||||||
@ -326,9 +330,11 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
|||||||
data: { name: 'Prompt-to-edit', groupId: 'modeling' },
|
data: { name: 'Prompt-to-edit', groupId: 'modeling' },
|
||||||
}),
|
}),
|
||||||
icon: 'sparkles',
|
icon: 'sparkles',
|
||||||
|
iconColor: '#29FFA4',
|
||||||
|
alwaysDark: true,
|
||||||
status: 'available',
|
status: 'available',
|
||||||
title: 'Edit with AI',
|
title: 'Modify with Zoo Text-to-CAD',
|
||||||
description: 'Edit geometry based on a text prompt.',
|
description: 'Edit geometry with AI / ML.',
|
||||||
links: [],
|
links: [],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|