Skip to content

The open alternative to Salesforce, designed for AI.

Move skeleton placeholders into twenty-ui (#27481)

Raphaël Bosi203fe7b78dd6
diff --git a/packages/twenty-docs/docs.json b/packages/twenty-docs/docs.json
index 32748c58661..a8fae6b5658 100644
--- a/packages/twenty-docs/docs.json
+++ b/packages/twenty-docs/docs.json
@@ -557,7 +557,8 @@
"ui/primitives/feedback/banner",
"ui/primitives/feedback/loader",
"ui/primitives/feedback/progress-bar",
- "ui/primitives/feedback/progress-ring"
+ "ui/primitives/feedback/progress-ring",
+ "ui/primitives/feedback/skeleton"
]
},
{
diff --git a/packages/twenty-docs/navigation/base-structure.json b/packages/twenty-docs/navigation/base-structure.json
index 8e913305378..98c540a124d 100644
--- a/packages/twenty-docs/navigation/base-structure.json
+++ b/packages/twenty-docs/navigation/base-structure.json
@@ -569,7 +569,8 @@
"ui/primitives/feedback/banner",
"ui/primitives/feedback/loader",
"ui/primitives/feedback/progress-bar",
- "ui/primitives/feedback/progress-ring"
+ "ui/primitives/feedback/progress-ring",
+ "ui/primitives/feedback/skeleton"
]
},
{
diff --git a/packages/twenty-docs/snippets/ui/generated/feedback/skeleton.mdx b/packages/twenty-docs/snippets/ui/generated/feedback/skeleton.mdx
new file mode 100644
index 00000000000..382bb49021d
--- /dev/null
+++ b/packages/twenty-docs/snippets/ui/generated/feedback/skeleton.mdx
@@ -0,0 +1,56 @@
+{/*
+ * _____ _
+ *|_ _|_ _____ _ __ | |_ _ _
+ * | | \ \ /\ / / _ \ '_ \| __| | | | Auto-generated file
+ * | | \ V V / __/ | | | |_| |_| | DO NOT EDIT - changes will be overwritten
+ * |_| \_/\_/ \___|_| |_|\__|\__, | Generated by: npx nx generate:ui twenty-docs
+ * |___/
+ *
+ * This file is generated from the documentation data in packages/twenty-ui/generated.
+ * To update it, edit the component prop types or design tokens in twenty-ui and run:
+ * npx nx generate:ui twenty-docs
+ */}
+
+<ParamField body="animated" type="boolean" default="true">
+ Animate the highlight by default. Reduced-motion preferences always disable animation.
+</ParamField>
+
+<ParamField body="aria-hidden" type="Booleanish">
+ Placeholders are decorative and hidden from assistive technology by default. The host owns loading announcements.
+</ParamField>
+
+<ParamField body="baseColor" type="BackgroundColor">
+ Placeholder background color. Defaults to the theme tertiary background.
+</ParamField>
+
+<ParamField body="borderRadius" type="BorderRadius&lt;string | number&gt;">
+ Corner radius in pixels or a CSS length. Defaults to 0.25rem and inherits the surrounding corner shape.
+</ParamField>
+
+<ParamField body="className" type="string">
+ CSS class merged with the placeholder class.
+</ParamField>
+
+<ParamField body="height" type="Height&lt;string | number&gt;">
+ Placeholder height in pixels or a CSS length. Defaults to the inherited font height.
+</ParamField>
+
+<ParamField body="highlightColor" type="BackgroundColor">
+ Animated highlight color. Defaults to the theme lighter transparent background.
+</ParamField>
+
+<ParamField body="ref" type="Ref&lt;HTMLSpanElement&gt;">
+ Ref to the placeholder span, or the element supplied through render.
+</ParamField>
+
+<ParamField body="render" type="ReactElement&lt;unknown, string | JSXElementConstructor&lt;any&gt;&gt; | ComponentRenderFn&lt;HTMLProps, {}&gt;">
+ Element or render callback composed through Base UI useRender.
+</ParamField>
+
+<ParamField body="style" type="CSSProperties">
+ Native styles merged with the placeholder dimensions and colors. Explicit styles win.
+</ParamField>
+
+<ParamField body="width" type="Width&lt;string | number&gt;">
+ Placeholder width in pixels or a CSS length. Defaults to the available width.
+</ParamField>
diff --git a/packages/twenty-docs/ui/primitives/feedback/skeleton.mdx b/packages/twenty-docs/ui/primitives/feedback/skeleton.mdx
new file mode 100644
index 00000000000..07a6d022dd7
--- /dev/null
+++ b/packages/twenty-docs/ui/primitives/feedback/skeleton.mdx
@@ -0,0 +1,53 @@
+---
+title: Skeleton
+description: Show themed placeholder shapes while content loads.
+---
+
+import { StoryEmbed } from '/snippets/ui/StoryEmbed.mdx';
+
+import SkeletonReference from '/snippets/ui/generated/feedback/skeleton.mdx';
+
+`Skeleton` provides a placeholder shape with theme colors and a moving highlight. Compose shapes in the layout of the content being loaded. The application owns loading state and feature-specific layouts.
+
+<StoryEmbed storyId="ui-feedback-skeleton--shapes" title="Skeleton shapes" />
+
+## Usage
+
+```tsx
+import { Skeleton, SKELETON_HEIGHT_SIZES } from 'twenty-ui/primitives/feedback';
+import { Text } from 'twenty-ui/primitives/typography';
+
+export const LoadingProfile = () => (
+ <Text render={<div />} style={{ display: 'flex', gap: 16 }}>
+ <Skeleton width={40} height={40} borderRadius="50%" />
+ <Text render={<div />} style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
+ <Skeleton borderRadius={4} width={180} height={SKELETON_HEIGHT_SIZES.s} />
+ <Skeleton borderRadius={4} width={120} height={SKELETON_HEIGHT_SIZES.xs} />
+ </Text>
+ </Text>
+);
+```
+
+Numeric dimensions use pixels. CSS lengths such as percentages and `em` are also supported. Without dimensions, the placeholder fills the available width and uses the inherited font height. Use equal dimensions and `borderRadius="50%"` for a circle.
+
+`SKELETON_HEIGHT_SIZES` provides shared heights for `xs` (13px), `s` (16px), `m` (24px), `l` (32px) and `xl` (40px). Keep layout-specific dimensions in the application.
+
+Each `Skeleton` renders one placeholder. Keep repeated lines, text-line spacing and loading regions in application components that wrap the primitive.
+
+## Motion and accessibility
+
+Skeletons are decorative and have `aria-hidden="true"` by default. Keep loading announcements in a host-owned status region instead of announcing each shape. Skeleton does not accept children.
+
+The highlight moves from left to right on a 1.5-second ease-in-out loop and is hidden when the user prefers reduced motion. Pass `animated={false}` for a static placeholder.
+
+<StoryEmbed storyId="ui-feedback-skeleton--static" title="Static skeleton" />
+
+## Composition and theme
+
+Native props, `className`, `style` and `ref` target the placeholder span. Use `render` to compose another element. Explicit native styles override dimension and color props.
+
+The base and highlight colors default to the theme tertiary background and lighter transparent background. Use `baseColor`, `highlightColor` and `borderRadius` to override them. The default radius is `0.25rem` and the corner shape follows the surrounding styles. No skeleton-specific provider or stylesheet import is needed after loading `twenty-ui/style.css` and the UI theme.
+
+## Props
+
+<SkeletonReference />
diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-feedback-gallery.front-component.tsx b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-feedback-gallery.front-component.tsx
index b84ad25222b..f6ddafeefae 100644
--- a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-feedback-gallery.front-component.tsx
+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-feedback-gallery.front-component.tsx
@@ -1,7 +1,12 @@
import { createElement } from 'react';
import { defineFrontComponent } from 'twenty-sdk/define';
import { Callout, InlineBanner } from 'twenty-ui/components/feedback';
-import { Banner, Loader, ProgressBar } from 'twenty-ui/primitives/feedback';
+import {
+ Banner,
+ Loader,
+ ProgressBar,
+ Skeleton,
+} from 'twenty-ui/primitives/feedback';
import { isDefined } from 'twenty-shared/utils';
import 'twenty-ui/style.css';
import { ThemeProvider } from 'twenty-ui/theme';
@@ -68,6 +73,16 @@ const FEEDBACK_ENTRIES: GalleryEntry[] = [
name: 'ProgressBar',
node: <ProgressBar value={50} ariaLabel="Progress" />,
},
+ {
+ name: 'Skeleton',
+ node: <Skeleton width={180} height={16} />,
+ },
+ {
+ name: 'StaticSkeleton',
+ node: (
+ <Skeleton width={40} height={40} borderRadius="50%" animated={false} />
+ ),
+ },
];
const FeedbackGallery = () => (
diff --git a/packages/twenty-front/.oxlintrc.json b/packages/twenty-front/.oxlintrc.json
index bd863052292..bafe1b2bac2 100644
--- a/packages/twenty-front/.oxlintrc.json
+++ b/packages/twenty-front/.oxlintrc.json
@@ -144,6 +144,14 @@
]
},
"overrides": [
+ {
+ "files": [
+ "src/modules/ui/feedback/skeleton/constants/LEGACY_SKELETON_COLORS.ts"
+ ],
+ "rules": {
+ "twenty/no-hardcoded-colors": "off"
+ }
+ },
{
"files": [
"src/modules/ui/input/components/NavigationButton.tsx",
diff --git a/packages/twenty-front/.storybook/preview.tsx b/packages/twenty-front/.storybook/preview.tsx
index 577370a1eee..8db064f17a1 100644
--- a/packages/twenty-front/.storybook/preview.tsx
+++ b/packages/twenty-front/.storybook/preview.tsx
@@ -28,7 +28,6 @@ import { UserContext } from '../src/modules/users/contexts/UserContext';
// oxlint-disable-next-line no-restricted-imports
import '../src/modules/app/utils/setupMonacoEnvironment';
-import 'react-loading-skeleton/dist/skeleton.css';
import 'twenty-ui/style.css';
import 'twenty-ui/theme-light.css';
import 'twenty-ui/theme-dark.css';
diff --git a/packages/twenty-front/package.json b/packages/twenty-front/package.json
index 65f97f5ce2b..dc130ae5283 100644
--- a/packages/twenty-front/package.json
+++ b/packages/twenty-front/package.json
@@ -130,7 +130,6 @@
"react-hotkeys-hook": "^4.4.4",
"react-imask": "^7.6.0",
"react-intersection-observer": "^9.15.1",
- "react-loading-skeleton": "^3.3.1",
"react-markdown": "^10.1.0",
"react-phone-number-input": "patch:react-phone-number-input@npm%3A3.4.5#../../.yarn/patches/react-phone-number-input-npm-3.4.5-dc2895c306.patch",
"react-qr-code": "^2.0.18",
diff --git a/packages/twenty-front/src/index.tsx b/packages/twenty-front/src/index.tsx
index c074b9352a4..00df5cae475 100644
--- a/packages/twenty-front/src/index.tsx
+++ b/packages/twenty-front/src/index.tsx
@@ -9,7 +9,6 @@ import '@fontsource/inter/400.css';
import '@fontsource/inter/500.css';
import '@fontsource/inter/600.css';
import '@fontsource/inter/700.css';
-import 'react-loading-skeleton/dist/skeleton.css';
import 'twenty-ui/style.css';
import 'twenty-ui/theme-light.css';
import 'twenty-ui/theme-dark.css';
diff --git a/packages/twenty-front/src/loading/components/LeftPanelSkeletonLoader.tsx b/packages/twenty-front/src/loading/components/LeftPanelSkeletonLoader.tsx
index 7c409398f22..17f3cb3ded7 100644
--- a/packages/twenty-front/src/loading/components/LeftPanelSkeletonLoader.tsx
+++ b/packages/twenty-front/src/loading/components/LeftPanelSkeletonLoader.tsx
@@ -1,8 +1,8 @@
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import { styled } from '@linaria/react';
import { motion } from 'framer-motion';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
+import { SKELETON_HEIGHT_SIZES } from 'twenty-ui/primitives/feedback';
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
import { NAVIGATION_DRAWER_CONSTRAINTS } from '@/ui/navigation/navigation-drawer/constants/NavigationDrawerConstraints';
import { useIsMobile } from 'twenty-ui/utilities';
import { MainNavigationDrawerItemsSkeletonLoader } from '~/loading/components/MainNavigationDrawerItemsSkeletonLoader';
@@ -61,16 +61,11 @@ export const LeftPanelSkeletonLoader = () => {
>
<StyledItemsContainer>
<StyledSkeletonTitleContainer>
- <SkeletonTheme
- baseColor={theme.background.quaternary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={4}
- >
- <Skeleton
- width={96}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.s}
- />
- </SkeletonTheme>
+ <SkeletonLine
+ width={96}
+ height={SKELETON_HEIGHT_SIZES.s}
+ baseColor={themeCssVariables.background.quaternary}
+ />
</StyledSkeletonTitleContainer>
<StyledSkeletonContainer>
<MainNavigationDrawerItemsSkeletonLoader length={3} />
diff --git a/packages/twenty-front/src/loading/components/MainNavigationDrawerItemsSkeletonLoader.tsx b/packages/twenty-front/src/loading/components/MainNavigationDrawerItemsSkeletonLoader.tsx
index c2043bc9529..4ca252d5630 100644
--- a/packages/twenty-front/src/loading/components/MainNavigationDrawerItemsSkeletonLoader.tsx
+++ b/packages/twenty-front/src/loading/components/MainNavigationDrawerItemsSkeletonLoader.tsx
@@ -1,8 +1,7 @@
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import { css } from '@linaria/core';
import { styled } from '@linaria/react';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
-import { useTheme } from 'twenty-ui/theme';
+import { SKELETON_HEIGHT_SIZES } from 'twenty-ui/primitives/feedback';
const StyledSkeletonContainer = styled.div`
align-items: flex-start;
@@ -24,28 +23,16 @@ export const MainNavigationDrawerItemsSkeletonLoader = ({
title?: boolean;
length: number;
}) => {
- const theme = useTheme();
return (
<StyledSkeletonContainer>
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={4}
- >
- {title && (
- <Skeleton
- width={48}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.xs}
- />
- )}
- {Array.from({ length }).map((_, index) => (
- <Skeleton
- key={index}
- containerClassName={fillSkeletonContainer}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.s}
- />
- ))}
- </SkeletonTheme>
+ {title && <SkeletonLine width={48} height={SKELETON_HEIGHT_SIZES.xs} />}
+ {Array.from({ length }).map((_, index) => (
+ <SkeletonLine
+ key={index}
+ containerClassName={fillSkeletonContainer}
+ height={SKELETON_HEIGHT_SIZES.s}
+ />
+ ))}
</StyledSkeletonContainer>
);
};
diff --git a/packages/twenty-front/src/loading/components/PageContentSkeletonLoader.tsx b/packages/twenty-front/src/loading/components/PageContentSkeletonLoader.tsx
index e9f90e5d9c1..1209a5b255e 100644
--- a/packages/twenty-front/src/loading/components/PageContentSkeletonLoader.tsx
+++ b/packages/twenty-front/src/loading/components/PageContentSkeletonLoader.tsx
@@ -1,9 +1,8 @@
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import { PageCardHeader } from '@/ui/layout/page/components/PageCardHeader';
import { PageCardLayout } from '@/ui/layout/page/components/PageCardLayout';
import { type ReactNode } from 'react';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
-import { useTheme } from 'twenty-ui/theme';
+import { SKELETON_HEIGHT_SIZES } from 'twenty-ui/primitives/feedback';
type PageContentSkeletonLoaderProps = {
secondaryBar?: ReactNode;
@@ -12,37 +11,21 @@ type PageContentSkeletonLoaderProps = {
export const PageContentSkeletonLoader = ({
secondaryBar,
}: PageContentSkeletonLoaderProps) => {
- const theme = useTheme();
-
return (
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={4}
+ <PageCardLayout
+ header={
+ <PageCardHeader
+ icon={<SkeletonLine width={20} height={20} />}
+ title={<SkeletonLine width={120} height={SKELETON_HEIGHT_SIZES.s} />}
+ actionButton={
+ <SkeletonLine width={80} height={SKELETON_HEIGHT_SIZES.s} />
+ }
+ />
+ }
+ secondaryBar={secondaryBar}
+ showInformationBanner={false}
>
- <PageCardLayout
- header={
- <PageCardHeader
- icon={<Skeleton width={20} height={20} />}
- title={
- <Skeleton
- width={120}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.s}
- />
- }
- actionButton={
- <Skeleton
- width={80}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.s}
- />
- }
- />
- }
- secondaryBar={secondaryBar}
- showInformationBanner={false}
- >
- {null}
- </PageCardLayout>
- </SkeletonTheme>
+ {null}
+ </PageCardLayout>
);
};
diff --git a/packages/twenty-front/src/loading/components/SidePanelSkeletonLoader.tsx b/packages/twenty-front/src/loading/components/SidePanelSkeletonLoader.tsx
index cd212e326d6..a43f5cde480 100644
--- a/packages/twenty-front/src/loading/components/SidePanelSkeletonLoader.tsx
+++ b/packages/twenty-front/src/loading/components/SidePanelSkeletonLoader.tsx
@@ -1,7 +1,7 @@
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import { styled } from '@linaria/react';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
-import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { SKELETON_HEIGHT_SIZES } from 'twenty-ui/primitives/feedback';
+import { themeCssVariables } from 'twenty-ui/theme';
const StyledSidePanelContainer = styled.div`
display: flex;
@@ -10,23 +10,10 @@ const StyledSidePanelContainer = styled.div`
width: 100%;
`;
-const StyledSkeletonLoader = () => {
- const theme = useTheme();
- return (
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={4}
- >
- <Skeleton height={SKELETON_LOADER_HEIGHT_SIZES.standard.m} width={140} />
- </SkeletonTheme>
- );
-};
-
export const SidePanelSkeletonLoader = () => {
return (
<StyledSidePanelContainer>
- <StyledSkeletonLoader />
+ <SkeletonLine height={SKELETON_HEIGHT_SIZES.m} width={140} />
</StyledSidePanelContainer>
);
};
diff --git a/packages/twenty-front/src/modules/activities/components/SkeletonLoader.tsx b/packages/twenty-front/src/modules/activities/components/SkeletonLoader.tsx
index aeaa4a4cfec..03e23089ed7 100644
--- a/packages/twenty-front/src/modules/activities/components/SkeletonLoader.tsx
+++ b/packages/twenty-front/src/modules/activities/components/SkeletonLoader.tsx
@@ -1,6 +1,7 @@
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import { styled } from '@linaria/react';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
-import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { SKELETON_HEIGHT_SIZES } from 'twenty-ui/primitives/feedback';
+import { themeCssVariables } from 'twenty-ui/theme';
const StyledSkeletonContainer = styled.div`
align-content: flex-start;
@@ -25,36 +26,13 @@ const StyledSkeletonSubSectionContent = styled.div`
justify-content: center;
`;
-const StyledSkeletonColumn = styled(Skeleton)`
+const StyledSkeletonColumn = styled(SkeletonLine)`
corner-shape: round;
`;
-export const SKELETON_LOADER_HEIGHT_SIZES = {
- standard: {
- xs: 13,
- s: 16,
- m: 24,
- l: 32,
- xl: 40,
- },
- columns: {
- s: 84,
- m: 120,
- xxl: 542,
- },
-};
-
-const SkeletonColumnLoader = ({ height }: { height: number }) => {
- const theme = useTheme();
- return (
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={80}
- >
- <StyledSkeletonColumn width={24} height={height} />
- </SkeletonTheme>
- );
+const SKELETON_COLUMN_HEIGHTS = {
+ short: 84,
+ tall: 120,
};
export const SkeletonLoader = ({
@@ -62,51 +40,34 @@ export const SkeletonLoader = ({
}: {
withSubSections?: boolean;
}) => {
- const theme = useTheme();
const skeletonItems = Array.from({ length: 3 }).map((_, index) => ({
id: `skeleton-item-${index}`,
}));
return (
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={4}
- >
- <StyledSkeletonContainer>
- <Skeleton
- width={440}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.s}
- />
- {withSubSections &&
- skeletonItems.map(({ id }, index) => (
- <StyledSkeletonSubSection key={id}>
- <SkeletonColumnLoader
- height={
- index === 1
- ? SKELETON_LOADER_HEIGHT_SIZES.columns.m
- : SKELETON_LOADER_HEIGHT_SIZES.columns.s
- }
- />
- <StyledSkeletonSubSectionContent>
- <Skeleton
- width={400}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.m}
- />
- <Skeleton
- width={400}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.m}
- />
- {index === 1 && (
- <Skeleton
- width={400}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.m}
- />
- )}
- </StyledSkeletonSubSectionContent>
- </StyledSkeletonSubSection>
- ))}
- </StyledSkeletonContainer>
- </SkeletonTheme>
+ <StyledSkeletonContainer>
+ <SkeletonLine width={440} height={SKELETON_HEIGHT_SIZES.s} />
+ {withSubSections &&
+ skeletonItems.map(({ id }, index) => (
+ <StyledSkeletonSubSection key={id}>
+ <StyledSkeletonColumn
+ width={24}
+ borderRadius={80}
+ height={
+ index === 1
+ ? SKELETON_COLUMN_HEIGHTS.tall
+ : SKELETON_COLUMN_HEIGHTS.short
+ }
+ />
+ <StyledSkeletonSubSectionContent>
+ <SkeletonLine width={400} height={SKELETON_HEIGHT_SIZES.m} />
+ <SkeletonLine width={400} height={SKELETON_HEIGHT_SIZES.m} />
+ {index === 1 && (
+ <SkeletonLine width={400} height={SKELETON_HEIGHT_SIZES.m} />
+ )}
+ </StyledSkeletonSubSectionContent>
+ </StyledSkeletonSubSection>
+ ))}
+ </StyledSkeletonContainer>
);
};
diff --git a/packages/twenty-front/src/modules/ai/components/LazyMarkdownRenderer.tsx b/packages/twenty-front/src/modules/ai/components/LazyMarkdownRenderer.tsx
index 4433fc4d045..f99c6441b0b 100644
--- a/packages/twenty-front/src/modules/ai/components/LazyMarkdownRenderer.tsx
+++ b/packages/twenty-front/src/modules/ai/components/LazyMarkdownRenderer.tsx
@@ -1,4 +1,4 @@
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import {
StyledMarkdownContainer,
StyledSkeletonContainer,
@@ -8,24 +8,18 @@ import { EMPTY_MARKDOWN_BLOCK_SPLIT_CACHE } from '@/ai/constants/EmptyMarkdownBl
import { getMarkdownBlocksIncrementally } from '@/ai/utils/getMarkdownBlocksIncrementally';
import { protectChatReferencesForMarkdown } from '@/ai/utils/protectChatReferencesForMarkdown';
import { memo, Suspense, useRef } from 'react';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
-import { useTheme } from 'twenty-ui/theme';
+import { SKELETON_HEIGHT_SIZES } from 'twenty-ui/primitives/feedback';
+import { themeCssVariables } from 'twenty-ui/theme';
export const MarkdownLoadingSkeleton = () => {
- const theme = useTheme();
return (
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={theme.border.radius.sm}
- >
- <StyledSkeletonContainer>
- <Skeleton
- width={200}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.s}
- />
- </StyledSkeletonContainer>
- </SkeletonTheme>
+ <StyledSkeletonContainer>
+ <SkeletonLine
+ borderRadius={themeCssVariables.border.radius.smRound}
+ width={200}
+ height={SKELETON_HEIGHT_SIZES.s}
+ />
+ </StyledSkeletonContainer>
);
};
diff --git a/packages/twenty-front/src/modules/ai/components/LazyMarkdownRendererStyledComponents.tsx b/packages/twenty-front/src/modules/ai/components/LazyMarkdownRendererStyledComponents.tsx
index 07865103c5e..31430b5ded6 100644
--- a/packages/twenty-front/src/modules/ai/components/LazyMarkdownRendererStyledComponents.tsx
+++ b/packages/twenty-front/src/modules/ai/components/LazyMarkdownRendererStyledComponents.tsx
@@ -164,7 +164,7 @@ export const StyledParagraph = styled.div`
export const StyledSkeletonContainer = styled.div`
max-width: 100%;
- .react-loading-skeleton {
+ [data-skeleton] {
max-width: 100%;
}
`;
diff --git a/packages/twenty-front/src/modules/ai/components/internal/AiChatSkeletonLoader.tsx b/packages/twenty-front/src/modules/ai/components/internal/AiChatSkeletonLoader.tsx
index e8059ed6806..fe57a095ed2 100644
--- a/packages/twenty-front/src/modules/ai/components/internal/AiChatSkeletonLoader.tsx
+++ b/packages/twenty-front/src/modules/ai/components/internal/AiChatSkeletonLoader.tsx
@@ -1,7 +1,8 @@
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import { StyledAiChatContentContainer } from '@/ai/components/StyledAiChatContentContainer';
import { styled } from '@linaria/react';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
-import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+
+import { themeCssVariables } from 'twenty-ui/theme';
const StyledSkeletonContainer = styled(StyledAiChatContentContainer)`
display: flex;
@@ -11,17 +12,9 @@ const StyledSkeletonContainer = styled(StyledAiChatContentContainer)`
`;
export const AiChatSkeletonLoader = () => {
- const theme = useTheme();
-
return (
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={4}
- >
- <StyledSkeletonContainer>
- <Skeleton height={20} borderRadius={8} />
- </StyledSkeletonContainer>
- </SkeletonTheme>
+ <StyledSkeletonContainer>
+ <SkeletonLine height={20} borderRadius={8} />
+ </StyledSkeletonContainer>
);
};
diff --git a/packages/twenty-front/src/modules/front-components/components/FrontComponentSkeletonLoader.tsx b/packages/twenty-front/src/modules/front-components/components/FrontComponentSkeletonLoader.tsx
index efce63dd81b..16a05d03cfd 100644
--- a/packages/twenty-front/src/modules/front-components/components/FrontComponentSkeletonLoader.tsx
+++ b/packages/twenty-front/src/modules/front-components/components/FrontComponentSkeletonLoader.tsx
@@ -1,6 +1,7 @@
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import { styled } from '@linaria/react';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
-import { useTheme } from 'twenty-ui/theme';
+
+import { themeCssVariables } from 'twenty-ui/theme';
const StyledContainer = styled.div`
height: 100%;
@@ -13,17 +14,12 @@ const StyledContainer = styled.div`
`;
export const FrontComponentSkeletonLoader = () => {
- const theme = useTheme();
-
return (
<StyledContainer>
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={theme.border.radius.md}
- >
- <Skeleton height="100%" />
- </SkeletonTheme>
+ <SkeletonLine
+ height="100%"
+ borderRadius={themeCssVariables.border.radius.mdRound}
+ />
</StyledContainer>
);
};
diff --git a/packages/twenty-front/src/modules/log-console/components/LogConsoleTable.tsx b/packages/twenty-front/src/modules/log-console/components/LogConsoleTable.tsx
index cc249ceaf14..49bb653378f 100644
--- a/packages/twenty-front/src/modules/log-console/components/LogConsoleTable.tsx
+++ b/packages/twenty-front/src/modules/log-console/components/LogConsoleTable.tsx
@@ -1,10 +1,11 @@
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import { styled } from '@linaria/react';
import { useLingui } from '@lingui/react/macro';
import { Fragment } from 'react';
import { useInView } from 'react-intersection-observer';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
+
import { isDefined } from 'twenty-shared/utils';
-import { themeCssVariables, useTheme } from 'twenty-ui/theme';
+import { themeCssVariables } from 'twenty-ui/theme';
import { LOG_CONSOLE_ANIMATION_EASING } from '@/log-console/constants/LogConsoleAnimationEasing';
import { LOG_CONSOLE_TABLE_SCROLL_WRAPPER_ID } from '@/log-console/constants/LogConsoleTableScrollWrapperId';
@@ -103,7 +104,6 @@ export const LogConsoleTable = ({
onEntryClick,
}: LogConsoleTableProps) => {
const { t } = useLingui();
- const theme = useTheme();
const { scrollWrapperHTMLElement } = useScrollWrapperHTMLElement(
LOG_CONSOLE_TABLE_SCROLL_WRAPPER_ID,
@@ -183,11 +183,7 @@ export const LogConsoleTable = ({
/>
)}
{(isInitialLoading || isLoadingNextPage) && (
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={4}
- >
+ <>
{Array.from({ length: SKELETON_ROW_COUNT }, (_, rowIndex) => (
<TableRow
key={`skel-${rowIndex}`}
@@ -195,12 +191,12 @@ export const LogConsoleTable = ({
>
{columns.map((column) => (
<TableCell key={column.id}>
- <Skeleton width={80} height={16} />
+ <SkeletonLine width={80} height={16} />
</TableCell>
))}
</TableRow>
))}
- </SkeletonTheme>
+ </>
)}
</StyledTable>
</ScrollWrapper>
diff --git a/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentDetailSkeletonLoader.tsx b/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentDetailSkeletonLoader.tsx
index aa4e8e07228..2291792f4f3 100644
--- a/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentDetailSkeletonLoader.tsx
+++ b/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentDetailSkeletonLoader.tsx
@@ -1,8 +1,8 @@
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import { styled } from '@linaria/react';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
+import { SKELETON_HEIGHT_SIZES } from 'twenty-ui/primitives/feedback';
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
-import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { themeCssVariables } from 'twenty-ui/theme';
const StyledSkeletonContainer = styled.div`
display: flex;
@@ -31,53 +31,31 @@ const StyledNameContainer = styled.div`
`;
export const CoreAgentDetailSkeletonLoader = () => {
- const theme = useTheme();
return (
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={4}
- >
- <StyledSkeletonContainer>
- <StyledFormSection>
- <StyledIconNameRow>
- <StyledIconContainer>
- <Skeleton
- width={SKELETON_LOADER_HEIGHT_SIZES.standard.l}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.l}
- />
- </StyledIconContainer>
- <StyledNameContainer>
- <Skeleton
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.l}
- width="100%"
- />
- </StyledNameContainer>
- </StyledIconNameRow>
-
- <Skeleton
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.l}
- width="100%"
- />
-
- <Skeleton
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.l}
- width="100%"
- />
-
- <Skeleton
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.l}
- width="100%"
- />
-
- <Skeleton
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.l}
- width="100%"
- />
-
- <Skeleton height={120} width="100%" />
- </StyledFormSection>
- </StyledSkeletonContainer>
- </SkeletonTheme>
+ <StyledSkeletonContainer>
+ <StyledFormSection>
+ <StyledIconNameRow>
+ <StyledIconContainer>
+ <SkeletonLine
+ width={SKELETON_HEIGHT_SIZES.l}
+ height={SKELETON_HEIGHT_SIZES.l}
+ />
+ </StyledIconContainer>
+ <StyledNameContainer>
+ <SkeletonLine height={SKELETON_HEIGHT_SIZES.l} width="100%" />
+ </StyledNameContainer>
+ </StyledIconNameRow>
+
+ <SkeletonLine height={SKELETON_HEIGHT_SIZES.l} width="100%" />
+
+ <SkeletonLine height={SKELETON_HEIGHT_SIZES.l} width="100%" />
+
+ <SkeletonLine height={SKELETON_HEIGHT_SIZES.l} width="100%" />
+
+ <SkeletonLine height={SKELETON_HEIGHT_SIZES.l} width="100%" />
+
+ <SkeletonLine height={120} width="100%" />
+ </StyledFormSection>
+ </StyledSkeletonContainer>
);
};
diff --git a/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentRunsTab.tsx b/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentRunsTab.tsx
index 90f34d5c406..11377529309 100644
--- a/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentRunsTab.tsx
+++ b/packages/twenty-front/src/modules/object-core/agents/components/CoreAgentRunsTab.tsx
@@ -2,7 +2,6 @@ import { useQuery } from '@apollo/client/react';
import { styled } from '@linaria/react';
import { t } from '@lingui/core/macro';
import { useState } from 'react';
-import Skeleton from 'react-loading-skeleton';
import { isDefined } from 'twenty-shared/utils';
import { themeCssVariables } from 'twenty-ui/theme';
@@ -12,6 +11,8 @@ import { CORE_AGENT_RUNS_GRID_TEMPLATE_COLUMNS } from '@/object-core/agents/cons
import { groupCoreAgentRunsByConversation } from '@/object-core/agents/utils/groupCoreAgentRunsByConversation';
import { AnimatedPlaceholder } from '@/ui/feedback/empty-state/components/AnimatedPlaceholder/AnimatedPlaceholder';
import { EmptyState } from '@/ui/feedback/empty-state/components/EmptyState';
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
+import { LEGACY_SKELETON_COLORS } from '@/ui/feedback/skeleton/constants/LEGACY_SKELETON_COLORS';
import { Table } from '@/ui/layout/table/components/Table';
import { TableHeader } from '@/ui/layout/table/components/TableHeader';
import { TableRow } from '@/ui/layout/table/components/TableRow';
@@ -78,7 +79,13 @@ export const CoreAgentRunsTab = ({ agentId }: CoreAgentRunsTabProps) => {
<Table>
{header}
{Array.from({ length: 3 }).map((_, index) => (
- <Skeleton height={32} borderRadius={4} key={index} />
+ <SkeletonLine
+ baseColor={LEGACY_SKELETON_COLORS.base}
+ highlightColor={LEGACY_SKELETON_COLORS.highlight}
+ height={32}
+ borderRadius={4}
+ key={index}
+ />
))}
</Table>
</StyledTableContainer>
diff --git a/packages/twenty-front/src/modules/object-metadata/components/NavigationDrawerWorkspaceSectionSkeletonLoader.tsx b/packages/twenty-front/src/modules/object-metadata/components/NavigationDrawerWorkspaceSectionSkeletonLoader.tsx
index 929d3c2b89c..ce86062aa48 100644
--- a/packages/twenty-front/src/modules/object-metadata/components/NavigationDrawerWorkspaceSectionSkeletonLoader.tsx
+++ b/packages/twenty-front/src/modules/object-metadata/components/NavigationDrawerWorkspaceSectionSkeletonLoader.tsx
@@ -1,8 +1,8 @@
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import { NavigationDrawerSection } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerSection';
import { css } from '@linaria/core';
import { styled } from '@linaria/react';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
+import { SKELETON_HEIGHT_SIZES } from 'twenty-ui/primitives/feedback';
import { themeCssVariables } from 'twenty-ui/theme';
const StyledTitleSkeleton = styled.div`
@@ -30,32 +30,30 @@ const fillSkeletonContainer = css`
export const NavigationDrawerWorkspaceSectionSkeletonLoader = () => {
return (
<NavigationDrawerSection>
- <SkeletonTheme
- baseColor={themeCssVariables.background.tertiary}
- highlightColor={themeCssVariables.background.transparent.light}
- borderRadius={4}
- >
- <StyledTitleSkeleton>
- <Skeleton
- width={72}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.xs}
- />
- </StyledTitleSkeleton>
- <StyledRowsContainer>
- <Skeleton
- containerClassName={fillSkeletonContainer}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.s}
- />
- <Skeleton
- containerClassName={fillSkeletonContainer}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.s}
- />
- <Skeleton
- containerClassName={fillSkeletonContainer}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.s}
- />
- </StyledRowsContainer>
- </SkeletonTheme>
+ <StyledTitleSkeleton>
+ <SkeletonLine
+ width={72}
+ height={SKELETON_HEIGHT_SIZES.xs}
+ highlightColor={themeCssVariables.background.transparent.light}
+ />
+ </StyledTitleSkeleton>
+ <StyledRowsContainer>
+ <SkeletonLine
+ containerClassName={fillSkeletonContainer}
+ height={SKELETON_HEIGHT_SIZES.s}
+ highlightColor={themeCssVariables.background.transparent.light}
+ />
+ <SkeletonLine
+ containerClassName={fillSkeletonContainer}
+ height={SKELETON_HEIGHT_SIZES.s}
+ highlightColor={themeCssVariables.background.transparent.light}
+ />
+ <SkeletonLine
+ containerClassName={fillSkeletonContainer}
+ height={SKELETON_HEIGHT_SIZES.s}
+ highlightColor={themeCssVariables.background.transparent.light}
+ />
+ </StyledRowsContainer>
</NavigationDrawerSection>
);
};
diff --git a/packages/twenty-front/src/modules/object-record/record-board/components/RecordBoardFetchMoreInViewTriggerComponent.tsx b/packages/twenty-front/src/modules/object-record/record-board/components/RecordBoardFetchMoreInViewTriggerComponent.tsx
index 604c16e57d8..4ad03f1de1e 100644
--- a/packages/twenty-front/src/modules/object-record/record-board/components/RecordBoardFetchMoreInViewTriggerComponent.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-board/components/RecordBoardFetchMoreInViewTriggerComponent.tsx
@@ -1,8 +1,8 @@
+import { SKELETON_HEIGHT_SIZES } from 'twenty-ui/primitives/feedback';
import { styled } from '@linaria/react';
import { useEffect } from 'react';
import { useInView } from 'react-intersection-observer';
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
import { RECORD_BOARD_COLUMN_PADDING_AND_BORDER_WIDTH } from '@/object-record/record-board/constants/RecordBoardColumnPaddingAndBorderWidth';
import { recordIndexKanbanColumnWidthComponentState } from '@/object-record/record-index/states/recordIndexKanbanColumnWidthComponentState';
@@ -28,8 +28,7 @@ const StyledFetchMoreTriggerDiv = styled.div<{ width: number }>`
const BOARD_CARD_HEADER_HEIGHT = 32 + 8 + 4;
// Per field row: skeleton height + RecordCardBodyContainer padding-bottom spacing(2) + StyledBodyContainer gap spacing(0.5)
-const BOARD_CARD_FIELD_ROW_HEIGHT =
- SKELETON_LOADER_HEIGHT_SIZES.standard.s + 8 + 2;
+const BOARD_CARD_FIELD_ROW_HEIGHT = SKELETON_HEIGHT_SIZES.s + 8 + 2;
// StyledBodyContainer padding (4+4) + card border (2×1px) + StyledSkeletonCardContainer margin-bottom spacing(2)
const BOARD_CARD_CHROME_HEIGHT = 8 + 2 + 8;
diff --git a/packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnCardContainerSkeletonLoader.tsx b/packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnCardContainerSkeletonLoader.tsx
index 282414049e6..1bac34bff7f 100644
--- a/packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnCardContainerSkeletonLoader.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnCardContainerSkeletonLoader.tsx
@@ -1,8 +1,7 @@
import { styled } from '@linaria/react';
-import { SkeletonTheme } from 'react-loading-skeleton';
-import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { Skeleton, SKELETON_HEIGHT_SIZES } from 'twenty-ui/primitives/feedback';
+import { themeCssVariables } from 'twenty-ui/theme';
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
import { RecordCardBodyContainer } from '@/object-record/record-card/components/RecordCardBodyContainer';
import { RecordCardHeaderContainer } from '@/object-record/record-card/components/RecordCardHeaderContainer';
import { visibleRecordFieldsComponentSelector } from '@/object-record/record-field/states/visibleRecordFieldsComponentSelector';
@@ -26,16 +25,7 @@ const StyledBodyContainer = styled.div`
padding-top: 4px;
`;
-const StyledStaticCellSkeleton = styled.div<{ width: number; height: number }>`
- background-color: ${themeCssVariables.background.tertiary};
- border-radius: ${themeCssVariables.border.radius.sm};
-
- height: ${({ height }) => height}px;
- width: ${({ width }) => width}px;
-`;
-
export const RecordBoardColumnCardContainerSkeletonLoader = () => {
- const theme = useTheme();
const { currentView } = useGetCurrentViewOnly();
const isCompactModeActive = currentView?.isCompact ?? false;
@@ -55,14 +45,18 @@ export const RecordBoardColumnCardContainerSkeletonLoader = () => {
const titleSkeletonWidth = isCompactModeActive ? 72 : 54;
return (
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={2}
- >
+ <>
<RecordCardHeaderContainer isCompact={isCompactModeActive}>
<StyledSkeletonTitle>
- <StyledStaticCellSkeleton width={titleSkeletonWidth} height={12} />
+ <Skeleton
+ render={<div />}
+ animated={false}
+ baseColor={themeCssVariables.background.tertiary}
+ borderRadius={themeCssVariables.border.radius.sm}
+ width={titleSkeletonWidth}
+ height={12}
+ style={{ display: 'block' }}
+ />
</StyledSkeletonTitle>
</RecordCardHeaderContainer>
<StyledBodyContainer>
@@ -70,18 +64,28 @@ export const RecordBoardColumnCardContainerSkeletonLoader = () => {
skeletonItems.map(({ id }) => (
<RecordCardBodyContainer key={id}>
<StyledSkeletonIconAndText>
- <StyledStaticCellSkeleton
+ <Skeleton
+ render={<div />}
+ animated={false}
+ baseColor={themeCssVariables.background.tertiary}
+ borderRadius={themeCssVariables.border.radius.sm}
+ style={{ display: 'block' }}
width={16}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.s}
+ height={SKELETON_HEIGHT_SIZES.s}
/>
- <StyledStaticCellSkeleton
+ <Skeleton
+ render={<div />}
+ animated={false}
+ baseColor={themeCssVariables.background.tertiary}
+ borderRadius={themeCssVariables.border.radius.sm}
+ style={{ display: 'block' }}
width={151}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.s}
+ height={SKELETON_HEIGHT_SIZES.s}
/>
</StyledSkeletonIconAndText>
</RecordCardBodyContainer>
))}
</StyledBodyContainer>
- </SkeletonTheme>
+ </>
);
};
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/RichTextFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/RichTextFieldInput.tsx
index 2496ab69c21..e66784fa375 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/RichTextFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/RichTextFieldInput.tsx
@@ -1,4 +1,4 @@
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import { FieldContext } from '@/object-record/record-field/ui/contexts/FieldContext';
import { FieldInputEventContext } from '@/object-record/record-field/ui/contexts/FieldInputEventContext';
import { useRegisterInputEvents } from '@/object-record/record-field/ui/meta-types/input/hooks/useRegisterInputEvents';
@@ -9,11 +9,11 @@ import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/com
import { styled } from '@linaria/react';
import { t } from '@lingui/core/macro';
import { Suspense, lazy, useContext, useRef } from 'react';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
+import { SKELETON_HEIGHT_SIZES } from 'twenty-ui/primitives/feedback';
import { CoreObjectNameSingular } from 'twenty-shared/types';
import { IconButton } from 'twenty-ui/components/input';
import { IconLayoutSidebarLeftCollapse } from 'twenty-ui/icon';
-import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { themeCssVariables } from 'twenty-ui/theme';
const ActivityRichTextEditor = lazy(() =>
import('@/activities/components/ActivityRichTextEditor').then((module) => ({
@@ -58,15 +58,11 @@ const StyledCollapseButton = styled.div`
`;
const LoadingSkeleton = () => {
- const theme = useTheme();
return (
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
+ <SkeletonLine
+ height={SKELETON_HEIGHT_SIZES.s}
borderRadius={themeCssVariables.border.radius.md}
- >
- <Skeleton height={SKELETON_LOADER_HEIGHT_SIZES.standard.s} />
- </SkeletonTheme>
+ />
);
};
diff --git a/packages/twenty-front/src/modules/object-record/record-index/components/RecordIndexSkeletonLoader.tsx b/packages/twenty-front/src/modules/object-record/record-index/components/RecordIndexSkeletonLoader.tsx
index 4af818e853d..1289db23cc4 100644
--- a/packages/twenty-front/src/modules/object-record/record-index/components/RecordIndexSkeletonLoader.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-index/components/RecordIndexSkeletonLoader.tsx
@@ -1,6 +1,6 @@
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import { styled } from '@linaria/react';
-import Skeleton from 'react-loading-skeleton';
+import { SKELETON_HEIGHT_SIZES } from 'twenty-ui/primitives/feedback';
import { themeCssVariables } from 'twenty-ui/theme';
import { PageContentSkeletonLoader } from '~/loading/components/PageContentSkeletonLoader';
@@ -19,14 +19,8 @@ export const RecordIndexSkeletonLoader = () => (
<PageContentSkeletonLoader
secondaryBar={
<StyledSecondaryBar>
- <Skeleton
- width={120}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.s}
- />
- <Skeleton
- width={180}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.s}
- />
+ <SkeletonLine width={120} height={SKELETON_HEIGHT_SIZES.s} />
+ <SkeletonLine width={180} height={SKELETON_HEIGHT_SIZES.s} />
</StyledSecondaryBar>
}
/>
diff --git a/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellSkeletonLoader.tsx b/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellSkeletonLoader.tsx
index 7b795dff559..913be98b5ec 100644
--- a/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellSkeletonLoader.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellSkeletonLoader.tsx
@@ -1,23 +1,12 @@
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
+import { SKELETON_HEIGHT_SIZES } from 'twenty-ui/primitives/feedback';
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
-import { useTheme } from 'twenty-ui/theme';
import { StyledSkeletonDiv } from './RecordInlineCellContainer';
export const RecordInlineCellSkeletonLoader = () => {
- const theme = useTheme();
return (
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={4}
- >
- <StyledSkeletonDiv>
- <Skeleton
- width={154}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.s}
- />
- </StyledSkeletonDiv>
- </SkeletonTheme>
+ <StyledSkeletonDiv>
+ <SkeletonLine width={154} height={SKELETON_HEIGHT_SIZES.s} />
+ </StyledSkeletonDiv>
);
};
diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellLoading.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellLoading.tsx
index 438cbdcee47..73006486e70 100644
--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellLoading.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellLoading.tsx
@@ -1,13 +1,15 @@
import { RecordTableCellStyleWrapper } from '@/object-record/record-table/record-table-cell/components/RecordTableCellStyleWrapper';
import { getRecordTableColumnFieldWidthClassName } from '@/object-record/record-table/utils/getRecordTableColumnFieldWidthClassName';
import { styled } from '@linaria/react';
+import { Skeleton } from 'twenty-ui/primitives/feedback';
import { themeCssVariables } from 'twenty-ui/theme';
-const StyledStaticCellSkeleton = styled.div`
- background-color: ${themeCssVariables.background.tertiary};
- border-radius: ${themeCssVariables.border.radius.sm};
+const StyledCellSkeleton = styled(Skeleton)`
+ display: block;
+ height: 0;
margin: 8px;
padding: 8px;
+ width: auto;
`;
export const RecordTableCellLoading = ({
@@ -22,7 +24,12 @@ export const RecordTableCellLoading = ({
widthClassName={getRecordTableColumnFieldWidthClassName(recordFieldIndex)}
isSelected={isSelected}
>
- <StyledStaticCellSkeleton />
+ <StyledCellSkeleton
+ render={<div />}
+ animated={false}
+ baseColor={themeCssVariables.background.tertiary}
+ borderRadius={themeCssVariables.border.radius.sm}
+ />
</RecordTableCellStyleWrapper>
);
};
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-summary/components/__stories__/CallRecordingSummaryBody.stories.tsx b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-summary/components/__stories__/CallRecordingSummaryBody.stories.tsx
index 6ef8d1c11d7..add9aea93d2 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-summary/components/__stories__/CallRecordingSummaryBody.stories.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-summary/components/__stories__/CallRecordingSummaryBody.stories.tsx
@@ -163,9 +163,7 @@ export const Loading: Story = {
},
play: async ({ canvasElement }) => {
await waitFor(() => {
- expect(
- canvasElement.querySelector('.react-loading-skeleton'),
- ).toBeVisible();
+ expect(canvasElement.querySelector('[data-skeleton]')).toBeVisible();
});
},
};
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/__stories__/CallRecordingTranscriptBody.stories.tsx b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/__stories__/CallRecordingTranscriptBody.stories.tsx
index 708be6653a5..6b3d688a0e4 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/__stories__/CallRecordingTranscriptBody.stories.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/__stories__/CallRecordingTranscriptBody.stories.tsx
@@ -813,9 +813,7 @@ export const Loading: Story = {
},
play: async ({ canvasElement }) => {
await waitFor(() => {
- expect(
- canvasElement.querySelector('.react-loading-skeleton'),
- ).toBeVisible();
+ expect(canvasElement.querySelector('[data-skeleton]')).toBeVisible();
});
},
};
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/components/WidgetSkeletonLoader.tsx b/packages/twenty-front/src/modules/page-layout/widgets/components/WidgetSkeletonLoader.tsx
index f3746e532f0..8561bde940b 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/components/WidgetSkeletonLoader.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/components/WidgetSkeletonLoader.tsx
@@ -1,7 +1,6 @@
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import { styled } from '@linaria/react';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
-import { useTheme } from 'twenty-ui/theme';
+import { SKELETON_HEIGHT_SIZES } from 'twenty-ui/primitives/feedback';
const StyledContainer = styled.div`
align-items: center;
@@ -12,19 +11,9 @@ const StyledContainer = styled.div`
`;
export const WidgetSkeletonLoader = () => {
- const theme = useTheme();
return (
<StyledContainer>
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={4}
- >
- <Skeleton
- width={120}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.m}
- />
- </SkeletonTheme>
+ <SkeletonLine width={120} height={SKELETON_HEIGHT_SIZES.m} />
</StyledContainer>
);
};
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetRichTextEditor.tsx b/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetRichTextEditor.tsx
index 1931941c6a1..e30b179186b 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetRichTextEditor.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetRichTextEditor.tsx
@@ -1,4 +1,4 @@
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import { type EnrichedObjectMetadataItem } from '@/object-metadata/types/EnrichedObjectMetadataItem';
import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
import { recordStoreFamilySelector } from '@/object-record/record-store/states/selectors/recordStoreFamilySelector';
@@ -6,9 +6,9 @@ import { ScrollWrapper } from '@/ui/utilities/scroll/components/ScrollWrapper';
import { useAtomFamilySelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilySelectorValue';
import { styled } from '@linaria/react';
import { lazy, Suspense } from 'react';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
+import { SKELETON_HEIGHT_SIZES } from 'twenty-ui/primitives/feedback';
import { isUndefined } from '@sniptt/guards';
-import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { themeCssVariables } from 'twenty-ui/theme';
const RichTextFieldEditor = lazy(() =>
import('@/object-record/record-field/ui/meta-types/input/components/RichTextFieldEditor').then(
@@ -41,16 +41,12 @@ const StyledSkeletonContainer = styled.div`
`;
const LoadingSkeleton = () => {
- const theme = useTheme();
return (
<StyledSkeletonContainer>
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
+ <SkeletonLine
+ height={SKELETON_HEIGHT_SIZES.s}
borderRadius={themeCssVariables.border.radius.md}
- >
- <Skeleton height={SKELETON_LOADER_HEIGHT_SIZES.standard.s} />
- </SkeletonTheme>
+ />
</StyledSkeletonContainer>
);
};
diff --git a/packages/twenty-front/src/modules/settings/accounts/components/message-folders/SettingsMessageFoldersSkeletonLoader.tsx b/packages/twenty-front/src/modules/settings/accounts/components/message-folders/SettingsMessageFoldersSkeletonLoader.tsx
index e9806503f96..c857230db86 100644
--- a/packages/twenty-front/src/modules/settings/accounts/components/message-folders/SettingsMessageFoldersSkeletonLoader.tsx
+++ b/packages/twenty-front/src/modules/settings/accounts/components/message-folders/SettingsMessageFoldersSkeletonLoader.tsx
@@ -1,7 +1,7 @@
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import { styled } from '@linaria/react';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
-import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { SKELETON_HEIGHT_SIZES } from 'twenty-ui/primitives/feedback';
+import { themeCssVariables } from 'twenty-ui/theme';
const StyledSkeletonContainer = styled.div`
display: flex;
@@ -34,33 +34,17 @@ const SKELETON_ROWS = [
];
export const SettingsMessageFoldersSkeletonLoader = () => {
- const theme = useTheme();
return (
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={4}
- >
- <StyledSkeletonContainer>
- {SKELETON_ROWS.map((row, index) => (
- <StyledSkeletonRow key={index}>
- <StyledSkeletonFolderInfo>
- <Skeleton
- width={20}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.s}
- />
- <Skeleton
- width={row.width}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.s}
- />
- </StyledSkeletonFolderInfo>
- <Skeleton
- width={16}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.s}
- />
- </StyledSkeletonRow>
- ))}
- </StyledSkeletonContainer>
- </SkeletonTheme>
+ <StyledSkeletonContainer>
+ {SKELETON_ROWS.map((row, index) => (
+ <StyledSkeletonRow key={index}>
+ <StyledSkeletonFolderInfo>
+ <SkeletonLine width={20} height={SKELETON_HEIGHT_SIZES.s} />
+ <SkeletonLine width={row.width} height={SKELETON_HEIGHT_SIZES.s} />
+ </StyledSkeletonFolderInfo>
+ <SkeletonLine width={16} height={SKELETON_HEIGHT_SIZES.s} />
+ </StyledSkeletonRow>
+ ))}
+ </StyledSkeletonContainer>
);
};
diff --git a/packages/twenty-front/src/modules/settings/components/SettingsSectionSkeletonLoader.tsx b/packages/twenty-front/src/modules/settings/components/SettingsSectionSkeletonLoader.tsx
index df7378fed0c..c96afdfe4a7 100644
--- a/packages/twenty-front/src/modules/settings/components/SettingsSectionSkeletonLoader.tsx
+++ b/packages/twenty-front/src/modules/settings/components/SettingsSectionSkeletonLoader.tsx
@@ -1,8 +1,7 @@
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import { styled } from '@linaria/react';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
-import { useTheme, themeCssVariables } from 'twenty-ui/theme';
-
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
+import { SKELETON_HEIGHT_SIZES } from 'twenty-ui/primitives/feedback';
+import { themeCssVariables } from 'twenty-ui/theme';
type SettingsSectionSkeletonLoaderProps = {
rowCount?: number;
@@ -18,20 +17,9 @@ const StyledRows = styled.div`
export const SettingsSectionSkeletonLoader = ({
rowCount = 4,
}: SettingsSectionSkeletonLoaderProps) => {
- const theme = useTheme();
-
return (
<StyledRows>
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={4}
- >
- <Skeleton
- count={rowCount}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.l}
- />
- </SkeletonTheme>
+ <SkeletonLine count={rowCount} height={SKELETON_HEIGHT_SIZES.l} />
</StyledRows>
);
};
diff --git a/packages/twenty-front/src/modules/settings/components/SettingsSkeletonLoader.tsx b/packages/twenty-front/src/modules/settings/components/SettingsSkeletonLoader.tsx
index 6df65627525..f4a8b185090 100644
--- a/packages/twenty-front/src/modules/settings/components/SettingsSkeletonLoader.tsx
+++ b/packages/twenty-front/src/modules/settings/components/SettingsSkeletonLoader.tsx
@@ -1,43 +1,26 @@
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import { PageCardHeader } from '@/ui/layout/page/components/PageCardHeader';
import { PageCardLayout } from '@/ui/layout/page/components/PageCardLayout';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
-import { useTheme } from 'twenty-ui/theme';
+import { SKELETON_HEIGHT_SIZES } from 'twenty-ui/primitives/feedback';
export const SettingsSkeletonLoader = () => {
- const theme = useTheme();
-
return (
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={4}
+ <PageCardLayout
+ header={
+ <PageCardHeader
+ links={[
+ {
+ children: (
+ <SkeletonLine width={64} height={SKELETON_HEIGHT_SIZES.s} />
+ ),
+ },
+ ]}
+ title={<SkeletonLine width={120} height={SKELETON_HEIGHT_SIZES.s} />}
+ />
+ }
+ showInformationBanner={false}
>
- <PageCardLayout
- header={
- <PageCardHeader
- links={[
- {
- children: (
- <Skeleton
- width={64}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.s}
- />
- ),
- },
- ]}
- title={
- <Skeleton
- width={120}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.s}
- />
- }
- />
- }
- showInformationBanner={false}
- >
- {null}
- </PageCardLayout>
- </SkeletonTheme>
+ {null}
+ </PageCardLayout>
);
};
diff --git a/packages/twenty-front/src/modules/settings/event-logs/components/EventLogResultsTable.tsx b/packages/twenty-front/src/modules/settings/event-logs/components/EventLogResultsTable.tsx
index 7437f095441..3d469f8538d 100644
--- a/packages/twenty-front/src/modules/settings/event-logs/components/EventLogResultsTable.tsx
+++ b/packages/twenty-front/src/modules/settings/event-logs/components/EventLogResultsTable.tsx
@@ -1,9 +1,9 @@
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import { SettingsEmptyPlaceholder } from '@/settings/components/SettingsEmptyPlaceholder';
import { styled } from '@linaria/react';
import { Trans, useLingui } from '@lingui/react/macro';
import { useCallback, useEffect, useState } from 'react';
import { useInView } from 'react-intersection-observer';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
import { Table } from '@/ui/layout/table/components/Table';
import { TableCell } from '@/ui/layout/table/components/TableCell';
@@ -11,7 +11,7 @@ import { TableHeader } from '@/ui/layout/table/components/TableHeader';
import { TableRow } from '@/ui/layout/table/components/TableRow';
import { ScrollWrapper } from '@/ui/utilities/scroll/components/ScrollWrapper';
import { useScrollWrapperHTMLElement } from '@/ui/utilities/scroll/hooks/useScrollWrapperHTMLElement';
-import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { themeCssVariables } from 'twenty-ui/theme';
import {
type EventLogRecord,
@@ -96,7 +96,6 @@ export const EventLogResultsTable = ({
onLoadMore,
selectedTable,
}: EventLogResultsTableProps) => {
- const theme = useTheme();
const { t } = useLingui();
const baseColumns = getColumnsForEventLogTable(selectedTable);
@@ -187,15 +186,7 @@ export const EventLogResultsTable = ({
<TableRow gridTemplateColumns={gridTemplateColumns}>
{baseColumns.map((column, index) => (
<TableCell key={column.id}>
- {index === 0 && (
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={4}
- >
- <Skeleton width={120} height={16} />
- </SkeletonTheme>
- )}
+ {index === 0 && <SkeletonLine width={120} height={16} />}
</TableCell>
))}
</TableRow>
diff --git a/packages/twenty-front/src/modules/settings/mcp-and-apis/components/RestPlayground.tsx b/packages/twenty-front/src/modules/settings/mcp-and-apis/components/RestPlayground.tsx
index 459551dd127..404947e188a 100644
--- a/packages/twenty-front/src/modules/settings/mcp-and-apis/components/RestPlayground.tsx
+++ b/packages/twenty-front/src/modules/settings/mcp-and-apis/components/RestPlayground.tsx
@@ -1,3 +1,4 @@
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import { RestPlaygroundSchemaFetchEffect } from '@/settings/mcp-and-apis/components/RestPlaygroundSchemaFetchEffect';
import {
isPlaygroundApiKeyFresh,
@@ -7,15 +8,11 @@ import { type PlaygroundSchemas } from '@/settings/mcp-and-apis/types/Playground
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { useState, lazy, Suspense } from 'react';
import { styled } from '@linaria/react';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
+
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath } from 'twenty-shared/utils';
import { REACT_APP_SERVER_BASE_URL } from '~/config';
-import {
- useTheme,
- useThemeColorScheme,
- themeCssVariables,
-} from 'twenty-ui/theme';
+import { useThemeColorScheme, themeCssVariables } from 'twenty-ui/theme';
const StyledContainer = styled.div`
border: 1px solid ${themeCssVariables.border.color.medium};
@@ -58,7 +55,6 @@ type RestPlaygroundProps = {
};
export const RestPlayground = ({ onError, schema }: RestPlaygroundProps) => {
- const theme = useTheme();
const colorScheme = useThemeColorScheme();
const playgroundApiKey = useAtomStateValue(playgroundApiKeyState);
const [specContent, setSpecContent] = useState<object | null>(null);
@@ -68,15 +64,7 @@ export const RestPlayground = ({ onError, schema }: RestPlaygroundProps) => {
return null;
}
- const fallback = (
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={4}
- >
- <Skeleton width="100%" height="100%" />
- </SkeletonTheme>
- );
+ const fallback = <SkeletonLine width="100%" height="100%" />;
return (
<StyledContainer>
diff --git a/packages/twenty-front/src/modules/settings/translations/components/MetadataTranslationsTable.tsx b/packages/twenty-front/src/modules/settings/translations/components/MetadataTranslationsTable.tsx
index 64baf3c779b..f5d4374decb 100644
--- a/packages/twenty-front/src/modules/settings/translations/components/MetadataTranslationsTable.tsx
+++ b/packages/twenty-front/src/modules/settings/translations/components/MetadataTranslationsTable.tsx
@@ -2,6 +2,8 @@ import { StyledSettingsDataModelTableBodyContainer } from '@/settings/data-model
import { MetadataTranslationsTableRow } from '@/settings/translations/components/MetadataTranslationsTableRow';
import { type MetadataTranslationLanguageRow } from '@/settings/translations/types/MetadataTranslationLanguageRow';
import { type MetadataTranslationRowValue } from '@/settings/translations/types/MetadataTranslationRowValue';
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
+import { LEGACY_SKELETON_COLORS } from '@/ui/feedback/skeleton/constants/LEGACY_SKELETON_COLORS';
import { Table } from '@/ui/layout/table/components/Table';
import { TableBody } from '@/ui/layout/table/components/TableBody';
import { TableCell } from '@/ui/layout/table/components/TableCell';
@@ -9,7 +11,6 @@ import { TableHeader } from '@/ui/layout/table/components/TableHeader';
import { TableRow } from '@/ui/layout/table/components/TableRow';
import { styled } from '@linaria/react';
import { useLingui } from '@lingui/react/macro';
-import Skeleton from 'react-loading-skeleton';
import { isNonEmptyArray } from 'twenty-shared/utils';
import { MOBILE_VIEWPORT, themeCssVariables } from 'twenty-ui/theme';
@@ -69,7 +70,13 @@ export const MetadataTranslationsTable = ({
<TableBody>
{showSkeleton
? Array.from({ length: 3 }).map((_, index) => (
- <Skeleton height={32} borderRadius={4} key={index} />
+ <SkeletonLine
+ baseColor={LEGACY_SKELETON_COLORS.base}
+ highlightColor={LEGACY_SKELETON_COLORS.highlight}
+ height={32}
+ borderRadius={4}
+ key={index}
+ />
))
: languageRows.map(({ locale, label, translations }) => (
<MetadataTranslationsTableRow
diff --git a/packages/twenty-front/src/modules/settings/usage/components/UsageSectionSkeleton.tsx b/packages/twenty-front/src/modules/settings/usage/components/UsageSectionSkeleton.tsx
index 39c3852db14..4557aac45f4 100644
--- a/packages/twenty-front/src/modules/settings/usage/components/UsageSectionSkeleton.tsx
+++ b/packages/twenty-front/src/modules/settings/usage/components/UsageSectionSkeleton.tsx
@@ -1,25 +1,17 @@
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
+
import { Section } from 'twenty-ui/components/layout';
-import { useTheme } from 'twenty-ui/theme';
export const UsageSectionSkeleton = () => {
- const theme = useTheme();
-
return (
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={4}
- >
- <Section.Root>
- <Skeleton width={160} height={16} />
- <Skeleton
- width="100%"
- height={200}
- borderRadius={8}
- style={{ marginTop: 16 }}
- />
- </Section.Root>
- </SkeletonTheme>
+ <Section.Root>
+ <SkeletonLine width={160} height={16} />
+ <SkeletonLine
+ width="100%"
+ height={200}
+ borderRadius={8}
+ style={{ marginTop: 16 }}
+ />
+ </Section.Root>
);
};
diff --git a/packages/twenty-front/src/modules/side-panel/pages/rich-text-page/components/SidePanelEditRichTextPage.tsx b/packages/twenty-front/src/modules/side-panel/pages/rich-text-page/components/SidePanelEditRichTextPage.tsx
index 142b7ab7bd4..17c798f7c08 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/rich-text-page/components/SidePanelEditRichTextPage.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/rich-text-page/components/SidePanelEditRichTextPage.tsx
@@ -1,11 +1,11 @@
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import { viewableRichTextComponentState } from '@/side-panel/pages/rich-text-page/states/viewableRichTextComponentState';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { styled } from '@linaria/react';
import { lazy, Suspense } from 'react';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
+import { SKELETON_HEIGHT_SIZES } from 'twenty-ui/primitives/feedback';
import { CoreObjectNameSingular } from 'twenty-shared/types';
-import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { themeCssVariables } from 'twenty-ui/theme';
const ActivityRichTextEditor = lazy(() =>
import('@/activities/components/ActivityRichTextEditor').then((module) => ({
@@ -29,15 +29,11 @@ const StyledContainer = styled.div`
`;
const LoadingSkeleton = () => {
- const theme = useTheme();
return (
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={theme.border.radius.sm}
- >
- <Skeleton height={SKELETON_LOADER_HEIGHT_SIZES.standard.s} />
- </SkeletonTheme>
+ <SkeletonLine
+ borderRadius={themeCssVariables.border.radius.smRound}
+ height={SKELETON_HEIGHT_SIZES.s}
+ />
);
};
diff --git a/packages/twenty-front/src/modules/side-panel/pages/search/components/SidePanelSearchRecordPreviewCard.tsx b/packages/twenty-front/src/modules/side-panel/pages/search/components/SidePanelSearchRecordPreviewCard.tsx
index c4516f405d7..bea56896e84 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/search/components/SidePanelSearchRecordPreviewCard.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/search/components/SidePanelSearchRecordPreviewCard.tsx
@@ -1,5 +1,5 @@
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import { allowRequestsToTwentyIconsState } from '@/client-config/states/allowRequestsToTwentyIcons';
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
import { formatFieldMetadataItemAsColumnDefinition } from '@/object-metadata/utils/formatFieldMetadataItemAsColumnDefinition';
@@ -18,12 +18,12 @@ import { useAtomFamilySelectorValue } from '@/ui/utilities/state/jotai/hooks/use
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { styled } from '@linaria/react';
import { useState } from 'react';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
+import { SKELETON_HEIGHT_SIZES } from 'twenty-ui/primitives/feedback';
import { useIcons } from 'twenty-ui/icon';
-import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { themeCssVariables } from 'twenty-ui/theme';
import { getAbsoluteImageUrl } from '~/utils/image/getAbsoluteImageUrl';
-const SKELETON_HEIGHT = SKELETON_LOADER_HEIGHT_SIZES.standard.s;
+const SKELETON_HEIGHT = SKELETON_HEIGHT_SIZES.s;
// Pinned width so the card keeps its shape across records of different objects
const StyledCard = styled.div`
@@ -117,7 +117,6 @@ export const SidePanelSearchRecordPreviewCard = ({
}: SidePanelSearchRecordPreviewCardProps) => {
const { objectMetadataItem } = useObjectMetadataItem({ objectNameSingular });
const { getIcon } = useIcons();
- const theme = useTheme();
const [areAllFieldsVisible, setAreAllFieldsVisible] = useState(false);
@@ -197,7 +196,7 @@ export const SidePanelSearchRecordPreviewCard = ({
</FieldContext.Provider>
</RecordFieldComponentInstanceContext.Provider>
) : (
- <Skeleton width={120} height={SKELETON_HEIGHT} />
+ <SkeletonLine width={120} height={SKELETON_HEIGHT} />
)}
</StyledFieldValue>
</StyledFieldRow>
@@ -205,44 +204,36 @@ export const SidePanelSearchRecordPreviewCard = ({
};
return (
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={4}
- >
- <StyledCard>
- <StyledHeader>
- <HeaderIdentifier
- avatar={{
- src: getAbsoluteImageUrl(recordIdentifier?.avatarUrl),
- name: recordIdentifier?.name ?? label,
- colorSeed: recordId,
- shape: recordIdentifier?.avatarShape ?? 'circle',
- }}
- title={
- <StyledTitleText>
- {recordIdentifier?.name ?? label}
- </StyledTitleText>
- }
- />
- </StyledHeader>
-
- <StyledFieldList>
- {displayedFields.map(renderFieldRow)}
- {!areAllFieldsVisible &&
- remainingFieldCount > 0 && (
- // Keeping focus on the search input so arrow keys still move through results
- <StyledShowMoreContainer
- onMouseDown={(event) => event.preventDefault()}
- >
- <FieldWidgetShowMoreButton
- remainingCount={remainingFieldCount}
- onClick={() => setAreAllFieldsVisible(true)}
- />
- </StyledShowMoreContainer>
- )}
- </StyledFieldList>
- </StyledCard>
- </SkeletonTheme>
+ <StyledCard>
+ <StyledHeader>
+ <HeaderIdentifier
+ avatar={{
+ src: getAbsoluteImageUrl(recordIdentifier?.avatarUrl),
+ name: recordIdentifier?.name ?? label,
+ colorSeed: recordId,
+ shape: recordIdentifier?.avatarShape ?? 'circle',
+ }}
+ title={
+ <StyledTitleText>{recordIdentifier?.name ?? label}</StyledTitleText>
+ }
+ />
+ </StyledHeader>
+
+ <StyledFieldList>
+ {displayedFields.map(renderFieldRow)}
+ {!areAllFieldsVisible &&
+ remainingFieldCount > 0 && (
+ // Keeping focus on the search input so arrow keys still move through results
+ <StyledShowMoreContainer
+ onMouseDown={(event) => event.preventDefault()}
+ >
+ <FieldWidgetShowMoreButton
+ remainingCount={remainingFieldCount}
+ onClick={() => setAreAllFieldsVisible(true)}
+ />
+ </StyledShowMoreContainer>
+ )}
+ </StyledFieldList>
+ </StyledCard>
);
};
diff --git a/packages/twenty-front/src/modules/spreadsheet-import/provider/components/SpreadsheetImportProvider.tsx b/packages/twenty-front/src/modules/spreadsheet-import/provider/components/SpreadsheetImportProvider.tsx
index 1e69a474b83..95fd2410f82 100644
--- a/packages/twenty-front/src/modules/spreadsheet-import/provider/components/SpreadsheetImportProvider.tsx
+++ b/packages/twenty-front/src/modules/spreadsheet-import/provider/components/SpreadsheetImportProvider.tsx
@@ -1,8 +1,8 @@
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import React from 'react';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
-import { useTheme } from 'twenty-ui/theme';
+import { SKELETON_HEIGHT_SIZES } from 'twenty-ui/primitives/feedback';
+import { themeCssVariables } from 'twenty-ui/theme';
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
import { SPREADSHEET_IMPORT_MODAL_ID } from '@/spreadsheet-import/constants/SpreadsheetImportModalId';
import { spreadsheetImportDialogState } from '@/spreadsheet-import/states/spreadsheetImportDialogState';
import { matchColumnsState } from '@/spreadsheet-import/steps/components/MatchColumnsStep/components/states/initialComputedColumnsState';
@@ -17,15 +17,11 @@ const SpreadsheetImport = React.lazy(() =>
);
const LoadingSkeleton = () => {
- const theme = useTheme();
return (
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={theme.border.radius.sm}
- >
- <Skeleton height={SKELETON_LOADER_HEIGHT_SIZES.standard.s} />
- </SkeletonTheme>
+ <SkeletonLine
+ borderRadius={themeCssVariables.border.radius.smRound}
+ height={SKELETON_HEIGHT_SIZES.s}
+ />
);
};
diff --git a/packages/twenty-front/src/modules/ui/feedback/skeleton/components/SkeletonLine.tsx b/packages/twenty-front/src/modules/ui/feedback/skeleton/components/SkeletonLine.tsx
new file mode 100644
index 00000000000..ca5fdf87828
--- /dev/null
+++ b/packages/twenty-front/src/modules/ui/feedback/skeleton/components/SkeletonLine.tsx
@@ -0,0 +1,55 @@
+import { type ComponentProps, Fragment } from 'react';
+import { Skeleton } from 'twenty-ui/primitives/feedback';
+import { themeCssVariables } from 'twenty-ui/theme';
+
+type SkeletonLineProps = Pick<
+ ComponentProps<typeof Skeleton>,
+ | 'width'
+ | 'height'
+ | 'className'
+ | 'style'
+ | 'baseColor'
+ | 'highlightColor'
+ | 'borderRadius'
+ | 'animated'
+ | 'render'
+ | 'ref'
+> & {
+ count?: number;
+ containerClassName?: string;
+};
+
+export const SkeletonLine = ({
+ width,
+ height,
+ count = 1,
+ containerClassName,
+ className,
+ style,
+ baseColor = themeCssVariables.background.tertiary,
+ highlightColor = themeCssVariables.background.transparent.lighter,
+ borderRadius = 4,
+ animated = true,
+ render,
+ ref,
+}: SkeletonLineProps) => (
+ <span className={containerClassName} aria-live="polite" aria-busy={animated}>
+ {Array.from({ length: count }, (_, index) => (
+ <Fragment key={index}>
+ <Skeleton
+ width={width}
+ height={height}
+ className={className}
+ style={style}
+ baseColor={baseColor}
+ highlightColor={highlightColor}
+ borderRadius={borderRadius}
+ animated={animated}
+ render={render}
+ ref={ref}
+ />
+ <br />
+ </Fragment>
+ ))}
+ </span>
+);
diff --git a/packages/twenty-front/src/modules/ui/feedback/skeleton/components/__tests__/SkeletonLine.test.tsx b/packages/twenty-front/src/modules/ui/feedback/skeleton/components/__tests__/SkeletonLine.test.tsx
new file mode 100644
index 00000000000..917d3977661
--- /dev/null
+++ b/packages/twenty-front/src/modules/ui/feedback/skeleton/components/__tests__/SkeletonLine.test.tsx
@@ -0,0 +1,37 @@
+import { render } from '@testing-library/react';
+
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
+
+describe('SkeletonLine', () => {
+ it('groups repeated placeholders and line breaks in one loading region', () => {
+ const { container } = render(<SkeletonLine count={3} height={32} />);
+ const loadingRegions = container.querySelectorAll('[aria-live="polite"]');
+ const loadingRegion = loadingRegions[0];
+
+ expect(loadingRegions).toHaveLength(1);
+ expect(loadingRegion).toHaveAttribute('aria-busy', 'true');
+ expect(loadingRegion.querySelectorAll('[data-skeleton]')).toHaveLength(3);
+ expect(loadingRegion.querySelectorAll('br')).toHaveLength(3);
+
+ for (const placeholder of loadingRegion.querySelectorAll(
+ '[data-skeleton]',
+ )) {
+ expect(placeholder).toHaveAttribute('aria-hidden', 'true');
+ expect(placeholder.nextElementSibling?.tagName).toBe('BR');
+ }
+ });
+
+ it('stops marking the loading region busy when animation is disabled', () => {
+ const { container, rerender } = render(<SkeletonLine />);
+
+ rerender(<SkeletonLine animated={false} />);
+
+ expect(container.querySelector('[aria-live="polite"]')).toHaveAttribute(
+ 'aria-busy',
+ 'false',
+ );
+ expect(container.querySelector('[data-skeleton]')).not.toHaveAttribute(
+ 'data-animated',
+ );
+ });
+});
diff --git a/packages/twenty-front/src/modules/ui/feedback/skeleton/constants/LEGACY_SKELETON_COLORS.ts b/packages/twenty-front/src/modules/ui/feedback/skeleton/constants/LEGACY_SKELETON_COLORS.ts
new file mode 100644
index 00000000000..a7f252ae313
--- /dev/null
+++ b/packages/twenty-front/src/modules/ui/feedback/skeleton/constants/LEGACY_SKELETON_COLORS.ts
@@ -0,0 +1,4 @@
+export const LEGACY_SKELETON_COLORS = {
+ base: '#ebebeb',
+ highlight: '#f5f5f5',
+};
diff --git a/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePicker.tsx b/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePicker.tsx
index 3a496732f26..33ba64168cb 100644
--- a/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePicker.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePicker.tsx
@@ -1,9 +1,9 @@
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import { styled } from '@linaria/react';
import { Suspense, lazy, type ComponentType } from 'react';
import type { DatePickerProps as ReactDatePickerLibProps } from 'react-datepicker';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
+import { SKELETON_HEIGHT_SIZES } from 'twenty-ui/primitives/feedback';
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
import { CalendarStartDay } from 'twenty-shared/constants';
@@ -209,28 +209,26 @@ export const DatePicker = ({
<Suspense
fallback={
<StyledDatePickerFallback>
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
+ <SkeletonLine
+ width={DATE_PICKER_CONTAINER_WIDTH - 16}
+ height={SKELETON_HEIGHT_SIZES.l}
borderRadius={2}
- >
- <Skeleton
- width={DATE_PICKER_CONTAINER_WIDTH - 16}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.l}
- />
- <Skeleton
- width={DATE_PICKER_CONTAINER_WIDTH - 16}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.l}
- />
- <Skeleton
- width={DATE_PICKER_CONTAINER_WIDTH - 16}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.l}
- />
- <Skeleton
- width={DATE_PICKER_CONTAINER_WIDTH - 16}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.l}
- />
- </SkeletonTheme>
+ />
+ <SkeletonLine
+ width={DATE_PICKER_CONTAINER_WIDTH - 16}
+ height={SKELETON_HEIGHT_SIZES.l}
+ borderRadius={2}
+ />
+ <SkeletonLine
+ width={DATE_PICKER_CONTAINER_WIDTH - 16}
+ height={SKELETON_HEIGHT_SIZES.l}
+ borderRadius={2}
+ />
+ <SkeletonLine
+ width={DATE_PICKER_CONTAINER_WIDTH - 16}
+ height={SKELETON_HEIGHT_SIZES.l}
+ borderRadius={2}
+ />
</StyledDatePickerFallback>
}
>
diff --git a/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePickerWithoutCalendar.tsx b/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePickerWithoutCalendar.tsx
index d30f73bec8f..a96bdc03c3d 100644
--- a/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePickerWithoutCalendar.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePickerWithoutCalendar.tsx
@@ -1,9 +1,9 @@
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import { styled } from '@linaria/react';
import { Suspense, lazy, type ComponentType } from 'react';
import type { DatePickerProps as ReactDatePickerLibProps } from 'react-datepicker';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
+import { SKELETON_HEIGHT_SIZES } from 'twenty-ui/primitives/feedback';
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
import { CalendarStartDay } from 'twenty-shared/constants';
@@ -19,7 +19,7 @@ import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomState
import { Temporal } from 'temporal-polyfill';
import { type Nullable } from 'twenty-shared/types';
import { isDefined, turnJSDateToPlainDate } from 'twenty-shared/utils';
-import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { themeCssVariables } from 'twenty-ui/theme';
const DATE_PICKER_SKELETON_PADDING = 16;
@@ -73,7 +73,6 @@ export const DatePickerWithoutCalendar = ({
onChange,
onClose,
}: DatePickerWithoutCalendarProps) => {
- const theme = useTheme();
const plainDate = isDefined(date) ? Temporal.PlainDate.from(date) : null;
const currentWorkspaceMember = useAtomStateValue(currentWorkspaceMemberState);
@@ -142,36 +141,34 @@ export const DatePickerWithoutCalendar = ({
<Suspense
fallback={
<StyledDatePickerFallback>
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
+ <SkeletonLine
+ width={
+ DATE_PICKER_CONTAINER_WIDTH - DATE_PICKER_SKELETON_PADDING
+ }
+ height={SKELETON_HEIGHT_SIZES.l}
borderRadius={2}
- >
- <Skeleton
- width={
- DATE_PICKER_CONTAINER_WIDTH - DATE_PICKER_SKELETON_PADDING
- }
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.l}
- />
- <Skeleton
- width={
- DATE_PICKER_CONTAINER_WIDTH - DATE_PICKER_SKELETON_PADDING
- }
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.l}
- />
- <Skeleton
- width={
- DATE_PICKER_CONTAINER_WIDTH - DATE_PICKER_SKELETON_PADDING
- }
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.l}
- />
- <Skeleton
- width={
- DATE_PICKER_CONTAINER_WIDTH - DATE_PICKER_SKELETON_PADDING
- }
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.l}
- />
- </SkeletonTheme>
+ />
+ <SkeletonLine
+ width={
+ DATE_PICKER_CONTAINER_WIDTH - DATE_PICKER_SKELETON_PADDING
+ }
+ height={SKELETON_HEIGHT_SIZES.l}
+ borderRadius={2}
+ />
+ <SkeletonLine
+ width={
+ DATE_PICKER_CONTAINER_WIDTH - DATE_PICKER_SKELETON_PADDING
+ }
+ height={SKELETON_HEIGHT_SIZES.l}
+ borderRadius={2}
+ />
+ <SkeletonLine
+ width={
+ DATE_PICKER_CONTAINER_WIDTH - DATE_PICKER_SKELETON_PADDING
+ }
+ height={SKELETON_HEIGHT_SIZES.l}
+ borderRadius={2}
+ />
</StyledDatePickerFallback>
}
>
diff --git a/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DateTimePicker.tsx b/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DateTimePicker.tsx
index 9a653a3dc6a..4f25788eb37 100644
--- a/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DateTimePicker.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DateTimePicker.tsx
@@ -1,4 +1,4 @@
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import {
convertFirstDayOfTheWeekToCalendarStartDayNumber,
isDefined,
@@ -15,7 +15,7 @@ import { styled } from '@linaria/react';
import { t } from '@lingui/core/macro';
import { Suspense, lazy, type ComponentType } from 'react';
import type { DatePickerProps as ReactDatePickerLibProps } from 'react-datepicker';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
+import { SKELETON_HEIGHT_SIZES } from 'twenty-ui/primitives/feedback';
import 'react-datepicker/dist/react-datepicker.css';
@@ -270,28 +270,10 @@ export const DateTimePicker = ({
<Suspense
fallback={
<StyledDatePickerFallback>
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={4}
- >
- <Skeleton
- width={200}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.m}
- />
- <Skeleton
- width={240}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.l}
- />
- <Skeleton
- width={220}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.m}
- />
- <Skeleton
- width={180}
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.s}
- />
- </SkeletonTheme>
+ <SkeletonLine width={200} height={SKELETON_HEIGHT_SIZES.m} />
+ <SkeletonLine width={240} height={SKELETON_HEIGHT_SIZES.l} />
+ <SkeletonLine width={220} height={SKELETON_HEIGHT_SIZES.m} />
+ <SkeletonLine width={180} height={SKELETON_HEIGHT_SIZES.s} />
</StyledDatePickerFallback>
}
>
diff --git a/packages/twenty-front/src/modules/ui/input/relation-picker/components/skeletons/DropdownMenuSkeletonItem.tsx b/packages/twenty-front/src/modules/ui/input/relation-picker/components/skeletons/DropdownMenuSkeletonItem.tsx
index 081b79b89c0..4b1012f4c27 100644
--- a/packages/twenty-front/src/modules/ui/input/relation-picker/components/skeletons/DropdownMenuSkeletonItem.tsx
+++ b/packages/twenty-front/src/modules/ui/input/relation-picker/components/skeletons/DropdownMenuSkeletonItem.tsx
@@ -1,8 +1,8 @@
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import { type CSSWidth } from '@/ui/types/CSSWidth';
import { styled } from '@linaria/react';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
-import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { SKELETON_HEIGHT_SIZES } from 'twenty-ui/primitives/feedback';
+import { themeCssVariables } from 'twenty-ui/theme';
const StyledDropdownMenuSkeletonContainer = styled.div`
--horizontal-padding: ${themeCssVariables.spacing[1]};
--vertical-padding: ${themeCssVariables.spacing[2]};
@@ -26,19 +26,16 @@ export const DropdownMenuSkeletonItem = ({
}: {
width?: CSSWidth;
}) => {
- const theme = useTheme();
return (
<StyledDropdownMenuSkeletonContainer>
- <SkeletonTheme
- baseColor={theme.background.quaternary}
- highlightColor={theme.background.secondary}
- >
- <Skeleton
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.s}
- style={{ lineHeight: 0 }}
- width={width}
- />
- </SkeletonTheme>
+ <SkeletonLine
+ borderRadius="0.25rem"
+ height={SKELETON_HEIGHT_SIZES.s}
+ style={{ lineHeight: 0 }}
+ width={width}
+ baseColor={themeCssVariables.background.quaternary}
+ highlightColor={themeCssVariables.background.secondary}
+ />
</StyledDropdownMenuSkeletonContainer>
);
};
diff --git a/packages/twenty-front/src/modules/ui/layout/show-page/components/FieldRichTextCard.tsx b/packages/twenty-front/src/modules/ui/layout/show-page/components/FieldRichTextCard.tsx
index 8c8e847f6c4..082c0f92833 100644
--- a/packages/twenty-front/src/modules/ui/layout/show-page/components/FieldRichTextCard.tsx
+++ b/packages/twenty-front/src/modules/ui/layout/show-page/components/FieldRichTextCard.tsx
@@ -1,14 +1,14 @@
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import { type CoreObjectNameSingular } from 'twenty-shared/types';
import { recordStoreFamilySelector } from '@/object-record/record-store/states/selectors/recordStoreFamilySelector';
import { useTargetRecord } from '@/ui/layout/contexts/useTargetRecord';
import { ScrollWrapper } from '@/ui/utilities/scroll/components/ScrollWrapper';
import { styled } from '@linaria/react';
import { lazy, Suspense } from 'react';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
+import { SKELETON_HEIGHT_SIZES } from 'twenty-ui/primitives/feedback';
import { useAtomFamilySelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilySelectorValue';
import { isDefined } from 'twenty-shared/utils';
-import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { themeCssVariables } from 'twenty-ui/theme';
const ActivityRichTextEditor = lazy(() =>
import('@/activities/components/ActivityRichTextEditor').then((module) => ({
@@ -32,16 +32,12 @@ const StyledSkeletonContainer = styled.div`
`;
const LoadingSkeleton = () => {
- const theme = useTheme();
return (
<StyledSkeletonContainer>
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
+ <SkeletonLine
+ height={SKELETON_HEIGHT_SIZES.s}
borderRadius={themeCssVariables.border.radius.md}
- >
- <Skeleton height={SKELETON_LOADER_HEIGHT_SIZES.standard.s} />
- </SkeletonTheme>
+ />
</StyledSkeletonContainer>
);
};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowRunCard.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowRunCard.tsx
index ed803dd15d8..5fbcc30b51d 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowRunCard.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowRunCard.tsx
@@ -1,4 +1,4 @@
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import { useTargetRecord } from '@/ui/layout/contexts/useTargetRecord';
import { getWorkflowVisualizerComponentInstanceId } from '@/workflow/utils/getWorkflowVisualizerComponentInstanceId';
import { WorkflowRunSSESubscribeEffect } from '@/workflow/workflow-diagram/components/WorkflowRunSSESubscribeEffect';
@@ -8,8 +8,8 @@ import { WorkflowRunVisualizerComponentInstanceContext } from '@/workflow/workfl
import { WorkflowVisualizerComponentInstanceContext } from '@/workflow/workflow-diagram/states/contexts/WorkflowVisualizerComponentInstanceContext';
import { styled } from '@linaria/react';
import { Suspense, useId } from 'react';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
-import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { SKELETON_HEIGHT_SIZES } from 'twenty-ui/primitives/feedback';
+import { themeCssVariables } from 'twenty-ui/theme';
const StyledLoadingSkeletonContainer = styled.div`
display: flex;
flex-direction: column;
@@ -20,18 +20,20 @@ const StyledLoadingSkeletonContainer = styled.div`
`;
const LoadingSkeleton = () => {
- const theme = useTheme();
return (
<StyledLoadingSkeletonContainer>
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={theme.border.radius.sm}
- >
- <Skeleton height={SKELETON_LOADER_HEIGHT_SIZES.standard.m} />
- <Skeleton height={SKELETON_LOADER_HEIGHT_SIZES.standard.m} />
- <Skeleton height={SKELETON_LOADER_HEIGHT_SIZES.standard.m} />
- </SkeletonTheme>
+ <SkeletonLine
+ borderRadius={themeCssVariables.border.radius.smRound}
+ height={SKELETON_HEIGHT_SIZES.m}
+ />
+ <SkeletonLine
+ borderRadius={themeCssVariables.border.radius.smRound}
+ height={SKELETON_HEIGHT_SIZES.m}
+ />
+ <SkeletonLine
+ borderRadius={themeCssVariables.border.radius.smRound}
+ height={SKELETON_HEIGHT_SIZES.m}
+ />
</StyledLoadingSkeletonContainer>
);
};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowVersionCard.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowVersionCard.tsx
index 4cc241a406e..70404f2f7bd 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowVersionCard.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowVersionCard.tsx
@@ -1,4 +1,4 @@
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import { useTargetRecord } from '@/ui/layout/contexts/useTargetRecord';
import { getWorkflowVisualizerComponentInstanceId } from '@/workflow/utils/getWorkflowVisualizerComponentInstanceId';
import { WorkflowVersionVisualizer } from '@/workflow/workflow-diagram/components/WorkflowVersionVisualizer';
@@ -6,8 +6,8 @@ import { WorkflowVersionVisualizerEffect } from '@/workflow/workflow-diagram/com
import { WorkflowVisualizerComponentInstanceContext } from '@/workflow/workflow-diagram/states/contexts/WorkflowVisualizerComponentInstanceContext';
import { styled } from '@linaria/react';
import { Suspense } from 'react';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
-import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { SKELETON_HEIGHT_SIZES } from 'twenty-ui/primitives/feedback';
+import { themeCssVariables } from 'twenty-ui/theme';
const StyledLoadingSkeletonContainer = styled.div`
display: flex;
flex-direction: column;
@@ -18,18 +18,20 @@ const StyledLoadingSkeletonContainer = styled.div`
`;
const LoadingSkeleton = () => {
- const theme = useTheme();
return (
<StyledLoadingSkeletonContainer>
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={theme.border.radius.sm}
- >
- <Skeleton height={SKELETON_LOADER_HEIGHT_SIZES.standard.m} />
- <Skeleton height={SKELETON_LOADER_HEIGHT_SIZES.standard.m} />
- <Skeleton height={SKELETON_LOADER_HEIGHT_SIZES.standard.m} />
- </SkeletonTheme>
+ <SkeletonLine
+ borderRadius={themeCssVariables.border.radius.smRound}
+ height={SKELETON_HEIGHT_SIZES.m}
+ />
+ <SkeletonLine
+ borderRadius={themeCssVariables.border.radius.smRound}
+ height={SKELETON_HEIGHT_SIZES.m}
+ />
+ <SkeletonLine
+ borderRadius={themeCssVariables.border.radius.smRound}
+ height={SKELETON_HEIGHT_SIZES.m}
+ />
</StyledLoadingSkeletonContainer>
);
};
diff --git a/packages/twenty-front/src/pages/auth/PasswordReset.tsx b/packages/twenty-front/src/pages/auth/PasswordReset.tsx
index be0fe4602d1..07acb785df0 100644
--- a/packages/twenty-front/src/pages/auth/PasswordReset.tsx
+++ b/packages/twenty-front/src/pages/auth/PasswordReset.tsx
@@ -1,4 +1,4 @@
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import { Logo } from '@/auth/components/Logo';
import { StyledAuthContent } from '@/auth/components/StyledAuthContent';
import { StyledOnboardingContentContainer } from '@/auth/components/StyledOnboardingContentContainer';
@@ -27,12 +27,12 @@ import { isNonEmptyString } from '@sniptt/guards';
import { motion } from 'framer-motion';
import { useEffect, useState } from 'react';
import { Controller, useForm } from 'react-hook-form';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
+import { SKELETON_HEIGHT_SIZES } from 'twenty-ui/primitives/feedback';
import { useParams } from 'react-router-dom';
import { AppPath } from 'twenty-shared/types';
import { useToast } from 'twenty-ui/components/feedback';
import { MainButton } from 'twenty-ui/components/input';
-import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { themeCssVariables } from 'twenty-ui/theme';
import { z } from 'zod';
import {
UpdatePasswordViaResetTokenDocument,
@@ -82,7 +82,6 @@ const StyledMainButtonContainer = styled.div`
`;
export const PasswordReset = () => {
- const theme = useTheme();
const { t } = useLingui();
const { enqueueToast } = useToast();
@@ -222,18 +221,16 @@ export const PasswordReset = () => {
<Title animate>{passwordActionLabel}</Title>
<StyledOnboardingContentContainer>
{!email ? (
- <SkeletonTheme
- baseColor={theme.background.quaternary}
- highlightColor={theme.background.secondary}
- >
- <Skeleton
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.m}
- count={2}
- style={{
- marginBottom: themeCssVariables.spacing[2],
- }}
- />
- </SkeletonTheme>
+ <SkeletonLine
+ borderRadius="0.25rem"
+ height={SKELETON_HEIGHT_SIZES.m}
+ count={2}
+ style={{
+ marginBottom: themeCssVariables.spacing[2],
+ }}
+ baseColor={themeCssVariables.background.quaternary}
+ highlightColor={themeCssVariables.background.secondary}
+ />
) : (
<StyledForm onSubmit={handleSubmit(onSubmit)}>
<StyledFullWidthContainer>
diff --git a/packages/twenty-front/src/pages/settings/ai/SettingsSkillForm.tsx b/packages/twenty-front/src/pages/settings/ai/SettingsSkillForm.tsx
index 300145b028f..6e4985a0cab 100644
--- a/packages/twenty-front/src/pages/settings/ai/SettingsSkillForm.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/SettingsSkillForm.tsx
@@ -1,6 +1,5 @@
import { useQuery } from '@apollo/client/react';
import { t } from '@lingui/core/macro';
-import Skeleton from 'react-loading-skeleton';
import { useParams } from 'react-router-dom';
import { isDefined } from 'twenty-shared/utils';
import { Section } from 'twenty-ui/components/layout';
@@ -9,6 +8,8 @@ import { useTheme } from 'twenty-ui/theme';
import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
import { SettingsPageLayout } from '@/settings/components/layout/SettingsPageLayout';
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
+import { LEGACY_SKELETON_COLORS } from '@/ui/feedback/skeleton/constants/LEGACY_SKELETON_COLORS';
import { FindOneSkillDocument } from '~/generated-metadata/graphql';
import { SettingsSkillFormContent } from '~/pages/settings/ai/components/SettingsSkillFormContent';
import { useNavigateToNotFoundOnLoadFailure } from '~/pages/settings/ai/hooks/useNavigateToNotFoundOnLoadFailure';
@@ -54,7 +55,12 @@ export const SettingsSkillForm = ({ mode }: { mode: 'create' | 'edit' }) => {
>
<SettingsPageContainer>
<Section.Root>
- <Skeleton height={400} borderRadius={4} />
+ <SkeletonLine
+ baseColor={LEGACY_SKELETON_COLORS.base}
+ highlightColor={LEGACY_SKELETON_COLORS.highlight}
+ height={400}
+ borderRadius={4}
+ />
</Section.Root>
</SettingsPageContainer>
</SettingsPageLayout>
diff --git a/packages/twenty-front/src/pages/settings/ai/SettingsToolDetail.tsx b/packages/twenty-front/src/pages/settings/ai/SettingsToolDetail.tsx
index ecbdf0a62c6..5f4a672c9ae 100644
--- a/packages/twenty-front/src/pages/settings/ai/SettingsToolDetail.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/SettingsToolDetail.tsx
@@ -1,3 +1,4 @@
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
import { useGetOneLogicFunction } from '@/logic-functions/hooks/useGetOneLogicFunction';
import { usePersistLogicFunction } from '@/logic-functions/hooks/usePersistLogicFunction';
@@ -11,7 +12,7 @@ import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomState
import { useQuery } from '@apollo/client/react';
import { t } from '@lingui/core/macro';
import { useState } from 'react';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
+
import { useNavigate, useParams } from 'react-router-dom';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath, isDefined, isValidUuid } from 'twenty-shared/utils';
@@ -19,7 +20,6 @@ import { useToast } from 'twenty-ui/components/feedback';
import { Section } from 'twenty-ui/components/layout';
import { IconTrash } from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
-import { useTheme } from 'twenty-ui/theme';
import { useDebouncedCallback } from 'use-debounce';
import {
GetToolIndexDocument,
@@ -32,7 +32,6 @@ const DELETE_TOOL_MODAL_ID = 'delete-tool-modal';
export const SettingsToolDetail = () => {
const { toolIdentifier } = useParams();
- const theme = useTheme();
const navigate = useNavigate();
const { enqueueToast } = useToast();
const { updateLogicFunction, deleteLogicFunction } =
@@ -201,18 +200,12 @@ export const SettingsToolDetail = () => {
>
<SettingsPageContainer>
{loading ? (
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={4}
- >
- <Section.Root>
- <Skeleton height={20} width={200} />
- <Skeleton height={20} width={400} />
+ <Section.Root>
+ <SkeletonLine height={20} width={200} />
+ <SkeletonLine height={20} width={400} />
- <Skeleton height={80} />
- </Section.Root>
- </SkeletonTheme>
+ <SkeletonLine height={80} />
+ </Section.Root>
) : (
<>
<Section.Root>
diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentSkillsTable.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentSkillsTable.tsx
index c72f6dc8022..ee83aed128f 100644
--- a/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentSkillsTable.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentSkillsTable.tsx
@@ -1,7 +1,8 @@
import { styled } from '@linaria/react';
import { useLingui } from '@lingui/react/macro';
-import Skeleton from 'react-loading-skeleton';
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
+import { LEGACY_SKELETON_COLORS } from '@/ui/feedback/skeleton/constants/LEGACY_SKELETON_COLORS';
import { SortableTableHeader } from '@/ui/layout/table/components/SortableTableHeader';
import { Table } from '@/ui/layout/table/components/Table';
import { TableHeader } from '@/ui/layout/table/components/TableHeader';
@@ -59,7 +60,13 @@ export const SettingsAgentSkillsTable = ({
</StyledTableHeaderRowContainer>
{showSkeleton
? Array.from({ length: 3 }).map((_, index) => (
- <Skeleton height={32} borderRadius={4} key={index} />
+ <SkeletonLine
+ baseColor={LEGACY_SKELETON_COLORS.base}
+ highlightColor={LEGACY_SKELETON_COLORS.highlight}
+ height={32}
+ borderRadius={4}
+ key={index}
+ />
))
: skills.map((skill) => (
<SettingsSkillTableRow
diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentToolsTable.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentToolsTable.tsx
index 2feb7db9b76..0a0dd08f23b 100644
--- a/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentToolsTable.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentToolsTable.tsx
@@ -1,4 +1,4 @@
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import { type CurrentWorkspace } from '@/auth/states/currentWorkspaceState';
import { Table } from '@/ui/layout/table/components/Table';
@@ -56,14 +56,7 @@ export const SettingsAgentToolsTable = ({
</StyledTableHeaderRowContainer>
{isLoading
? Array.from({ length: 3 }).map((_, index) => (
- <SkeletonTheme
- key={index}
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={4}
- >
- <Skeleton height={32} borderRadius={4} />
- </SkeletonTheme>
+ <SkeletonLine height={32} key={index} />
))
: tools.map((tool) => {
const application = isDefined(tool.applicationId)
diff --git a/packages/twenty-front/src/pages/settings/billing/SettingsUsageUserDetail.tsx b/packages/twenty-front/src/pages/settings/billing/SettingsUsageUserDetail.tsx
index 8bdaa0f1cee..101aeab20c8 100644
--- a/packages/twenty-front/src/pages/settings/billing/SettingsUsageUserDetail.tsx
+++ b/packages/twenty-front/src/pages/settings/billing/SettingsUsageUserDetail.tsx
@@ -1,3 +1,4 @@
+import { SkeletonLine } from '@/ui/feedback/skeleton/components/SkeletonLine';
import { SettingsBillingLabelValueItem } from '@/settings/billing/components/internal/SettingsBillingLabelValueItem';
import { SubscriptionInfoContainer } from '@/settings/billing/components/SubscriptionInfoContainer';
import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
@@ -10,13 +11,13 @@ import { SettingsPageLayout } from '@/settings/components/layout/SettingsPageLay
import { styled } from '@linaria/react';
import { t } from '@lingui/core/macro';
import { Trans, useLingui } from '@lingui/react/macro';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
+
import { useParams } from 'react-router-dom';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath } from 'twenty-shared/utils';
import { Section } from 'twenty-ui/components/layout';
import { Avatar } from 'twenty-ui/primitives/data-display';
-import { useTheme, themeCssVariables } from 'twenty-ui/theme';
+import { themeCssVariables } from 'twenty-ui/theme';
const StyledUserHeader = styled.div`
align-items: center;
@@ -44,7 +45,6 @@ const StyledUserCredits = styled.span`
export const SettingsUsageUserDetail = () => {
const { t: tLingui } = useLingui();
const { userWorkspaceId } = useParams<{ userWorkspaceId: string }>();
- const theme = useTheme();
const { formatUsageValue } = useUsageValueFormatter();
const { analytics, isInitialLoading } = useUsageAnalyticsData({
@@ -90,21 +90,15 @@ export const SettingsUsageUserDetail = () => {
return (
<SettingsPageLayout title={tLingui`User Usage`} links={breadcrumbLinks}>
<SettingsPageContainer>
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- borderRadius={4}
- >
- <StyledUserHeader>
- <Skeleton width={40} height={40} borderRadius={8} />
- <StyledUserInfo>
- <Skeleton width={160} height={16} />
- <Skeleton width={100} height={13} />
- </StyledUserInfo>
- </StyledUserHeader>
- <UsageSectionSkeleton />
- <UsageSectionSkeleton />
- </SkeletonTheme>
+ <StyledUserHeader>
+ <SkeletonLine width={40} height={40} borderRadius={8} />
+ <StyledUserInfo>
+ <SkeletonLine width={160} height={16} />
+ <SkeletonLine width={100} height={13} />
+ </StyledUserInfo>
+ </StyledUserHeader>
+ <UsageSectionSkeleton />
+ <UsageSectionSkeleton />
</SettingsPageContainer>
</SettingsPageLayout>
);
diff --git a/packages/twenty-shared/src/constants/DocumentationPaths.ts b/packages/twenty-shared/src/constants/DocumentationPaths.ts
index e0020fdefa1..14b8211eaaf 100644
--- a/packages/twenty-shared/src/constants/DocumentationPaths.ts
+++ b/packages/twenty-shared/src/constants/DocumentationPaths.ts
@@ -182,6 +182,7 @@ export const DOCUMENTATION_PATHS = {
UI_PRIMITIVES_FEEDBACK_LOADER: '/ui/primitives/feedback/loader',
UI_PRIMITIVES_FEEDBACK_PROGRESS_BAR: '/ui/primitives/feedback/progress-bar',
UI_PRIMITIVES_FEEDBACK_PROGRESS_RING: '/ui/primitives/feedback/progress-ring',
+ UI_PRIMITIVES_FEEDBACK_SKELETON: '/ui/primitives/feedback/skeleton',
UI_PRIMITIVES_INPUT_BUTTON: '/ui/primitives/input/button',
UI_PRIMITIVES_INPUT_BUTTON_GROUP: '/ui/primitives/input/button-group',
UI_PRIMITIVES_INPUT_CHECKBOX: '/ui/primitives/input/checkbox',
diff --git a/packages/twenty-ui/docs/components.ts b/packages/twenty-ui/docs/components.ts
index d1faa1cf7d2..1aabd49c2d7 100644
--- a/packages/twenty-ui/docs/components.ts
+++ b/packages/twenty-ui/docs/components.ts
@@ -52,6 +52,7 @@ import { ICON_BUTTON_PROP_DESCRIPTIONS } from './iconButtonPropDescriptions';
import { LIGHT_BUTTON_PROP_DESCRIPTIONS } from './lightButtonPropDescriptions';
import { LIGHT_ICON_BUTTON_PROP_DESCRIPTIONS } from './lightIconButtonPropDescriptions';
import { LOADER_PROP_DESCRIPTIONS } from './loaderPropDescriptions';
+import { SKELETON_PROP_DESCRIPTIONS } from './skeletonPropDescriptions';
import { OVERFLOWING_TEXT_WITH_TOOLTIP_PROP_DESCRIPTIONS } from './overflowingTextWithTooltipPropDescriptions';
import { PILL_PROP_DESCRIPTIONS } from './pillPropDescriptions';
import { PROGRESS_BAR_PROP_DESCRIPTIONS } from './progressBarPropDescriptions';
@@ -150,6 +151,13 @@ export const DOCUMENTED_COMPONENTS = [
slug: 'feedback/loader',
propDescriptions: LOADER_PROP_DESCRIPTIONS,
},
+ {
+ name: 'Skeleton',
+ source: 'primitives/feedback/Skeleton/Skeleton.tsx',
+ entryPoint: 'twenty-ui/primitives/feedback',
+ slug: 'feedback/skeleton',
+ propDescriptions: SKELETON_PROP_DESCRIPTIONS,
+ },
{
name: 'ProgressBar',
source: 'primitives/feedback/ProgressBar/ProgressBar.tsx',
diff --git a/packages/twenty-ui/docs/module-ownership.json b/packages/twenty-ui/docs/module-ownership.json
index 56ef29665da..499d487f317 100644
--- a/packages/twenty-ui/docs/module-ownership.json
+++ b/packages/twenty-ui/docs/module-ownership.json
@@ -34,6 +34,7 @@
"Select",
"Separator",
"Shortcut",
+ "Skeleton",
"Slider",
"Status",
"Switch",
diff --git a/packages/twenty-ui/docs/public-exports.json b/packages/twenty-ui/docs/public-exports.json
index 2b1d6e694d3..5a3720db148 100644
--- a/packages/twenty-ui/docs/public-exports.json
+++ b/packages/twenty-ui/docs/public-exports.json
@@ -739,14 +739,17 @@
"Banner": "primitives/feedback/Banner/Banner",
"Loader": "primitives/feedback/Loader/Loader",
"ProgressBar": "primitives/feedback/ProgressBar/ProgressBar",
- "ProgressRing": "primitives/feedback/ProgressRing/ProgressRing"
+ "ProgressRing": "primitives/feedback/ProgressRing/ProgressRing",
+ "Skeleton": "primitives/feedback/Skeleton/Skeleton",
+ "SKELETON_HEIGHT_SIZES": "primitives/feedback/Skeleton/constants/SKELETON_HEIGHT_SIZES"
},
"types": {
"BannerColor": "primitives/feedback/Banner/Banner",
"BannerVariant": "primitives/feedback/Banner/Banner",
"LoaderProps": "primitives/feedback/Loader/types/LoaderProps",
"ProgressBarProps": "primitives/feedback/ProgressBar/types/ProgressBarProps",
- "ProgressRingProps": "primitives/feedback/ProgressRing/types/ProgressRingProps"
+ "ProgressRingProps": "primitives/feedback/ProgressRing/types/ProgressRingProps",
+ "SkeletonProps": "primitives/feedback/Skeleton/types/SkeletonProps"
}
},
"primitives/input": {
diff --git a/packages/twenty-ui/docs/skeletonPropDescriptions.ts b/packages/twenty-ui/docs/skeletonPropDescriptions.ts
new file mode 100644
index 00000000000..4866dd36121
--- /dev/null
+++ b/packages/twenty-ui/docs/skeletonPropDescriptions.ts
@@ -0,0 +1,21 @@
+export const SKELETON_PROP_DESCRIPTIONS = {
+ animated:
+ 'Animate the highlight by default. Reduced-motion preferences always disable animation.',
+ width:
+ 'Placeholder width in pixels or a CSS length. Defaults to the available width.',
+ height:
+ 'Placeholder height in pixels or a CSS length. Defaults to the inherited font height.',
+ borderRadius:
+ 'Corner radius in pixels or a CSS length. Defaults to 0.25rem and inherits the surrounding corner shape.',
+ baseColor:
+ 'Placeholder background color. Defaults to the theme tertiary background.',
+ highlightColor:
+ 'Animated highlight color. Defaults to the theme lighter transparent background.',
+ className: 'CSS class merged with the placeholder class.',
+ style:
+ 'Native styles merged with the placeholder dimensions and colors. Explicit styles win.',
+ ref: 'Ref to the placeholder span, or the element supplied through render.',
+ render: 'Element or render callback composed through Base UI useRender.',
+ 'aria-hidden':
+ 'Placeholders are decorative and hidden from assistive technology by default. The host owns loading announcements.',
+};
diff --git a/packages/twenty-ui/generated/components.docs.json b/packages/twenty-ui/generated/components.docs.json
index 4109f4abe57..afb951d1c1d 100644
--- a/packages/twenty-ui/generated/components.docs.json
+++ b/packages/twenty-ui/generated/components.docs.json
@@ -675,6 +675,90 @@
}
]
},
+ {
+ "name": "Skeleton",
+ "entryPoint": "twenty-ui/primitives/feedback",
+ "slug": "feedback/skeleton",
+ "props": [
+ {
+ "name": "animated",
+ "type": "boolean",
+ "required": false,
+ "defaultValue": "true",
+ "description": "Animate the highlight by default. Reduced-motion preferences always disable animation."
+ },
+ {
+ "name": "aria-hidden",
+ "type": "Booleanish",
+ "required": false,
+ "defaultValue": null,
+ "description": "Placeholders are decorative and hidden from assistive technology by default. The host owns loading announcements."
+ },
+ {
+ "name": "baseColor",
+ "type": "BackgroundColor",
+ "required": false,
+ "defaultValue": null,
+ "description": "Placeholder background color. Defaults to the theme tertiary background."
+ },
+ {
+ "name": "borderRadius",
+ "type": "BorderRadius<string | number>",
+ "required": false,
+ "defaultValue": null,
+ "description": "Corner radius in pixels or a CSS length. Defaults to 0.25rem and inherits the surrounding corner shape."
+ },
+ {
+ "name": "className",
+ "type": "string",
+ "required": false,
+ "defaultValue": null,
+ "description": "CSS class merged with the placeholder class."
+ },
+ {
+ "name": "height",
+ "type": "Height<string | number>",
+ "required": false,
+ "defaultValue": null,
+ "description": "Placeholder height in pixels or a CSS length. Defaults to the inherited font height."
+ },
+ {
+ "name": "highlightColor",
+ "type": "BackgroundColor",
+ "required": false,
+ "defaultValue": null,
+ "description": "Animated highlight color. Defaults to the theme lighter transparent background."
+ },
+ {
+ "name": "ref",
+ "type": "Ref<HTMLSpanElement>",
+ "required": false,
+ "defaultValue": null,
+ "description": "Ref to the placeholder span, or the element supplied through render."
+ },
+ {
+ "name": "render",
+ "type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, {}>",
+ "required": false,
+ "defaultValue": null,
+ "description": "Element or render callback composed through Base UI useRender."
+ },
+ {
+ "name": "style",
+ "type": "CSSProperties",
+ "required": false,
+ "defaultValue": null,
+ "description": "Native styles merged with the placeholder dimensions and colors. Explicit styles win."
+ },
+ {
+ "name": "width",
+ "type": "Width<string | number>",
+ "required": false,
+ "defaultValue": null,
+ "description": "Placeholder width in pixels or a CSS length. Defaults to the available width."
+ }
+ ]
+ },
{
"name": "ProgressBar",
"entryPoint": "twenty-ui/primitives/feedback",
diff --git a/packages/twenty-ui/project.json b/packages/twenty-ui/project.json
index d44dafd183b..2fae3ba169d 100644
--- a/packages/twenty-ui/project.json
+++ b/packages/twenty-ui/project.json
@@ -161,12 +161,12 @@
},
"storybook:test": {
"options": {
- "command": "vitest run --coverage --shard={args.shard} --project storybook"
+ "command": "vitest run --coverage --shard={args.shard} --project storybook --project reduced-motion"
}
},
"storybook:test:no-coverage": {
"options": {
- "command": "vitest run --shard={args.shard} --project storybook"
+ "command": "vitest run --shard={args.shard} --project storybook --project reduced-motion"
}
},
"storybook:visual-diff": {
diff --git a/packages/twenty-ui/src/components/input/CurrencyPicker/__stories__/CurrencyPicker.interactions.stories.tsx b/packages/twenty-ui/src/components/input/CurrencyPicker/__stories__/CurrencyPicker.interactions.stories.tsx
index 66feacb0e59..b513e5753fa 100644
--- a/packages/twenty-ui/src/components/input/CurrencyPicker/__stories__/CurrencyPicker.interactions.stories.tsx
+++ b/packages/twenty-ui/src/components/input/CurrencyPicker/__stories__/CurrencyPicker.interactions.stories.tsx
@@ -178,6 +178,8 @@ export const DisabledCurrency: Story = {
await userEvent.keyboard('{Enter}');
await expect(args.onValueChange).toHaveBeenCalledOnce();
await expect(args.onValueChange).toHaveBeenCalledWith('JPY');
+ await waitFor(() => expect(dialog).not.toBeInTheDocument());
+ await waitFor(() => expect(trigger).toHaveFocus());
},
};
diff --git a/packages/twenty-ui/src/primitives/feedback/Skeleton/Skeleton.module.scss b/packages/twenty-ui/src/primitives/feedback/Skeleton/Skeleton.module.scss
new file mode 100644
index 00000000000..92d84383ed0
--- /dev/null
+++ b/packages/twenty-ui/src/primitives/feedback/Skeleton/Skeleton.module.scss
@@ -0,0 +1,44 @@
+.root {
+ --skeleton-base-color: var(--t-background-tertiary);
+ --skeleton-highlight-color: var(--t-background-transparent-lighter);
+
+ background-color: var(--skeleton-base-color);
+ border-radius: 0.25rem;
+ display: inline-flex;
+ line-height: 1;
+ overflow: hidden;
+ position: relative;
+ user-select: none;
+ width: 100%;
+
+ &[data-animated]::after {
+ animation: skeletonShimmer 1.5s ease-in-out infinite;
+ background-image: linear-gradient(
+ 90deg,
+ var(--skeleton-base-color) 0%,
+ var(--skeleton-highlight-color) 50%,
+ var(--skeleton-base-color) 100%
+ );
+ background-repeat: no-repeat;
+ content: ' ';
+ display: block;
+ height: 100%;
+ left: 0;
+ position: absolute;
+ right: 0;
+ top: 0;
+ transform: translateX(-100%);
+ }
+}
+
+@keyframes skeletonShimmer {
+ to {
+ transform: translateX(100%);
+ }
+}
+
+@media (prefers-reduced-motion: reduce) {
+ .root[data-animated]::after {
+ display: none;
+ }
+}
diff --git a/packages/twenty-ui/src/primitives/feedback/Skeleton/Skeleton.module.scss.d.ts b/packages/twenty-ui/src/primitives/feedback/Skeleton/Skeleton.module.scss.d.ts
new file mode 100644
index 00000000000..4d6743c3dcd
--- /dev/null
+++ b/packages/twenty-ui/src/primitives/feedback/Skeleton/Skeleton.module.scss.d.ts
@@ -0,0 +1,4 @@
+declare const classNames: {
+ readonly root: 'root';
+};
+export default classNames;
diff --git a/packages/twenty-ui/src/primitives/feedback/Skeleton/Skeleton.tsx b/packages/twenty-ui/src/primitives/feedback/Skeleton/Skeleton.tsx
new file mode 100644
index 00000000000..754b2f748c0
--- /dev/null
+++ b/packages/twenty-ui/src/primitives/feedback/Skeleton/Skeleton.tsx
@@ -0,0 +1,44 @@
+import { useRender } from '@base-ui/react/use-render';
+import { clsx } from 'clsx';
+import { type CSSProperties } from 'react';
+
+import { type SkeletonProps } from './types/SkeletonProps';
+
+import styles from './Skeleton.module.scss';
+
+export const Skeleton = ({
+ width,
+ height,
+ borderRadius,
+ baseColor,
+ highlightColor,
+ animated = true,
+ className,
+ style,
+ render,
+ ref,
+ ...props
+}: SkeletonProps) => {
+ return useRender({
+ defaultTagName: 'span',
+ render,
+ ref,
+ props: {
+ 'aria-hidden': true,
+ ...props,
+ 'data-skeleton': '',
+ 'data-animated': animated || undefined,
+ className: clsx(styles.root, className),
+ style: {
+ width,
+ height,
+ borderRadius,
+ backgroundColor: baseColor,
+ '--skeleton-base-color': baseColor,
+ '--skeleton-highlight-color': highlightColor,
+ ...style,
+ } as CSSProperties,
+ children: '\u200c',
+ },
+ });
+};
diff --git a/packages/twenty-ui/src/primitives/feedback/Skeleton/__stories__/Skeleton.stories.tsx b/packages/twenty-ui/src/primitives/feedback/Skeleton/__stories__/Skeleton.stories.tsx
new file mode 100644
index 00000000000..1d6c06ff08c
--- /dev/null
+++ b/packages/twenty-ui/src/primitives/feedback/Skeleton/__stories__/Skeleton.stories.tsx
@@ -0,0 +1,148 @@
+import { type Meta, type StoryObj } from '@storybook/react-vite';
+import { expect } from 'storybook/test';
+
+import { Skeleton } from '@ui/primitives/feedback';
+import { Text } from '@ui/primitives/typography';
+import { ComponentDecorator } from '@ui/testing';
+import { ThemeProvider } from '@ui/theme';
+
+const meta: Meta<typeof Skeleton> = {
+ title: 'UI/Feedback/Skeleton',
+ component: Skeleton,
+ decorators: [ComponentDecorator],
+ args: {
+ width: 240,
+ height: 16,
+ borderRadius: 4,
+ },
+ render: (args) => <Skeleton {...args} data-testid="placeholder" />,
+};
+
+export default meta;
+
+type Story = StoryObj<typeof Skeleton>;
+
+const isMotionEnabled = () =>
+ !window.matchMedia('(prefers-reduced-motion: reduce)').matches;
+
+export const Default: Story = {
+ play: async ({ canvas }) => {
+ const placeholder = canvas.getByTestId('placeholder');
+
+ await expect(placeholder).toBeVisible();
+ await expect(placeholder).toHaveAttribute('aria-hidden', 'true');
+ await expect(placeholder).toHaveStyle({ width: '240px', height: '16px' });
+ const highlight = getComputedStyle(placeholder, '::after');
+ const isAnimating =
+ highlight.animationName !== 'none' && highlight.display !== 'none';
+
+ await expect(isAnimating).toBe(isMotionEnabled());
+
+ const shapeStyle = getComputedStyle(placeholder);
+ const highlightColor = shapeStyle
+ .getPropertyValue('--skeleton-highlight-color')
+ .trim();
+
+ await expect(shapeStyle.backgroundColor).toBe(
+ shapeStyle.getPropertyValue('--t-background-tertiary').trim(),
+ );
+ await expect(highlightColor).toBe(
+ shapeStyle.getPropertyValue('--t-background-transparent-lighter').trim(),
+ );
+ await expect(highlight.backgroundImage).toBe(
+ `linear-gradient(90deg, ${shapeStyle.backgroundColor} 0%, ${highlightColor} 50%, ${shapeStyle.backgroundColor} 100%)`,
+ );
+ await expect(highlight.animationDuration).toBe('1.5s');
+ await expect(highlight.animationTimingFunction).toBe('ease-in-out');
+ await expect(highlight.animationIterationCount).toBe('infinite');
+ },
+};
+
+export const Shapes: Story = {
+ render: (args) => (
+ <Text
+ render={<div />}
+ style={{ display: 'flex', gap: 16, alignItems: 'center' }}
+ >
+ <Skeleton {...args} width={40} height={40} borderRadius="50%" />
+ <Text
+ render={<div />}
+ style={{ display: 'flex', flexDirection: 'column', gap: 8 }}
+ >
+ <Skeleton {...args} width={180} height={16} />
+ <Skeleton {...args} width={120} height={13} />
+ </Text>
+ </Text>
+ ),
+};
+
+export const Static: Story = {
+ args: { animated: false },
+};
+
+export const StaticBehavior: Story = {
+ ...Static,
+ play: async ({ canvas }) => {
+ const placeholder = canvas.getByTestId('placeholder');
+
+ await expect(placeholder).toBeVisible();
+ await expect(getComputedStyle(placeholder, '::after').animationName).toBe(
+ 'none',
+ );
+ },
+};
+
+export const Dark: Story = {
+ play: Default.play,
+ decorators: [
+ (Story) => (
+ <ThemeProvider colorScheme="dark">
+ <Story />
+ </ThemeProvider>
+ ),
+ ],
+};
+
+export const RightToLeft: Story = {
+ args: { dir: 'rtl' },
+ play: async ({ canvas }) => {
+ const highlight = getComputedStyle(
+ canvas.getByTestId('placeholder'),
+ '::after',
+ );
+
+ if (!isMotionEnabled()) {
+ await expect(highlight.display).toBe('none');
+ return;
+ }
+
+ await expect(highlight.animationDirection).toBe('normal');
+ },
+};
+
+export const Composition: Story = {
+ args: {
+ render: <div />,
+ width: '50%',
+ height: 32,
+ borderRadius: 8,
+ baseColor: '#123456',
+ highlightColor: '#abcdef',
+ style: { marginTop: 8 },
+ },
+ play: async ({ canvas }) => {
+ const placeholder = canvas.getByTestId('placeholder');
+
+ await expect(placeholder.tagName).toBe('DIV');
+ await expect(placeholder.style.width).toBe('50%');
+ await expect(placeholder).toHaveStyle({
+ height: '32px',
+ 'border-radius': '8px',
+ 'background-color': 'rgb(18, 52, 86)',
+ 'margin-top': '8px',
+ });
+ await expect(
+ getComputedStyle(placeholder, '::after').backgroundImage,
+ ).toContain('171, 205, 239');
+ },
+};
diff --git a/packages/twenty-ui/src/primitives/feedback/Skeleton/__tests__/Skeleton.reduced-motion.test.tsx b/packages/twenty-ui/src/primitives/feedback/Skeleton/__tests__/Skeleton.reduced-motion.test.tsx
new file mode 100644
index 00000000000..fb8b1be7c3b
--- /dev/null
+++ b/packages/twenty-ui/src/primitives/feedback/Skeleton/__tests__/Skeleton.reduced-motion.test.tsx
@@ -0,0 +1,20 @@
+import { cleanup, render, screen } from '@testing-library/react';
+import { afterEach, expect, it } from 'vitest';
+
+import { Skeleton } from '@ui/primitives/feedback';
+
+afterEach(cleanup);
+
+it('disables the shimmer when the browser prefers reduced motion', () => {
+ render(<Skeleton data-testid="placeholder" width={120} height={16} />);
+
+ const placeholder = screen.getByTestId('placeholder');
+ const highlight = getComputedStyle(placeholder, '::after');
+
+ expect(window.matchMedia('(prefers-reduced-motion: reduce)').matches).toBe(
+ true,
+ );
+ expect(highlight.display).toBe('none');
+ expect(placeholder.getAnimations({ subtree: true })).toHaveLength(0);
+ expect(placeholder.getBoundingClientRect().height).toBe(16);
+});
diff --git a/packages/twenty-ui/src/primitives/feedback/Skeleton/__tests__/Skeleton.test.tsx b/packages/twenty-ui/src/primitives/feedback/Skeleton/__tests__/Skeleton.test.tsx
new file mode 100644
index 00000000000..f5d20fd5af4
--- /dev/null
+++ b/packages/twenty-ui/src/primitives/feedback/Skeleton/__tests__/Skeleton.test.tsx
@@ -0,0 +1,43 @@
+import { runComponentConformance } from '@test-utilities/conformance/runComponentConformance';
+import { render, screen } from '@testing-library/react';
+
+import { Skeleton } from '@ui/primitives/feedback';
+
+runComponentConformance({
+ name: 'Skeleton',
+ element: <Skeleton width={120} height={16} />,
+ refInstanceOf: HTMLSpanElement,
+ ownClassName: 'root',
+});
+
+it('keeps placeholder shapes out of the accessibility tree', () => {
+ render(<Skeleton data-testid="placeholder" />);
+
+ expect(screen.getByTestId('placeholder')).toHaveAttribute(
+ 'aria-hidden',
+ 'true',
+ );
+ expect(screen.queryByRole('status')).not.toBeInTheDocument();
+});
+
+it('lets native styles override dimensions and colors', () => {
+ render(
+ <Skeleton
+ data-testid="placeholder"
+ width={120}
+ height={16}
+ borderRadius={4}
+ baseColor="red"
+ style={{
+ width: '50%',
+ height: 32,
+ borderRadius: 8,
+ backgroundColor: 'blue',
+ }}
+ />,
+ );
+
+ expect(screen.getByTestId('placeholder')).toHaveStyle(
+ 'width: 50%; height: 32px; border-radius: 8px; background-color: rgb(0, 0, 255)',
+ );
+});
diff --git a/packages/twenty-ui/src/primitives/feedback/Skeleton/constants/SKELETON_HEIGHT_SIZES.ts b/packages/twenty-ui/src/primitives/feedback/Skeleton/constants/SKELETON_HEIGHT_SIZES.ts
new file mode 100644
index 00000000000..07ca68ef3ad
--- /dev/null
+++ b/packages/twenty-ui/src/primitives/feedback/Skeleton/constants/SKELETON_HEIGHT_SIZES.ts
@@ -0,0 +1,7 @@
+export const SKELETON_HEIGHT_SIZES = {
+ xs: 13,
+ s: 16,
+ m: 24,
+ l: 32,
+ xl: 40,
+} as const;
diff --git a/packages/twenty-ui/src/primitives/feedback/Skeleton/types/SkeletonProps.ts b/packages/twenty-ui/src/primitives/feedback/Skeleton/types/SkeletonProps.ts
new file mode 100644
index 00000000000..dde0b699f48
--- /dev/null
+++ b/packages/twenty-ui/src/primitives/feedback/Skeleton/types/SkeletonProps.ts
@@ -0,0 +1,14 @@
+import { type useRender } from '@base-ui/react/use-render';
+import { type CSSProperties } from 'react';
+
+export type SkeletonProps = Omit<
+ useRender.ComponentProps<'span'>,
+ 'children'
+> & {
+ width?: CSSProperties['width'];
+ height?: CSSProperties['height'];
+ borderRadius?: CSSProperties['borderRadius'];
+ baseColor?: CSSProperties['backgroundColor'];
+ highlightColor?: CSSProperties['backgroundColor'];
+ animated?: boolean;
+};
diff --git a/packages/twenty-ui/src/primitives/feedback/index.ts b/packages/twenty-ui/src/primitives/feedback/index.ts
index f8bf28eaed8..813d3a11895 100644
--- a/packages/twenty-ui/src/primitives/feedback/index.ts
+++ b/packages/twenty-ui/src/primitives/feedback/index.ts
@@ -15,3 +15,6 @@ export { ProgressBar } from './ProgressBar/ProgressBar';
export type { ProgressBarProps } from './ProgressBar/types/ProgressBarProps';
export { ProgressRing } from './ProgressRing/ProgressRing';
export type { ProgressRingProps } from './ProgressRing/types/ProgressRingProps';
+export { SKELETON_HEIGHT_SIZES } from './Skeleton/constants/SKELETON_HEIGHT_SIZES';
+export { Skeleton } from './Skeleton/Skeleton';
+export type { SkeletonProps } from './Skeleton/types/SkeletonProps';
diff --git a/packages/twenty-ui/vitest.config.ts b/packages/twenty-ui/vitest.config.ts
index b9535a71bca..6043274c130 100644
--- a/packages/twenty-ui/vitest.config.ts
+++ b/packages/twenty-ui/vitest.config.ts
@@ -25,10 +25,26 @@ export default defineConfig({
'src/**/*.{test,spec}.{ts,tsx}',
'design-tokens/**/*.{test,spec}.{ts,tsx}',
],
+ exclude: ['src/**/*.reduced-motion.test.tsx'],
setupFiles: ['./setupTests.ts'],
css: { modules: { classNameStrategy: 'non-scoped' } },
},
},
+ {
+ extends: './vite.config.ts',
+ test: {
+ name: 'reduced-motion',
+ include: ['src/**/*.reduced-motion.test.tsx'],
+ browser: {
+ enabled: true,
+ headless: true,
+ provider: playwright({
+ contextOptions: { reducedMotion: 'reduce' },
+ }),
+ instances: [{ browser: 'chromium' }],
+ },
+ },
+ },
{
extends: './vite.config.ts',
plugins: [
diff --git a/yarn.lock b/yarn.lock
index e2279b6eb8f..166df7dbd40 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -44900,15 +44900,6 @@ __metadata:
languageName: node
linkType: hard
-"react-loading-skeleton@npm:^3.3.1":
- version: 3.5.0
- resolution: "react-loading-skeleton@npm:3.5.0"
- peerDependencies:
- react: ">=16.8.0"
- checksum: 10c0/a081f561c9700fead6ba98b91e3fe77a36a680e3fd69dbf4eecbaa5fabcb7173049c6d6fb7487355331a770bed432356edaa147702f3d46ddf0d6caa623e779f
- languageName: node
- linkType: hard
-
"react-markdown@npm:^10.1.0":
version: 10.1.0
resolution: "react-markdown@npm:10.1.0"
@@ -50519,7 +50510,6 @@ __metadata:
react-hotkeys-hook: "npm:^4.4.4"
react-imask: "npm:^7.6.0"
react-intersection-observer: "npm:^9.15.1"
- react-loading-skeleton: "npm:^3.3.1"
react-markdown: "npm:^10.1.0"
react-phone-number-input: "patch:react-phone-number-input@npm%3A3.4.5#../../.yarn/patches/react-phone-number-input-npm-3.4.5-dc2895c306.patch"
react-qr-code: "npm:^2.0.18"