Skip to content
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
b7298c4
feat: implement SubscriptionTable scaffolding and register global mod…
abhinavkdeval08-design Jun 29, 2026
812e1ac
feat: implement SubscriptionTable scaffolding and register global mod…
abhinavkdeval08-design Jun 29, 2026
43af05b
refactor: resolve bot feedback for SubscriptionTable
abhinavkdeval08-design Jul 6, 2026
7d6b915
Merge branch 'master' into feature/subscription-comparison-table
abhinavkdeval08-design Jul 6, 2026
9ed80d4
Merge branch 'master' into feature/subscription-comparison-table
abhinavkdeval08-design Jul 7, 2026
f8c8be8
Merge branch 'master' into feature/subscription-comparison-table
abhinavkdeval08-design Jul 14, 2026
1b53031
Merge branch 'master' into feature/subscription-comparison-table
hortison Jul 15, 2026
ccda099
Merge branch 'master' into feature/subscription-comparison-table
abhinavkdeval08-design Jul 15, 2026
06e9bb9
Merge branch 'master' into feature/subscription-comparison-table
abhinavkdeval08-design Jul 16, 2026
0034b96
Merge branch 'master' into feature/subscription-comparison-table
abhinavkdeval08-design Jul 23, 2026
55cfd16
Merge branch 'master' into feature/subscription-comparison-table
abhinavkdeval08-design Aug 29, 2026
191ae3b
refactor: resolve bot feedback on responsive overflow, tokens, and ac…
abhinavkdeval08-design Aug 29, 2026
d1d1835
Merge branch 'master' into feature/subscription-comparison-table
abhinavkdeval08-design Sep 1, 2026
efd53ac
feat: add root exports, default export and unit tests for Subscriptio…
abhinavkdeval08-design Sep 1, 2026
111f843
Merge branch 'master' into feature/subscription-comparison-table
abhinavkdeval08-design Sep 26, 2026
171f8be
refactor(SubscriptionTable): switch to standard typography variants a…
abhinavkdeval08-design Sep 26, 2026
26b15e0
refactor(SubscriptionTable): simplify custom barrel export and assert…
abhinavkdeval08-design Sep 27, 2026
1964f3a
chore(custom): resolve merge conflict in barrel exports
abhinavkdeval08-design Oct 6, 2026
7f423a0
Merge branch 'master' into feature/subscription-comparison-table
abhinavkdeval08-design Oct 10, 2026
5dfab2e
Merge branch 'master' into feature/subscription-comparison-table
abhinavkdeval08-design Oct 14, 2026
f2896db
Merge branch 'master' into feature/subscription-comparison-table
abhinavkdeval08-design Oct 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 135 additions & 0 deletions src/custom/SubscriptionTable/SubscriptionTable.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
import CheckIcon from '@mui/icons-material/Check';
import CloseIcon from '@mui/icons-material/Close';
import { Box, Button, Table, TableBody, TableHead, TableRow, Typography } from '@mui/material';
import React from 'react';
Comment thread
abhinavkdeval08-design marked this conversation as resolved.
import { FeatureHeaderCell, StyledHeaderRow, StyledTableCell, StyledTableContainer } from './style';

export interface PlanFeature {
featureName: string;
freePlan: boolean | string;
teamPlan: boolean | string;
enterprisePlan: boolean | string;
}

export interface SubscriptionTableProps {
title?: string;
features?: PlanFeature[];
onPlanSelect?: (planType: 'free' | 'team' | 'enterprise') => void;
featuresLabel?: string;
freePlanLabel?: string;
freePlanButtonLabel?: string;
teamPlanLabel?: string;
teamPlanButtonLabel?: string;
enterprisePlanLabel?: string;
enterprisePlanButtonLabel?: string;
}

export const SubscriptionTable: React.FC<SubscriptionTableProps> = ({
title = 'Subscription Plans Comparison',
features = [],
onPlanSelect,
featuresLabel = 'Features',
freePlanLabel = 'Free Plan',
freePlanButtonLabel = 'Get Started',
teamPlanLabel = 'Team Plan',
teamPlanButtonLabel = 'Upgrade',
enterprisePlanLabel = 'Enterprise Plan',
enterprisePlanButtonLabel = 'Contact Us'
}) => {
Comment thread
abhinavkdeval08-design marked this conversation as resolved.
const renderValue = (value: boolean | string) => {
if (typeof value === 'boolean') {
return value ? (
<CheckIcon color="success" data-testid="check-icon" titleAccess="Included" aria-label="Included" />
) : (
<CloseIcon color="error" data-testid="close-icon" titleAccess="Not included" aria-label="Not included" />
);
}
return (
<Typography variant="body2" sx={{ fontWeight: 500 }}>
{value}
</Typography>
);
Comment thread
coderabbitai[bot] marked this conversation as resolved.
};

return (
<Box sx={{ width: '100%', my: 4 }}>
{title && (
<Typography
variant="h4"
component="h2"
sx={{
mb: 3,
fontWeight: 700
}}
>
{title}
</Typography>
)}
<StyledTableContainer>
<Table sx={{ minWidth: 650 }} aria-label="subscription comparison table">
<TableHead>
<StyledHeaderRow>
<StyledTableCell sx={{ fontWeight: 'bold', fontSize: '1.1rem' }}>
{featuresLabel}
</StyledTableCell>
<StyledTableCell align="center" sx={{ fontWeight: 'bold', fontSize: '1.1rem' }}>
{freePlanLabel}
<Box sx={{ mt: 1 }}>
<Button size="small" variant="outlined" onClick={() => onPlanSelect?.('free')}>
{freePlanButtonLabel}
</Button>
</Box>
</StyledTableCell>
<StyledTableCell align="center" sx={{ fontWeight: 'bold', fontSize: '1.1rem' }}>
{teamPlanLabel}
<Box sx={{ mt: 1 }}>
<Button
size="small"
variant="contained"
color="primary"
onClick={() => onPlanSelect?.('team')}
>
{teamPlanButtonLabel}
</Button>
</Box>
</StyledTableCell>
<StyledTableCell align="center" sx={{ fontWeight: 'bold', fontSize: '1.1rem' }}>
{enterprisePlanLabel}
<Box sx={{ mt: 1 }}>
<Button
size="small"
variant="contained"
color="secondary"
onClick={() => onPlanSelect?.('enterprise')}
>
{enterprisePlanButtonLabel}
</Button>
</Box>
</StyledTableCell>
</StyledHeaderRow>
</TableHead>
<TableBody>
{features.map((row, index) => (
<TableRow
key={index}
sx={{
'&:last-child td, &:last-child th': { border: 0 },
'&:hover': { backgroundColor: 'action.hover' }
}}
>
<FeatureHeaderCell component="th" scope="row">
{row.featureName}
</FeatureHeaderCell>
<StyledTableCell align="center">{renderValue(row.freePlan)}</StyledTableCell>
<StyledTableCell align="center">{renderValue(row.teamPlan)}</StyledTableCell>
<StyledTableCell align="center">{renderValue(row.enterprisePlan)}</StyledTableCell>
</TableRow>
))}
</TableBody>
</Table>
</StyledTableContainer>
</Box>
);
};

SubscriptionTable.displayName = 'SubscriptionTable';
1 change: 1 addition & 0 deletions src/custom/SubscriptionTable/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './SubscriptionTable';
26 changes: 26 additions & 0 deletions src/custom/SubscriptionTable/style.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Paper, TableCell, TableRow } from '@mui/material';
import { styled } from '@mui/material/styles';

export const StyledTableContainer = styled(Paper)(({ theme }) => ({
borderRadius: theme.shape.borderRadius * 2,
overflowX: 'auto',
overflowY: 'hidden',
boxShadow: theme.shadows[2],
border: `1px solid ${theme.palette.divider}`
}));
Comment thread
coderabbitai[bot] marked this conversation as resolved.

export const StyledHeaderRow = styled(TableRow)(({ theme }) => ({
backgroundColor: theme.palette.mode === 'light' ? theme.palette.grey[50] : theme.palette.grey[900]
}));

export const StyledTableCell = styled(TableCell)(({ theme }) => ({
fontFamily: theme.typography.fontFamily,
borderColor: theme.palette.divider,
fontWeight: 500
}));

export const FeatureHeaderCell = styled(StyledTableCell)(({ theme }) => ({
fontFamily: theme.typography.fontFamily,
fontWeight: 700,
color: theme.palette.text.primary
}));
Comment thread
coderabbitai[bot] marked this conversation as resolved.
3 changes: 2 additions & 1 deletion src/custom/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ export * from './Markdown';
export * from './Modal';
export * from './RJSFFormWrapper';
export * from './StyledAccordion';
export * from './SubscriptionTable';
export * from './WidgetPicker';
export * from './WidgetEmptyState';
export * from './WidgetEmptyState';
3 changes: 3 additions & 0 deletions src/custom/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import ResponsiveDataTable, {
} from './ResponsiveDataTable';
import SearchBar, { SearchBarProps } from './SearchBar';
import { StyledCardProps } from './StyledCard/StyledCard';
import { SubscriptionTable } from './SubscriptionTable';
import { getCopyDeepLinkAction, TableAction } from './TableActions';
import { TeamTable, TeamTableConfiguration } from './TeamTable';
import { TooltipIcon } from './TooltipIconButton';
Expand Down Expand Up @@ -127,6 +128,7 @@ export {
StyledDialogActions,
StyledDialogContent,
StyledDialogTitle,
SubscriptionTable,
TeamTable,
TeamTableConfiguration,
TooltipIcon,
Expand Down Expand Up @@ -191,5 +193,6 @@ export * from './permissions';
export * from './ResourceDetailFormatters';
export * from './RJSFFormWrapper';
export * from './ShareModal';
export * from './SubscriptionTable';
export * from './UserSearchField';
export * from './Workspaces';
Loading