Skip to content

The open alternative to Salesforce, designed for AI.

Allow prop spreading in twenty-ui and remove the unused VISIBILITY_HIDDEN export (#24370)

Raphaël Bosid47e1f73105d
diff --git a/packages/twenty-ui/.oxlintrc.json b/packages/twenty-ui/.oxlintrc.json
index 8bcfc4d061a..0a644122fe8 100644
--- a/packages/twenty-ui/.oxlintrc.json
+++ b/packages/twenty-ui/.oxlintrc.json
@@ -28,7 +28,7 @@
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
"react/jsx-no-useless-fragment": "off",
- "react/jsx-props-no-spreading": ["error", { "explicitSpread": "ignore" }],
+ "react/jsx-props-no-spreading": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
diff --git a/packages/twenty-ui/src/accessibility/components/VisibilityHiddenInput.tsx b/packages/twenty-ui/src/accessibility/components/VisibilityHiddenInput.tsx
index ca9d85bbc33..916339c86d6 100644
--- a/packages/twenty-ui/src/accessibility/components/VisibilityHiddenInput.tsx
+++ b/packages/twenty-ui/src/accessibility/components/VisibilityHiddenInput.tsx
@@ -9,7 +9,6 @@ export const VisibilityHiddenInput = forwardRef<
HTMLInputElement,
React.ComponentPropsWithoutRef<'input'>
>(({ className, ...props }, ref) => (
- // oxlint-disable-next-line react/jsx-props-no-spreading
<input ref={ref} className={clsx(styles.root, className)} {...props} />
));
diff --git a/packages/twenty-ui/src/accessibility/index.ts b/packages/twenty-ui/src/accessibility/index.ts
index 767ee9d3d97..ebf8674bc48 100644
--- a/packages/twenty-ui/src/accessibility/index.ts
+++ b/packages/twenty-ui/src/accessibility/index.ts
@@ -10,4 +10,3 @@
export { VisibilityHidden } from './components/VisibilityHidden';
export { VisibilityHiddenInput } from './components/VisibilityHiddenInput';
export { handleClickableElementKeyDown } from './utils/handleClickableElementKeyDown';
-export { VISIBILITY_HIDDEN } from './utils/visibility-hidden';
diff --git a/packages/twenty-ui/src/accessibility/utils/visibility-hidden.ts b/packages/twenty-ui/src/accessibility/utils/visibility-hidden.ts
deleted file mode 100644
index 0ee9b33dda7..00000000000
--- a/packages/twenty-ui/src/accessibility/utils/visibility-hidden.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-export const VISIBILITY_HIDDEN = `
- position: absolute;
- width: 1px;
- height: 1px;
- padding: 0;
- margin: -1px;
- overflow: hidden;
- clip: rect(0, 0, 0, 0);
- white-space: nowrap;
- border-width: 0;
-`;
diff --git a/packages/twenty-ui/src/data-display/AvatarGroup/__stories__/AvatarGroup.stories.tsx b/packages/twenty-ui/src/data-display/AvatarGroup/__stories__/AvatarGroup.stories.tsx
index e18b57d0f3d..a57dd7d3de3 100644
--- a/packages/twenty-ui/src/data-display/AvatarGroup/__stories__/AvatarGroup.stories.tsx
+++ b/packages/twenty-ui/src/data-display/AvatarGroup/__stories__/AvatarGroup.stories.tsx
@@ -16,7 +16,6 @@ import {
} from '@ui/data-display/AvatarGroup/AvatarGroup';
const makeAvatar = (userName: string, props: Partial<AvatarProps> = {}) => (
- // oxlint-disable-next-line react/jsx-props-no-spreading
<Avatar placeholder={userName} placeholderColorSeed={userName} {...props} />
);
diff --git a/packages/twenty-ui/src/data-display/StyledTintedIconTileContainer/StyledTintedIconTileContainer.tsx b/packages/twenty-ui/src/data-display/StyledTintedIconTileContainer/StyledTintedIconTileContainer.tsx
index f10aeb0afa8..fc690a4f76d 100644
--- a/packages/twenty-ui/src/data-display/StyledTintedIconTileContainer/StyledTintedIconTileContainer.tsx
+++ b/packages/twenty-ui/src/data-display/StyledTintedIconTileContainer/StyledTintedIconTileContainer.tsx
@@ -18,7 +18,6 @@ export const StyledTintedIconTileContainer = ({
...rest
}: StyledTintedIconTileContainerProps) => (
<div
- // oxlint-disable-next-line react/jsx-props-no-spreading
{...rest}
className={clsx(styles.root, className)}
style={
diff --git a/packages/twenty-ui/src/feedback/Banner/__stories__/Banner.stories.tsx b/packages/twenty-ui/src/feedback/Banner/__stories__/Banner.stories.tsx
index 93042ddeb81..a8b4e24bc32 100644
--- a/packages/twenty-ui/src/feedback/Banner/__stories__/Banner.stories.tsx
+++ b/packages/twenty-ui/src/feedback/Banner/__stories__/Banner.stories.tsx
@@ -70,7 +70,6 @@ export const Default: Story = {
},
render: (args) => (
<div className={styles.container}>
- {/* oxlint-disable-next-line react/jsx-props-no-spreading */}
<Banner {...args}>
<div className={styles.bannerContent}>
Sync lost with mailbox [email protected]. Please reconnect for updates:
@@ -96,7 +95,6 @@ export const Catalog: CatalogStory<Story, typeof Banner> = {
variant: { control: false },
},
render: (args) => (
- // oxlint-disable-next-line react/jsx-props-no-spreading
<Banner {...args}>
<div className={styles.bannerContent}>
Sync lost with mailbox [email protected]. Please reconnect for updates:
diff --git a/packages/twenty-ui/src/feedback/EmptyPlaceholderStyled/EmptyPlaceholderStyled.tsx b/packages/twenty-ui/src/feedback/EmptyPlaceholderStyled/EmptyPlaceholderStyled.tsx
index 6a88376e844..fe47ab421ba 100644
--- a/packages/twenty-ui/src/feedback/EmptyPlaceholderStyled/EmptyPlaceholderStyled.tsx
+++ b/packages/twenty-ui/src/feedback/EmptyPlaceholderStyled/EmptyPlaceholderStyled.tsx
@@ -29,31 +29,19 @@ export const AnimatedPlaceholderEmptyTextContainer = ({
className,
...rest
}: ComponentPropsWithoutRef<'div'>) => (
- <div
- className={clsx(styles.emptyTextContainer, className)}
- // oxlint-disable-next-line react/jsx-props-no-spreading
- {...rest}
- />
+ <div className={clsx(styles.emptyTextContainer, className)} {...rest} />
);
export const AnimatedPlaceholderEmptyTitle = ({
className,
...rest
}: ComponentPropsWithoutRef<'div'>) => (
- <div
- className={clsx(styles.emptyTitle, className)}
- // oxlint-disable-next-line react/jsx-props-no-spreading
- {...rest}
- />
+ <div className={clsx(styles.emptyTitle, className)} {...rest} />
);
export const AnimatedPlaceholderEmptySubTitle = ({
className,
...rest
}: ComponentPropsWithoutRef<'div'>) => (
- <div
- className={clsx(styles.emptySubTitle, className)}
- // oxlint-disable-next-line react/jsx-props-no-spreading
- {...rest}
- />
+ <div className={clsx(styles.emptySubTitle, className)} {...rest} />
);
diff --git a/packages/twenty-ui/src/feedback/ErrorPlaceholderStyled/ErrorPlaceholderStyled.tsx b/packages/twenty-ui/src/feedback/ErrorPlaceholderStyled/ErrorPlaceholderStyled.tsx
index a7b6e561ca7..c80e11aaa54 100644
--- a/packages/twenty-ui/src/feedback/ErrorPlaceholderStyled/ErrorPlaceholderStyled.tsx
+++ b/packages/twenty-ui/src/feedback/ErrorPlaceholderStyled/ErrorPlaceholderStyled.tsx
@@ -7,42 +7,26 @@ export const AnimatedPlaceholderErrorContainer = ({
className,
...rest
}: ComponentPropsWithoutRef<'div'>) => (
- <div
- className={clsx(styles.errorContainer, className)}
- // oxlint-disable-next-line react/jsx-props-no-spreading
- {...rest}
- />
+ <div className={clsx(styles.errorContainer, className)} {...rest} />
);
export const AnimatedPlaceholderErrorTextContainer = ({
className,
...rest
}: ComponentPropsWithoutRef<'div'>) => (
- <div
- className={clsx(styles.errorTextContainer, className)}
- // oxlint-disable-next-line react/jsx-props-no-spreading
- {...rest}
- />
+ <div className={clsx(styles.errorTextContainer, className)} {...rest} />
);
export const AnimatedPlaceholderErrorTitle = ({
className,
...rest
}: ComponentPropsWithoutRef<'div'>) => (
- <div
- className={clsx(styles.errorTitle, className)}
- // oxlint-disable-next-line react/jsx-props-no-spreading
- {...rest}
- />
+ <div className={clsx(styles.errorTitle, className)} {...rest} />
);
export const AnimatedPlaceholderErrorSubTitle = ({
className,
...rest
}: ComponentPropsWithoutRef<'div'>) => (
- <div
- className={clsx(styles.errorSubTitle, className)}
- // oxlint-disable-next-line react/jsx-props-no-spreading
- {...rest}
- />
+ <div className={clsx(styles.errorSubTitle, className)} {...rest} />
);
diff --git a/packages/twenty-ui/src/icon/components/IllustrationIconWrapper.tsx b/packages/twenty-ui/src/icon/components/IllustrationIconWrapper.tsx
index e75417a57c0..eef0d02de4d 100644
--- a/packages/twenty-ui/src/icon/components/IllustrationIconWrapper.tsx
+++ b/packages/twenty-ui/src/icon/components/IllustrationIconWrapper.tsx
@@ -9,7 +9,6 @@ export const IllustrationIconWrapper = forwardRef<
HTMLDivElement,
React.ComponentPropsWithoutRef<'div'>
>(({ className, ...props }, ref) => (
- // oxlint-disable-next-line react/jsx-props-no-spreading
<div ref={ref} className={clsx(styles.root, className)} {...props} />
));
diff --git a/packages/twenty-ui/src/input/Slider/Slider.tsx b/packages/twenty-ui/src/input/Slider/Slider.tsx
index f79996b0a9d..bf8bb68ae59 100644
--- a/packages/twenty-ui/src/input/Slider/Slider.tsx
+++ b/packages/twenty-ui/src/input/Slider/Slider.tsx
@@ -92,7 +92,6 @@ export const Slider = ({
step={step}
type="range"
value={value}
- // oxlint-disable-next-line react/jsx-props-no-spreading
{...props}
/>
</div>
diff --git a/packages/twenty-ui/src/input/TabButton/__stories__/TabButton.stories.tsx b/packages/twenty-ui/src/input/TabButton/__stories__/TabButton.stories.tsx
index 4697bea600e..ab302331b4d 100644
--- a/packages/twenty-ui/src/input/TabButton/__stories__/TabButton.stories.tsx
+++ b/packages/twenty-ui/src/input/TabButton/__stories__/TabButton.stories.tsx
@@ -1,4 +1,3 @@
-/* oxlint-disable react/jsx-props-no-spreading */
import { type Meta, type StoryObj } from '@storybook/react-vite';
import {
IconCheckbox,
diff --git a/packages/twenty-ui/src/input/TabButton/parts/StyledTabBase.tsx b/packages/twenty-ui/src/input/TabButton/parts/StyledTabBase.tsx
index ffe8f44ef85..7d4f67ddd27 100644
--- a/packages/twenty-ui/src/input/TabButton/parts/StyledTabBase.tsx
+++ b/packages/twenty-ui/src/input/TabButton/parts/StyledTabBase.tsx
@@ -29,7 +29,6 @@ export const StyledTabButton = forwardRef<HTMLElement, StyledTabButtonProps>(
className={clsx(styles.tabButton, className)}
data-active={active || undefined}
data-disabled={disabled || undefined}
- // oxlint-disable-next-line react/jsx-props-no-spreading
{...rest}
>
{children}
@@ -54,7 +53,6 @@ export const StyledTabContainer = forwardRef<
className={clsx(styles.tabContainer, className)}
data-active={active || undefined}
data-disabled={disabled || undefined}
- // oxlint-disable-next-line react/jsx-props-no-spreading
{...rest}
>
{children}
@@ -73,7 +71,6 @@ export const StyledTabHover = forwardRef<HTMLSpanElement, StyledTabHoverProps>(
ref={ref}
className={clsx(styles.tabHover, className)}
data-content-size={contentSize}
- // oxlint-disable-next-line react/jsx-props-no-spreading
{...rest}
>
{children}
diff --git a/packages/twenty-ui/src/navigation/MenuItem/parts/StyledMenuItemBase.tsx b/packages/twenty-ui/src/navigation/MenuItem/parts/StyledMenuItemBase.tsx
index 5b058d5a655..eee179ff1ae 100644
--- a/packages/twenty-ui/src/navigation/MenuItem/parts/StyledMenuItemBase.tsx
+++ b/packages/twenty-ui/src/navigation/MenuItem/parts/StyledMenuItemBase.tsx
@@ -46,7 +46,6 @@ export const StyledMenuItemBase = forwardRef<
data-hover-background-disabled={isHoverBackgroundDisabled || undefined}
data-disabled={disabled || undefined}
data-focused={focused || undefined}
- // oxlint-disable-next-line react/jsx-props-no-spreading
{...rest}
>
{children}
@@ -61,12 +60,7 @@ type StyledStaticDivProps = ComponentPropsWithoutRef<'div'>;
const createStyledDiv = (classNameFromModule: string, displayName: string) => {
const StyledDiv = forwardRef<HTMLDivElement, StyledStaticDivProps>(
({ className, children, ...rest }, ref) => (
- <div
- ref={ref}
- className={clsx(classNameFromModule, className)}
- // oxlint-disable-next-line react/jsx-props-no-spreading
- {...rest}
- >
+ <div ref={ref} className={clsx(classNameFromModule, className)} {...rest}>
{children}
</div>
),
@@ -147,7 +141,6 @@ export const StyledHoverableMenuItemBase = forwardRef<
isIconDisplayedOnHoverOnly || undefined
}
data-cursor={cursor}
- // oxlint-disable-next-line react/jsx-props-no-spreading
{...rest}
>
{children}
diff --git a/packages/twenty-ui/src/navigation/MenuItemSelect/MenuItemSelect.tsx b/packages/twenty-ui/src/navigation/MenuItemSelect/MenuItemSelect.tsx
index 70536287802..c1745559341 100644
--- a/packages/twenty-ui/src/navigation/MenuItemSelect/MenuItemSelect.tsx
+++ b/packages/twenty-ui/src/navigation/MenuItemSelect/MenuItemSelect.tsx
@@ -36,7 +36,6 @@ export const StyledMenuItemSelect = forwardRef<
data-disabled={disabled || undefined}
data-focused={focused || undefined}
data-key-selected={isKeySelected || undefined}
- // oxlint-disable-next-line react/jsx-props-no-spreading
{...rest}
>
{children}
diff --git a/packages/twenty-ui/src/surfaces/Card/Card.tsx b/packages/twenty-ui/src/surfaces/Card/Card.tsx
index 151324a1676..5a865426d27 100644
--- a/packages/twenty-ui/src/surfaces/Card/Card.tsx
+++ b/packages/twenty-ui/src/surfaces/Card/Card.tsx
@@ -32,7 +32,6 @@ export const Card = ({
} as CSSProperties)
: style
}
- // oxlint-disable-next-line react/jsx-props-no-spreading
{...rest}
>
{children}
diff --git a/packages/twenty-ui/src/surfaces/Card/__stories__/Card.stories.tsx b/packages/twenty-ui/src/surfaces/Card/__stories__/Card.stories.tsx
index 7af86a1149a..026f137ebe6 100644
--- a/packages/twenty-ui/src/surfaces/Card/__stories__/Card.stories.tsx
+++ b/packages/twenty-ui/src/surfaces/Card/__stories__/Card.stories.tsx
@@ -11,7 +11,6 @@ const meta: Meta<typeof Card> = {
component: Card,
decorators: [ComponentDecorator],
render: (args) => (
- // oxlint-disable-next-line react/jsx-props-no-spreading
<Card {...args}>
<CardHeader>Lorem ipsum</CardHeader>
<CardContent>
diff --git a/packages/twenty-ui/src/surfaces/CardContent/CardContent.tsx b/packages/twenty-ui/src/surfaces/CardContent/CardContent.tsx
index 88a181fd072..87f310f0928 100644
--- a/packages/twenty-ui/src/surfaces/CardContent/CardContent.tsx
+++ b/packages/twenty-ui/src/surfaces/CardContent/CardContent.tsx
@@ -25,7 +25,6 @@ export const CardContent = ({
data-divider={divider || undefined}
data-clickable={isClickable || undefined}
data-hover-highlight={hasHoverHighlight || undefined}
- // oxlint-disable-next-line react/jsx-props-no-spreading
{...rest}
>
{children}
diff --git a/packages/twenty-ui/src/surfaces/CardFooter/CardFooter.tsx b/packages/twenty-ui/src/surfaces/CardFooter/CardFooter.tsx
index 93fdc1ba84b..f1fc7ac53e7 100644
--- a/packages/twenty-ui/src/surfaces/CardFooter/CardFooter.tsx
+++ b/packages/twenty-ui/src/surfaces/CardFooter/CardFooter.tsx
@@ -17,7 +17,6 @@ export const CardFooter = ({
<div
className={clsx(styles.cardFooter, className)}
data-no-divider={divider === false || undefined}
- // oxlint-disable-next-line react/jsx-props-no-spreading
{...rest}
>
{children}
diff --git a/packages/twenty-ui/src/surfaces/CardHeader/CardHeader.tsx b/packages/twenty-ui/src/surfaces/CardHeader/CardHeader.tsx
index 1a15cd03d2d..8045dd4781a 100644
--- a/packages/twenty-ui/src/surfaces/CardHeader/CardHeader.tsx
+++ b/packages/twenty-ui/src/surfaces/CardHeader/CardHeader.tsx
@@ -11,7 +11,6 @@ export const CardHeader = ({
...rest
}: CardHeaderProps) => {
return (
- // oxlint-disable-next-line react/jsx-props-no-spreading
<div className={clsx(styles.cardHeader, className)} {...rest}>
{children}
</div>
diff --git a/packages/twenty-ui/src/surfaces/ModalBackdrop/ModalBackdrop.tsx b/packages/twenty-ui/src/surfaces/ModalBackdrop/ModalBackdrop.tsx
index 6f1c570c694..c9b65c6bbf5 100644
--- a/packages/twenty-ui/src/surfaces/ModalBackdrop/ModalBackdrop.tsx
+++ b/packages/twenty-ui/src/surfaces/ModalBackdrop/ModalBackdrop.tsx
@@ -35,7 +35,6 @@ export const ModalBackdrop = forwardRef<HTMLDivElement, ModalBackdropProps>(
...style,
} as React.CSSProperties
}
- // oxlint-disable-next-line react/jsx-props-no-spreading
{...divProps}
/>
),
diff --git a/packages/twenty-ui/src/typography/StyledText/StyledText.tsx b/packages/twenty-ui/src/typography/StyledText/StyledText.tsx
index 404788a661a..9cc7f6ae993 100644
--- a/packages/twenty-ui/src/typography/StyledText/StyledText.tsx
+++ b/packages/twenty-ui/src/typography/StyledText/StyledText.tsx
@@ -15,7 +15,6 @@ export const StyledTextContent = ({
className,
...divProps
}: StyledTextContentProps) => (
- // oxlint-disable-next-line react/jsx-props-no-spreading
<div className={clsx(styles.content, className)} {...divProps} />
);
@@ -36,7 +35,6 @@ export const StyledTextWrapper = ({
? ({ '--styled-text-color': color, ...style } as React.CSSProperties)
: style
}
- // oxlint-disable-next-line react/jsx-props-no-spreading
{...divProps}
/>
);