diff --git a/app/client/packages/design-system/ads/src/Icon/Icon.provider.tsx b/app/client/packages/design-system/ads/src/Icon/Icon.provider.tsx index 1bdf87646d..16f6de3db0 100644 --- a/app/client/packages/design-system/ads/src/Icon/Icon.provider.tsx +++ b/app/client/packages/design-system/ads/src/Icon/Icon.provider.tsx @@ -8,6 +8,9 @@ const AddMoreIcon = importRemixIcon( const AddMoreFillIcon = importRemixIcon( async () => import("remixicon-react/AddCircleFillIcon"), ); +const ArrowGoForwardLineIcon = importRemixIcon( + async () => import("remixicon-react/ArrowGoForwardLineIcon"), +); const ArrowGoBackLineIcon = importRemixIcon( async () => import("remixicon-react/ArrowGoBackLineIcon"), ); @@ -1178,6 +1181,7 @@ const ICON_LOOKUP = { "add-line": AddLineIcon, "add-more": AddMoreIcon, "add-more-fill": AddMoreFillIcon, + "arrow-go-forward": ArrowGoForwardLineIcon, "alert-fill": AlertFillIcon, "alert-line": AlertLineIcon, "align-center": AlignCenter, diff --git a/app/client/packages/design-system/widgets/src/components/Sidebar/src/Sidebar.tsx b/app/client/packages/design-system/widgets/src/components/Sidebar/src/Sidebar.tsx index f758522a82..353d1c1654 100644 --- a/app/client/packages/design-system/widgets/src/components/Sidebar/src/Sidebar.tsx +++ b/app/client/packages/design-system/widgets/src/components/Sidebar/src/Sidebar.tsx @@ -14,6 +14,7 @@ const _Sidebar = (props: SidebarProps, ref: Ref) => { children, className, collapsible = "offcanvas", + extraTitleButton, onEnter: onEnterProp, onEntered: onEnteredProp, onExit: onExitProp, @@ -47,7 +48,7 @@ const _Sidebar = (props: SidebarProps, ref: Ref) => { }; const content = ( - + {typeof children === "function" ? children({ isAnimating, state }) : children} diff --git a/app/client/packages/design-system/widgets/src/components/Sidebar/src/SidebarContent.tsx b/app/client/packages/design-system/widgets/src/components/Sidebar/src/SidebarContent.tsx index 9c88ff3cf8..e3e46dbe8d 100644 --- a/app/client/packages/design-system/widgets/src/components/Sidebar/src/SidebarContent.tsx +++ b/app/client/packages/design-system/widgets/src/components/Sidebar/src/SidebarContent.tsx @@ -1,5 +1,5 @@ import clsx from "clsx"; -import React, { type Ref } from "react"; +import React, { type ReactNode, type Ref } from "react"; import { Flex } from "../../Flex"; import { Text } from "../../Text"; @@ -9,6 +9,7 @@ import { useSidebar } from "./use-sidebar"; interface SidebarContentProps { title?: string; + extraTitleButton?: ReactNode; className?: string; children: React.ReactNode; } @@ -17,7 +18,7 @@ const _SidebarContent = ( props: SidebarContentProps, ref: Ref, ) => { - const { children, className, title, ...rest } = props; + const { children, className, extraTitleButton, title, ...rest } = props; const { isMobile, setState, state } = useSidebar(); return ( @@ -39,26 +40,29 @@ const _SidebarContent = ( className={styles.sidebarTitle} fontWeight={500} lineClamp={1} - textAlign="center" > {title} )} - {!isMobile && ( - + + + + + {generateVisualization.elements ? ( + + + + ) : ( + + )} + {generateVisualization.isLoading && } + + + ); +}; diff --git a/app/client/src/PluginActionEditor/components/PluginActionResponse/components/Visualization/components/EmptyVisualization.tsx b/app/client/src/PluginActionEditor/components/PluginActionResponse/components/Visualization/components/EmptyVisualization.tsx new file mode 100644 index 0000000000..a56b24a96b --- /dev/null +++ b/app/client/src/PluginActionEditor/components/PluginActionResponse/components/Visualization/components/EmptyVisualization.tsx @@ -0,0 +1,18 @@ +import { Flex, Text } from "@appsmith/ads"; +import NoVisualizationSVG from "assets/images/no-visualization.svg"; +import React from "react"; + +export const EmptyVisualization = () => { + return ( + + No visualization + The response visualization will be shown here + + ); +}; diff --git a/app/client/src/PluginActionEditor/components/PluginActionResponse/components/Visualization/components/LoadingOverlay.tsx b/app/client/src/PluginActionEditor/components/PluginActionResponse/components/Visualization/components/LoadingOverlay.tsx new file mode 100644 index 0000000000..f61aeeef22 --- /dev/null +++ b/app/client/src/PluginActionEditor/components/PluginActionResponse/components/Visualization/components/LoadingOverlay.tsx @@ -0,0 +1,22 @@ +import { Flex, Text } from "@appsmith/ads"; +import React from "react"; + +export const LoadingOverlay = () => { + return ( + + + Generating visualization... + + + ); +}; diff --git a/app/client/src/PluginActionEditor/components/PluginActionResponse/components/Visualization/components/PromptInput.tsx b/app/client/src/PluginActionEditor/components/PluginActionResponse/components/Visualization/components/PromptInput.tsx new file mode 100644 index 0000000000..d69dd29d75 --- /dev/null +++ b/app/client/src/PluginActionEditor/components/PluginActionResponse/components/Visualization/components/PromptInput.tsx @@ -0,0 +1,47 @@ +import { Button, Input } from "@appsmith/ads"; +import React from "react"; +import styled from "styled-components"; + +interface PromptInputProps { + value: string; + onChange: (value: string) => void; + onSubmit: () => void; + isLoading: boolean; + isDisabled: boolean; +} + +const PromptForm = styled.form` + display: flex; + flex: 1; + gap: var(--ads-v2-spaces-3); +`; + +export const PromptInput = (props: PromptInputProps) => { + const { isDisabled, isLoading, onChange, onSubmit, value } = props; + + return ( + { + e.preventDefault(); + onSubmit(); + }} + > + +