Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

chore(templates): remove abandoned table-page chart/heatmap experiments (#5167)

Ernest972a3169bca1
diff --git a/apps/docsite/src/components/templateComponents.ts b/apps/docsite/src/components/templateComponents.ts
index ab9c81118c..e80a1ada11 100644
--- a/apps/docsite/src/components/templateComponents.ts
+++ b/apps/docsite/src/components/templateComponents.ts
@@ -162,18 +162,6 @@ export const TEMPLATE_COMPONENTS: Record<
() =>
import('../../../../packages/cli/assets/templates/pages/table-page/page'),
),
- 'table-page-chart': lazy(
- () =>
- import('../../../../packages/cli/assets/templates/pages/table-page-chart/page'),
- ),
- 'table-page-heatmap-status': lazy(
- () =>
- import('../../../../packages/cli/assets/templates/pages/table-page-heatmap-status/page'),
- ),
- 'table-page-shoe-store-heatmap': lazy(
- () =>
- import('../../../../packages/cli/assets/templates/pages/table-page-shoe-store-heatmap/page'),
- ),
};
/** Resolve a template's lazy component by slug, or `undefined` if unknown. */
diff --git a/packages/cli/assets/templates/pages/table-page-chart/page.tsx b/packages/cli/assets/templates/pages/table-page-chart/page.tsx
deleted file mode 100644
index 1cd064e8bc..0000000000
--- a/packages/cli/assets/templates/pages/table-page-chart/page.tsx
+++ /dev/null
@@ -1,577 +0,0 @@
-// Copyright (c) Meta Platforms, Inc. and affiliates.
-
-'use client';
-
-import {
- VStack,
- HStack,
- StackItem,
- Layout,
- LayoutContent,
- LayoutHeader,
-} from '@astryxdesign/core/Layout';
-import {Text, Heading} from '@astryxdesign/core/Text';
-import {Button} from '@astryxdesign/core/Button';
-import {IconButton} from '@astryxdesign/core/IconButton';
-import {Icon} from '@astryxdesign/core/Icon';
-import {Badge} from '@astryxdesign/core/Badge';
-import {Link} from '@astryxdesign/core/Link';
-import {Thumbnail} from '@astryxdesign/core/Thumbnail';
-import {Table, proportional, pixel} from '@astryxdesign/core/Table';
-import type {TableColumn} from '@astryxdesign/core/Table';
-import {Chart, ChartGrid, ChartAxis, area, line} from '@astryxdesign/charts';
-import {
- FunnelIcon,
- ArrowDownTrayIcon,
- PlusIcon,
-} from '@heroicons/react/24/outline';
-
-// ============= DATA =============
-
-type ProductCategory = 'Matcha' | 'Coffee' | 'Tea' | 'Smoothie' | 'Specialty';
-
-interface OrderRow extends Record<string, unknown> {
- id: string;
- customer: string;
- email: string;
- product: string;
- category: ProductCategory;
- imageIndex: number;
- amount: number;
- status: 'completed' | 'processing' | 'shipped' | 'refunded';
- date: string;
-}
-
-const PRODUCTS = [
- {
- name: 'Ceremonial Matcha Latte',
- category: 'Matcha' as ProductCategory,
- image: '/template-assets/matcha-product-1.png',
- price: 6,
- },
- {
- name: 'Oat Milk Cappuccino',
- category: 'Coffee' as ProductCategory,
- image: '/template-assets/matcha-product-2.png',
- price: 5,
- },
- {
- name: 'Jasmine Green Tea',
- category: 'Tea' as ProductCategory,
- image: '/template-assets/matcha-product-3.png',
- price: 4,
- },
- {
- name: 'Mango Matcha Smoothie',
- category: 'Smoothie' as ProductCategory,
- image: '/template-assets/matcha-product-4.png',
- price: 8,
- },
- {
- name: 'Hojicha Latte',
- category: 'Specialty' as ProductCategory,
- image: '/template-assets/matcha-product-5.png',
- price: 7,
- },
- {
- name: 'Iced Yuzu Matcha',
- category: 'Matcha' as ProductCategory,
- image: '/template-assets/matcha-product-6.png',
- price: 7,
- },
-];
-
-const orders: OrderRow[] = [
- {
- id: 'ORD-1001',
- customer: 'Sarah Chen',
- email: '[email protected]',
- product: PRODUCTS[0].name,
- category: PRODUCTS[0].category,
- imageIndex: 0,
- amount: 6,
- status: 'completed',
- date: '2025-01-15',
- },
- {
- id: 'ORD-1002',
- customer: 'Marcus Rivera',
- email: '[email protected]',
- product: PRODUCTS[1].name,
- category: PRODUCTS[1].category,
- imageIndex: 1,
- amount: 5,
- status: 'completed',
- date: '2025-01-15',
- },
- {
- id: 'ORD-1003',
- customer: 'Aisha Patel',
- email: '[email protected]',
- product: PRODUCTS[2].name,
- category: PRODUCTS[2].category,
- imageIndex: 2,
- amount: 4,
- status: 'shipped',
- date: '2025-01-14',
- },
- {
- id: 'ORD-1004',
- customer: "James O'Brien",
- email: '[email protected]',
- product: PRODUCTS[3].name,
- category: PRODUCTS[3].category,
- imageIndex: 3,
- amount: 8,
- status: 'processing',
- date: '2025-01-14',
- },
- {
- id: 'ORD-1005',
- customer: 'Yuki Tanaka',
- email: '[email protected]',
- product: PRODUCTS[4].name,
- category: PRODUCTS[4].category,
- imageIndex: 4,
- amount: 7,
- status: 'completed',
- date: '2025-01-13',
- },
- {
- id: 'ORD-1006',
- customer: 'Elena Volkov',
- email: '[email protected]',
- product: PRODUCTS[5].name,
- category: PRODUCTS[5].category,
- imageIndex: 5,
- amount: 7,
- status: 'refunded',
- date: '2025-01-13',
- },
- {
- id: 'ORD-1007',
- customer: 'David Kim',
- email: '[email protected]',
- product: PRODUCTS[0].name,
- category: PRODUCTS[0].category,
- imageIndex: 0,
- amount: 6,
- status: 'completed',
- date: '2025-01-12',
- },
- {
- id: 'ORD-1008',
- customer: 'Fatima Al-Rashid',
- email: '[email protected]',
- product: PRODUCTS[1].name,
- category: PRODUCTS[1].category,
- imageIndex: 1,
- amount: 5,
- status: 'shipped',
- date: '2025-01-12',
- },
- {
- id: 'ORD-1009',
- customer: 'Lucas Andersson',
- email: '[email protected]',
- product: PRODUCTS[2].name,
- category: PRODUCTS[2].category,
- imageIndex: 2,
- amount: 4,
- status: 'completed',
- date: '2025-01-11',
- },
- {
- id: 'ORD-1010',
- customer: 'Priya Sharma',
- email: '[email protected]',
- product: PRODUCTS[3].name,
- category: PRODUCTS[3].category,
- imageIndex: 3,
- amount: 8,
- status: 'processing',
- date: '2025-01-11',
- },
- {
- id: 'ORD-1011',
- customer: 'Noah Williams',
- email: '[email protected]',
- product: PRODUCTS[4].name,
- category: PRODUCTS[4].category,
- imageIndex: 4,
- amount: 7,
- status: 'completed',
- date: '2025-01-10',
- },
- {
- id: 'ORD-1012',
- customer: 'Sofia Garcia',
- email: '[email protected]',
- product: PRODUCTS[5].name,
- category: PRODUCTS[5].category,
- imageIndex: 5,
- amount: 7,
- status: 'completed',
- date: '2025-01-10',
- },
- {
- id: 'ORD-1013',
- customer: 'Oliver Brown',
- email: '[email protected]',
- product: PRODUCTS[0].name,
- category: PRODUCTS[0].category,
- imageIndex: 0,
- amount: 6,
- status: 'shipped',
- date: '2025-01-09',
- },
- {
- id: 'ORD-1014',
- customer: 'Mei Lin',
- email: '[email protected]',
- product: PRODUCTS[1].name,
- category: PRODUCTS[1].category,
- imageIndex: 1,
- amount: 5,
- status: 'completed',
- date: '2025-01-09',
- },
- {
- id: 'ORD-1015',
- customer: 'Hassan Ahmed',
- email: '[email protected]',
- product: PRODUCTS[2].name,
- category: PRODUCTS[2].category,
- imageIndex: 2,
- amount: 4,
- status: 'refunded',
- date: '2025-01-08',
- },
- {
- id: 'ORD-1016',
- customer: 'Isabella Rossi',
- email: '[email protected]',
- product: PRODUCTS[3].name,
- category: PRODUCTS[3].category,
- imageIndex: 3,
- amount: 8,
- status: 'completed',
- date: '2025-01-08',
- },
- {
- id: 'ORD-1017',
- customer: 'Liam Murphy',
- email: '[email protected]',
- product: PRODUCTS[4].name,
- category: PRODUCTS[4].category,
- imageIndex: 4,
- amount: 7,
- status: 'processing',
- date: '2025-01-07',
- },
- {
- id: 'ORD-1018',
- customer: 'Chloe Dubois',
- email: '[email protected]',
- product: PRODUCTS[5].name,
- category: PRODUCTS[5].category,
- imageIndex: 5,
- amount: 7,
- status: 'completed',
- date: '2025-01-07',
- },
- {
- id: 'ORD-1019',
- customer: 'Andre Santos',
- email: '[email protected]',
- product: PRODUCTS[0].name,
- category: PRODUCTS[0].category,
- imageIndex: 0,
- amount: 6,
- status: 'shipped',
- date: '2025-01-06',
- },
- {
- id: 'ORD-1020',
- customer: 'Nina Johansson',
- email: '[email protected]',
- product: PRODUCTS[1].name,
- category: PRODUCTS[1].category,
- imageIndex: 1,
- amount: 5,
- status: 'completed',
- date: '2025-01-06',
- },
- {
- id: 'ORD-1021',
- customer: 'Raj Kapoor',
- email: '[email protected]',
- product: PRODUCTS[2].name,
- category: PRODUCTS[2].category,
- imageIndex: 2,
- amount: 4,
- status: 'completed',
- date: '2025-01-05',
- },
- {
- id: 'ORD-1022',
- customer: 'Emma Thompson',
- email: '[email protected]',
- product: PRODUCTS[3].name,
- category: PRODUCTS[3].category,
- imageIndex: 3,
- amount: 8,
- status: 'completed',
- date: '2025-01-05',
- },
- {
- id: 'ORD-1023',
- customer: 'Carlos Mendez',
- email: '[email protected]',
- product: PRODUCTS[4].name,
- category: PRODUCTS[4].category,
- imageIndex: 4,
- amount: 7,
- status: 'shipped',
- date: '2025-01-04',
- },
- {
- id: 'ORD-1024',
- customer: 'Zoe Mitchell',
- email: '[email protected]',
- product: PRODUCTS[5].name,
- category: PRODUCTS[5].category,
- imageIndex: 5,
- amount: 7,
- status: 'processing',
- date: '2025-01-04',
- },
- {
- id: 'ORD-1025',
- customer: 'Henrik Larsson',
- email: '[email protected]',
- product: PRODUCTS[0].name,
- category: PRODUCTS[0].category,
- imageIndex: 0,
- amount: 6,
- status: 'completed',
- date: '2025-01-03',
- },
- {
- id: 'ORD-1026',
- customer: 'Amara Okafor',
- email: '[email protected]',
- product: PRODUCTS[1].name,
- category: PRODUCTS[1].category,
- imageIndex: 1,
- amount: 5,
- status: 'completed',
- date: '2025-01-03',
- },
- {
- id: 'ORD-1027',
- customer: 'Leo Fischer',
- email: '[email protected]',
- product: PRODUCTS[2].name,
- category: PRODUCTS[2].category,
- imageIndex: 2,
- amount: 4,
- status: 'completed',
- date: '2025-01-02',
- },
- {
- id: 'ORD-1028',
- customer: 'Maya Petrov',
- email: '[email protected]',
- product: PRODUCTS[3].name,
- category: PRODUCTS[3].category,
- imageIndex: 3,
- amount: 8,
- status: 'shipped',
- date: '2025-01-02',
- },
- {
- id: 'ORD-1029',
- customer: 'Tomás Herrera',
- email: '[email protected]',
- product: PRODUCTS[4].name,
- category: PRODUCTS[4].category,
- imageIndex: 4,
- amount: 7,
- status: 'completed',
- date: '2025-01-01',
- },
- {
- id: 'ORD-1030',
- customer: 'Grace Nakamura',
- email: '[email protected]',
- product: PRODUCTS[5].name,
- category: PRODUCTS[5].category,
- imageIndex: 5,
- amount: 7,
- status: 'completed',
- date: '2025-01-01',
- },
-];
-
-const revenueData = [
- {date: 'Jan 1', revenue: 84},
- {date: 'Jan 2', revenue: 72},
- {date: 'Jan 3', revenue: 91},
- {date: 'Jan 4', revenue: 68},
- {date: 'Jan 5', revenue: 105},
- {date: 'Jan 6', revenue: 118},
- {date: 'Jan 7', revenue: 96},
- {date: 'Jan 8', revenue: 132},
- {date: 'Jan 9', revenue: 110},
- {date: 'Jan 10', revenue: 98},
- {date: 'Jan 11', revenue: 125},
- {date: 'Jan 12', revenue: 142},
- {date: 'Jan 13', revenue: 108},
- {date: 'Jan 14', revenue: 156},
- {date: 'Jan 15', revenue: 138},
-];
-
-const statusColor: Record<string, 'green' | 'blue' | 'orange' | 'red'> = {
- completed: 'green',
- shipped: 'blue',
- processing: 'orange',
- refunded: 'red',
-};
-
-const columns: TableColumn<OrderRow>[] = [
- {
- key: 'id',
- header: 'Order',
- width: pixel(110),
- renderCell: (item: OrderRow) => (
- <Link href="#" isStandalone>
- {item.id}
- </Link>
- ),
- },
- {
- key: 'product',
- header: 'Product',
- width: proportional(3),
- renderCell: (item: OrderRow) => (
- <HStack gap={3} vAlign="center">
- <Thumbnail
- src={PRODUCTS[item.imageIndex].image}
- alt={item.product}
- label={item.product}
- style={{width: 36, height: 36, flexShrink: 0}}
- />
- <VStack gap={0}>
- <Text type="body">{item.product}</Text>
- <Text type="supporting" color="secondary">
- {item.category}
- </Text>
- </VStack>
- </HStack>
- ),
- },
- {
- key: 'amount',
- header: 'Amount',
- width: pixel(90),
- renderCell: (item: OrderRow) => <Text type="body">${item.amount}</Text>,
- },
- {
- key: 'customer',
- header: 'Customer',
- width: proportional(2),
- renderCell: (item: OrderRow) => <Text type="body">{item.customer}</Text>,
- },
- {
- key: 'email',
- header: 'Email',
- width: proportional(2),
- renderCell: (item: OrderRow) => <Text type="body">{item.email}</Text>,
- },
- {
- key: 'status',
- header: 'Status',
- width: pixel(120),
- renderCell: (item: OrderRow) => (
- <Badge
- label={item.status.charAt(0).toUpperCase() + item.status.slice(1)}
- variant={statusColor[item.status]}
- />
- ),
- },
- {
- key: 'date',
- header: 'Date',
- width: pixel(110),
- renderCell: (item: OrderRow) => <Text type="body">{item.date}</Text>,
- },
-];
-
-// ============= PAGE =============
-
-export default function TablePageChartTemplate() {
- return (
- <Layout
- height="fill"
- header={
- <LayoutHeader hasDivider>
- <HStack gap={2} vAlign="center">
- <StackItem size="fill">
- <Heading level={1}>Sales</Heading>
- </StackItem>
- <IconButton
- label="Filter"
- icon={<Icon icon={FunnelIcon} size="sm" />}
- variant="ghost"
- />
- <IconButton
- label="Export"
- icon={<Icon icon={ArrowDownTrayIcon} size="sm" />}
- variant="ghost"
- />
- <Button
- label="New order"
- icon={<Icon icon={PlusIcon} size="sm" />}
- />
- </HStack>
- </LayoutHeader>
- }
- content={
- <LayoutContent padding={3}>
- <VStack gap={4}>
- <Chart
- data={revenueData}
- xKey="date"
- series={[
- area('revenue', {color: '#14b8a6', gradient: true}),
- line('revenue', {color: '#14b8a6'}),
- ]}
- grid={<ChartGrid horizontal />}
- axes={
- <>
- <ChartAxis position="bottom" />
- <ChartAxis
- position="left"
- tickFormat={(v: unknown) => `$${v}`}
- />
- </>
- }
- height={280}
- margin={{left: 40, right: 10, top: 10, bottom: 30}}
- />
-
- <Table<OrderRow>
- data={orders}
- columns={columns}
- idKey="id"
- density="balanced"
- dividers="rows"
- hasHover
- />
- </VStack>
- </LayoutContent>
- }
- />
- );
-}
diff --git a/packages/cli/assets/templates/pages/table-page-chart/template.doc.mjs b/packages/cli/assets/templates/pages/table-page-chart/template.doc.mjs
deleted file mode 100644
index e2285877cb..0000000000
--- a/packages/cli/assets/templates/pages/table-page-chart/template.doc.mjs
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright (c) Meta Platforms, Inc. and affiliates.
-
-/** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */
-export const doc = {
- type: 'page',
- name: 'Matcha Sales Table',
- displayName: 'Matcha Sales Table',
- description:
- 'Matcha store sales data table with a revenue area chart and product thumbnails.',
- isReady: true,
- category: 'Table - Chart',
- isHiddenFromOverview: true,
-};
diff --git a/packages/cli/assets/templates/pages/table-page-heatmap-status/page.tsx b/packages/cli/assets/templates/pages/table-page-heatmap-status/page.tsx
deleted file mode 100644
index f64be8e2c7..0000000000
--- a/packages/cli/assets/templates/pages/table-page-heatmap-status/page.tsx
+++ /dev/null
@@ -1,467 +0,0 @@
-// Copyright (c) Meta Platforms, Inc. and affiliates.
-
-'use client';
-
-import {useMemo} from 'react';
-import {
- VStack,
- HStack,
- StackItem,
- Layout,
- LayoutContent,
- LayoutHeader,
-} from '@astryxdesign/core/Layout';
-import {Text, Heading} from '@astryxdesign/core/Text';
-import {Button} from '@astryxdesign/core/Button';
-import {IconButton} from '@astryxdesign/core/IconButton';
-import {Icon} from '@astryxdesign/core/Icon';
-import {Avatar} from '@astryxdesign/core/Avatar';
-import {Badge} from '@astryxdesign/core/Badge';
-import {Link} from '@astryxdesign/core/Link';
-import {Table, proportional, pixel} from '@astryxdesign/core/Table';
-import type {TableColumn} from '@astryxdesign/core/Table';
-import {Chart, ChartAxis, ChartHeatmapGL} from '@astryxdesign/lab';
-import {
- FunnelIcon,
- ArrowDownTrayIcon,
- ArrowPathIcon,
-} from '@heroicons/react/24/outline';
-
-// ============= DATA =============
-
-type Severity = 'critical' | 'major' | 'minor' | 'resolved';
-type ProductName =
- | 'Ads Manager'
- | 'Business Suite'
- | 'Commerce Manager'
- | 'Pages'
- | 'Messenger API'
- | 'Graph API'
- | 'WhatsApp Business'
- | 'Instagram API';
-
-function avatarSvg(bg: string) {
- const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect width="100" height="100" fill="${bg}"/><circle cx="50" cy="38" r="18" fill="white" opacity="0.85"/><ellipse cx="50" cy="90" rx="30" ry="28" fill="white" opacity="0.85"/></svg>`;
- return `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`;
-}
-
-const ONCALL_AVATARS: Record<string, string> = {
- 'Sarah Chen': avatarSvg('#6366F1'),
- 'David Kim': avatarSvg('#EC4899'),
- 'Priya Sharma': avatarSvg('#F59E0B'),
- 'Marcus Rivera': avatarSvg('#10B981'),
- 'Elena Volkov': avatarSvg('#8B5CF6'),
- 'Noah Williams': avatarSvg('#EF4444'),
- 'Mei Lin': avatarSvg('#06B6D4'),
- 'Carlos Mendez': avatarSvg('#F97316'),
- 'Fatima Al-Rashid': avatarSvg('#3B82F6'),
- 'Lucas Andersson': avatarSvg('#14B8A6'),
- 'Sofia Garcia': avatarSvg('#A855F7'),
- 'Raj Kapoor': avatarSvg('#E11D48'),
- 'Emma Thompson': avatarSvg('#0EA5E9'),
- 'Andre Santos': avatarSvg('#84CC16'),
-};
-
-interface IncidentRow extends Record<string, unknown> {
- id: string;
- product: ProductName;
- title: string;
- severity: Severity;
- status: 'ongoing' | 'identified' | 'monitoring' | 'resolved';
- oncall: string;
- startTime: string;
- duration: string;
- date: string;
- dayOfWeek: number;
- hour: number;
-}
-
-const incidents: IncidentRow[] = [
- // Active — ongoing
- {
- id: 'INC-4008',
- product: 'Business Suite',
- title:
- 'Notification delivery delays affecting mobile push and email channels — queue saturation under investigation',
- severity: 'major',
- oncall: 'Carlos Mendez',
- status: 'ongoing',
- startTime: '09:15',
- duration: 'ongoing',
- date: '2025-01-15',
- dayOfWeek: 3,
- hour: 9,
- },
- // Tue (2) 3pm — the only major outage cluster (3 incidents)
- {
- id: 'INC-4001',
- product: 'Ads Manager',
- title:
- 'Campaign creation timing out for ~12% of advertisers in EMEA region — root caused to elevated DB write latency',
- severity: 'critical',
- oncall: 'Sarah Chen',
- status: 'resolved',
- startTime: '15:10',
- duration: '2h 15m',
- date: '2025-01-14',
- dayOfWeek: 2,
- hour: 15,
- },
- {
- id: 'INC-4002',
- product: 'Graph API',
- title:
- 'Elevated 5xx error rates on /me and /me/accounts endpoints affecting third-party integrations globally',
- severity: 'critical',
- oncall: 'David Kim',
- status: 'resolved',
- startTime: '15:30',
- duration: '3h 20m',
- date: '2025-01-14',
- dayOfWeek: 2,
- hour: 15,
- },
- {
- id: 'INC-4003',
- product: 'Instagram API',
- title:
- 'Media upload failures for image and video content via /media endpoint affecting ~8% of publishers',
- severity: 'major',
- oncall: 'Priya Sharma',
- status: 'resolved',
- startTime: '15:05',
- duration: '1h 50m',
- date: '2025-01-14',
- dayOfWeek: 2,
- hour: 15,
- },
- // Tue (2) 4pm — spillover (2 incidents)
- {
- id: 'INC-4004',
- product: 'Ads Manager',
- title:
- 'Audience insights tab returning empty results due to cache invalidation cascade from earlier outage',
- severity: 'minor',
- oncall: 'Marcus Rivera',
- status: 'resolved',
- startTime: '16:00',
- duration: '45m',
- date: '2025-01-14',
- dayOfWeek: 2,
- hour: 16,
- },
- {
- id: 'INC-4005',
- product: 'WhatsApp Business',
- title:
- 'Outbound message delivery delays of 2-5 minutes for high-volume senders due to queue backpressure',
- severity: 'major',
- oncall: 'Elena Volkov',
- status: 'resolved',
- startTime: '16:20',
- duration: '1h 15m',
- date: '2025-01-14',
- dayOfWeek: 2,
- hour: 16,
- },
- // Thu (4) 10am — single incident
- {
- id: 'INC-4006',
- product: 'Commerce Manager',
- title:
- 'Product catalog sync failures from Shopify and BigCommerce integrations after schema migration deployed',
- severity: 'major',
- oncall: 'Noah Williams',
- status: 'resolved',
- startTime: '10:15',
- duration: '2h 40m',
- date: '2025-01-16',
- dayOfWeek: 4,
- hour: 10,
- },
- // Fri (5) 4pm — single incident
- {
- id: 'INC-4007',
- product: 'Messenger API',
- title:
- 'Webhook delivery failures for subscribed page events — retries succeeded but signaled false alerts',
- severity: 'minor',
- oncall: 'Mei Lin',
- status: 'resolved',
- startTime: '16:30',
- duration: '45m',
- date: '2025-01-17',
- dayOfWeek: 5,
- hour: 16,
- },
- // Active incident
- // Scattered minor blips — light pink cells
- {
- id: 'INC-4009',
- product: 'Pages',
- title:
- 'Image upload timeouts for posts larger than 4MB — auto-recovered after CDN region failover',
- severity: 'minor',
- oncall: 'Fatima Al-Rashid',
- status: 'resolved',
- startTime: '11:00',
- duration: '20m',
- date: '2025-01-12',
- dayOfWeek: 0,
- hour: 11,
- },
- {
- id: 'INC-4010',
- product: 'Graph API',
- title:
- 'Intermittent 503 errors on a single load balancer in us-east-1 — auto-healed by health check rotation',
- severity: 'minor',
- oncall: 'Lucas Andersson',
- status: 'resolved',
- startTime: '14:30',
- duration: '15m',
- date: '2025-01-13',
- dayOfWeek: 1,
- hour: 14,
- },
- {
- id: 'INC-4011',
- product: 'WhatsApp Business',
- title:
- 'Template message rejections due to stale category cache for newly approved templates',
- severity: 'minor',
- oncall: 'Sofia Garcia',
- status: 'resolved',
- startTime: '13:00',
- duration: '30m',
- date: '2025-01-16',
- dayOfWeek: 4,
- hour: 13,
- },
- {
- id: 'INC-4012',
- product: 'Commerce Manager',
- title:
- 'Inventory count mismatch between checkout and catalog services for ~200 SKUs in test region',
- severity: 'minor',
- oncall: 'Raj Kapoor',
- status: 'resolved',
- startTime: '12:00',
- duration: '1h 00m',
- date: '2025-01-17',
- dayOfWeek: 5,
- hour: 12,
- },
- {
- id: 'INC-4013',
- product: 'Instagram API',
- title:
- 'Story insights data delayed by 30-60 minutes for accounts with >100K followers',
- severity: 'minor',
- oncall: 'Emma Thompson',
- status: 'resolved',
- startTime: '10:00',
- duration: '45m',
- date: '2025-01-18',
- dayOfWeek: 6,
- hour: 10,
- },
- {
- id: 'INC-4014',
- product: 'Business Suite',
- title:
- 'Slow inbox loading times (>3s p95) for accounts with large message histories — index rebuild in progress',
- severity: 'minor',
- oncall: 'Andre Santos',
- status: 'resolved',
- startTime: '15:00',
- duration: '25m',
- date: '2025-01-15',
- dayOfWeek: 3,
- hour: 15,
- },
-];
-
-const DAYS = [
- 'Jan 12',
- 'Jan 13',
- 'Jan 14',
- 'Jan 15',
- 'Jan 16',
- 'Jan 17',
- 'Jan 18',
-];
-const HOURS = [
- '9am',
- '10am',
- '11am',
- '12pm',
- '1pm',
- '2pm',
- '3pm',
- '4pm',
- '5pm',
-];
-
-function buildHeatmapData(data: IncidentRow[]) {
- return HOURS.flatMap((hour, hi) =>
- DAYS.map((day, di) => {
- const hourValue = 9 + hi;
- const count = data.filter(
- o => o.dayOfWeek === di && o.hour === hourValue,
- ).length;
- return {day, hour, incidents: count};
- }),
- );
-}
-
-const statusVariant: Record<string, 'error' | 'warning' | 'info' | 'success'> =
- {
- ongoing: 'error',
- identified: 'warning',
- monitoring: 'info',
- resolved: 'success',
- };
-
-const columns: TableColumn<IncidentRow>[] = [
- {
- key: 'id',
- header: 'Incident',
- width: pixel(110),
- renderCell: (item: IncidentRow) => (
- <Link href="#" isStandalone>
- {item.id}
- </Link>
- ),
- },
- {
- key: 'product',
- header: 'Product',
- width: proportional(2),
- renderCell: (item: IncidentRow) => <Text type="body">{item.product}</Text>,
- },
- {
- key: 'title',
- header: 'Description',
- width: proportional(5),
- renderCell: (item: IncidentRow) => <Text type="body">{item.title}</Text>,
- },
- {
- key: 'startTime',
- header: 'Started',
- width: pixel(80),
- renderCell: (item: IncidentRow) => (
- <Text type="body">{item.startTime}</Text>
- ),
- },
- {
- key: 'duration',
- header: 'Duration',
- width: pixel(100),
- renderCell: (item: IncidentRow) => <Text type="body">{item.duration}</Text>,
- },
- {
- key: 'oncall',
- header: 'On-call',
- width: proportional(2),
- renderCell: (item: IncidentRow) => (
- <HStack gap={2} vAlign="center">
- <Avatar
- name={item.oncall}
- src={ONCALL_AVATARS[item.oncall]}
- size="sm"
- />
- <Text type="body">{item.oncall}</Text>
- </HStack>
- ),
- },
- {
- key: 'status',
- header: 'Status',
- width: pixel(120),
- renderCell: (item: IncidentRow) => (
- <Badge
- label={item.status.charAt(0).toUpperCase() + item.status.slice(1)}
- variant={statusVariant[item.status]}
- />
- ),
- },
- {
- key: 'date',
- header: 'Date',
- width: pixel(110),
- renderCell: (item: IncidentRow) => <Text type="body">{item.date}</Text>,
- },
-];
-
-// ============= HEATMAP =============
-
-function OutageHeatmap() {
- const heatmapData = useMemo(() => buildHeatmapData(incidents), []);
-
- return (
- <Chart
- data={heatmapData}
- xKey="day"
- yKeys={['incidents']}
- height={280}
- margin={{left: 0, right: 0, top: 0, bottom: 30}}>
- <ChartAxis position="bottom" />
- <ChartHeatmapGL
- xKey="day"
- yKey="hour"
- valueKey="incidents"
- colorRange={['#dcfce7', '#fee2e2', '#fca5a5', '#ef4444', '#991b1b']}
- />
- </Chart>
- );
-}
-
-// ============= PAGE =============
-
-export default function TablePageHeatmapStatusTemplate() {
- return (
- <Layout
- height="fill"
- header={
- <LayoutHeader hasDivider>
- <HStack gap={2} vAlign="center">
- <StackItem size="fill">
- <Heading level={1}>Status</Heading>
- </StackItem>
- <IconButton
- label="Filter"
- icon={<Icon icon={FunnelIcon} size="sm" />}
- variant="ghost"
- />
- <IconButton
- label="Export"
- icon={<Icon icon={ArrowDownTrayIcon} size="sm" />}
- variant="ghost"
- />
- <Button
- label="Refresh"
- icon={<Icon icon={ArrowPathIcon} size="sm" />}
- />
- </HStack>
- </LayoutHeader>
- }
- content={
- <LayoutContent padding={3}>
- <VStack gap={4}>
- <OutageHeatmap />
-
- <Table<IncidentRow>
- data={incidents}
- columns={columns}
- idKey="id"
- density="balanced"
- dividers="rows"
- hasHover
- />
- </VStack>
- </LayoutContent>
- }
- />
- );
-}
diff --git a/packages/cli/assets/templates/pages/table-page-heatmap-status/template.doc.mjs b/packages/cli/assets/templates/pages/table-page-heatmap-status/template.doc.mjs
deleted file mode 100644
index a26a310850..0000000000
--- a/packages/cli/assets/templates/pages/table-page-heatmap-status/template.doc.mjs
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright (c) Meta Platforms, Inc. and affiliates.
-
-/** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */
-export const doc = {
- type: 'page',
- name: 'Outage Heatmap Table',
- displayName: 'Outage Heatmap Table',
- description:
- 'Product status page with an outage heatmap and incident log table.',
- isReady: true,
- category: 'Table - Heatmap',
- isHiddenFromOverview: true,
-};
diff --git a/packages/cli/assets/templates/pages/table-page-shoe-store-heatmap/page.tsx b/packages/cli/assets/templates/pages/table-page-shoe-store-heatmap/page.tsx
deleted file mode 100644
index 8a2f23bdca..0000000000
--- a/packages/cli/assets/templates/pages/table-page-shoe-store-heatmap/page.tsx
+++ /dev/null
@@ -1,931 +0,0 @@
-// Copyright (c) Meta Platforms, Inc. and affiliates.
-
-'use client';
-
-import {
- VStack,
- HStack,
- StackItem,
- Layout,
- LayoutContent,
- LayoutHeader,
-} from '@astryxdesign/core/Layout';
-import {Text, Heading} from '@astryxdesign/core/Text';
-import {Button} from '@astryxdesign/core/Button';
-import {IconButton} from '@astryxdesign/core/IconButton';
-import {Icon} from '@astryxdesign/core/Icon';
-import {Badge} from '@astryxdesign/core/Badge';
-import {Link} from '@astryxdesign/core/Link';
-import {Thumbnail} from '@astryxdesign/core/Thumbnail';
-import {Table, proportional, pixel} from '@astryxdesign/core/Table';
-import type {TableColumn} from '@astryxdesign/core/Table';
-import {Chart, ChartGrid, ChartAxis, area, line} from '@astryxdesign/charts';
-import {
- FunnelIcon,
- ArrowDownTrayIcon,
- PlusIcon,
-} from '@heroicons/react/24/outline';
-
-// ============= DATA =============
-
-type ProductCategory =
- 'Running' | 'Lifestyle' | 'Basketball' | 'Training' | 'Skateboarding';
-
-function shoeSvg(bg: string, accent: string) {
- const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect width="100" height="100" rx="12" fill="${bg}"/><g transform="translate(22.5, 22.5) scale(2.29)" fill="none" stroke="${accent}" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="m15 10.42 4.8-5.07"/><path d="M19 18h3"/><path d="M9.5 22 21.414 9.415A2 2 0 0 0 21.2 6.4l-5.61-4.208A1 1 0 0 0 14 3v2a2 2 0 0 1-1.394 1.906L8.677 8.053A1 1 0 0 0 8 9c-.155 6.393-2.082 9-4 9a2 2 0 0 0 0 4h14"/></g></svg>`;
- return `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`;
-}
-
-interface OrderRow extends Record<string, unknown> {
- id: string;
- customer: string;
- email: string;
- product: string;
- category: ProductCategory;
- imageIndex: number;
- amount: number;
- status: 'completed' | 'processing' | 'shipped' | 'refunded';
- date: string;
-}
-
-const PRODUCTS = [
- {
- name: 'Air Max 90',
- category: 'Lifestyle' as ProductCategory,
- image: shoeSvg('#FDE68A', '#DC2626'),
- price: 130,
- },
- {
- name: 'UltraBoost 22',
- category: 'Running' as ProductCategory,
- image: shoeSvg('#DBEAFE', '#1E40AF'),
- price: 190,
- },
- {
- name: 'Old Skool',
- category: 'Skateboarding' as ProductCategory,
- image: shoeSvg('#FED7AA', '#EA580C'),
- price: 70,
- },
- {
- name: 'Jordan 1 Retro',
- category: 'Basketball' as ProductCategory,
- image: shoeSvg('#E5E7EB', '#111827'),
- price: 180,
- },
- {
- name: 'Metcon 8',
- category: 'Training' as ProductCategory,
- image: shoeSvg('#FEE2E2', '#991B1B'),
- price: 140,
- },
- {
- name: 'Dunk Low',
- category: 'Skateboarding' as ProductCategory,
- image: shoeSvg('#D1FAE5', '#065F46'),
- price: 110,
- },
-];
-
-const orders: OrderRow[] = [
- // Sun (0) — spread across 9am–5pm, very hot
- {
- id: 'ORD-1001',
- customer: 'Sarah Chen',
- email: '[email protected]',
- product: PRODUCTS[0].name,
- category: PRODUCTS[0].category,
- imageIndex: 0,
- amount: 130,
- status: 'completed',
- date: '2025-01-12',
- },
- {
- id: 'ORD-1002',
- customer: 'Marcus Rivera',
- email: '[email protected]',
- product: PRODUCTS[1].name,
- category: PRODUCTS[1].category,
- imageIndex: 1,
- amount: 190,
- status: 'completed',
- date: '2025-01-12',
- },
- {
- id: 'ORD-1003',
- customer: 'Aisha Patel',
- email: '[email protected]',
- product: PRODUCTS[2].name,
- category: PRODUCTS[2].category,
- imageIndex: 2,
- amount: 70,
- status: 'shipped',
- date: '2025-01-12',
- },
- {
- id: 'ORD-1004',
- customer: "James O'Brien",
- email: '[email protected]',
- product: PRODUCTS[3].name,
- category: PRODUCTS[3].category,
- imageIndex: 3,
- amount: 180,
- status: 'processing',
- date: '2025-01-12',
- },
- {
- id: 'ORD-1005',
- customer: 'Yuki Tanaka',
- email: '[email protected]',
- product: PRODUCTS[4].name,
- category: PRODUCTS[4].category,
- imageIndex: 4,
- amount: 140,
- status: 'completed',
- date: '2025-01-12',
- },
- {
- id: 'ORD-1006',
- customer: 'Elena Volkov',
- email: '[email protected]',
- product: PRODUCTS[5].name,
- category: PRODUCTS[5].category,
- imageIndex: 5,
- amount: 110,
- status: 'completed',
- date: '2025-01-12',
- },
- {
- id: 'ORD-1007',
- customer: 'David Kim',
- email: '[email protected]',
- product: PRODUCTS[0].name,
- category: PRODUCTS[0].category,
- imageIndex: 0,
- amount: 130,
- status: 'completed',
- date: '2025-01-12',
- },
- {
- id: 'ORD-1008',
- customer: 'Fatima Al-Rashid',
- email: '[email protected]',
- product: PRODUCTS[1].name,
- category: PRODUCTS[1].category,
- imageIndex: 1,
- amount: 190,
- status: 'shipped',
- date: '2025-01-12',
- },
- {
- id: 'ORD-1009',
- customer: 'Lucas Andersson',
- email: '[email protected]',
- product: PRODUCTS[2].name,
- category: PRODUCTS[2].category,
- imageIndex: 2,
- amount: 70,
- status: 'completed',
- date: '2025-01-12',
- },
- {
- id: 'ORD-1010',
- customer: 'Priya Sharma',
- email: '[email protected]',
- product: PRODUCTS[3].name,
- category: PRODUCTS[3].category,
- imageIndex: 3,
- amount: 180,
- status: 'completed',
- date: '2025-01-12',
- },
- {
- id: 'ORD-1011',
- customer: 'Noah Williams',
- email: '[email protected]',
- product: PRODUCTS[4].name,
- category: PRODUCTS[4].category,
- imageIndex: 4,
- amount: 140,
- status: 'completed',
- date: '2025-01-12',
- },
- {
- id: 'ORD-1012',
- customer: 'Sofia Garcia',
- email: '[email protected]',
- product: PRODUCTS[5].name,
- category: PRODUCTS[5].category,
- imageIndex: 5,
- amount: 110,
- status: 'completed',
- date: '2025-01-12',
- },
- {
- id: 'ORD-1013',
- customer: 'Oliver Brown',
- email: '[email protected]',
- product: PRODUCTS[0].name,
- category: PRODUCTS[0].category,
- imageIndex: 0,
- amount: 130,
- status: 'shipped',
- date: '2025-01-12',
- },
- {
- id: 'ORD-1014',
- customer: 'Mei Lin',
- email: '[email protected]',
- product: PRODUCTS[1].name,
- category: PRODUCTS[1].category,
- imageIndex: 1,
- amount: 190,
- status: 'completed',
- date: '2025-01-12',
- },
- // Mon (1) — light-medium, midday into afternoon
- {
- id: 'ORD-1015',
- customer: 'Hassan Ahmed',
- email: '[email protected]',
- product: PRODUCTS[2].name,
- category: PRODUCTS[2].category,
- imageIndex: 2,
- amount: 70,
- status: 'refunded',
- date: '2025-01-13',
- },
- {
- id: 'ORD-1016',
- customer: 'Isabella Rossi',
- email: '[email protected]',
- product: PRODUCTS[3].name,
- category: PRODUCTS[3].category,
- imageIndex: 3,
- amount: 180,
- status: 'completed',
- date: '2025-01-13',
- },
- {
- id: 'ORD-1058',
- customer: 'Thiago Lima',
- email: '[email protected]',
- product: PRODUCTS[4].name,
- category: PRODUCTS[4].category,
- imageIndex: 4,
- amount: 140,
- status: 'completed',
- date: '2025-01-13',
- },
- {
- id: 'ORD-1059',
- customer: 'Nadia Popov',
- email: '[email protected]',
- product: PRODUCTS[5].name,
- category: PRODUCTS[5].category,
- imageIndex: 5,
- amount: 110,
- status: 'shipped',
- date: '2025-01-13',
- },
- // Tue (2) — afternoon concentrated: 2pm–5pm hot
- {
- id: 'ORD-1017',
- customer: 'Liam Murphy',
- email: '[email protected]',
- product: PRODUCTS[4].name,
- category: PRODUCTS[4].category,
- imageIndex: 4,
- amount: 140,
- status: 'processing',
- date: '2025-01-14',
- },
- {
- id: 'ORD-1018',
- customer: 'Chloe Dubois',
- email: '[email protected]',
- product: PRODUCTS[5].name,
- category: PRODUCTS[5].category,
- imageIndex: 5,
- amount: 110,
- status: 'completed',
- date: '2025-01-14',
- },
- {
- id: 'ORD-1019',
- customer: 'Andre Santos',
- email: '[email protected]',
- product: PRODUCTS[0].name,
- category: PRODUCTS[0].category,
- imageIndex: 0,
- amount: 130,
- status: 'shipped',
- date: '2025-01-14',
- },
- {
- id: 'ORD-1020',
- customer: 'Nina Johansson',
- email: '[email protected]',
- product: PRODUCTS[1].name,
- category: PRODUCTS[1].category,
- imageIndex: 1,
- amount: 190,
- status: 'completed',
- date: '2025-01-14',
- },
- {
- id: 'ORD-1021',
- customer: 'Raj Kapoor',
- email: '[email protected]',
- product: PRODUCTS[2].name,
- category: PRODUCTS[2].category,
- imageIndex: 2,
- amount: 70,
- status: 'completed',
- date: '2025-01-14',
- },
- {
- id: 'ORD-1022',
- customer: 'Emma Thompson',
- email: '[email protected]',
- product: PRODUCTS[3].name,
- category: PRODUCTS[3].category,
- imageIndex: 3,
- amount: 180,
- status: 'completed',
- date: '2025-01-14',
- },
- {
- id: 'ORD-1023',
- customer: 'Carlos Mendez',
- email: '[email protected]',
- product: PRODUCTS[4].name,
- category: PRODUCTS[4].category,
- imageIndex: 4,
- amount: 140,
- status: 'shipped',
- date: '2025-01-14',
- },
- {
- id: 'ORD-1024',
- customer: 'Zoe Mitchell',
- email: '[email protected]',
- product: PRODUCTS[5].name,
- category: PRODUCTS[5].category,
- imageIndex: 5,
- amount: 110,
- status: 'processing',
- date: '2025-01-14',
- },
- {
- id: 'ORD-1025',
- customer: 'Henrik Larsson',
- email: '[email protected]',
- product: PRODUCTS[0].name,
- category: PRODUCTS[0].category,
- imageIndex: 0,
- amount: 130,
- status: 'completed',
- date: '2025-01-14',
- },
- // Wed (3) — light-medium, midday into afternoon
- {
- id: 'ORD-1026',
- customer: 'Amara Okafor',
- email: '[email protected]',
- product: PRODUCTS[1].name,
- category: PRODUCTS[1].category,
- imageIndex: 1,
- amount: 190,
- status: 'completed',
- date: '2025-01-15',
- },
- {
- id: 'ORD-1027',
- customer: 'Leo Fischer',
- email: '[email protected]',
- product: PRODUCTS[2].name,
- category: PRODUCTS[2].category,
- imageIndex: 2,
- amount: 70,
- status: 'completed',
- date: '2025-01-15',
- },
- {
- id: 'ORD-1028',
- customer: 'Maya Petrov',
- email: '[email protected]',
- product: PRODUCTS[3].name,
- category: PRODUCTS[3].category,
- imageIndex: 3,
- amount: 180,
- status: 'shipped',
- date: '2025-01-15',
- },
- {
- id: 'ORD-1060',
- customer: 'Kai Nakamura',
- email: '[email protected]',
- product: PRODUCTS[0].name,
- category: PRODUCTS[0].category,
- imageIndex: 0,
- amount: 130,
- status: 'completed',
- date: '2025-01-15',
- },
- {
- id: 'ORD-1061',
- customer: 'Elisa Moretti',
- email: '[email protected]',
- product: PRODUCTS[4].name,
- category: PRODUCTS[4].category,
- imageIndex: 4,
- amount: 140,
- status: 'completed',
- date: '2025-01-15',
- },
- // Thu (4) — afternoon concentrated: 1pm–5pm hot
- {
- id: 'ORD-1029',
- customer: 'Tomás Herrera',
- email: '[email protected]',
- product: PRODUCTS[4].name,
- category: PRODUCTS[4].category,
- imageIndex: 4,
- amount: 140,
- status: 'completed',
- date: '2025-01-09',
- },
- {
- id: 'ORD-1030',
- customer: 'Grace Nakamura',
- email: '[email protected]',
- product: PRODUCTS[5].name,
- category: PRODUCTS[5].category,
- imageIndex: 5,
- amount: 110,
- status: 'completed',
- date: '2025-01-09',
- },
- {
- id: 'ORD-1031',
- customer: 'Kenji Watanabe',
- email: '[email protected]',
- product: PRODUCTS[0].name,
- category: PRODUCTS[0].category,
- imageIndex: 0,
- amount: 130,
- status: 'completed',
- date: '2025-01-09',
- },
- {
- id: 'ORD-1032',
- customer: 'Lucia Fernandez',
- email: '[email protected]',
- product: PRODUCTS[1].name,
- category: PRODUCTS[1].category,
- imageIndex: 1,
- amount: 190,
- status: 'completed',
- date: '2025-01-09',
- },
- {
- id: 'ORD-1033',
- customer: 'Oscar Nilsson',
- email: '[email protected]',
- product: PRODUCTS[2].name,
- category: PRODUCTS[2].category,
- imageIndex: 2,
- amount: 70,
- status: 'shipped',
- date: '2025-01-09',
- },
- {
- id: 'ORD-1034',
- customer: 'Dani Alves',
- email: '[email protected]',
- product: PRODUCTS[3].name,
- category: PRODUCTS[3].category,
- imageIndex: 3,
- amount: 180,
- status: 'completed',
- date: '2025-01-09',
- },
- {
- id: 'ORD-1035',
- customer: 'Rina Sato',
- email: '[email protected]',
- product: PRODUCTS[4].name,
- category: PRODUCTS[4].category,
- imageIndex: 4,
- amount: 140,
- status: 'completed',
- date: '2025-01-09',
- },
- {
- id: 'ORD-1036',
- customer: 'Ivan Petrov',
- email: '[email protected]',
- product: PRODUCTS[5].name,
- category: PRODUCTS[5].category,
- imageIndex: 5,
- amount: 110,
- status: 'processing',
- date: '2025-01-09',
- },
- {
- id: 'ORD-1037',
- customer: 'Aiko Mori',
- email: '[email protected]',
- product: PRODUCTS[0].name,
- category: PRODUCTS[0].category,
- imageIndex: 0,
- amount: 130,
- status: 'completed',
- date: '2025-01-09',
- },
- // Fri (5) — medium, early afternoon
- {
- id: 'ORD-1038',
- customer: 'Felix Braun',
- email: '[email protected]',
- product: PRODUCTS[1].name,
- category: PRODUCTS[1].category,
- imageIndex: 1,
- amount: 190,
- status: 'completed',
- date: '2025-01-10',
- },
- {
- id: 'ORD-1039',
- customer: 'Rosa Delgado',
- email: '[email protected]',
- product: PRODUCTS[2].name,
- category: PRODUCTS[2].category,
- imageIndex: 2,
- amount: 70,
- status: 'completed',
- date: '2025-01-10',
- },
- {
- id: 'ORD-1040',
- customer: 'Nils Eriksson',
- email: '[email protected]',
- product: PRODUCTS[3].name,
- category: PRODUCTS[3].category,
- imageIndex: 3,
- amount: 180,
- status: 'shipped',
- date: '2025-01-10',
- },
- {
- id: 'ORD-1041',
- customer: 'Suki Park',
- email: '[email protected]',
- product: PRODUCTS[4].name,
- category: PRODUCTS[4].category,
- imageIndex: 4,
- amount: 140,
- status: 'completed',
- date: '2025-01-10',
- },
- // Sat (6) — spread across 9am–6pm, very hot
- {
- id: 'ORD-1042',
- customer: 'Omar Haddad',
- email: '[email protected]',
- product: PRODUCTS[5].name,
- category: PRODUCTS[5].category,
- imageIndex: 5,
- amount: 110,
- status: 'completed',
- date: '2025-01-11',
- },
- {
- id: 'ORD-1043',
- customer: 'Freya Jensen',
- email: '[email protected]',
- product: PRODUCTS[0].name,
- category: PRODUCTS[0].category,
- imageIndex: 0,
- amount: 130,
- status: 'shipped',
- date: '2025-01-11',
- },
- {
- id: 'ORD-1044',
- customer: 'Marco Bianchi',
- email: '[email protected]',
- product: PRODUCTS[1].name,
- category: PRODUCTS[1].category,
- imageIndex: 1,
- amount: 190,
- status: 'completed',
- date: '2025-01-11',
- },
- {
- id: 'ORD-1045',
- customer: 'Aya Tanaka',
- email: '[email protected]',
- product: PRODUCTS[2].name,
- category: PRODUCTS[2].category,
- imageIndex: 2,
- amount: 70,
- status: 'completed',
- date: '2025-01-11',
- },
- {
- id: 'ORD-1046',
- customer: 'Lars Müller',
- email: '[email protected]',
- product: PRODUCTS[3].name,
- category: PRODUCTS[3].category,
- imageIndex: 3,
- amount: 180,
- status: 'completed',
- date: '2025-01-11',
- },
- {
- id: 'ORD-1047',
- customer: 'Mia Chang',
- email: '[email protected]',
- product: PRODUCTS[4].name,
- category: PRODUCTS[4].category,
- imageIndex: 4,
- amount: 140,
- status: 'processing',
- date: '2025-01-11',
- },
- {
- id: 'ORD-1048',
- customer: 'Petra Novak',
- email: '[email protected]',
- product: PRODUCTS[5].name,
- category: PRODUCTS[5].category,
- imageIndex: 5,
- amount: 110,
- status: 'completed',
- date: '2025-01-11',
- },
- {
- id: 'ORD-1049',
- customer: 'Tariq Osman',
- email: '[email protected]',
- product: PRODUCTS[0].name,
- category: PRODUCTS[0].category,
- imageIndex: 0,
- amount: 130,
- status: 'completed',
- date: '2025-01-11',
- },
- {
- id: 'ORD-1050',
- customer: 'Lena Holm',
- email: '[email protected]',
- product: PRODUCTS[1].name,
- category: PRODUCTS[1].category,
- imageIndex: 1,
- amount: 190,
- status: 'completed',
- date: '2025-01-11',
- },
- {
- id: 'ORD-1051',
- customer: 'Vera Costa',
- email: '[email protected]',
- product: PRODUCTS[2].name,
- category: PRODUCTS[2].category,
- imageIndex: 2,
- amount: 70,
- status: 'shipped',
- date: '2025-01-11',
- },
- {
- id: 'ORD-1052',
- customer: 'Hugo Blanc',
- email: '[email protected]',
- product: PRODUCTS[3].name,
- category: PRODUCTS[3].category,
- imageIndex: 3,
- amount: 180,
- status: 'completed',
- date: '2025-01-11',
- },
- {
- id: 'ORD-1053',
- customer: 'Ingrid Berg',
- email: '[email protected]',
- product: PRODUCTS[4].name,
- category: PRODUCTS[4].category,
- imageIndex: 4,
- amount: 140,
- status: 'completed',
- date: '2025-01-11',
- },
- {
- id: 'ORD-1054',
- customer: 'Hana Kim',
- email: '[email protected]',
- product: PRODUCTS[5].name,
- category: PRODUCTS[5].category,
- imageIndex: 5,
- amount: 110,
- status: 'completed',
- date: '2025-01-11',
- },
- {
- id: 'ORD-1055',
- customer: 'Axel Lindgren',
- email: '[email protected]',
- product: PRODUCTS[0].name,
- category: PRODUCTS[0].category,
- imageIndex: 0,
- amount: 130,
- status: 'shipped',
- date: '2025-01-11',
- },
- {
- id: 'ORD-1056',
- customer: 'Yara Mansour',
- email: '[email protected]',
- product: PRODUCTS[1].name,
- category: PRODUCTS[1].category,
- imageIndex: 1,
- amount: 190,
- status: 'completed',
- date: '2025-01-11',
- },
- {
- id: 'ORD-1057',
- customer: 'Dmitri Volkov',
- email: '[email protected]',
- product: PRODUCTS[2].name,
- category: PRODUCTS[2].category,
- imageIndex: 2,
- amount: 70,
- status: 'completed',
- date: '2025-01-11',
- },
-];
-
-const revenueData = [
- {date: 'Jan 1', revenue: 5200},
- {date: 'Jan 2', revenue: 4800},
- {date: 'Jan 3', revenue: 6100},
- {date: 'Jan 4', revenue: 7400},
- {date: 'Jan 5', revenue: 5900},
- {date: 'Jan 6', revenue: 6800},
- {date: 'Jan 7', revenue: 7200},
- {date: 'Jan 8', revenue: 8300},
- {date: 'Jan 9', revenue: 6500},
- {date: 'Jan 10', revenue: 5400},
- {date: 'Jan 11', revenue: 7800},
- {date: 'Jan 12', revenue: 9200},
- {date: 'Jan 13', revenue: 6900},
- {date: 'Jan 14', revenue: 8600},
- {date: 'Jan 15', revenue: 7100},
-];
-
-const statusColor: Record<string, 'green' | 'blue' | 'orange' | 'red'> = {
- completed: 'green',
- shipped: 'blue',
- processing: 'orange',
- refunded: 'red',
-};
-
-const columns: TableColumn<OrderRow>[] = [
- {
- key: 'id',
- header: 'Order',
- width: pixel(110),
- renderCell: (item: OrderRow) => (
- <Link href="#" isStandalone>
- {item.id}
- </Link>
- ),
- },
- {
- key: 'product',
- header: 'Product',
- width: proportional(3),
- renderCell: (item: OrderRow) => (
- <HStack gap={3} vAlign="center">
- <Thumbnail
- src={PRODUCTS[item.imageIndex].image}
- alt={item.product}
- label={item.product}
- style={{width: 36, height: 36, flexShrink: 0}}
- />
- <VStack gap={0}>
- <Text type="body">{item.product}</Text>
- <Text type="supporting" color="secondary">
- {item.category}
- </Text>
- </VStack>
- </HStack>
- ),
- },
- {
- key: 'amount',
- header: 'Amount',
- width: pixel(90),
- renderCell: (item: OrderRow) => <Text type="body">${item.amount}</Text>,
- },
- {
- key: 'customer',
- header: 'Customer',
- width: proportional(2),
- renderCell: (item: OrderRow) => <Text type="body">{item.customer}</Text>,
- },
- {
- key: 'email',
- header: 'Email',
- width: proportional(2),
- renderCell: (item: OrderRow) => <Text type="body">{item.email}</Text>,
- },
- {
- key: 'status',
- header: 'Status',
- width: pixel(120),
- renderCell: (item: OrderRow) => (
- <Badge
- label={item.status.charAt(0).toUpperCase() + item.status.slice(1)}
- variant={statusColor[item.status]}
- />
- ),
- },
- {
- key: 'date',
- header: 'Date',
- width: pixel(110),
- renderCell: (item: OrderRow) => <Text type="body">{item.date}</Text>,
- },
-];
-
-// ============= PAGE =============
-
-export default function TablePageShoeStoreHeatmapTemplate() {
- return (
- <Layout
- height="fill"
- header={
- <LayoutHeader hasDivider>
- <HStack gap={2} vAlign="center">
- <StackItem size="fill">
- <Heading level={1}>Sales</Heading>
- </StackItem>
- <IconButton
- label="Filter"
- icon={<Icon icon={FunnelIcon} size="sm" />}
- variant="ghost"
- />
- <IconButton
- label="Export"
- icon={<Icon icon={ArrowDownTrayIcon} size="sm" />}
- variant="ghost"
- />
- <Button
- label="New order"
- icon={<Icon icon={PlusIcon} size="sm" />}
- />
- </HStack>
- </LayoutHeader>
- }
- content={
- <LayoutContent padding={3}>
- <VStack gap={4}>
- <Chart
- data={revenueData}
- xKey="date"
- series={[
- area('revenue', {color: '#3b82f6', gradient: true}),
- line('revenue', {color: '#3b82f6'}),
- ]}
- grid={<ChartGrid horizontal />}
- axes={
- <>
- <ChartAxis position="bottom" />
- <ChartAxis
- position="left"
- tickFormat={(v: unknown) => `$${Number(v) / 1000}k`}
- />
- </>
- }
- height={280}
- margin={{left: 40, right: 10, top: 10, bottom: 30}}
- />
-
- <Table<OrderRow>
- data={orders}
- columns={columns}
- idKey="id"
- density="balanced"
- dividers="rows"
- hasHover
- />
- </VStack>
- </LayoutContent>
- }
- />
- );
-}
diff --git a/packages/cli/assets/templates/pages/table-page-shoe-store-heatmap/template.doc.mjs b/packages/cli/assets/templates/pages/table-page-shoe-store-heatmap/template.doc.mjs
deleted file mode 100644
index 1901f57eca..0000000000
--- a/packages/cli/assets/templates/pages/table-page-shoe-store-heatmap/template.doc.mjs
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright (c) Meta Platforms, Inc. and affiliates.
-
-/** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */
-export const doc = {
- type: 'page',
- name: 'Shoe Sales Table',
- displayName: 'Shoe Sales Table',
- description:
- 'Shoe store sales data table with a revenue area chart and product thumbnails.',
- isReady: true,
- category: 'Table - Chart',
- isHiddenFromOverview: true,
-};