From 5bce61b969af5eeada20838140e0d0e4ecc7a549 Mon Sep 17 00:00:00 2001 From: Shavin Chandrawansha Date: Wed, 19 Aug 2026 13:57:31 +0530 Subject: [PATCH 01/12] feat(apicp): enhance theme management and add claude skills --- .../.claude/oxygen-ui/components.md | 1431 +++++++++++++++++ .../.claude/oxygen-ui/migration.md | 281 ++++ .../.claude/oxygen-ui/patterns.md | 1197 ++++++++++++++ .../.claude/oxygen-ui/theming.md | 334 ++++ .../.claude/skills/oxygen-component/SKILL.md | 147 ++ .../.claude/skills/oxygen-form/SKILL.md | 410 +++++ .../.claude/skills/oxygen-layout/SKILL.md | 233 +++ .../.claude/skills/oxygen-migrate/SKILL.md | 280 ++++ portals/api-control-plane/CLAUDE.md | 5 + portals/api-control-plane/package-lock.json | 1188 +++++++++++--- portals/api-control-plane/package.json | 9 +- .../src/theme/AppThemeProvider.tsx | 37 + .../src/theme/emotionCache.ts | 33 + portals/api-control-plane/src/theme/index.ts | 31 + .../api-control-plane/src/theme/receipes.ts | 147 ++ portals/api-control-plane/src/theme/themes.ts | 28 + 16 files changed, 5526 insertions(+), 265 deletions(-) create mode 100644 portals/api-control-plane/.claude/oxygen-ui/components.md create mode 100644 portals/api-control-plane/.claude/oxygen-ui/migration.md create mode 100644 portals/api-control-plane/.claude/oxygen-ui/patterns.md create mode 100644 portals/api-control-plane/.claude/oxygen-ui/theming.md create mode 100644 portals/api-control-plane/.claude/skills/oxygen-component/SKILL.md create mode 100644 portals/api-control-plane/.claude/skills/oxygen-form/SKILL.md create mode 100644 portals/api-control-plane/.claude/skills/oxygen-layout/SKILL.md create mode 100644 portals/api-control-plane/.claude/skills/oxygen-migrate/SKILL.md create mode 100644 portals/api-control-plane/CLAUDE.md create mode 100644 portals/api-control-plane/src/theme/AppThemeProvider.tsx create mode 100644 portals/api-control-plane/src/theme/emotionCache.ts create mode 100644 portals/api-control-plane/src/theme/index.ts create mode 100644 portals/api-control-plane/src/theme/receipes.ts create mode 100644 portals/api-control-plane/src/theme/themes.ts diff --git a/portals/api-control-plane/.claude/oxygen-ui/components.md b/portals/api-control-plane/.claude/oxygen-ui/components.md new file mode 100644 index 0000000000..fe912c6f81 --- /dev/null +++ b/portals/api-control-plane/.claude/oxygen-ui/components.md @@ -0,0 +1,1431 @@ +# Oxygen UI Component Reference + +Complete API reference for custom Oxygen UI components. For MUI components, refer to [Material-UI documentation](https://mui.com/material-ui/). + +## Table of Contents + +- [OxygenUIThemeProvider](#oxygenuitthemeprovider) +- [ListingTable](#listingtable) +- [AppShell](#appshell) +- [Layout](#layout) +- [Header](#header) +- [Sidebar](#sidebar) +- [Footer](#footer) +- [UserMenu](#usermenu) +- [Form](#form) +- [NotificationPanel](#notificationpanel) +- [NotificationBanner](#notificationbanner) +- [ParticleBackground](#particlebackground) +- [Other Components](#other-components) +- [MUI X Namespaces](#mui-x-namespaces) +- [Hooks](#hooks) +- [Utilities](#utilities) + +--- + +## OxygenUIThemeProvider + +Theme provider that wraps your application. Required at the root level. + +```tsx +import { OxygenUIThemeProvider, OxygenTheme } from '@wso2/oxygen-ui'; +``` + +### Props + +| Prop | Type | Default | Description | +|------|------|---------|-------------| +| `children` | `ReactNode` | required | App content | +| `theme` | `Theme` | `OxygenTheme` | Single theme (disables switching) | +| `themes` | `ThemeOption[]` | - | Array of themes (enables switching) | +| `initialTheme` | `string` | First theme key | Initial theme key | + +### ThemeOption Type + +```tsx +interface ThemeOption { + key: string; // Unique identifier + label: string; // Display name + theme: Theme; // MUI Theme object +} +``` + +### Basic Usage + +```tsx +// Single theme (no switching) + + + +``` + +### Theme Switching + +```tsx +import { + OxygenUIThemeProvider, + OxygenTheme, + AcrylicOrangeTheme, + AcrylicPurpleTheme, +} from '@wso2/oxygen-ui'; + +const themes = [ + { key: 'default', label: 'Default', theme: OxygenTheme }, + { key: 'orange', label: 'Orange', theme: AcrylicOrangeTheme }, + { key: 'purple', label: 'Purple', theme: AcrylicPurpleTheme }, +]; + + + + +``` + +--- + +## ListingTable + +Advanced data table with compound component pattern. Supports search, sort, pagination, selection, and bulk actions. + +```tsx +import { ListingTable } from '@wso2/oxygen-ui'; +``` + +### Sub-components + +| Component | Description | +|-----------|-------------| +| `ListingTable.Provider` | Context provider for state management | +| `ListingTable.Container` | Paper wrapper with styling | +| `ListingTable.Toolbar` | Search, filters, and actions bar | +| `ListingTable.Head` | Table header wrapper | +| `ListingTable.Body` | Table body wrapper | +| `ListingTable.Footer` | Table footer (pagination) | +| `ListingTable.Row` | Table row | +| `ListingTable.Cell` | Table cell | +| `ListingTable.SortLabel` | Sortable column header | +| `ListingTable.DensityControl` | Density toggle button | +| `ListingTable.EmptyState` | Empty state display | +| `ListingTable.RowActions` | Row action buttons | +| `ListingTable.CellIcon` | Icon in cell | + +### ListingTable Props + +| Prop | Type | Default | Description | +|------|------|---------|-------------| +| `variant` | `'table' \| 'card'` | `'table'` | Display style | +| `density` | `'compact' \| 'standard' \| 'comfortable'` | `'standard'` | Row padding | +| `striped` | `boolean` | `false` | Alternating row colors | +| `bordered` | `boolean` | `false` | Cell borders | + +### Provider Props (Context State) + +```tsx +interface ListingTableProviderProps { + // Search + searchValue?: string; + onSearchChange?: (value: string) => void; + + // Sort + sortField?: string; + sortDirection?: 'asc' | 'desc'; + onSortChange?: (field: string, direction: 'asc' | 'desc') => void; + + // Pagination + page?: number; // 0-indexed + rowsPerPage?: number; + totalCount?: number; + onPageChange?: (page: number) => void; + onRowsPerPageChange?: (rowsPerPage: number) => void; + + // Selection + selected?: readonly string[]; + onSelectionChange?: (selected: readonly string[]) => void; + onSelectAll?: () => void; + onClearSelection?: () => void; + isSelected?: (id: string) => boolean; + + // Filters + filters?: Record; + onFilterChange?: (key: string, value: unknown) => void; + onClearFilters?: () => void; + + // Bulk Actions + onBulkDelete?: (ids: readonly string[]) => void; + onBulkAction?: (actionId: string, ids: readonly string[]) => void; + + // UI State + density?: 'compact' | 'standard' | 'comfortable'; + onDensityChange?: (density: ListingTableDensity) => void; + loading?: boolean; +} +``` + +### Toolbar Props + +| Prop | Type | Default | Description | +|------|------|---------|-------------| +| `showSearch` | `boolean` | `false` | Show built-in search | +| `searchSlot` | `ReactNode` | - | Custom search component | +| `searchPlaceholder` | `string` | `'Search...'` | Search placeholder | +| `actions` | `ReactNode` | - | Right-side actions | +| `children` | `ReactNode` | - | Center content | + +### Basic Table + +```tsx + + + + + Name + Status + Actions + + + + {data.map((row) => ( + + {row.name} + {row.status} + + edit(row.id) }, + { id: 'delete', label: 'Delete', onClick: () => delete(row.id) }, + ]} + /> + + + ))} + + + +``` + +### Full-Featured Table with Context + +```tsx +const [search, setSearch] = useState(''); +const [sortField, setSortField] = useState('name'); +const [sortDirection, setSortDirection] = useState<'asc' | 'desc'>('asc'); +const [page, setPage] = useState(0); +const [rowsPerPage, setRowsPerPage] = useState(10); + + { + setSortField(field); + setSortDirection(dir); + }} + page={page} + rowsPerPage={rowsPerPage} + totalCount={data.length} + onPageChange={setPage} + onRowsPerPageChange={setRowsPerPage} +> + + } + /> + + + + + Name + + + Status + + + + + {paginatedData.map((row) => ( + + {row.name} + {row.status} + + ))} + + + + + +``` + +--- + +## AppShell + +Application layout wrapper using compound component pattern. + +```tsx +import { AppShell } from '@wso2/oxygen-ui'; +``` + +### Sub-components + +| Component | Description | +|-----------|-------------| +| `AppShell.Navbar` | Top navigation area (header) | +| `AppShell.Sidebar` | Left sidebar area | +| `AppShell.Main` | Main content area | +| `AppShell.Footer` | Bottom footer area | +| `AppShell.NotificationPanel` | Overlay notification panel | + +### Usage + +```tsx + + +
...
+
+ + + ... + + + + {/* React Router outlet */} + + + +