The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Share progress rings and metric rows (#27031)
Raphaël Bosi82368f6b15d3
diff --git a/packages/twenty-docs/docs.json b/packages/twenty-docs/docs.jsonindex 77f30aad966..f94fceafdf6 100644--- a/packages/twenty-docs/docs.json+++ b/packages/twenty-docs/docs.json@@ -556,7 +556,8 @@"pages": ["ui/primitives/feedback/banner","ui/primitives/feedback/loader",- "ui/primitives/feedback/progress-bar"+ "ui/primitives/feedback/progress-bar",+ "ui/primitives/feedback/progress-ring"]},{@@ -638,6 +639,7 @@"ui/components/json-tree","ui/components/menu-items","ui/components/menu-picker",+ "ui/components/metric-row","ui/components/notification-counter","ui/components/search-input","ui/components/tinted-icon-tile"diff --git a/packages/twenty-docs/navigation/base-structure.json b/packages/twenty-docs/navigation/base-structure.jsonindex d9704d72661..ade7466e952 100644--- a/packages/twenty-docs/navigation/base-structure.json+++ b/packages/twenty-docs/navigation/base-structure.json@@ -568,7 +568,8 @@"pages": ["ui/primitives/feedback/banner","ui/primitives/feedback/loader",- "ui/primitives/feedback/progress-bar"+ "ui/primitives/feedback/progress-bar",+ "ui/primitives/feedback/progress-ring"]},{@@ -656,6 +657,7 @@"ui/components/json-tree","ui/components/menu-items","ui/components/menu-picker",+ "ui/components/metric-row","ui/components/notification-counter","ui/components/search-input","ui/components/tinted-icon-tile"diff --git a/packages/twenty-docs/snippets/ui/generated/components/metric-row.mdx b/packages/twenty-docs/snippets/ui/generated/components/metric-row.mdxnew file mode 100644index 00000000000..7610b75abca--- /dev/null+++ b/packages/twenty-docs/snippets/ui/generated/components/metric-row.mdx@@ -0,0 +1,48 @@+{/*+ * _____ _+ *|_ _|_ _____ _ __ | |_ _ _+ * | | \ \ /\ / / _ \ '_ \| __| | | | 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="children" type="string" required>+ Required nonempty text label that also names the optional progress ring.+</ParamField>++<ParamField body="className" type="string">+ CSS class applied to the row root.+</ParamField>++<ParamField body="progress" type="number">+ Optional controlled progress from 0 to 100. Omitting it displays the value without a ring.+</ParamField>++<ParamField body="progressColor" type="string">+ CSS color of the filled arc when progress is provided.+</ParamField>++<ParamField body="progressValueText" type="string">+ Accessible value text for the progress ring. Overrides the string value fallback; supply it when formatted content needs more context than a percentage.+</ParamField>++<ParamField body="render" type="ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, {}>">+ Replaces the row root element while preserving its contents.+</ParamField>++<ParamField body="startIcon" type="IconComponent">+ Decorative icon before the label, rendered at 14px.+</ParamField>++<ParamField body="style" type="CSSProperties">+ Inline styles applied to the row root.+</ParamField>++<ParamField body="value" type="ReactNode" required>+ Preformatted value displayed at the end of the row. String values also supply the progress ring accessible value text.+</ParamField>diff --git a/packages/twenty-docs/snippets/ui/generated/feedback/progress-ring.mdx b/packages/twenty-docs/snippets/ui/generated/feedback/progress-ring.mdxnew file mode 100644index 00000000000..08fc7c29617--- /dev/null+++ b/packages/twenty-docs/snippets/ui/generated/feedback/progress-ring.mdx@@ -0,0 +1,52 @@+{/*+ * _____ _+ *|_ _|_ _____ _ __ | |_ _ _+ * | | \ \ /\ / / _ \ '_ \| __| | | | 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="aria-label" type="string">+ Accessible name identifying the measured operation.+</ParamField>++<ParamField body="aria-labelledby" type="string">+ ID of the visible label that names the measured operation.+</ParamField>++<ParamField body="aria-valuetext" type="string">+ Human-readable progress value when a percentage alone is insufficient.+</ParamField>++<ParamField body="barColor" type="string">+ CSS color of the filled arc. Defaults to the blue theme color.+</ParamField>++<ParamField body="children" type="ReactNode">+ Optional preformatted value displayed before the ring.+</ParamField>++<ParamField body="className" type="string">+ CSS class applied to the progress root.+</ParamField>++<ParamField body="render" type="ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, {}>">+ Replaces the root element while preserving progress semantics.+</ParamField>++<ParamField body="size" type=""md" | "sm"" default="md">+ Ring diameter: sm (14px) or md (16px). Defaults to md.+</ParamField>++<ParamField body="style" type="CSSProperties">+ Inline styles applied to the progress root.+</ParamField>++<ParamField body="value" type="number" required>+ Controlled progress from 0 to 100. Out-of-range values are bounded and NaN renders as zero.+</ParamField>diff --git a/packages/twenty-docs/ui/components/metric-row.mdx b/packages/twenty-docs/ui/components/metric-row.mdxnew file mode 100644index 00000000000..6d09e85b333--- /dev/null+++ b/packages/twenty-docs/ui/components/metric-row.mdx@@ -0,0 +1,69 @@+---+title: MetricRow+description: Align a metric label and formatted value with optional progress.+---++import { StoryEmbed } from '/snippets/ui/StoryEmbed.mdx';+import MetricRowReference from '/snippets/ui/generated/components/metric-row.mdx';++`MetricRow` aligns a label, optional icon, and preformatted value. An optional [ProgressRing](/ui/primitives/feedback/progress-ring) uses the visible label as its accessible name.++<StoryEmbed+ storyId="ui-data-display-metricrow--default"+ title="Metric row example"+ height={160}+/>++## Usage++Pass a nonempty text label as required children and the formatted value through `value`. Add `progress` when the metric has a known percentage.++```tsx+import { MetricRow } from 'twenty-ui/components';+import { IconDatabase } from 'twenty-ui/icon';++export const StorageMetric = () => (+ <MetricRow startIcon={IconDatabase} value="12 / 20 GB" progress={60}>+ Storage+ </MetricRow>+);+```++The application owns calculations, units, number formatting, and the meaning of the metric. `progressColor` accepts a CSS color for the filled arc.++## Values without progress++Omit `progress` to show a plain value. Numeric zero displays as `0`; content is never replaced with a placeholder. Supply your own placeholder when data is unavailable.++```tsx+import { MetricRow } from 'twenty-ui/components';++export const CompletedMetric = () => (+ <MetricRow value={0}>Completed imports</MetricRow>+);+```++## Composition and accessibility++The required text label names the progress ring. A string value is also exposed as its accessible value text. For formatted value content, supply `progressValueText` when a percentage does not describe the metric fully. This text overrides the string value fallback. Without it, other content keeps the ring's percentage value text. The optional `startIcon` is decorative and renders at 14px.++```tsx+import { MetricRow } from 'twenty-ui/components';+import { Text } from 'twenty-ui/primitives/typography';++export const FormattedStorageMetric = () => (+ <MetricRow+ value={<Text render={<bdi />}>12 / 20 GB</Text>}+ progress={60}+ progressValueText="12 of 20 gigabytes used"+ >+ Storage+ </MetricRow>+);+```++Native attributes, `className`, `style`, and `ref` target the outer row. `render` can replace that element. Progress stays controlled and bounded to 0 to 100, with the same reduced-motion behavior as `ProgressRing`.++## Props++<MetricRowReference />diff --git a/packages/twenty-docs/ui/components/overview.mdx b/packages/twenty-docs/ui/components/overview.mdxindex 97cb64f9eaf..7119062f40e 100644--- a/packages/twenty-docs/ui/components/overview.mdx+++ b/packages/twenty-docs/ui/components/overview.mdx@@ -18,6 +18,7 @@ Import shared components from `twenty-ui/components`. The code editor has its ow| [LightIconButton](/ui/components/input/light-icon-button) | Lightweight icon actions with standard or subtle emphasis. || [Section](/ui/components/section) | Related content with a heading, description, and optional action. || [SettingsRow](/ui/components/settings-row) | Labeled switches for settings and filters. |+| [MetricRow](/ui/components/metric-row) | Labels and formatted values with optional determinate progress. || [Dropdown](/ui/components/dropdown) | Action menus, searchable pickers, and form panels. || [TabButton](/ui/components/tab-button) | Route links and adjacent actions with the same appearance as tabs. || [CodeEditor](/ui/components/code-editor) | Code editing with Monaco, an optional header, and the Twenty theme. |diff --git a/packages/twenty-docs/ui/primitives/feedback/progress-ring.mdx b/packages/twenty-docs/ui/primitives/feedback/progress-ring.mdxnew file mode 100644index 00000000000..afeac409e4e--- /dev/null+++ b/packages/twenty-docs/ui/primitives/feedback/progress-ring.mdx@@ -0,0 +1,51 @@+---+title: ProgressRing+description: Show a known progress value in a compact circular indicator.+---++import { StoryEmbed } from '/snippets/ui/StoryEmbed.mdx';+import ProgressRingReference from '/snippets/ui/generated/feedback/progress-ring.mdx';++`ProgressRing` shows a controlled percentage with accessible progressbar semantics. It can display a preformatted value beside the ring.++<StoryEmbed+ storyId="ui-feedback-progressring-progressring--default"+ title="Progress ring example"+ height={140}+/>++## Usage++Supply a value from 0 to 100 and an accessible name. Use `aria-valuetext` when a formatted value explains progress more clearly than a percentage.++```tsx+import { ProgressRing } from 'twenty-ui/primitives/feedback';++export const ImportProgress = () => (+ <ProgressRing+ value={60}+ aria-label="Importing records"+ aria-valuetext="600 of 1,000 records"+ >+ 600 / 1,000+ </ProgressRing>+);+```++Use `aria-labelledby` to associate the ring with an existing visible label. The optional children display a value; they do not provide the ring's accessible name.++## Controlled progress++The application calculates `value` and formats the displayed text. The ring does not fetch data, advance progress, or calculate quotas. Values outside 0 to 100 are bounded to that range, including infinite values. `NaN` renders as zero. Displayed children stay unchanged.++Use [Loader](/ui/primitives/feedback/loader) for indeterminate loading, [ProgressBar](/ui/primitives/feedback/progress-bar) for horizontal progress, or [MetricRow](/ui/components/metric-row) for a label and aligned value.++## Appearance and motion++`size="md"` renders a 16px ring; `size="sm"` renders a 14px ring. Both use a 2px stroke and fill clockwise from the top. `barColor` accepts CSS colors, including theme variables.++Value changes animate for 300ms. The transition is disabled when the user prefers reduced motion. Native attributes, `className`, `style`, and `ref` target the outer progress element. `render` can replace that element while retaining the progress semantics.++## Props++<ProgressRingReference />diff --git a/packages/twenty-docs/ui/primitives/overview.mdx b/packages/twenty-docs/ui/primitives/overview.mdxindex 16d0284e418..400b30cab4e 100644--- a/packages/twenty-docs/ui/primitives/overview.mdx+++ b/packages/twenty-docs/ui/primitives/overview.mdx@@ -90,7 +90,7 @@ Each page includes usage examples, interaction guidance, and a generated API ref| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- || Accessibility | [VisibilityHidden](/ui/primitives/accessibility/visibility-hidden) || Data display | [Avatar](/ui/primitives/data-display/avatar), [Chip](/ui/primitives/data-display/chip), [ColorSample](/ui/primitives/data-display/color-sample), [Pill](/ui/primitives/data-display/pill), [Status](/ui/primitives/data-display/status), [Tag](/ui/primitives/data-display/tag) |-| Feedback | [Banner](/ui/primitives/feedback/banner), [Loader](/ui/primitives/feedback/loader), [ProgressBar](/ui/primitives/feedback/progress-bar) |+| Feedback | [Banner](/ui/primitives/feedback/banner), [Loader](/ui/primitives/feedback/loader), [ProgressBar](/ui/primitives/feedback/progress-bar), [ProgressRing](/ui/primitives/feedback/progress-ring) || Forms | [Button](/ui/primitives/input/button), [ButtonGroup](/ui/primitives/input/button-group), [Checkbox](/ui/primitives/input/checkbox), [Field](/ui/primitives/input/field), [Input](/ui/primitives/input/input), [InputGroup](/ui/primitives/input/input-group), [Radio](/ui/primitives/input/radio), [RadioGroup](/ui/primitives/input/radio-group), [SegmentedControl](/ui/primitives/input/segmented-control), [Select](/ui/primitives/input/select), [Slider](/ui/primitives/input/slider), [Switch](/ui/primitives/input/switch), [Textarea](/ui/primitives/input/textarea) || Layout | [Collapsible](/ui/primitives/layout/collapsible), [HorizontalSeparator](/ui/primitives/layout/horizontal-separator), [ResizeHandle](/ui/primitives/layout/resize-handle), [TextDirectionProvider](/ui/primitives/layout/text-direction-provider) || Navigation | [ListItem](/ui/primitives/navigation/list-item), [Tabs](/ui/primitives/navigation/tabs) |diff --git a/packages/twenty-front-component-renderer/src/__stories__/TwentyUiGallery.stories.tsx b/packages/twenty-front-component-renderer/src/__stories__/TwentyUiGallery.stories.tsxindex aa1842ec026..bcc85aab6eb 100644--- a/packages/twenty-front-component-renderer/src/__stories__/TwentyUiGallery.stories.tsx+++ b/packages/twenty-front-component-renderer/src/__stories__/TwentyUiGallery.stories.tsx@@ -2,6 +2,7 @@ import { breadcrumbTest } from '@/__stories__/twenty-ui-gallery/utils/breadcrumbimport { jsonTreeTest } from '@/__stories__/twenty-ui-gallery/utils/jsonTreeTest';import { inlineBannerSandboxTest } from '@/__stories__/twenty-ui-gallery/utils/inlineBannerSandboxTest';import { themeTokenTest } from '@/__stories__/twenty-ui-gallery/utils/themeTokenTest';+import { progressTest } from '@/__stories__/twenty-ui-gallery/utils/progressTest';import { inputTest } from '@/__stories__/twenty-ui-gallery/utils/inputTest';import { settingsRowTest } from '@/__stories__/twenty-ui-gallery/utils/settingsRowTest';import { resizeHandleTest } from '@/__stories__/twenty-ui-gallery/utils/resizeHandleTest';@@ -91,6 +92,18 @@ export const FeedbackPreact: Story = createGalleryStory({play: galleryRenderTest,});+export const ProgressReact: Story = createGalleryStory({+ frontComponentBundleName: 'twenty-ui-progress',+ runtime: 'react',+ play: progressTest,+});++export const ProgressPreact: Story = createGalleryStory({+ frontComponentBundleName: 'twenty-ui-progress',+ runtime: 'preact',+ play: progressTest,+});+export const IconReact: Story = createGalleryStory({frontComponentBundleName: 'twenty-ui-icon-gallery',runtime: 'react',diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-progress.front-component.tsx b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-progress.front-component.tsxnew file mode 100644index 00000000000..31a5bef886c--- /dev/null+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-progress.front-component.tsx@@ -0,0 +1,45 @@+import { useState } from 'react';+import { defineFrontComponent } from 'twenty-sdk/define';+import { MetricRow } from 'twenty-ui/components';+import { IconDatabase } from 'twenty-ui/icon';+import { ProgressRing } from 'twenty-ui/primitives/feedback';+import { Button } from 'twenty-ui/primitives/input';+import { Text } from 'twenty-ui/primitives/typography';++import { TwentyUiGalleryCard } from '@/__stories__/shared/front-components/twenty-ui-gallery-card';++const ProgressExample = () => {+ const [progress, setProgress] = useState(25);++ return (+ <TwentyUiGalleryCard title="Determinate progress">+ <ProgressRing+ value={progress}+ aria-label="Importing records"+ aria-valuetext={`${progress} of 100 records`}+ >+ {progress} / 100+ </ProgressRing>+ <MetricRow+ startIcon={IconDatabase}+ value={<Text render={<bdi />}>{progress} / 100 GB</Text>}+ progress={progress}+ progressValueText={`${progress} of 100 gigabytes used`}+ >+ Storage+ </MetricRow>+ <MetricRow value={0}>Completed imports</MetricRow>+ <ProgressRing value={-10} size="sm" aria-label="Empty progress" />+ <ProgressRing value={120} size="sm" aria-label="Complete progress" />+ <Button onClick={() => setProgress(75)}>Advance progress</Button>+ </TwentyUiGalleryCard>+ );+};++export default defineFrontComponent({+ universalIdentifier: 'bdc37e74-31d3-4a94-9805-03bd38f40ddf',+ name: 'twenty-ui-progress',+ description:+ 'Controlled progress, formatted metric values and accessible names in the sandbox',+ component: ProgressExample,+});diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/progressTest.ts b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/progressTest.tsnew file mode 100644index 00000000000..8e1e26cf78c--- /dev/null+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/progressTest.ts@@ -0,0 +1,57 @@+import { expect, userEvent, waitFor, within } from 'storybook/test';++import { errorHandler } from '@/__stories__/shared/test-utils/createFrontComponentStoryMeta';+import { expectFrontComponentMounted } from '@/__stories__/shared/test-utils/matchers/expectFrontComponentMounted';+import { type TwentyUiGalleryPlayFunction } from '@/__stories__/twenty-ui-gallery/types/TwentyUiGalleryPlayFunction';++export const progressTest: TwentyUiGalleryPlayFunction = async ({+ canvasElement,+}) => {+ const canvas = within(canvasElement);+ await expectFrontComponentMounted(canvas);++ const importProgress = canvas.getByRole('progressbar', {+ name: 'Importing records',+ });+ const storageProgress = canvas.getByRole('progressbar', {+ name: 'Storage',+ });++ expect(importProgress).toHaveAttribute('aria-valuenow', '25');+ expect(importProgress).toHaveAttribute('aria-valuemin', '0');+ expect(importProgress).toHaveAttribute('aria-valuemax', '100');+ expect(importProgress).toHaveAttribute('aria-valuetext', '25 of 100 records');+ expect(storageProgress).toHaveAttribute('aria-valuenow', '25');+ expect(storageProgress).toHaveAttribute(+ 'aria-valuetext',+ '25 of 100 gigabytes used',+ );+ expect(canvas.getByText('25 / 100 GB')).toBeVisible();+ expect(canvas.getByText('0')).toBeVisible();+ expect(canvas.getAllByRole('progressbar')).toHaveLength(4);+ expect(+ canvas.getByRole('progressbar', { name: 'Empty progress' }),+ ).toHaveAttribute('aria-valuenow', '0');+ expect(+ canvas.getByRole('progressbar', { name: 'Complete progress' }),+ ).toHaveAttribute('aria-valuenow', '100');++ await userEvent.click(+ canvas.getByRole('button', { name: 'Advance progress' }),+ );++ await waitFor(() => {+ expect(importProgress).toHaveAttribute('aria-valuenow', '75');+ expect(importProgress).toHaveAttribute(+ 'aria-valuetext',+ '75 of 100 records',+ );+ expect(storageProgress).toHaveAttribute('aria-valuenow', '75');+ expect(storageProgress).toHaveAttribute(+ 'aria-valuetext',+ '75 of 100 gigabytes used',+ );+ expect(canvas.getByText('75 / 100 GB')).toBeVisible();+ });+ expect(errorHandler).not.toHaveBeenCalled();+};diff --git a/packages/twenty-front/src/modules/ai/components/AiModelTierInformationButton.tsx b/packages/twenty-front/src/modules/ai/components/AiModelTierInformationButton.tsxindex 3c02f1f286d..b116bb80fea 100644--- a/packages/twenty-front/src/modules/ai/components/AiModelTierInformationButton.tsx+++ b/packages/twenty-front/src/modules/ai/components/AiModelTierInformationButton.tsx@@ -27,12 +27,12 @@ import {IconInfoCircle,} from 'twenty-ui/icon';import { HorizontalSeparator } from 'twenty-ui/primitives/layout';+import { MetricRow } from 'twenty-ui/components';import { themeCssVariables, useThemeContainer } from 'twenty-ui/theme';import { type ResolvedAiModelTier } from '@/ai/types/ResolvedAiModelTier';import { getAiModelEffortLabel } from '@/ai/utils/getAiModelEffortLabel';import { getAiModelModeDescription } from '@/settings/ai/utils/getAiModelModeDescription';-import { UsageProgressRow } from '@/ui/feedback/progress-ring/components/UsageProgressRow';import { StyledInformationCard } from '@/ui/layout/information-card/components/StyledInformationCard';import { formatNumber } from '~/utils/format/formatNumber';@@ -179,24 +179,16 @@ export const AiModelTierInformationButton = ({{...getFloatingProps()}>{rows.map(({ label, Icon, value }) => (- <UsageProgressRow- key={label}- Icon={Icon}- label={label}- value={null}- valueLabel={value}- />+ <MetricRow key={label} startIcon={Icon} value={value}>+ {label}+ </MetricRow>))}<HorizontalSeparator noMargin /><StyledHeading>{t`Vs Balanced mode`}</StyledHeading>{comparisons.map(({ label, Icon, value }) => (- <UsageProgressRow- key={label}- Icon={Icon}- label={label}- value={null}- valueLabel={value}- />+ <MetricRow key={label} startIcon={Icon} value={value}>+ {label}+ </MetricRow>))}{model?.isBenchmarkInherited === true && (<StyledNote>{t`Not measured at this effort yet, so these are the base model's readings.`}</StyledNote>diff --git a/packages/twenty-front/src/modules/ai/components/internal/AiChatContextUsageButton.tsx b/packages/twenty-front/src/modules/ai/components/internal/AiChatContextUsageButton.tsxindex 276a5065bcc..1e308839bb2 100644--- a/packages/twenty-front/src/modules/ai/components/internal/AiChatContextUsageButton.tsx+++ b/packages/twenty-front/src/modules/ai/components/internal/AiChatContextUsageButton.tsx@@ -21,13 +21,14 @@ import { useLingui } from '@lingui/react/macro';import { useState } from 'react';import { useReducedMotion } from 'framer-motion';import { isDefined } from 'twenty-shared/utils';+import { MetricRow } from 'twenty-ui/components';+import { ProgressRing } from 'twenty-ui/primitives/feedback';import { Button } from 'twenty-ui/primitives/input';import { IconWindow, IconGauge } from 'twenty-ui/icon';import { HorizontalSeparator } from 'twenty-ui/primitives/layout';import { themeCssVariables } from 'twenty-ui/theme';import { AiChatContextUsageDetails } from '@/ai/components/internal/AiChatContextUsageDetails';-import { ContextUsageProgressRing } from '@/ai/components/internal/ContextUsageProgressRing';import { useAiChatUsage } from '@/ai/hooks/useAiChatUsage';import { useAiModelTiers } from '@/ai/hooks/useAiModelTiers';import { useWorkspaceAiModelTiers } from '@/ai/hooks/useWorkspaceAiModelTiers';@@ -38,7 +39,6 @@ import { currentAiChatThreadState } from '@/ai/states/currentAiChatThreadState';import { getUsageLimitRingColor } from '@/settings/billing/utils/getUsageLimitRingColor';import { computeUsageLimitProgress } from '@/settings/billing/utils/computeUsageLimitProgress';import { StyledInformationCard } from '@/ui/layout/information-card/components/StyledInformationCard';-import { UsageProgressRow } from '@/ui/feedback/progress-ring/components/UsageProgressRow';import { useAtomComponentFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentFamilyStateValue';import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';import { formatNumber } from '~/utils/format/formatNumber';@@ -111,6 +111,17 @@ export const AiChatContextUsageButton = () => {? Math.min(100, Math.max(0, (conversationSize / contextWindow) * 100)): 0;+ const formattedPercentage = formatNumber(percentage, { decimals: 1 });++ const formattedConversationSize = formatAiChatTokens(conversationSize);++ const formattedContextWindow = formatAiChatTokens(contextWindow);++ const contextWindowRingColor = getUsageLimitRingColor({+ consumedPercentage: percentage,+ isExhausted: percentage >= 100,+ });+const {usage: creditUsage,loading,@@ -141,6 +152,14 @@ export const AiChatContextUsageButton = () => {): null;+ const usageLabelInput = {+ loading,+ hasError: isDefined(error),+ hasUsage: isDefined(creditUsage),+ daysUntilReset,+ creditPercentage,+ };+const { refs, floatingStyles, context } = useFloating({open: isOpen,onOpenChange: (open) => {@@ -182,11 +201,20 @@ export const AiChatContextUsageButton = () => {<StyledTriggerref={refs.setReference}type="button"- aria-label={t`Context and usage`}+ aria-label={+ contextWindow > 0+ ? t`Context and usage, ${formattedPercentage}% of context window used`+ : t`Context and usage, context window unavailable`+ }// oxlint-disable-next-line react/jsx-props-no-spreading{...getReferenceProps()}>- <ContextUsageProgressRing percentage={percentage} />+ <ProgressRing+ value={percentage}+ aria-hidden+ barColor={contextWindowRingColor}+ render={<span />}+ /></StyledTrigger>{isMounted && (<FloatingPortal>@@ -197,39 +225,41 @@ export const AiChatContextUsageButton = () => {// oxlint-disable-next-line react/jsx-props-no-spreading{...getFloatingProps()}>- <UsageProgressRow- Icon={IconWindow}- label={t`Context window`}- value={percentage}- valueLabel={+ <MetricRow+ startIcon={IconWindow}+ progress={percentage}+ value={contextWindow > 0- ? `(${formatAiChatTokens(conversationSize)}/${formatAiChatTokens(contextWindow)}) ${formatNumber(percentage, { decimals: 1 })}%`+ ? `(${formattedConversationSize}/${formattedContextWindow}) ${formattedPercentage}%`: t`Not available`}- barColor={getUsageLimitRingColor({- consumedPercentage: percentage,- isExhausted: percentage >= 100,- })}- />+ progressValueText={+ contextWindow > 0+ ? t`${formattedPercentage}% used, ${formattedConversationSize} of ${formattedContextWindow} tokens`+ : undefined+ }+ progressColor={contextWindowRingColor}+ >+ {t`Context window`}+ </MetricRow>{!isWorkspaceSetupChat && (- <UsageProgressRow- Icon={IconGauge}- label={t`Usage`}- value={+ <MetricRow+ startIcon={IconGauge}+ progress={loading || isDefined(error) ? 0 : (creditPercentage ?? 0)}- valueLabel={getAiChatUsageLabel({- loading,- hasError: isDefined(error),- hasUsage: isDefined(creditUsage),- daysUntilReset,- creditPercentage,+ value={getAiChatUsageLabel(usageLabelInput)}+ progressValueText={getAiChatUsageLabel({+ ...usageLabelInput,+ unavailableConsumptionLabel: t`Not available`,})}- barColor={getUsageLimitRingColor({+ progressColor={getUsageLimitRingColor({consumedPercentage: creditPercentage ?? 0,isExhausted: creditPercentage === 100,})}- />+ >+ {t`Usage`}+ </MetricRow>)}{showDetails && <AiChatContextUsageDetails />}{isDefined(agentChatUsage) && (diff --git a/packages/twenty-front/src/modules/ai/components/internal/AiChatContextUsageDetails.tsx b/packages/twenty-front/src/modules/ai/components/internal/AiChatContextUsageDetails.tsxindex 1f74ca192d3..c1ad3d63456 100644--- a/packages/twenty-front/src/modules/ai/components/internal/AiChatContextUsageDetails.tsx+++ b/packages/twenty-front/src/modules/ai/components/internal/AiChatContextUsageDetails.tsx@@ -2,6 +2,7 @@ import { formatAiChatTokens } from '@/ai/utils/formatAiChatTokens';import { styled } from '@linaria/react';import { useLingui } from '@lingui/react/macro';import { isDefined } from 'twenty-shared/utils';+import { MetricRow } from 'twenty-ui/components';import { HorizontalSeparator } from 'twenty-ui/primitives/layout';import {IconArrowUp,@@ -13,7 +14,6 @@ import { themeCssVariables } from 'twenty-ui/theme';import { agentChatUsageComponentFamilyState } from '@/ai/states/agentChatUsageComponentFamilyState';import { currentAiChatThreadState } from '@/ai/states/currentAiChatThreadState';-import { UsageProgressRow } from '@/ui/feedback/progress-ring/components/UsageProgressRow';import { useAtomComponentFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentFamilyStateValue';import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';import { formatNumber } from '~/utils/format/formatNumber';@@ -53,66 +53,66 @@ export const AiChatContextUsageDetails = () => {<HorizontalSeparator noMargin /><StyledSection><StyledSectionTitle>{t`Last message`}</StyledSectionTitle>- <UsageProgressRow- Icon={IconArrowUp}- label={t`Input tokens`}- value={null}- valueLabel={formatAiChatTokens(lastMessage.inputTokens)}- />- <UsageProgressRow- Icon={IconHistory}- label={t`Cached input`}- value={null}- valueLabel={formatAiChatTokens(lastMessage.cachedInputTokens)}- />- <UsageProgressRow- Icon={IconArrowDown}- label={t`Output tokens`}- value={null}- valueLabel={formatAiChatTokens(lastMessage.outputTokens)}- />- <UsageProgressRow- Icon={IconCoins}- label={t`Credits`}- value={null}- valueLabel={formatNumber(+ <MetricRow+ startIcon={IconArrowUp}+ value={formatAiChatTokens(lastMessage.inputTokens)}+ >+ {t`Input tokens`}+ </MetricRow>+ <MetricRow+ startIcon={IconHistory}+ value={formatAiChatTokens(lastMessage.cachedInputTokens)}+ >+ {t`Cached input`}+ </MetricRow>+ <MetricRow+ startIcon={IconArrowDown}+ value={formatAiChatTokens(lastMessage.outputTokens)}+ >+ {t`Output tokens`}+ </MetricRow>+ <MetricRow+ startIcon={IconCoins}+ value={formatNumber(lastMessage.inputCredits + lastMessage.outputCredits,{ decimals: 3 },)}- />+ >+ {t`Credits`}+ </MetricRow></StyledSection></>)}<HorizontalSeparator noMargin /><StyledSection><StyledSectionTitle>{t`Conversation`}</StyledSectionTitle>- <UsageProgressRow- Icon={IconArrowUp}- label={t`Input tokens`}- value={null}- valueLabel={formatAiChatTokens(agentChatUsage.inputTokens)}- />- <UsageProgressRow- Icon={IconHistory}- label={t`Cached input`}- value={null}- valueLabel={formatAiChatTokens(agentChatUsage.cachedInputTokens)}- />- <UsageProgressRow- Icon={IconArrowDown}- label={t`Output tokens`}- value={null}- valueLabel={formatAiChatTokens(agentChatUsage.outputTokens)}- />- <UsageProgressRow- Icon={IconCoins}- label={t`Credits`}- value={null}- valueLabel={formatNumber(+ <MetricRow+ startIcon={IconArrowUp}+ value={formatAiChatTokens(agentChatUsage.inputTokens)}+ >+ {t`Input tokens`}+ </MetricRow>+ <MetricRow+ startIcon={IconHistory}+ value={formatAiChatTokens(agentChatUsage.cachedInputTokens)}+ >+ {t`Cached input`}+ </MetricRow>+ <MetricRow+ startIcon={IconArrowDown}+ value={formatAiChatTokens(agentChatUsage.outputTokens)}+ >+ {t`Output tokens`}+ </MetricRow>+ <MetricRow+ startIcon={IconCoins}+ value={formatNumber(agentChatUsage.inputCredits + agentChatUsage.outputCredits,{ decimals: 3 },)}- />+ >+ {t`Credits`}+ </MetricRow></StyledSection></>);diff --git a/packages/twenty-front/src/modules/ai/components/internal/ContextUsageProgressRing.tsx b/packages/twenty-front/src/modules/ai/components/internal/ContextUsageProgressRing.tsxdeleted file mode 100644index 144d7bb04ad..00000000000--- a/packages/twenty-front/src/modules/ai/components/internal/ContextUsageProgressRing.tsx+++ /dev/null@@ -1,31 +0,0 @@-import { themeCssVariables } from 'twenty-ui/theme';--import { ProgressRing } from '@/ui/feedback/progress-ring/components/ProgressRing';--type ContextUsageProgressRingProps = {- percentage: number;- size?: number;- strokeWidth?: number;-};--export const ContextUsageProgressRing = ({- percentage,- size,- strokeWidth,-}: ContextUsageProgressRingProps) => {- const barColor =- percentage > 80- ? themeCssVariables.color.red- : percentage > 60- ? themeCssVariables.color.orange- : themeCssVariables.color.blue;-- return (- <ProgressRing- value={percentage}- size={size}- strokeWidth={strokeWidth}- barColor={barColor}- />- );-};diff --git a/packages/twenty-front/src/modules/ai/components/internal/__stories__/AiChatContextUsageButton.stories.tsx b/packages/twenty-front/src/modules/ai/components/internal/__stories__/AiChatContextUsageButton.stories.tsxindex 22f22214c40..fb8f123cb8c 100644--- a/packages/twenty-front/src/modules/ai/components/internal/__stories__/AiChatContextUsageButton.stories.tsx+++ b/packages/twenty-front/src/modules/ai/components/internal/__stories__/AiChatContextUsageButton.stories.tsx@@ -110,9 +110,11 @@ export const NewChat: Story = {play: async ({ canvasElement }) => {const canvas = within(canvasElement);const page = within(canvasElement.ownerDocument.body);- await userEvent.click(- canvas.getByRole('button', { name: 'Context and usage' }),+ const trigger = canvas.getByRole('button', { name: /^Context and usage/ });+ await expect(trigger).toHaveAccessibleName(+ 'Context and usage, context window unavailable',);+ await userEvent.click(trigger);await waitFor(() => expect(page.getByText('80%')).toBeVisible());await expect(page.queryByRole('button', { name: /^More/ }),@@ -128,8 +130,15 @@ export const Expanded: Story = {play: async ({ canvasElement }) => {const canvas = within(canvasElement);const page = within(canvasElement.ownerDocument.body);+ const trigger = canvas.getByRole('button', { name: /^Context and usage/ });+ await expect(trigger).toHaveAccessibleName(+ 'Context and usage, 20% of context window used',+ );await userEvent.tab();await waitFor(() => expect(page.getByRole('dialog')).toBeVisible());+ await expect(+ page.getByRole('progressbar', { name: 'Context window' }),+ ).toHaveAttribute('aria-valuetext', '20% used, 200k of 1M tokens');await userEvent.click(page.getByRole('button', { name: /^More/ }));await expect(page.getByText('Last message')).toBeVisible();await expect(page.getByText('Conversation')).toBeVisible();@@ -138,9 +147,7 @@ export const Expanded: Story = {await expect(page.getByText('75k')).toBeVisible();await userEvent.click(page.getByRole('button', { name: /^Less/ }));await expect(page.queryByText('Last message')).not.toBeInTheDocument();- await userEvent.click(- canvas.getByRole('button', { name: 'Context and usage' }),- );+ await userEvent.click(trigger);},};export const ReopenedConversation: Story = {diff --git a/packages/twenty-front/src/modules/ai/utils/__tests__/getAiChatUsageLabel.test.ts b/packages/twenty-front/src/modules/ai/utils/__tests__/getAiChatUsageLabel.test.tsindex c497a587d32..919f3e8c4be 100644--- a/packages/twenty-front/src/modules/ai/utils/__tests__/getAiChatUsageLabel.test.ts+++ b/packages/twenty-front/src/modules/ai/utils/__tests__/getAiChatUsageLabel.test.ts@@ -26,6 +26,16 @@ describe('getAiChatUsageLabel', () => {expect(getAiChatUsageLabel({ ...base, hasUsage: false })).toBe('No limit');});+ it('uses the provided label for unavailable consumption', () => {+ expect(+ getAiChatUsageLabel({+ ...base,+ creditPercentage: null,+ unavailableConsumptionLabel: 'Not available',+ }),+ ).toBe('Not available');+ });+it('prioritizes loading and errors over stale data', () => {expect(getAiChatUsageLabel({ ...base, loading: true })).toBe('Loading…');expect(getAiChatUsageLabel({ ...base, hasError: true })).toBe(diff --git a/packages/twenty-front/src/modules/ai/utils/getAiChatUsageLabel.ts b/packages/twenty-front/src/modules/ai/utils/getAiChatUsageLabel.tsindex d8120276216..2461a337b85 100644--- a/packages/twenty-front/src/modules/ai/utils/getAiChatUsageLabel.ts+++ b/packages/twenty-front/src/modules/ai/utils/getAiChatUsageLabel.ts@@ -8,12 +8,14 @@ export const getAiChatUsageLabel = ({hasUsage,daysUntilReset,creditPercentage,+ unavailableConsumptionLabel = '—',}: {loading: boolean;hasError: boolean;hasUsage: boolean;daysUntilReset: number | null;creditPercentage: number | null;+ unavailableConsumptionLabel?: string;}): string => {if (loading) {return t`Loading…`;@@ -28,7 +30,7 @@ export const getAiChatUsageLabel = ({}if (!isDefined(creditPercentage)) {- return '—';+ return unavailableConsumptionLabel;}const percentage = formatNumber(creditPercentage, { decimals: 1 });diff --git a/packages/twenty-front/src/modules/onboarding/components/free-credits/OnboardingFreeCreditsPopoverContent.tsx b/packages/twenty-front/src/modules/onboarding/components/free-credits/OnboardingFreeCreditsPopoverContent.tsxindex 914645ef72e..360adbb774d 100644--- a/packages/twenty-front/src/modules/onboarding/components/free-credits/OnboardingFreeCreditsPopoverContent.tsx+++ b/packages/twenty-front/src/modules/onboarding/components/free-credits/OnboardingFreeCreditsPopoverContent.tsx@@ -3,7 +3,6 @@ import { type OnboardingCreditsProgress } from '@/onboarding/types/OnboardingCreimport { type OnboardingCreditsStep } from '@/onboarding/types/OnboardingCreditsStep';import { formatOnboardingCredits } from '@/onboarding/utils/formatOnboardingCredits';import { getOnboardingCreditWorth } from '@/onboarding/utils/getOnboardingCreditWorth';-import { UsageProgressRow } from '@/ui/feedback/progress-ring/components/UsageProgressRow';import { styled } from '@linaria/react';import { plural } from '@lingui/core/macro';import { useLingui } from '@lingui/react/macro';@@ -23,6 +22,7 @@ import {IconVideo,IconWand,} from 'twenty-ui/icon';+import { MetricRow } from 'twenty-ui/components';import { HorizontalSeparator } from 'twenty-ui/primitives/layout';import { themeCssVariables, useTheme } from 'twenty-ui/theme';@@ -102,15 +102,15 @@ export const OnboardingFreeCreditsPopoverContent = ({<StyledContent><StyledSection><StyledSectionTitle>{t`Free credits`}</StyledSectionTitle>- <UsageProgressRow- Icon={IconCoins}- label={t`Total earned`}- value={null}- valueLabel={plural(earnedCredits, {+ <MetricRow+ startIcon={IconCoins}+ value={plural(earnedCredits, {one: `${formattedEarnedCredits} credit`,other: `${formattedEarnedCredits} credits`,})}- />+ >+ {t`Total earned`}+ </MetricRow></StyledSection>{isNonEmptyArray(earnedCreditsByStep) && (<>@@ -118,17 +118,17 @@ export const OnboardingFreeCreditsPopoverContent = ({<StyledSection><StyledSectionTitle>{t`Breakdown`}</StyledSectionTitle>{earnedCreditsByStep.map(({ step, credits, rewardCredits }) => (- <UsageProgressRow+ <MetricRowkey={step}- Icon={creditsSteps[step].Icon}- label={creditsSteps[step].label}- value={null}- valueLabel={+ startIcon={creditsSteps[step].Icon}+ value={credits < rewardCredits? `${formatOnboardingCredits(credits, numberFormat)}/${formatOnboardingCredits(rewardCredits, numberFormat)}`: formatOnboardingCredits(credits, numberFormat)}- />+ >+ {creditsSteps[step].label}+ </MetricRow>))}</StyledSection></>@@ -140,39 +140,30 @@ export const OnboardingFreeCreditsPopoverContent = ({? t`Enough for one of these on average`: t`1 credit is enough for one of these on average`}</StyledSectionTitle>- <UsageProgressRow- Icon={IconSparkles}- label={t`AI actions`}- value={null}- valueLabel={formatNumber(aiActions)}- />- <UsageProgressRow- Icon={IconSettingsAutomation}- label={t`Workflow steps`}- value={null}- valueLabel={formatNumber(workflowSteps)}- />- <UsageProgressRow- Icon={IconWand}- label={t`Enrichments`}- value={null}- valueLabel={formatNumber(enrichments)}- />- <UsageProgressRow- Icon={IconVideo}- label={t`Call recording`}- value={null}- valueLabel={plural(callRecordingHours, {+ <MetricRow startIcon={IconSparkles} value={formatNumber(aiActions)}>+ {t`AI actions`}+ </MetricRow>+ <MetricRow+ startIcon={IconSettingsAutomation}+ value={formatNumber(workflowSteps)}+ >+ {t`Workflow steps`}+ </MetricRow>+ <MetricRow startIcon={IconWand} value={formatNumber(enrichments)}>+ {t`Enrichments`}+ </MetricRow>+ <MetricRow+ startIcon={IconVideo}+ value={plural(callRecordingHours, {one: `${formattedCallRecordingHours} hour`,other: `${formattedCallRecordingHours} hours`,})}- />- <UsageProgressRow- Icon={IconMail}- label={t`Shared inbox emails`}- value={null}- valueLabel={formatNumber(emailsSent)}- />+ >+ {t`Call recording`}+ </MetricRow>+ <MetricRow startIcon={IconMail} value={formatNumber(emailsSent)}>+ {t`Shared inbox emails`}+ </MetricRow></StyledSection><HorizontalSeparator noMargin /><StyledFooter>diff --git a/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitForm.tsx b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitForm.tsxindex e6368672b5c..a94ed5ab8df 100644--- a/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitForm.tsx+++ b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitForm.tsx@@ -2,6 +2,7 @@ import { styled } from '@linaria/react';import { useLingui } from '@lingui/react/macro';import { INTERNAL_CREDITS_PER_DISPLAY_CREDIT } from 'twenty-shared/constants';import { isDefined } from 'twenty-shared/utils';+import { ProgressRing } from 'twenty-ui/primitives/feedback';import { Section } from 'twenty-ui/components';import { Tooltip } from 'twenty-ui/primitives/surfaces';import { themeCssVariables } from 'twenty-ui/theme';@@ -26,7 +27,6 @@ import { getUsageLimitLabel } from '@/settings/billing/utils/getUsageLimitLabel'import { getUsageLimitRingColor } from '@/settings/billing/utils/getUsageLimitRingColor';import { Select } from '@/ui/input/components/Select';import { SettingsTextInput } from '@/ui/input/components/SettingsTextInput';-import { ProgressRing } from '@/ui/feedback/progress-ring/components/ProgressRing';import { TooltipDelay } from '@/ui/layout/tooltip/constants/TooltipDelay';import {type UsageQuotaDefinitionsQuery,@@ -223,6 +223,7 @@ export const SettingsBillingLimitForm = ({<StyledRingAnchor id={RING_ANCHOR_ID}><ProgressRingvalue={consumedPercentage}+ aria-label={t`Used`}barColor={getUsageLimitRingColor({consumedPercentage,isExhausted,diff --git a/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitsTable.tsx b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitsTable.tsxindex 1818adb38be..d1199fe2f36 100644--- a/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitsTable.tsx+++ b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitsTable.tsx@@ -3,6 +3,7 @@ import { useLingui } from '@lingui/react/macro';import { useState } from 'react';import { SettingsPath } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';+import { ProgressRing } from 'twenty-ui/primitives/feedback';import { SearchInput } from 'twenty-ui/components';import { Tooltip } from 'twenty-ui/primitives/surfaces';import { useTheme, themeCssVariables } from 'twenty-ui/theme';@@ -18,7 +19,6 @@ import { getUsageLimitRingColor } from '@/settings/billing/utils/getUsageLimitRiimport { SettingsEmptyPlaceholder } from '@/settings/components/SettingsEmptyPlaceholder';import { SettingsNameCellSecondaryLabel } from '@/settings/components/SettingsNameCellSecondaryLabel';import { SettingsTableListSection } from '@/settings/components/SettingsTableListSection';-import { ProgressRingWithLabel } from '@/ui/feedback/progress-ring/components/ProgressRingWithLabel';import { TooltipDelay } from '@/ui/layout/tooltip/constants/TooltipDelay';import { type UsageResourceType } from '~/generated-metadata/graphql';import { useNavigateSettings } from '~/hooks/useNavigateSettings';@@ -146,13 +146,17 @@ const UsedCell = ({ item }: { item: UsageLimitRow }) => {><StyledUsed id={anchorId}>{isDefined(item.consumedPercentage) ? (- <ProgressRingWithLabel+ <ProgressRingvalue={item.consumedPercentage}+ size="sm"+ aria-label={t`${item.name} used by ${item.spenderName}`}barColor={getUsageLimitRingColor({consumedPercentage: item.consumedPercentage,isExhausted: item.isExhausted,})}- />+ >+ {`${item.consumedPercentage}%`}+ </ProgressRing>) : (<StyledEmptyValue>—</StyledEmptyValue>)}diff --git a/packages/twenty-front/src/modules/settings/billing/components/__stories__/SettingsBillingLimitsTable.stories.tsx b/packages/twenty-front/src/modules/settings/billing/components/__stories__/SettingsBillingLimitsTable.stories.tsxindex f467ca4e75f..62135ccafcd 100644--- a/packages/twenty-front/src/modules/settings/billing/components/__stories__/SettingsBillingLimitsTable.stories.tsx+++ b/packages/twenty-front/src/modules/settings/billing/components/__stories__/SettingsBillingLimitsTable.stories.tsx@@ -72,6 +72,12 @@ export const Default: Story = {play: async ({ canvasElement }) => {const canvas = within(canvasElement);+ await expect(+ await canvas.findByRole('progressbar', {+ name: /used by Production key$/,+ }),+ ).toHaveAttribute('aria-valuenow', '98');+await userEvent.hover(await canvas.findByText('Deactivated'));const tooltip = await within(canvasElement.ownerDocument.body).findByRole(diff --git a/packages/twenty-front/src/modules/ui/feedback/progress-ring/components/ProgressRing.tsx b/packages/twenty-front/src/modules/ui/feedback/progress-ring/components/ProgressRing.tsxdeleted file mode 100644index d9fe7e1ca2d..00000000000--- a/packages/twenty-front/src/modules/ui/feedback/progress-ring/components/ProgressRing.tsx+++ /dev/null@@ -1,59 +0,0 @@-import { styled } from '@linaria/react';-import { themeCssVariables } from 'twenty-ui/theme';--type ProgressRingProps = {- value: number;- size?: number;- strokeWidth?: number;- barColor?: string;-};--const StyledSvg = styled.svg`- transform: rotate(-90deg);-`;--const StyledTrackCircle = styled.circle`- fill: none;- stroke: color-mix(- in srgb,- ${themeCssVariables.border.color.strong} 50%,- ${themeCssVariables.background.quaternary} 50%- );-`;--const StyledValueCircle = styled.circle`- fill: none;- transition: stroke-dashoffset 0.3s ease;-`;--export const ProgressRing = ({- value,- size = 16,- strokeWidth = 2,- barColor = themeCssVariables.color.blue,-}: ProgressRingProps) => {- const boundedValue = Math.min(Math.max(value, 0), 100);- const radius = (size - strokeWidth) / 2;- const circumference = 2 * Math.PI * radius;-- return (- <StyledSvg width={size} height={size}>- <StyledTrackCircle- cx={size / 2}- cy={size / 2}- r={radius}- strokeWidth={strokeWidth}- />- <StyledValueCircle- cx={size / 2}- cy={size / 2}- r={radius}- strokeWidth={strokeWidth}- style={{ stroke: barColor }}- strokeDasharray={circumference}- strokeDashoffset={circumference - (boundedValue / 100) * circumference}- strokeLinecap="round"- />- </StyledSvg>- );-};diff --git a/packages/twenty-front/src/modules/ui/feedback/progress-ring/components/ProgressRingWithLabel.tsx b/packages/twenty-front/src/modules/ui/feedback/progress-ring/components/ProgressRingWithLabel.tsxdeleted file mode 100644index 1317ff6981d..00000000000--- a/packages/twenty-front/src/modules/ui/feedback/progress-ring/components/ProgressRingWithLabel.tsx+++ /dev/null@@ -1,31 +0,0 @@-import { styled } from '@linaria/react';-import { type ReactNode } from 'react';-import { themeCssVariables } from 'twenty-ui/theme';--import { ProgressRing } from '@/ui/feedback/progress-ring/components/ProgressRing';--type ProgressRingWithLabelProps = {- value: number;- label?: ReactNode;- barColor?: string;-};--const StyledContainer = styled.div`- align-items: center;- display: flex;- flex-shrink: 0;- gap: ${themeCssVariables.spacing[2]};- justify-content: flex-end;- white-space: nowrap;-`;--export const ProgressRingWithLabel = ({- value,- label,- barColor,-}: ProgressRingWithLabelProps) => (- <StyledContainer>- <span>{label ?? `${value}%`}</span>- <ProgressRing size={14} value={value} barColor={barColor} />- </StyledContainer>-);diff --git a/packages/twenty-front/src/modules/ui/feedback/progress-ring/components/UsageProgressRow.tsx b/packages/twenty-front/src/modules/ui/feedback/progress-ring/components/UsageProgressRow.tsxdeleted file mode 100644index fa7ee3ac656..00000000000--- a/packages/twenty-front/src/modules/ui/feedback/progress-ring/components/UsageProgressRow.tsx+++ /dev/null@@ -1,58 +0,0 @@-import { isDefined } from 'twenty-shared/utils';-import { styled } from '@linaria/react';-import { type ReactNode } from 'react';-import { type IconComponent } from 'twenty-ui/icon';-import { themeCssVariables } from 'twenty-ui/theme';--import { ProgressRingWithLabel } from '@/ui/feedback/progress-ring/components/ProgressRingWithLabel';--type UsageProgressRowProps = {- Icon: IconComponent;- label: string;- value: number | null;- valueLabel?: ReactNode;- barColor?: string;-};--const StyledRow = styled.div`- align-items: center;- color: ${themeCssVariables.font.color.primary};- display: flex;- font-size: ${themeCssVariables.font.size.sm};- font-weight: ${themeCssVariables.font.weight.medium};- gap: ${themeCssVariables.spacing[2]};- min-height: 24px;-`;--const StyledLabel = styled.div`- align-items: center;- color: ${themeCssVariables.font.color.tertiary};- display: flex;- flex: 1;- gap: ${themeCssVariables.spacing[1]};- min-width: 0;-`;--export const UsageProgressRow = ({- Icon,- label,- value,- valueLabel,- barColor,-}: UsageProgressRowProps) => (- <StyledRow>- <StyledLabel>- <Icon size={14} />- <span>{label}</span>- </StyledLabel>- {!isDefined(value) ? (- <span>{valueLabel ?? '—'}</span>- ) : (- <ProgressRingWithLabel- value={value}- label={valueLabel}- barColor={barColor}- />- )}- </StyledRow>-);diff --git a/packages/twenty-front/src/modules/ui/feedback/progress-ring/components/__stories__/ProgressRingWithLabel.stories.tsx b/packages/twenty-front/src/modules/ui/feedback/progress-ring/components/__stories__/ProgressRingWithLabel.stories.tsxdeleted file mode 100644index b907f289a03..00000000000--- a/packages/twenty-front/src/modules/ui/feedback/progress-ring/components/__stories__/ProgressRingWithLabel.stories.tsx+++ /dev/null@@ -1,15 +0,0 @@-import { type Meta, type StoryObj } from '@storybook/react-vite';-import { ComponentDecorator } from 'twenty-ui/testing';-import { ProgressRingWithLabel } from '@/ui/feedback/progress-ring/components/ProgressRingWithLabel';-const meta = {- title: 'UI/Feedback/ProgressRingWithLabel',- component: ProgressRingWithLabel,- decorators: [ComponentDecorator],- args: { value: 80 },-} satisfies Meta<typeof ProgressRingWithLabel>;-export default meta;-type Story = StoryObj<typeof meta>;-export const Default: Story = {};-export const Empty: Story = { args: { value: 0, label: 'No limit' } };-export const Full: Story = { args: { value: 100 } };-export const LongLabel: Story = { args: { label: 'Reset in 14 days (80%)' } };diff --git a/packages/twenty-front/src/modules/ui/feedback/progress-ring/components/__stories__/UsageProgressRow.stories.tsx b/packages/twenty-front/src/modules/ui/feedback/progress-ring/components/__stories__/UsageProgressRow.stories.tsxdeleted file mode 100644index 7793f0d9f61..00000000000--- a/packages/twenty-front/src/modules/ui/feedback/progress-ring/components/__stories__/UsageProgressRow.stories.tsx+++ /dev/null@@ -1,17 +0,0 @@-import { type Meta, type StoryObj } from '@storybook/react-vite';-import { IconGauge } from 'twenty-ui/icon';-import { ComponentDecorator } from 'twenty-ui/testing';-import { UsageProgressRow } from '@/ui/feedback/progress-ring/components/UsageProgressRow';-const meta = {- title: 'UI/Feedback/UsageProgressRow',- component: UsageProgressRow,- decorators: [ComponentDecorator],- parameters: { container: { width: 300 } },- args: { Icon: IconGauge, label: 'Usage', value: 80 },-} satisfies Meta<typeof UsageProgressRow>;-export default meta;-type Story = StoryObj<typeof meta>;-export const Default: Story = {};-export const PlainValue: Story = { args: { value: null, valueLabel: '100k' } };-export const NoLimit: Story = { args: { value: 0, valueLabel: 'No limit' } };-export const Exhausted: Story = { args: { value: 100 } };diff --git a/packages/twenty-shared/src/constants/DocumentationPaths.ts b/packages/twenty-shared/src/constants/DocumentationPaths.tsindex 6a66d75eac3..a7fe3004676 100644--- a/packages/twenty-shared/src/constants/DocumentationPaths.ts+++ b/packages/twenty-shared/src/constants/DocumentationPaths.ts@@ -144,6 +144,7 @@ export const DOCUMENTATION_PATHS = {UI_COMPONENTS_JSON_TREE: '/ui/components/json-tree',UI_COMPONENTS_MENU_ITEMS: '/ui/components/menu-items',UI_COMPONENTS_MENU_PICKER: '/ui/components/menu-picker',+ UI_COMPONENTS_METRIC_ROW: '/ui/components/metric-row',UI_COMPONENTS_NOTIFICATION_COUNTER: '/ui/components/notification-counter',UI_COMPONENTS_OVERVIEW: '/ui/components/overview',UI_COMPONENTS_SEARCH_INPUT: '/ui/components/search-input',@@ -167,6 +168,7 @@ export const DOCUMENTATION_PATHS = {UI_PRIMITIVES_FEEDBACK_BANNER: '/ui/primitives/feedback/banner',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_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.tsindex af8bb34730e..1b36553643a 100644--- a/packages/twenty-ui/docs/components.ts+++ b/packages/twenty-ui/docs/components.ts@@ -1,3 +1,5 @@+import { METRIC_ROW_PROP_DESCRIPTIONS } from './metricRowPropDescriptions';+import { PROGRESS_RING_PROP_DESCRIPTIONS } from './progressRingPropDescriptions';import { AVATAR_GROUP_PROP_DESCRIPTIONS } from './avatarGroupPropDescriptions';import { COMMAND_BLOCK_PROP_DESCRIPTIONS } from './commandBlockPropDescriptions';import { JSON_TREE_PROP_DESCRIPTIONS } from './jsonTreePropDescriptions';@@ -60,6 +62,20 @@ import { TOOLTIP_PROP_DESCRIPTIONS } from './tooltipPropDescriptions';import { VISIBILITY_HIDDEN_PROP_DESCRIPTIONS } from './visibilityHiddenPropDescriptions';export const DOCUMENTED_COMPONENTS = [+ {+ name: 'ProgressRing',+ source: 'primitives/feedback/ProgressRing/ProgressRing.tsx',+ entryPoint: 'twenty-ui/primitives/feedback',+ slug: 'feedback/progress-ring',+ propDescriptions: PROGRESS_RING_PROP_DESCRIPTIONS,+ },+ {+ name: 'MetricRow',+ source: 'components/data-display/MetricRow/MetricRow.tsx',+ entryPoint: 'twenty-ui/components',+ slug: 'components/metric-row',+ propDescriptions: METRIC_ROW_PROP_DESCRIPTIONS,+ },{name: 'Shortcut',source: 'primitives/typography/Shortcut/Shortcut.tsx',diff --git a/packages/twenty-ui/docs/metricRowPropDescriptions.ts b/packages/twenty-ui/docs/metricRowPropDescriptions.tsnew file mode 100644index 00000000000..765ae45943d--- /dev/null+++ b/packages/twenty-ui/docs/metricRowPropDescriptions.ts@@ -0,0 +1,19 @@+import { type ComponentProps } from 'react';++import { type MetricRow } from '../src/components/data-display/MetricRow/MetricRow';++export const METRIC_ROW_PROP_DESCRIPTIONS = {+ children:+ 'Required nonempty text label that also names the optional progress ring.',+ startIcon: 'Decorative icon before the label, rendered at 14px.',+ value:+ 'Preformatted value displayed at the end of the row. String values also supply the progress ring accessible value text.',+ progress:+ 'Optional controlled progress from 0 to 100. Omitting it displays the value without a ring.',+ progressColor: 'CSS color of the filled arc when progress is provided.',+ progressValueText:+ 'Accessible value text for the progress ring. Overrides the string value fallback; supply it when formatted content needs more context than a percentage.',+ className: 'CSS class applied to the row root.',+ style: 'Inline styles applied to the row root.',+ render: 'Replaces the row root element while preserving its contents.',+} satisfies Partial<Record<keyof ComponentProps<typeof MetricRow>, string>>;diff --git a/packages/twenty-ui/docs/module-ownership.json b/packages/twenty-ui/docs/module-ownership.jsonindex 6d10f0b77d4..1e0c8d14396 100644--- a/packages/twenty-ui/docs/module-ownership.json+++ b/packages/twenty-ui/docs/module-ownership.json@@ -24,6 +24,7 @@"Pill","Popover","ProgressBar",+ "ProgressRing","Radio","RadioGroup","ResizeHandle",@@ -60,6 +61,7 @@"MenuItemDraggable","MenuItemSuggestion","MenuPicker",+ "MetricRow","NotificationCounter","SearchInput","Section",diff --git a/packages/twenty-ui/docs/progressRingPropDescriptions.ts b/packages/twenty-ui/docs/progressRingPropDescriptions.tsnew file mode 100644index 00000000000..8fa997dbf18--- /dev/null+++ b/packages/twenty-ui/docs/progressRingPropDescriptions.ts@@ -0,0 +1,19 @@+import { type ComponentProps } from 'react';++import { type ProgressRing } from '../src/primitives/feedback/ProgressRing/ProgressRing';++export const PROGRESS_RING_PROP_DESCRIPTIONS = {+ value:+ 'Controlled progress from 0 to 100. Out-of-range values are bounded and NaN renders as zero.',+ size: 'Ring diameter: sm (14px) or md (16px). Defaults to md.',+ barColor: 'CSS color of the filled arc. Defaults to the blue theme color.',+ children: 'Optional preformatted value displayed before the ring.',+ 'aria-label': 'Accessible name identifying the measured operation.',+ 'aria-labelledby':+ 'ID of the visible label that names the measured operation.',+ 'aria-valuetext':+ 'Human-readable progress value when a percentage alone is insufficient.',+ className: 'CSS class applied to the progress root.',+ style: 'Inline styles applied to the progress root.',+ render: 'Replaces the root element while preserving progress semantics.',+} satisfies Partial<Record<keyof ComponentProps<typeof ProgressRing>, string>>;diff --git a/packages/twenty-ui/docs/public-exports.json b/packages/twenty-ui/docs/public-exports.jsonindex 86e83b8e538..c4a49269b5d 100644--- a/packages/twenty-ui/docs/public-exports.json+++ b/packages/twenty-ui/docs/public-exports.json@@ -30,6 +30,7 @@"MenuItemDraggable": "components/navigation/MenuItemDraggable/MenuItemDraggable","MenuItemSuggestion": "components/navigation/MenuItemSuggestion/MenuItemSuggestion","MenuPicker": "components/navigation/MenuPicker/MenuPicker",+ "MetricRow": "components/data-display/MetricRow/MetricRow","NotificationCounter": "components/data-display/NotificationCounter/NotificationCounter","SearchInput": "components/input/SearchInput/SearchInput","Section": "components/layout/Section/Section",@@ -80,6 +81,7 @@"MenuItemProps": "components/navigation/MenuItem/types/MenuItemProps","MenuItemSuggestionProps": "components/navigation/MenuItemSuggestion/types/MenuItemSuggestionProps","MenuPickerProps": "components/navigation/MenuPicker/types/MenuPickerProps",+ "MetricRowProps": "components/data-display/MetricRow/types/MetricRowProps","SearchInputProps": "components/input/SearchInput/types/SearchInputProps","SectionHeaderProps": "components/layout/Section/types/SectionHeaderProps","SectionRootProps": "components/layout/Section/types/SectionRootProps",@@ -670,12 +672,14 @@"values": {"Banner": "primitives/feedback/Banner/Banner","Loader": "primitives/feedback/Loader/Loader",- "ProgressBar": "primitives/feedback/ProgressBar/ProgressBar"+ "ProgressBar": "primitives/feedback/ProgressBar/ProgressBar",+ "ProgressRing": "primitives/feedback/ProgressRing/ProgressRing"},"types": {"BannerColor": "primitives/feedback/Banner/Banner","BannerVariant": "primitives/feedback/Banner/Banner",- "ProgressBarProps": "primitives/feedback/ProgressBar/types/ProgressBarProps"+ "ProgressBarProps": "primitives/feedback/ProgressBar/types/ProgressBarProps",+ "ProgressRingProps": "primitives/feedback/ProgressRing/types/ProgressRingProps"}},"primitives/input": {diff --git a/packages/twenty-ui/generated/components.docs.json b/packages/twenty-ui/generated/components.docs.jsonindex 9d57863adc4..a7ba6f4ca8b 100644--- a/packages/twenty-ui/generated/components.docs.json+++ b/packages/twenty-ui/generated/components.docs.json@@ -1,4 +1,151 @@[+ {+ "name": "ProgressRing",+ "entryPoint": "twenty-ui/primitives/feedback",+ "slug": "feedback/progress-ring",+ "props": [+ {+ "name": "aria-label",+ "type": "string",+ "required": false,+ "defaultValue": null,+ "description": "Accessible name identifying the measured operation."+ },+ {+ "name": "aria-labelledby",+ "type": "string",+ "required": false,+ "defaultValue": null,+ "description": "ID of the visible label that names the measured operation."+ },+ {+ "name": "aria-valuetext",+ "type": "string",+ "required": false,+ "defaultValue": null,+ "description": "Human-readable progress value when a percentage alone is insufficient."+ },+ {+ "name": "barColor",+ "type": "string",+ "required": false,+ "defaultValue": null,+ "description": "CSS color of the filled arc. Defaults to the blue theme color."+ },+ {+ "name": "children",+ "type": "ReactNode",+ "required": false,+ "defaultValue": null,+ "description": "Optional preformatted value displayed before the ring."+ },+ {+ "name": "className",+ "type": "string",+ "required": false,+ "defaultValue": null,+ "description": "CSS class applied to the progress root."+ },+ {+ "name": "render",+ "type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, {}>",+ "required": false,+ "defaultValue": null,+ "description": "Replaces the root element while preserving progress semantics."+ },+ {+ "name": "size",+ "type": "\"md\" | \"sm\"",+ "required": false,+ "defaultValue": "md",+ "description": "Ring diameter: sm (14px) or md (16px). Defaults to md."+ },+ {+ "name": "style",+ "type": "CSSProperties",+ "required": false,+ "defaultValue": null,+ "description": "Inline styles applied to the progress root."+ },+ {+ "name": "value",+ "type": "number",+ "required": true,+ "defaultValue": null,+ "description": "Controlled progress from 0 to 100. Out-of-range values are bounded and NaN renders as zero."+ }+ ]+ },+ {+ "name": "MetricRow",+ "entryPoint": "twenty-ui/components",+ "slug": "components/metric-row",+ "props": [+ {+ "name": "children",+ "type": "string",+ "required": true,+ "defaultValue": null,+ "description": "Required nonempty text label that also names the optional progress ring."+ },+ {+ "name": "className",+ "type": "string",+ "required": false,+ "defaultValue": null,+ "description": "CSS class applied to the row root."+ },+ {+ "name": "progress",+ "type": "number",+ "required": false,+ "defaultValue": null,+ "description": "Optional controlled progress from 0 to 100. Omitting it displays the value without a ring."+ },+ {+ "name": "progressColor",+ "type": "string",+ "required": false,+ "defaultValue": null,+ "description": "CSS color of the filled arc when progress is provided."+ },+ {+ "name": "progressValueText",+ "type": "string",+ "required": false,+ "defaultValue": null,+ "description": "Accessible value text for the progress ring. Overrides the string value fallback; supply it when formatted content needs more context than a percentage."+ },+ {+ "name": "render",+ "type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, {}>",+ "required": false,+ "defaultValue": null,+ "description": "Replaces the row root element while preserving its contents."+ },+ {+ "name": "startIcon",+ "type": "IconComponent",+ "required": false,+ "defaultValue": null,+ "description": "Decorative icon before the label, rendered at 14px."+ },+ {+ "name": "style",+ "type": "CSSProperties",+ "required": false,+ "defaultValue": null,+ "description": "Inline styles applied to the row root."+ },+ {+ "name": "value",+ "type": "ReactNode",+ "required": true,+ "defaultValue": null,+ "description": "Preformatted value displayed at the end of the row. String values also supply the progress ring accessible value text."+ }+ ]+ },{"name": "Shortcut","entryPoint": "twenty-ui/primitives/typography",diff --git a/packages/twenty-ui/src/components/data-display/MetricRow/MetricRow.module.scss b/packages/twenty-ui/src/components/data-display/MetricRow/MetricRow.module.scssnew file mode 100644index 00000000000..d863b48fbee--- /dev/null+++ b/packages/twenty-ui/src/components/data-display/MetricRow/MetricRow.module.scss@@ -0,0 +1,18 @@+.row {+ align-items: center;+ color: var(--t-font-color-primary);+ display: flex;+ font-size: var(--t-font-size-sm);+ font-weight: var(--t-font-weight-medium);+ gap: var(--t-spacing-2);+ min-height: 24px;+}++.label {+ align-items: center;+ color: var(--t-font-color-tertiary);+ display: flex;+ flex: 1;+ gap: var(--t-spacing-1);+ min-width: 0;+}diff --git a/packages/twenty-ui/src/components/data-display/MetricRow/MetricRow.module.scss.d.ts b/packages/twenty-ui/src/components/data-display/MetricRow/MetricRow.module.scss.d.tsnew file mode 100644index 00000000000..bf78aea9b92--- /dev/null+++ b/packages/twenty-ui/src/components/data-display/MetricRow/MetricRow.module.scss.d.ts@@ -0,0 +1,5 @@+declare const classNames: {+ readonly row: 'row';+ readonly label: 'label';+};+export default classNames;diff --git a/packages/twenty-ui/src/components/data-display/MetricRow/MetricRow.tsx b/packages/twenty-ui/src/components/data-display/MetricRow/MetricRow.tsxnew file mode 100644index 00000000000..dc28356eaea--- /dev/null+++ b/packages/twenty-ui/src/components/data-display/MetricRow/MetricRow.tsx@@ -0,0 +1,57 @@+import { useRender } from '@base-ui/react/use-render';+import { isString } from '@sniptt/guards';+import { clsx } from 'clsx';+import { useId } from 'react';++import { ProgressRing } from '@ui/primitives/feedback/ProgressRing/ProgressRing';+import { isDefined } from '@ui/utilities/utils/isDefined';++import styles from './MetricRow.module.scss';+import { type MetricRowProps } from './types/MetricRowProps';++export const MetricRow = ({+ children,+ startIcon: StartIcon,+ value,+ progress,+ progressColor,+ progressValueText,+ render,+ ref,+ className,+ ...props+}: MetricRowProps) => {+ const labelId = useId();++ return useRender({+ render,+ ref,+ props: {+ ...props,+ className: clsx(styles.row, className),+ children: (+ <>+ <div className={styles.label}>+ {isDefined(StartIcon) && <StartIcon size={14} aria-hidden={true} />}+ <span id={labelId}>{children}</span>+ </div>+ {isDefined(progress) ? (+ <ProgressRing+ value={progress}+ size="sm"+ barColor={progressColor}+ aria-labelledby={labelId}+ aria-valuetext={+ progressValueText ?? (isString(value) ? value : undefined)+ }+ >+ {value}+ </ProgressRing>+ ) : (+ <span>{value}</span>+ )}+ </>+ ),+ },+ });+};diff --git a/packages/twenty-ui/src/components/data-display/MetricRow/__stories__/MetricRow.stories.tsx b/packages/twenty-ui/src/components/data-display/MetricRow/__stories__/MetricRow.stories.tsxnew file mode 100644index 00000000000..a4073cbeca6--- /dev/null+++ b/packages/twenty-ui/src/components/data-display/MetricRow/__stories__/MetricRow.stories.tsx@@ -0,0 +1,182 @@+import { type Meta, type StoryObj } from '@storybook/react-vite';+import { useState } from 'react';+import { expect, userEvent, within } from 'storybook/test';++import { MetricRow } from '@ui/components';+import { IconFiles } from '@ui/icon';+import { Button } from '@ui/primitives/input/Button/Button';+import { Card } from '@ui/primitives/surfaces/Card/Card';+import { Text } from '@ui/primitives/typography/Text/Text';+import { A11Y_DEFER_COLOR_CONTRAST, ComponentDecorator } from '@ui/testing';++const meta: Meta<typeof MetricRow> = {+ title: 'UI/Data Display/MetricRow',+ component: MetricRow,+ decorators: [ComponentDecorator],+ parameters: {+ container: { width: 320 },+ a11y: A11Y_DEFER_COLOR_CONTRAST,+ },+ args: {+ children: 'Imported files',+ value: '75 of 100',+ progress: 75,+ startIcon: IconFiles,+ },+ argTypes: {+ startIcon: { control: false },+ className: { control: false },+ progress: { control: { type: 'range', min: 0, max: 100, step: 1 } },+ },+};++export default meta;++type Story = StoryObj<typeof MetricRow>;++export const Default: Story = {};++export const WithoutProgress: Story = {+ args: {+ children: 'Data transferred',+ value: '12.5 MB',+ progress: undefined,+ startIcon: undefined,+ },+ play: async ({ canvasElement }) => {+ const canvas = within(canvasElement);++ await expect(canvas.getByText('Data transferred')).toBeVisible();+ await expect(canvas.getByText('12.5 MB')).toBeVisible();+ await expect(canvas.queryByRole('progressbar')).not.toBeInTheDocument();+ },+};++export const InCard: Story = {+ render: () => (+ <Card.Root>+ <Card.Content>+ <MetricRow startIcon={IconFiles} value="75 of 100" progress={75}>+ Imported files+ </MetricRow>+ <MetricRow value="24 of 80" progress={30}>+ Reviewed files+ </MetricRow>+ <MetricRow value="12.5 MB">Data transferred</MetricRow>+ </Card.Content>+ </Card.Root>+ ),+ play: async ({ canvasElement }) => {+ const canvas = within(canvasElement);+ const imported = canvas.getByRole('progressbar', {+ name: 'Imported files',+ });+ const reviewed = canvas.getByRole('progressbar', {+ name: 'Reviewed files',+ });++ await expect(imported).toHaveAttribute('aria-valuenow', '75');+ await expect(imported).toHaveTextContent('75 of 100');+ await expect(imported).toHaveAttribute('aria-valuetext', '75 of 100');+ await expect(reviewed).toHaveAttribute('aria-valuenow', '30');+ await expect(reviewed).toHaveTextContent('24 of 80');+ await expect(canvas.getAllByRole('progressbar')).toHaveLength(2);+ await expect(canvas.queryByRole('img')).not.toBeInTheDocument();+ },+};++export const FormattedValue: Story = {+ args: {+ value: <Text render={<bdi />}>75 of 100</Text>,+ },+ play: async ({ canvasElement }) => {+ const progress = within(canvasElement).getByRole('progressbar', {+ name: 'Imported files',+ });++ await expect(progress).toHaveTextContent('75 of 100');+ await expect(progress).toHaveAttribute('aria-valuetext', '75%');+ },+};++export const EmptyValueText: Story = {+ args: {+ progressValueText: '',+ },+ play: async ({ canvasElement }) => {+ const progress = within(canvasElement).getByRole('progressbar', {+ name: 'Imported files',+ });++ await expect(progress).toHaveAttribute('aria-valuetext', '75%');+ },+};++const ControlledMetricRow = () => {+ const [completed, setCompleted] = useState(false);++ return (+ <>+ <MetricRow+ startIcon={IconFiles}+ value={completed ? '100 of 100' : '25 of 100'}+ progress={completed ? 100 : 25}+ >+ Imported files+ </MetricRow>+ <Button onClick={() => setCompleted(true)}>Complete import</Button>+ </>+ );+};++export const Controlled: Story = {+ render: () => <ControlledMetricRow />,+ play: async ({ canvasElement }) => {+ const canvas = within(canvasElement);+ const progress = canvas.getByRole('progressbar', {+ name: 'Imported files',+ });++ await expect(progress).toHaveAttribute('aria-valuenow', '25');+ await expect(progress).toHaveTextContent('25 of 100');+ await userEvent.click(+ canvas.getByRole('button', { name: 'Complete import' }),+ );+ await expect(progress).toHaveAttribute('aria-valuenow', '100');+ await expect(progress).toHaveTextContent('100 of 100');+ await expect(progress).toHaveAccessibleName('Imported files');+ await expect(progress).toHaveAttribute('aria-valuetext', '100 of 100');+ },+};++export const CatalogDark: Story = {+ globals: { colorScheme: 'dark' },+ tags: ['!autodocs'],+};++export const RightToLeft: Story = {+ args: {+ dir: 'rtl',+ progressValueText: '75 of 100 files imported',+ value: (+ <Text render={<bdi />} dir="ltr">+ 75 of 100+ </Text>+ ),+ },+ play: async ({ canvasElement }) => {+ const canvas = within(canvasElement);+ const label = canvas.getByText('Imported files');+ const progress = canvas.getByRole('progressbar', {+ name: 'Imported files',+ });++ await expect(progress).toHaveAttribute(+ 'aria-valuetext',+ '75 of 100 files imported',+ );+ await expect(progress.getBoundingClientRect().right).toBeLessThan(+ label.getBoundingClientRect().left,+ );+ },+};diff --git a/packages/twenty-ui/src/components/data-display/MetricRow/__tests__/MetricRow.test.tsx b/packages/twenty-ui/src/components/data-display/MetricRow/__tests__/MetricRow.test.tsxnew file mode 100644index 00000000000..bec33d7b847--- /dev/null+++ b/packages/twenty-ui/src/components/data-display/MetricRow/__tests__/MetricRow.test.tsx@@ -0,0 +1,21 @@+import { runComponentConformance } from '@test-utilities/conformance/runComponentConformance';+import { type ComponentProps } from 'react';+import { expectTypeOf, it } from 'vitest';++import { MetricRow } from '@ui/components';++runComponentConformance({+ name: 'MetricRow',+ element: (+ <MetricRow value="42 of 100" progress={42}>+ Imported files+ </MetricRow>+ ),+ refInstanceOf: HTMLDivElement,+});++it('requires a text label for the progress accessible name', () => {+ expectTypeOf<ComponentProps<typeof MetricRow>>()+ .pick<'children'>()+ .toEqualTypeOf<{ children: string }>();+});diff --git a/packages/twenty-ui/src/components/data-display/MetricRow/types/MetricRowProps.ts b/packages/twenty-ui/src/components/data-display/MetricRow/types/MetricRowProps.tsnew file mode 100644index 00000000000..86daf090023--- /dev/null+++ b/packages/twenty-ui/src/components/data-display/MetricRow/types/MetricRowProps.ts@@ -0,0 +1,16 @@+import { type useRender } from '@base-ui/react/use-render';+import { type ReactNode } from 'react';++import { type IconComponent } from '@ui/icon';++export type MetricRowProps = Omit<+ useRender.ComponentProps<'div'>,+ 'children'+> & {+ children: string;+ startIcon?: IconComponent;+ value: ReactNode;+ progress?: number;+ progressColor?: string;+ progressValueText?: string;+};diff --git a/packages/twenty-ui/src/components/index.ts b/packages/twenty-ui/src/components/index.tsindex f9b4e8b78f9..697318ea1ab 100644--- a/packages/twenty-ui/src/components/index.ts+++ b/packages/twenty-ui/src/components/index.ts@@ -16,6 +16,8 @@ export type { JsonNodeHighlighting } from './data-display/JsonTree/types/JsonNodexport type { JsonTreeEntry } from './data-display/JsonTree/types/JsonTreeEntry';export type { JsonTreeProps } from './data-display/JsonTree/types/JsonTreeProps';export type { ShouldExpandNodeInitiallyProps } from './data-display/JsonTree/types/ShouldExpandNodeInitiallyProps';+export { MetricRow } from './data-display/MetricRow/MetricRow';+export type { MetricRowProps } from './data-display/MetricRow/types/MetricRowProps';export { NotificationCounter } from './data-display/NotificationCounter/NotificationCounter';export { TintedIconTile } from './data-display/TintedIconTile/TintedIconTile';export type { TintedIconTileProps } from './data-display/TintedIconTile/types/TintedIconTileProps';diff --git a/packages/twenty-ui/src/components/input/SettingsRow/SettingsRow.tsx b/packages/twenty-ui/src/components/input/SettingsRow/SettingsRow.tsxindex 4123c26f9f6..00d4889d7ad 100644--- a/packages/twenty-ui/src/components/input/SettingsRow/SettingsRow.tsx+++ b/packages/twenty-ui/src/components/input/SettingsRow/SettingsRow.tsx@@ -1,8 +1,8 @@import { useId } from 'react';import { Switch } from '@ui/primitives/input/Switch/Switch';-import { isRenderableSlot } from '@ui/primitives/navigation/ListItem/internal/isRenderableSlot';import { ListItem } from '@ui/primitives/navigation/ListItem/ListItem';+import { isRenderableSlot } from '@ui/utilities/internal/isRenderableSlot';import { type SettingsRowProps } from './types/SettingsRowProps';diff --git a/packages/twenty-ui/src/primitives/feedback/ProgressRing/ProgressRing.module.scss b/packages/twenty-ui/src/primitives/feedback/ProgressRing/ProgressRing.module.scssnew file mode 100644index 00000000000..90d7bbf1f8a--- /dev/null+++ b/packages/twenty-ui/src/primitives/feedback/ProgressRing/ProgressRing.module.scss@@ -0,0 +1,35 @@+.root {+ align-items: center;+ display: inline-flex;+ flex-shrink: 0;+ gap: var(--t-spacing-2);+ justify-content: flex-end;+ vertical-align: middle;+ white-space: nowrap;+}++.ring {+ flex-shrink: 0;+ transform: rotate(-90deg);+}++.track {+ fill: none;+ stroke: color-mix(+ in srgb,+ var(--t-border-color-strong) 50%,+ var(--t-background-quaternary) 50%+ );+}++.indicator {+ fill: none;+ stroke: var(--progress-ring-color, var(--t-color-blue));+ transition: stroke-dashoffset duration(normal) ease;+}++@media (prefers-reduced-motion: reduce) {+ .indicator {+ transition: none;+ }+}diff --git a/packages/twenty-ui/src/primitives/feedback/ProgressRing/ProgressRing.module.scss.d.ts b/packages/twenty-ui/src/primitives/feedback/ProgressRing/ProgressRing.module.scss.d.tsnew file mode 100644index 00000000000..987d76a0498--- /dev/null+++ b/packages/twenty-ui/src/primitives/feedback/ProgressRing/ProgressRing.module.scss.d.ts@@ -0,0 +1,7 @@+declare const classNames: {+ readonly root: 'root';+ readonly ring: 'ring';+ readonly track: 'track';+ readonly indicator: 'indicator';+};+export default classNames;diff --git a/packages/twenty-ui/src/primitives/feedback/ProgressRing/ProgressRing.tsx b/packages/twenty-ui/src/primitives/feedback/ProgressRing/ProgressRing.tsxnew file mode 100644index 00000000000..07deea176df--- /dev/null+++ b/packages/twenty-ui/src/primitives/feedback/ProgressRing/ProgressRing.tsx@@ -0,0 +1,80 @@+import { Progress } from '@base-ui/react/progress';+import { clamp } from '@base-ui/utils/clamp';+import { isNonEmptyString } from '@sniptt/guards';+import { clsx } from 'clsx';+import { type CSSProperties } from 'react';++import { isRenderableSlot } from '@ui/utilities/internal/isRenderableSlot';+import { isDefined } from '@ui/utilities/utils/isDefined';++import styles from './ProgressRing.module.scss';+import { type ProgressRingProps } from './types/ProgressRingProps';++const RING_SIZE = { sm: 14, md: 16 };+const STROKE_WIDTH = 2;++export const ProgressRing = ({+ value,+ size = 'md',+ barColor,+ children,+ className,+ style,+ 'aria-valuetext': ariaValueText,+ ...props+}: ProgressRingProps) => {+ const clampedValue = clamp(value, 0, 100);+ const boundedValue = Number.isNaN(clampedValue) ? 0 : clampedValue;+ const diameter = RING_SIZE[size];+ const radius = (diameter - STROKE_WIDTH) / 2;+ const circumference = 2 * Math.PI * radius;++ return (+ <Progress.Root+ {...props}+ value={boundedValue}+ min={0}+ max={100}+ getAriaValueText={(formattedValue) =>+ isNonEmptyString(ariaValueText) ? ariaValueText : formattedValue+ }+ className={clsx(styles.root, className)}+ style={+ {+ ...(isDefined(barColor) ? { '--progress-ring-color': barColor } : {}),+ ...style,+ } as CSSProperties+ }+ >+ {isRenderableSlot(children) && <span>{children}</span>}+ <svg+ className={styles.ring}+ width={diameter}+ height={diameter}+ viewBox={`0 0 ${diameter} ${diameter}`}+ aria-hidden="true"+ focusable="false"+ >+ <circle+ className={styles.track}+ cx={diameter / 2}+ cy={diameter / 2}+ r={radius}+ strokeWidth={STROKE_WIDTH}+ />+ <circle+ className={styles.indicator}+ cx={diameter / 2}+ cy={diameter / 2}+ r={radius}+ strokeWidth={STROKE_WIDTH}+ strokeDasharray={circumference}+ strokeDashoffset={+ circumference - (boundedValue / 100) * circumference+ }+ strokeLinecap="round"+ />+ </svg>+ </Progress.Root>+ );+};diff --git a/packages/twenty-ui/src/primitives/feedback/ProgressRing/__stories__/ProgressRing.stories.tsx b/packages/twenty-ui/src/primitives/feedback/ProgressRing/__stories__/ProgressRing.stories.tsxnew file mode 100644index 00000000000..94793c8d308--- /dev/null+++ b/packages/twenty-ui/src/primitives/feedback/ProgressRing/__stories__/ProgressRing.stories.tsx@@ -0,0 +1,165 @@+import { type Meta, type StoryObj } from '@storybook/react-vite';+import { useState } from 'react';+import { expect, userEvent, within } from 'storybook/test';++import { ProgressRing } from '@ui/primitives/feedback';+import { Button } from '@ui/primitives/input/Button/Button';+import { Text } from '@ui/primitives/typography/Text/Text';+import { ComponentDecorator } from '@ui/testing';++const meta: Meta<typeof ProgressRing> = {+ title: 'UI/Feedback/ProgressRing/ProgressRing',+ component: ProgressRing,+ decorators: [ComponentDecorator],+ args: {+ value: 75,+ 'aria-label': 'Import progress',+ },+ argTypes: {+ value: { control: { type: 'range', min: 0, max: 100, step: 1 } },+ className: { control: false },+ },+};++export default meta;++type Story = StoryObj<typeof ProgressRing>;++export const Default: Story = {};++export const Small: Story = {+ args: { size: 'sm' },+ play: async ({ canvasElement }) => {+ const progress = within(canvasElement).getByRole('progressbar', {+ name: 'Import progress',+ });+ const { width, height } = progress.getBoundingClientRect();++ await expect(width).toBe(14);+ await expect(height).toBe(14);+ await expect(progress).toHaveAttribute('aria-valuetext', '75%');+ },+};++const WITH_VALUE_ARGS = {+ children: '75 of 100 files',+ 'aria-valuetext': '75 of 100 files imported',+};++export const WithValue: Story = {+ args: WITH_VALUE_ARGS,+};++const BOUNDARY_VALUES = [+ { label: 'Below zero', value: -10, expected: 0 },+ { label: 'Above one hundred', value: 120, expected: 100 },+ { label: 'Invalid value', value: Number.NaN, expected: 0 },+ { label: 'Negative infinity', value: Number.NEGATIVE_INFINITY, expected: 0 },+ {+ label: 'Positive infinity',+ value: Number.POSITIVE_INFINITY,+ expected: 100,+ },+ { label: 'Fractional progress', value: 42.5, expected: 42.5 },+];++export const BoundedValues: Story = {+ render: () => (+ <>+ {BOUNDARY_VALUES.map(({ label, value }) => (+ <ProgressRing key={label} aria-label={label} value={value}>+ {label}+ </ProgressRing>+ ))}+ </>+ ),+ play: async ({ canvasElement }) => {+ const canvas = within(canvasElement);++ for (const { label, expected } of BOUNDARY_VALUES) {+ const progress = canvas.getByRole('progressbar', { name: label });++ await expect(progress).toHaveAttribute('aria-valuenow', String(expected));+ await expect(progress).toHaveAttribute('aria-valuemin', '0');+ await expect(progress).toHaveAttribute('aria-valuemax', '100');+ await expect(progress.tabIndex).toBe(-1);+ }+ },+};++const ControlledProgressRing = () => {+ const [value, setValue] = useState(0);++ return (+ <>+ <ProgressRing+ value={value}+ aria-label="Import progress"+ aria-valuetext={`${value} of 100 files imported`}+ >+ {value} of 100 files+ </ProgressRing>+ <Button onClick={() => setValue(50)}>Report progress</Button>+ <Button onClick={() => setValue(100)}>Complete import</Button>+ </>+ );+};++export const Controlled: Story = {+ render: () => <ControlledProgressRing />,+ play: async ({ canvasElement }) => {+ const canvas = within(canvasElement);+ const progress = canvas.getByRole('progressbar', {+ name: 'Import progress',+ });++ await expect(progress).toHaveAttribute('aria-valuenow', '0');+ await expect(progress).toHaveTextContent('0 of 100 files');+ await userEvent.click(+ canvas.getByRole('button', { name: 'Report progress' }),+ );+ await expect(progress).toHaveAttribute('aria-valuenow', '50');+ await expect(progress).toHaveTextContent('50 of 100 files');+ await expect(progress).toHaveAttribute(+ 'aria-valuetext',+ '50 of 100 files imported',+ );+ await userEvent.tab();+ await expect(+ canvas.getByRole('button', { name: 'Complete import' }),+ ).toHaveFocus();+ await userEvent.keyboard('{Enter}');+ await expect(progress).toHaveAttribute('aria-valuenow', '100');+ await expect(progress).toHaveTextContent('100 of 100 files');+ },+};++export const CatalogDark: Story = {+ args: WITH_VALUE_ARGS,+ tags: ['!autodocs'],+ globals: { colorScheme: 'dark' },+};++export const RightToLeft: Story = {+ args: {+ ...WITH_VALUE_ARGS,+ dir: 'rtl',+ children: (+ <Text render={<bdi />} dir="ltr">+ 75 of 100 files+ </Text>+ ),+ },+ play: async ({ canvasElement }) => {+ const progress = within(canvasElement).getByRole('progressbar', {+ name: 'Import progress',+ });+ const progressBounds = progress.getBoundingClientRect();+ const valueBounds = within(progress)+ .getByText('75 of 100 files')+ .getBoundingClientRect();++ await expect(valueBounds.right).toBeCloseTo(progressBounds.right);+ await expect(valueBounds.left).toBeGreaterThan(progressBounds.left);+ },+};diff --git a/packages/twenty-ui/src/primitives/feedback/ProgressRing/__tests__/ProgressRing.test.tsx b/packages/twenty-ui/src/primitives/feedback/ProgressRing/__tests__/ProgressRing.test.tsxnew file mode 100644index 00000000000..a2176b47d73--- /dev/null+++ b/packages/twenty-ui/src/primitives/feedback/ProgressRing/__tests__/ProgressRing.test.tsx@@ -0,0 +1,9 @@+import { runComponentConformance } from '@test-utilities/conformance/runComponentConformance';++import { ProgressRing } from '@ui/primitives/feedback';++runComponentConformance({+ name: 'ProgressRing',+ element: <ProgressRing value={42} aria-label="Import progress" />,+ refInstanceOf: HTMLDivElement,+});diff --git a/packages/twenty-ui/src/primitives/feedback/ProgressRing/types/ProgressRingProps.ts b/packages/twenty-ui/src/primitives/feedback/ProgressRing/types/ProgressRingProps.tsnew file mode 100644index 00000000000..77026650544--- /dev/null+++ b/packages/twenty-ui/src/primitives/feedback/ProgressRing/types/ProgressRingProps.ts@@ -0,0 +1,7 @@+import { type useRender } from '@base-ui/react/use-render';++export type ProgressRingProps = useRender.ComponentProps<'div'> & {+ value: number;+ size?: 'sm' | 'md';+ barColor?: string;+};diff --git a/packages/twenty-ui/src/primitives/feedback/index.ts b/packages/twenty-ui/src/primitives/feedback/index.tsindex d7e5d071110..8ca76230945 100644--- a/packages/twenty-ui/src/primitives/feedback/index.ts+++ b/packages/twenty-ui/src/primitives/feedback/index.ts@@ -12,3 +12,5 @@ export { Banner } from './Banner/Banner';export { Loader } from './Loader/Loader';export { ProgressBar } from './ProgressBar/ProgressBar';export type { ProgressBarProps } from './ProgressBar/types/ProgressBarProps';+export { ProgressRing } from './ProgressRing/ProgressRing';+export type { ProgressRingProps } from './ProgressRing/types/ProgressRingProps';diff --git a/packages/twenty-ui/src/primitives/input/SegmentedControl/SegmentedControl.tsx b/packages/twenty-ui/src/primitives/input/SegmentedControl/SegmentedControl.tsxindex 8a37ff1d087..0fa3290e431 100644--- a/packages/twenty-ui/src/primitives/input/SegmentedControl/SegmentedControl.tsx+++ b/packages/twenty-ui/src/primitives/input/SegmentedControl/SegmentedControl.tsx@@ -2,7 +2,7 @@ import { Radio as RadioPrimitive } from '@base-ui/react/radio';import { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group';import { clsx } from 'clsx';-import { isRenderableSlot } from '@ui/primitives/navigation/ListItem/internal/isRenderableSlot';+import { isRenderableSlot } from '@ui/utilities/internal/isRenderableSlot';import { mergeClassNames } from '@ui/utilities/internal/mergeClassNames';import styles from './SegmentedControl.module.scss';diff --git a/packages/twenty-ui/src/primitives/input/Select/internal/SelectItem.tsx b/packages/twenty-ui/src/primitives/input/Select/internal/SelectItem.tsxindex 64f6d4b0529..fc0383b125c 100644--- a/packages/twenty-ui/src/primitives/input/Select/internal/SelectItem.tsx+++ b/packages/twenty-ui/src/primitives/input/Select/internal/SelectItem.tsx@@ -2,8 +2,8 @@ import { Select as SelectPrimitive } from '@base-ui/react/select';import { clsx } from 'clsx';import { IconCheck } from '@ui/icon';-import { isRenderableSlot } from '@ui/primitives/navigation/ListItem/internal/isRenderableSlot';import listItemStyles from '@ui/primitives/navigation/ListItem/ListItem.module.scss';+import { isRenderableSlot } from '@ui/utilities/internal/isRenderableSlot';import { mergeClassNames } from '@ui/utilities/internal/mergeClassNames';import styles from '../Select.module.scss';diff --git a/packages/twenty-ui/src/primitives/navigation/ListItem/ListItem.tsx b/packages/twenty-ui/src/primitives/navigation/ListItem/ListItem.tsxindex e7bb71c7e9b..664954c3ebd 100644--- a/packages/twenty-ui/src/primitives/navigation/ListItem/ListItem.tsx+++ b/packages/twenty-ui/src/primitives/navigation/ListItem/ListItem.tsx@@ -6,9 +6,9 @@ import { type MouseEvent } from 'react';import { IconCheck, IconChevronRight } from '@ui/icon';import { Shortcut } from '@ui/primitives/typography/Shortcut/Shortcut';import { OverflowingTextWithTooltip } from '@ui/primitives/typography/OverflowingTextWithTooltip/OverflowingTextWithTooltip';+import { isRenderableSlot } from '@ui/utilities/internal/isRenderableSlot';import { isDefined } from '@ui/utilities/utils/isDefined';-import { isRenderableSlot } from './internal/isRenderableSlot';import { ListItemCheckboxIndicator } from './internal/ListItemCheckboxIndicator';import styles from './ListItem.module.scss';import { type ListItemProps } from './types/ListItemProps';diff --git a/packages/twenty-ui/src/primitives/navigation/Tabs/internal/isRenderableSlot.ts b/packages/twenty-ui/src/primitives/navigation/Tabs/internal/isRenderableSlot.tsdeleted file mode 100644index 43cb770c0aa..00000000000--- a/packages/twenty-ui/src/primitives/navigation/Tabs/internal/isRenderableSlot.ts+++ /dev/null@@ -1,7 +0,0 @@-import { isBoolean } from '@sniptt/guards';-import { type ReactNode } from 'react';--import { isDefined } from '@ui/utilities/utils/isDefined';--export const isRenderableSlot = (slot: ReactNode) =>- isDefined(slot) && !isBoolean(slot) && slot !== '';diff --git a/packages/twenty-ui/src/primitives/navigation/internal/tab/TabsTabContent.tsx b/packages/twenty-ui/src/primitives/navigation/internal/tab/TabsTabContent.tsxindex 1c8016e1513..0e7b509ca23 100644--- a/packages/twenty-ui/src/primitives/navigation/internal/tab/TabsTabContent.tsx+++ b/packages/twenty-ui/src/primitives/navigation/internal/tab/TabsTabContent.tsx@@ -1,4 +1,5 @@-import { isRenderableSlot } from '../../Tabs/internal/isRenderableSlot';+import { isRenderableSlot } from '@ui/utilities/internal/isRenderableSlot';+import { type TabsTabProps } from '../../Tabs/types/TabsTabProps';import styles from './Tab.module.scss';diff --git a/packages/twenty-ui/src/primitives/navigation/ListItem/internal/isRenderableSlot.ts b/packages/twenty-ui/src/utilities/internal/isRenderableSlot.tssimilarity index 100%rename from packages/twenty-ui/src/primitives/navigation/ListItem/internal/isRenderableSlot.tsrename to packages/twenty-ui/src/utilities/internal/isRenderableSlot.ts