Merge branch 'release' of https://github.com/appsmithorg/appsmith into release
This commit is contained in:
commit
d4ec738167
|
|
@ -14,6 +14,7 @@ import { ReactComponent as FlightIcon } from "assets/icons/ads/flight.svg";
|
||||||
|
|
||||||
import styled from "styled-components";
|
import styled from "styled-components";
|
||||||
import { Size } from "./Button";
|
import { Size } from "./Button";
|
||||||
|
import { CommonComponentProps } from "./common";
|
||||||
|
|
||||||
export const AppIconCollection = [
|
export const AppIconCollection = [
|
||||||
"bag",
|
"bag",
|
||||||
|
|
@ -80,7 +81,7 @@ const IconWrapper = styled.div<AppIconProps & { styledProps: cssAttributes }>`
|
||||||
background-color: ${props => props.color};
|
background-color: ${props => props.color};
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export type AppIconProps = {
|
export type AppIconProps = CommonComponentProps & {
|
||||||
size: Size;
|
size: Size;
|
||||||
color: string;
|
color: string;
|
||||||
name: AppIconName;
|
name: AppIconName;
|
||||||
|
|
@ -132,7 +133,11 @@ const AppIcon = (props: AppIconProps) => {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return returnIcon ? (
|
return returnIcon ? (
|
||||||
<IconWrapper {...props} styledProps={styledProps}>
|
<IconWrapper
|
||||||
|
data-cy={props.cypressSelector}
|
||||||
|
{...props}
|
||||||
|
styledProps={styledProps}
|
||||||
|
>
|
||||||
{returnIcon}
|
{returnIcon}
|
||||||
</IconWrapper>
|
</IconWrapper>
|
||||||
) : null;
|
) : null;
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ const Checkbox = (props: CheckboxProps) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledCheckbox disabled={props.disabled}>
|
<StyledCheckbox data-cy={props.cypressSelector} disabled={props.disabled}>
|
||||||
{props.label}
|
{props.label}
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ const ColorSelector = (props: ColorSelectorProps) => {
|
||||||
const [selected, setSelected] = useState<string>(appColorPalette[0]);
|
const [selected, setSelected] = useState<string>(appColorPalette[0]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Palette fill={props.fill}>
|
<Palette fill={props.fill} data-cy={props.cypressSelector}>
|
||||||
{props.colorPalette &&
|
{props.colorPalette &&
|
||||||
props.colorPalette.map((hex: string, index: number) => {
|
props.colorPalette.map((hex: string, index: number) => {
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,11 @@ export default function Dropdown(props: DropdownProps) {
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DropdownContainer tabIndex={0} onBlur={() => setIsOpen(false)}>
|
<DropdownContainer
|
||||||
|
tabIndex={0}
|
||||||
|
onBlur={() => setIsOpen(false)}
|
||||||
|
data-cy={props.cypressSelector}
|
||||||
|
>
|
||||||
<Selected
|
<Selected
|
||||||
isOpen={isOpen}
|
isOpen={isOpen}
|
||||||
disabled={props.disabled}
|
disabled={props.disabled}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import { EditableText as BlueprintEditableText } from "@blueprintjs/core";
|
||||||
import styled from "styled-components";
|
import styled from "styled-components";
|
||||||
import Text, { TextType } from "./Text";
|
import Text, { TextType } from "./Text";
|
||||||
import Spinner from "./Spinner";
|
import Spinner from "./Spinner";
|
||||||
import { hexToRgba, Classes } from "./common";
|
import { hexToRgba, Classes, CommonComponentProps } from "./common";
|
||||||
import { theme } from "constants/DefaultTheme";
|
import { theme } from "constants/DefaultTheme";
|
||||||
import { noop } from "lodash";
|
import { noop } from "lodash";
|
||||||
import Icon, { IconSize } from "./Icon";
|
import Icon, { IconSize } from "./Icon";
|
||||||
|
|
@ -24,7 +24,7 @@ export enum SavingState {
|
||||||
ERROR = "ERROR",
|
ERROR = "ERROR",
|
||||||
}
|
}
|
||||||
|
|
||||||
type EditableTextProps = {
|
type EditableTextProps = CommonComponentProps & {
|
||||||
defaultValue: string;
|
defaultValue: string;
|
||||||
onTextChanged: (value: string) => void;
|
onTextChanged: (value: string) => void;
|
||||||
placeholder: string;
|
placeholder: string;
|
||||||
|
|
@ -246,6 +246,7 @@ export const EditableText = (props: EditableTextProps) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<EditableTextWrapper
|
<EditableTextWrapper
|
||||||
|
data-cy={props.cypressSelector}
|
||||||
fill={props.fill}
|
fill={props.fill}
|
||||||
onMouseEnter={nonEditMode}
|
onMouseEnter={nonEditMode}
|
||||||
onDoubleClick={
|
onDoubleClick={
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ const IconSelector = (props: IconSelectorProps) => {
|
||||||
}, [props.selectedIcon]);
|
}, [props.selectedIcon]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<IconPalette fill={props.fill}>
|
<IconPalette fill={props.fill} data-cy={props.cypressSelector}>
|
||||||
{props.iconPalette &&
|
{props.iconPalette &&
|
||||||
props.iconPalette.map((iconName: AppIconName, index: number) => {
|
props.iconPalette.map((iconName: AppIconName, index: number) => {
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ const MenuOption = styled.div`
|
||||||
|
|
||||||
const Menu = (props: MenuProps) => {
|
const Menu = (props: MenuProps) => {
|
||||||
return (
|
return (
|
||||||
<Popover minimal position={props.position}>
|
<Popover minimal position={props.position} data-cy={props.cypressSelector}>
|
||||||
{props.target}
|
{props.target}
|
||||||
<MenuWrapper>
|
<MenuWrapper>
|
||||||
{props.children.map((el, index) => {
|
{props.children.map((el, index) => {
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,11 @@ const IconContainer = styled.div`
|
||||||
|
|
||||||
function MenuItem(props: MenuItemProps) {
|
function MenuItem(props: MenuItemProps) {
|
||||||
return (
|
return (
|
||||||
<ItemRow onClick={props.onSelect} disabled={props.disabled}>
|
<ItemRow
|
||||||
|
onClick={props.onSelect}
|
||||||
|
disabled={props.disabled}
|
||||||
|
data-cy={props.cypressSelector}
|
||||||
|
>
|
||||||
<IconContainer>
|
<IconContainer>
|
||||||
{props.icon ? <Icon name={props.icon} size={IconSize.LARGE} /> : null}
|
{props.icon ? <Icon name={props.icon} size={IconSize.LARGE} /> : null}
|
||||||
{props.text ? (
|
{props.text ? (
|
||||||
|
|
|
||||||
|
|
@ -127,6 +127,7 @@ export default function RadioComponent(props: RadioProps) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
|
data-cy={props.cypressSelector}
|
||||||
rows={props.rows}
|
rows={props.rows}
|
||||||
onChange={(e: any) => onChangeHandler(e.target.value)}
|
onChange={(e: any) => onChangeHandler(e.target.value)}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -115,6 +115,7 @@ const SearchInput = forwardRef(
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<InputWrapper
|
<InputWrapper
|
||||||
|
data-cy={props.cypressSelector}
|
||||||
value={searchValue}
|
value={searchValue}
|
||||||
isFocused={isFocused}
|
isFocused={isFocused}
|
||||||
variant={props.variant}
|
variant={props.variant}
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,7 @@ const TableDropdown = (props: DropdownProps) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Popover
|
<Popover
|
||||||
|
data-cy={props.cypressSelector}
|
||||||
usePortal={false}
|
usePortal={false}
|
||||||
position={props.position || Position.BOTTOM_LEFT}
|
position={props.position || Position.BOTTOM_LEFT}
|
||||||
isOpen={isDropdownOpen}
|
isOpen={isDropdownOpen}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import { Tab, Tabs, TabList, TabPanel } from "react-tabs";
|
||||||
import "react-tabs/style/react-tabs.css";
|
import "react-tabs/style/react-tabs.css";
|
||||||
import styled from "styled-components";
|
import styled from "styled-components";
|
||||||
import Icon, { IconName, IconSize } from "./Icon";
|
import Icon, { IconName, IconSize } from "./Icon";
|
||||||
import { Classes } from "./common";
|
import { Classes, CommonComponentProps } from "./common";
|
||||||
|
|
||||||
export type TabProp = {
|
export type TabProp = {
|
||||||
key: string;
|
key: string;
|
||||||
|
|
@ -105,7 +105,7 @@ const TabTitle = styled.span`
|
||||||
letter-spacing: ${props => props.theme.typography.h4.letterSpacing}px;
|
letter-spacing: ${props => props.theme.typography.h4.letterSpacing}px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
type TabbedViewComponentType = {
|
type TabbedViewComponentType = CommonComponentProps & {
|
||||||
tabs: Array<TabProp>;
|
tabs: Array<TabProp>;
|
||||||
selectedIndex?: number;
|
selectedIndex?: number;
|
||||||
onSelect?: Function;
|
onSelect?: Function;
|
||||||
|
|
@ -114,7 +114,10 @@ type TabbedViewComponentType = {
|
||||||
|
|
||||||
export const TabComponent = (props: TabbedViewComponentType) => {
|
export const TabComponent = (props: TabbedViewComponentType) => {
|
||||||
return (
|
return (
|
||||||
<TabsWrapper shouldOverflow={props.overflow}>
|
<TabsWrapper
|
||||||
|
shouldOverflow={props.overflow}
|
||||||
|
data-cy={props.cypressSelector}
|
||||||
|
>
|
||||||
<Tabs
|
<Tabs
|
||||||
selectedIndex={props.selectedIndex}
|
selectedIndex={props.selectedIndex}
|
||||||
onSelect={(index: number) => {
|
onSelect={(index: number) => {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import styled from "styled-components";
|
import styled from "styled-components";
|
||||||
import { ThemeProp, Classes } from "./common";
|
import { ThemeProp, Classes, CommonComponentProps } from "./common";
|
||||||
|
|
||||||
export enum TextType {
|
export enum TextType {
|
||||||
P1 = "p1",
|
P1 = "p1",
|
||||||
|
|
@ -24,7 +24,7 @@ export enum FontWeight {
|
||||||
NORMAL = "normal",
|
NORMAL = "normal",
|
||||||
}
|
}
|
||||||
|
|
||||||
export type TextProps = {
|
export type TextProps = CommonComponentProps & {
|
||||||
type: TextType;
|
type: TextType;
|
||||||
underline?: boolean;
|
underline?: boolean;
|
||||||
italic?: boolean;
|
italic?: boolean;
|
||||||
|
|
@ -52,8 +52,9 @@ const typeSelector = (props: TextProps & ThemeProp): string => {
|
||||||
return color;
|
return color;
|
||||||
};
|
};
|
||||||
|
|
||||||
const Text = styled.span.attrs(() => ({
|
const Text = styled.span.attrs((props: TextProps) => ({
|
||||||
className: Classes.TEXT,
|
className: Classes.TEXT,
|
||||||
|
"data-cy": props.cypressSelector,
|
||||||
}))<TextProps>`
|
}))<TextProps>`
|
||||||
text-decoration: ${props => (props.underline ? "underline" : "unset")};
|
text-decoration: ${props => (props.underline ? "underline" : "unset")};
|
||||||
font-style: ${props => (props.italic ? "italic" : "normal")};
|
font-style: ${props => (props.italic ? "italic" : "normal")};
|
||||||
|
|
|
||||||
|
|
@ -155,7 +155,7 @@ const TextInput = forwardRef(
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<InputWrapper>
|
<InputWrapper data-cy={props.cypressSelector}>
|
||||||
<StyledInput
|
<StyledInput
|
||||||
type="text"
|
type="text"
|
||||||
ref={ref}
|
ref={ref}
|
||||||
|
|
|
||||||
|
|
@ -126,6 +126,7 @@ export default function Toggle(props: ToggleProps) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledToggle
|
<StyledToggle
|
||||||
|
data-cy={props.cypressSelector}
|
||||||
isLoading={props.isLoading}
|
isLoading={props.isLoading}
|
||||||
disabled={props.disabled}
|
disabled={props.disabled}
|
||||||
value={value}
|
value={value}
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ const TooltipWrapper = styled.div<{ variant?: Variant }>`
|
||||||
|
|
||||||
const TooltipComponent = (props: TooltipProps) => {
|
const TooltipComponent = (props: TooltipProps) => {
|
||||||
return (
|
return (
|
||||||
<TooltipWrapper variant={props.variant}>
|
<TooltipWrapper variant={props.variant} data-cy={props.cypressSelector}>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
content={props.content}
|
content={props.content}
|
||||||
position={props.position}
|
position={props.position}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,5 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import {
|
import { withKnobs, select, boolean, number } from "@storybook/addon-knobs";
|
||||||
withKnobs,
|
|
||||||
select,
|
|
||||||
boolean,
|
|
||||||
text,
|
|
||||||
number,
|
|
||||||
} from "@storybook/addon-knobs";
|
|
||||||
import { withDesign } from "storybook-addon-designs";
|
import { withDesign } from "storybook-addon-designs";
|
||||||
import { StoryWrapper } from "components/ads/common";
|
import { StoryWrapper } from "components/ads/common";
|
||||||
import RadioComponent from "components/ads/Radio";
|
import RadioComponent from "components/ads/Radio";
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import { Position } from "@blueprintjs/core";
|
||||||
import TooltipComponent from "components/ads/Tooltip";
|
import TooltipComponent from "components/ads/Tooltip";
|
||||||
import { StoryWrapper } from "components/ads/common";
|
import { StoryWrapper } from "components/ads/common";
|
||||||
import Text, { TextType } from "components/ads/Text";
|
import Text, { TextType } from "components/ads/Text";
|
||||||
import Button from "components/ads/Button";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: "Tooltip",
|
title: "Tooltip",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user