diff --git a/app/client/packages/design-system/ads/src/List/List.stories.tsx b/app/client/packages/design-system/ads/src/List/List.stories.tsx
index 160b027f7d8..cd1acd256d6 100644
--- a/app/client/packages/design-system/ads/src/List/List.stories.tsx
+++ b/app/client/packages/design-system/ads/src/List/List.stories.tsx
@@ -1,5 +1,5 @@
import React from "react";
-import { List, ListItem, Icon } from "@appsmith/ads";
+import { List, ListItem, Icon, Button } from "@appsmith/ads";
import type { StoryObj } from "@storybook/react";
import type { ListItemProps, ListProps } from "@appsmith/ads";
@@ -79,15 +79,21 @@ const ListItemArgTypes = {
},
},
},
- endIcon: {
- control: "text",
- description: "The icon to display at the end of the list item",
+ rightControl: {
+ description: "The control to display at the end of the list item",
table: {
type: {
- summary: "string",
+ summary: "ReactNode",
},
},
},
+ rightControlVisibility: {
+ description:
+ "`always` type will show the right control always. `hover` type will show the right control only when the list item is hovered.",
+ control: "radio",
+ options: ["always", "hover"],
+ defaultValue: "always",
+ },
description: {
control: "text",
description: "Description text to be shown alongside the title",
@@ -140,11 +146,12 @@ const ListItemArgTypes = {
},
},
},
- onEndIconClick: {
- description: "callback for when the end icon is clicked",
+ customTitleComponent: {
+ description:
+ "A custom title component for the list item to use input component for name editing",
table: {
type: {
- summary: "() => void",
+ summary: "ReactNode",
},
},
},
@@ -163,7 +170,7 @@ ListItemLargeStory.args = {
description: "inline",
descriptionType: "inline",
size: "lg",
- endIcon: "add-more",
+ rightControl: ,
};
export const ListItemErrorStory = ListItemTemplate.bind({}) as StoryObj;
@@ -215,10 +222,12 @@ ListItemOverflowStory.args = {
title: "Action item 1 Action item 1 Action item 1 Action item 1",
};
-export const ListItemEndIconStory = ListItemTemplate.bind({}) as StoryObj;
-ListItemEndIconStory.storyName = "List item end icon";
-ListItemEndIconStory.argTypes = ListItemArgTypes;
-ListItemEndIconStory.args = {
+export const ListItemRightControlStory = ListItemTemplate.bind({}) as StoryObj;
+ListItemRightControlStory.storyName = "List item right control";
+ListItemRightControlStory.argTypes = ListItemArgTypes;
+ListItemRightControlStory.args = {
title: "Action item 1",
- endIcon: "add-more",
+ rightControl: (
+
+ ),
};
diff --git a/app/client/packages/design-system/ads/src/List/List.styles.tsx b/app/client/packages/design-system/ads/src/List/List.styles.tsx
index 65bde433973..38be7eb1fb1 100644
--- a/app/client/packages/design-system/ads/src/List/List.styles.tsx
+++ b/app/client/packages/design-system/ads/src/List/List.styles.tsx
@@ -36,14 +36,49 @@ export const StyledList = styled.div`
gap: var(--ads-v2-spaces-2);
`;
-export const Wrapper = styled.div`
+export const Wrapper = styled.div<{
+ rightControlVisibility?: "hover" | "always";
+}>`
display: flex;
width: 100%;
align-items: center;
- gap: var(--ads-v2-spaces-3);
cursor: pointer;
box-sizing: border-box;
position: relative;
+ border-radius: var(--ads-v2-border-radius);
+ min-height: 32px;
+
+ ${(props) =>
+ props.rightControlVisibility === "hover" &&
+ `
+ ${RightControlWrapper} { display: none; }
+ &:hover ${RightControlWrapper} { display: block; }`}
+
+ &:hover {
+ background-color: var(--ads-v2-colors-content-surface-hover-bg);
+ }
+
+ &:active {
+ background-color: var(--ads-v2-colors-content-surface-active-bg);
+ }
+
+ &[data-selected="true"] {
+ background-color: var(--ads-v2-colors-content-surface-active-bg);
+ }
+
+ /* disabled style */
+ &[data-disabled="true"] {
+ cursor: not-allowed;
+ opacity: var(--ads-v2-opacity-disabled);
+ background-color: var(--ads-v2-colors-content-surface-default-bg);
+ }
+
+ /* Focus styles */
+ &:focus-visible {
+ outline: var(--ads-v2-border-width-outline) solid
+ var(--ads-v2-color-outline);
+ outline-offset: var(--ads-v2-offset-outline);
+ }
`;
export const TooltipTextWrapper = styled.div`
@@ -56,13 +91,6 @@ export const ContentWrapper = styled.div`
gap: var(--ads-v2-spaces-3);
`;
-export const ContentTextWrapper = styled.div`
- display: flex;
- gap: var(--ads-v2-spaces-3);
- flex: 1;
- min-width: 0;
-`;
-
export const DescriptionWrapper = styled.div`
flex-direction: column;
min-width: 0;
@@ -79,14 +107,17 @@ export const InlineDescriptionWrapper = styled.div`
flex: 1;
`;
-export const EndIconWrapper = styled.div`
- position: absolute;
- right: var(--ads-v2-spaces-3);
+export const RightControlWrapper = styled.div`
+ height: 100%;
+
+ button {
+ height: 100% !important;
+ width: 32px;
+ }
`;
export const StyledListItem = styled.div<{
size: ListSizes;
- endIcon?: string;
isBlockDescription: boolean;
}>`
${Variables};
@@ -94,15 +125,14 @@ export const StyledListItem = styled.div<{
display: flex;
width: 100%;
align-items: center;
- border-radius: var(--ads-v2-border-radius);
- padding: var(--ads-v2-spaces-3);
box-sizing: border-box;
- // 40px is the offset to make it look like the end icon is part of this div
- ${(props) => !!props.endIcon && `padding: 8px 40px 8px 8px;`}}
+ padding: var(--ads-v2-spaces-2) var(--ads-v2-spaces-2) var(--ads-v2-spaces-2)
+ var(--ads-v2-spaces-3);
+ gap: var(--ads-v2-spaces-3);
+ overflow: hidden;
${({ size }) => Sizes[size]}
-
& .${ListItemTextOverflowClassName} {
overflow: hidden;
white-space: nowrap;
@@ -126,30 +156,6 @@ export const StyledListItem = styled.div<{
& .${ListItemIDescClassName} {
font-size: var(--listitem-idescription-font-size);
- }
-
- &:hover {
- background-color: var(--ads-v2-colors-content-surface-hover-bg);
- }
-
- &:active {
- background-color: var(--ads-v2-colors-content-surface-active-bg);
- }
-
- &[data-selected="true"] {
- background-color: var(--ads-v2-colors-content-surface-active-bg);
- }
-
- /* disabled style */
- &[data-disabled="true"] {
- cursor: not-allowed;
- opacity: var(--ads-v2-opacity-disabled);
- }
-
- /* Focus styles */
- &:focus-visible {
- outline: var(--ads-v2-border-width-outline) solid
- var(--ads-v2-color-outline);
- outline-offset: var(--ads-v2-offset-outline);
+ line-height: 16px;
}
`;
diff --git a/app/client/packages/design-system/ads/src/List/List.tsx b/app/client/packages/design-system/ads/src/List/List.tsx
index c4761a73972..8efbd293ce5 100644
--- a/app/client/packages/design-system/ads/src/List/List.tsx
+++ b/app/client/packages/design-system/ads/src/List/List.tsx
@@ -3,10 +3,9 @@ import clsx from "classnames";
import type { ListItemProps, ListProps } from "./List.types";
import {
- ContentTextWrapper,
DescriptionWrapper,
- EndIconWrapper,
InlineDescriptionWrapper,
+ RightControlWrapper,
StyledList,
StyledListItem,
TooltipTextWrapper,
@@ -14,7 +13,6 @@ import {
} from "./List.styles";
import type { TextProps } from "../Text";
import { Text } from "../Text";
-import { Button } from "../Button";
import { Tooltip } from "../Tooltip";
import {
ListClassName,
@@ -85,8 +83,9 @@ function ListItem(props: ListItemProps) {
const {
description,
descriptionType = "inline",
- endIcon,
hasError,
+ rightControl,
+ rightControlVisibility = "always",
size = "md",
startIcon,
title,
@@ -104,27 +103,6 @@ function ListItem(props: ListItemProps) {
}
};
- const endIconhandleKeyDown = (e: React.KeyboardEvent) => {
- e.stopPropagation();
-
- if (!props.isDisabled && props.onEndIconClick) {
- switch (e.key) {
- case "Enter":
- case " ":
- props.onEndIconClick();
- break;
- }
- }
- };
-
- const endIconOnClick = (e: React.MouseEvent) => {
- e.stopPropagation();
-
- if (!props.isDisabled && props.onEndIconClick) {
- props.onEndIconClick();
- }
- };
-
const handleOnClick = () => {
if (!props.isDisabled && props.onClick) {
props.onClick();
@@ -132,20 +110,24 @@ function ListItem(props: ListItemProps) {
};
return (
-
+
-
- {startIcon}
+ {startIcon}
+ {props.customTitleComponent ? (
+ props.customTitleComponent
+ ) : (
)}
-
+ )}
- {endIcon && (
-
-
-
+ {rightControl && (
+ {rightControl}
)}
);
diff --git a/app/client/packages/design-system/ads/src/List/List.types.tsx b/app/client/packages/design-system/ads/src/List/List.types.tsx
index d522b287e70..64c92247014 100644
--- a/app/client/packages/design-system/ads/src/List/List.types.tsx
+++ b/app/client/packages/design-system/ads/src/List/List.types.tsx
@@ -6,10 +6,10 @@ export type ListSizes = Extract;
export interface ListItemProps {
/** The icon to display before the list item title. */
startIcon?: ReactNode;
- /** The icon to display at the end. Pass name of the icon from remix-icon library(eg: home-2-line) or an svg icon. */
- endIcon?: string;
- /** callback for when the endIcon is clicked */
- onEndIconClick?: () => void;
+ /** The control to display at the end. */
+ rightControl?: ReactNode;
+ /** */
+ rightControlVisibility?: "hover" | "always";
/** callback for when the list item is clicked */
onClick: () => void;
/** Whether the list item is disabled. */
@@ -23,17 +23,19 @@ export interface ListItemProps {
/** The title/label of the list item */
title: string;
/** Description text to be shown alongside the title */
- description: string;
+ description?: string;
/** `inline` type will show the description beside the title. `block` type will show the description
* below the title.
*/
- descriptionType: "inline" | "block";
+ descriptionType?: "inline" | "block";
/** class names for the list item */
className?: string;
/** class names for the wrapper */
wrapperClassName?: string;
/** id for the list item */
id?: string;
+ /** customTitleComponent for the list item to use input component for name editing */
+ customTitleComponent?: ReactNode | ReactNode[];
}
export interface ListProps {
diff --git a/app/client/src/pages/Editor/Explorer/Actions/ActionEntity.tsx b/app/client/src/pages/Editor/Explorer/Actions/ActionEntity.tsx
index 69f2c1130d3..f4eae18d77e 100644
--- a/app/client/src/pages/Editor/Explorer/Actions/ActionEntity.tsx
+++ b/app/client/src/pages/Editor/Explorer/Actions/ActionEntity.tsx
@@ -1,6 +1,6 @@
import React, { memo, useCallback, useMemo } from "react";
import { useSelector } from "react-redux";
-import Entity, { EntityClassNames } from "../Entity";
+import { EntityClassNames } from "../Entity";
import ActionEntityContextMenu from "./ActionEntityContextMenu";
import history, { NavigationMethod } from "utils/history";
import {
@@ -21,17 +21,18 @@ import {
} from "ee/utils/BusinessFeatures/permissionPageHelpers";
import { useFeatureFlag } from "utils/hooks/useFeatureFlag";
import { FEATURE_FLAG } from "ee/entities/FeatureFlag";
-import { saveActionNameBasedOnParentEntity } from "ee/actions/helpers";
+// import { saveActionNameBasedOnParentEntity } from "ee/actions/helpers";
import type { ActionParentEntityTypeInterface } from "ee/entities/Engine/actionHelpers";
import { convertToBaseParentEntityIdSelector } from "selectors/pageListSelectors";
+import { ListItem } from "@appsmith/ads";
-const getUpdateActionNameReduxAction = (
- id: string,
- name: string,
- parentEntityType: ActionParentEntityTypeInterface,
-) => {
- return saveActionNameBasedOnParentEntity(id, name, parentEntityType);
-};
+// const getUpdateActionNameReduxAction = (
+// id: string,
+// name: string,
+// parentEntityType: ActionParentEntityTypeInterface,
+// ) => {
+// return saveActionNameBasedOnParentEntity(id, name, parentEntityType);
+// };
interface ExplorerActionEntityProps {
step: number;
@@ -109,21 +110,14 @@ export const ExplorerActionEntity = memo((props: ExplorerActionEntityProps) => {
);
return (
-
- getUpdateActionNameReduxAction(id, name, props.parentEntityType)
- }
+
);
});
diff --git a/app/client/src/pages/Editor/Explorer/ExplorerIcons.tsx b/app/client/src/pages/Editor/Explorer/ExplorerIcons.tsx
index fe87497930b..589a2667fcd 100644
--- a/app/client/src/pages/Editor/Explorer/ExplorerIcons.tsx
+++ b/app/client/src/pages/Editor/Explorer/ExplorerIcons.tsx
@@ -266,8 +266,8 @@ export { EntityIcon };
// fontSize is set to 56% by default.
export function ApiMethodIcon(
type: keyof typeof HTTP_METHOD,
- height = "18px",
- width = "36px",
+ height = "16px",
+ width = "34px",
fontSize = 52,
) {
return (