@wso2/oxygen-ui 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.ai/AGENTS.md +17 -15
- package/.ai/components.md +706 -73
- package/.ai/migration.md +4 -2
- package/.ai/patterns.md +20 -8
- package/.ai/theming.md +15 -2
- package/.claude/components.md +706 -73
- package/.claude/migration.md +4 -2
- package/.claude/patterns.md +20 -8
- package/.claude/skills/oxygen-component/SKILL.md +12 -6
- package/.claude/skills/oxygen-migrate/SKILL.md +5 -2
- package/.claude/skills/oxygen-sync/SKILL.md +157 -0
- package/.claude/theming.md +15 -2
- package/bin/cli.js +32 -19
- package/dist/components/AppShell/AppShell.d.ts +8 -6
- package/dist/components/AppShell/context.d.ts +64 -0
- package/dist/components/AppShell/index.d.ts +1 -0
- package/dist/components/Header/HeaderToggle.d.ts +4 -4
- package/dist/components/NotificationPanel/NotificationPanel.d.ts +4 -4
- package/dist/components/Sidebar/SidebarItem.d.ts +10 -0
- package/dist/hooks/useAppShell/useAppShell.d.ts +43 -8
- package/dist/index.js +544 -409
- package/dist/index.js.map +4 -4
- package/dist/utils/pxToRem.d.ts +1 -1
- package/package.json +2 -2
package/.claude/migration.md
CHANGED
|
@@ -61,11 +61,13 @@ import { BarChart } from '@mui/x-charts';
|
|
|
61
61
|
|
|
62
62
|
**After:**
|
|
63
63
|
```tsx
|
|
64
|
-
import { DataGrid, DatePickers
|
|
64
|
+
import { DataGrid, DatePickers } from '@wso2/oxygen-ui';
|
|
65
65
|
|
|
66
66
|
const { DataGrid: DataGridComponent } = DataGrid;
|
|
67
67
|
const { DatePicker } = DatePickers;
|
|
68
|
-
|
|
68
|
+
|
|
69
|
+
// For Charts, use the separate package
|
|
70
|
+
import { BarChart } from '@wso2/oxygen-ui-charts-react';
|
|
69
71
|
```
|
|
70
72
|
|
|
71
73
|
### Icons
|
package/.claude/patterns.md
CHANGED
|
@@ -56,10 +56,9 @@ function App() {
|
|
|
56
56
|
<Header.Spacer />
|
|
57
57
|
<Header.Actions>
|
|
58
58
|
<ColorSchemeToggle />
|
|
59
|
-
<UserMenu
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
/>
|
|
59
|
+
<UserMenu>
|
|
60
|
+
<UserMenu.Trigger name="John Doe" />
|
|
61
|
+
</UserMenu>
|
|
63
62
|
</Header.Actions>
|
|
64
63
|
</Header>
|
|
65
64
|
</AppShell.Navbar>
|
|
@@ -99,7 +98,9 @@ function App() {
|
|
|
99
98
|
</AppShell.Main>
|
|
100
99
|
|
|
101
100
|
<AppShell.Footer>
|
|
102
|
-
<Footer
|
|
101
|
+
<Footer>
|
|
102
|
+
<Footer.Copyright>© 2025 WSO2 LLC. All rights reserved.</Footer.Copyright>
|
|
103
|
+
</Footer>
|
|
103
104
|
</AppShell.Footer>
|
|
104
105
|
</AppShell>
|
|
105
106
|
</OxygenUIThemeProvider>
|
|
@@ -361,8 +362,11 @@ function Dashboard() {
|
|
|
361
362
|
|
|
362
363
|
### Dashboard with Charts
|
|
363
364
|
|
|
365
|
+
> **Note:** Charts are available in a separate package `@wso2/oxygen-ui-charts-react` built on Recharts.
|
|
366
|
+
|
|
364
367
|
```tsx
|
|
365
|
-
import { Grid, Paper, Typography, Box
|
|
368
|
+
import { Grid, Paper, Typography, Box } from '@wso2/oxygen-ui';
|
|
369
|
+
import { LineChart, PieChart } from '@wso2/oxygen-ui-charts-react';
|
|
366
370
|
|
|
367
371
|
function DashboardCharts() {
|
|
368
372
|
const salesData = [
|
|
@@ -381,7 +385,7 @@ function DashboardCharts() {
|
|
|
381
385
|
<Typography variant="h6" gutterBottom>
|
|
382
386
|
Sales Overview
|
|
383
387
|
</Typography>
|
|
384
|
-
<
|
|
388
|
+
<LineChart
|
|
385
389
|
height={300}
|
|
386
390
|
series={[
|
|
387
391
|
{ data: salesData.map((d) => d.sales), label: 'Sales' },
|
|
@@ -397,7 +401,7 @@ function DashboardCharts() {
|
|
|
397
401
|
<Typography variant="h6" gutterBottom>
|
|
398
402
|
Traffic Sources
|
|
399
403
|
</Typography>
|
|
400
|
-
<
|
|
404
|
+
<PieChart
|
|
401
405
|
height={300}
|
|
402
406
|
series={[
|
|
403
407
|
{
|
|
@@ -1136,8 +1140,12 @@ import {
|
|
|
1136
1140
|
OxygenTheme,
|
|
1137
1141
|
AcrylicOrangeTheme,
|
|
1138
1142
|
AcrylicPurpleTheme,
|
|
1143
|
+
ChoreoTheme,
|
|
1139
1144
|
ClassicTheme,
|
|
1140
1145
|
HighContrastTheme,
|
|
1146
|
+
PaleBaseTheme,
|
|
1147
|
+
PaleGrayTheme,
|
|
1148
|
+
PaleIndigoTheme,
|
|
1141
1149
|
useThemeSwitcher,
|
|
1142
1150
|
Select,
|
|
1143
1151
|
MenuItem,
|
|
@@ -1147,8 +1155,12 @@ const themes = [
|
|
|
1147
1155
|
{ key: 'default', label: 'Default', theme: OxygenTheme },
|
|
1148
1156
|
{ key: 'orange', label: 'Acrylic Orange', theme: AcrylicOrangeTheme },
|
|
1149
1157
|
{ key: 'purple', label: 'Acrylic Purple', theme: AcrylicPurpleTheme },
|
|
1158
|
+
{ key: 'choreo', label: 'Choreo', theme: ChoreoTheme },
|
|
1150
1159
|
{ key: 'classic', label: 'Classic', theme: ClassicTheme },
|
|
1151
1160
|
{ key: 'highContrast', label: 'High Contrast', theme: HighContrastTheme },
|
|
1161
|
+
{ key: 'paleBase', label: 'Pale Base', theme: PaleBaseTheme },
|
|
1162
|
+
{ key: 'paleGray', label: 'Pale Gray', theme: PaleGrayTheme },
|
|
1163
|
+
{ key: 'paleIndigo', label: 'Pale Indigo', theme: PaleIndigoTheme },
|
|
1152
1164
|
];
|
|
1153
1165
|
|
|
1154
1166
|
function ThemeSelector() {
|
|
@@ -121,16 +121,11 @@ import {
|
|
|
121
121
|
## MUI X Components (Use Namespaces)
|
|
122
122
|
|
|
123
123
|
```tsx
|
|
124
|
-
import { DataGrid,
|
|
124
|
+
import { DataGrid, DatePickers, TreeView } from '@wso2/oxygen-ui';
|
|
125
125
|
|
|
126
126
|
// DataGrid
|
|
127
127
|
<DataGrid.DataGrid rows={rows} columns={columns} />
|
|
128
128
|
|
|
129
|
-
// Charts
|
|
130
|
-
<Charts.LineChart series={series} />
|
|
131
|
-
<Charts.BarChart series={series} />
|
|
132
|
-
<Charts.PieChart series={series} />
|
|
133
|
-
|
|
134
129
|
// DatePickers
|
|
135
130
|
<DatePickers.DatePicker value={date} onChange={setDate} />
|
|
136
131
|
|
|
@@ -139,3 +134,14 @@ import { DataGrid, Charts, DatePickers, TreeView } from '@wso2/oxygen-ui';
|
|
|
139
134
|
<TreeView.TreeItem itemId="1" label="Item 1" />
|
|
140
135
|
</TreeView.SimpleTreeView>
|
|
141
136
|
```
|
|
137
|
+
|
|
138
|
+
## Charts (Separate Package)
|
|
139
|
+
|
|
140
|
+
```tsx
|
|
141
|
+
// Charts are in a separate package built on Recharts
|
|
142
|
+
import { LineChart, BarChart, PieChart } from '@wso2/oxygen-ui-charts-react';
|
|
143
|
+
|
|
144
|
+
<LineChart series={series} />
|
|
145
|
+
<BarChart series={series} />
|
|
146
|
+
<PieChart series={series} />
|
|
147
|
+
```
|
|
@@ -68,13 +68,16 @@ import { SimpleTreeView } from '@mui/x-tree-view';
|
|
|
68
68
|
|
|
69
69
|
**After:**
|
|
70
70
|
```tsx
|
|
71
|
-
import { DataGrid, DatePickers,
|
|
71
|
+
import { DataGrid, DatePickers, TreeView } from '@wso2/oxygen-ui';
|
|
72
72
|
|
|
73
73
|
// Use as namespaces
|
|
74
74
|
<DataGrid.DataGrid rows={rows} columns={columns} />
|
|
75
75
|
<DatePickers.DatePicker value={date} onChange={setDate} />
|
|
76
|
-
<Charts.BarChart series={series} />
|
|
77
76
|
<TreeView.SimpleTreeView items={items} />
|
|
77
|
+
|
|
78
|
+
// For Charts, use the separate package
|
|
79
|
+
import { BarChart } from '@wso2/oxygen-ui-charts-react';
|
|
80
|
+
<BarChart series={series} />
|
|
78
81
|
```
|
|
79
82
|
|
|
80
83
|
## Theme Provider Migration
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: oxygen-sync
|
|
3
|
+
description: Sync AI documentation with current source code. Use when components, themes, hooks, or exports have been added, modified, or removed in the Oxygen UI package.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Sync AI Documentation with Source Code
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Reads the Oxygen UI source code and regenerates all AI documentation files (`.claude/` and `.ai/`) to match the current codebase state. Intended for design system maintainers working inside the `oxygen-ui` repo.
|
|
11
|
+
|
|
12
|
+
## Rules
|
|
13
|
+
|
|
14
|
+
- **NEVER** modify the root `CLAUDE.md` at the repository root
|
|
15
|
+
- **NEVER** modify source code files (`src/`)
|
|
16
|
+
- **NEVER** modify other skill `SKILL.md` files
|
|
17
|
+
- Preserve existing doc structure, heading hierarchy, and formatting conventions
|
|
18
|
+
- Use `src/components/index.ts` export order as canonical component ordering
|
|
19
|
+
- Extract props from actual TypeScript interfaces — never guess or fabricate
|
|
20
|
+
- Report major additions/removals to the user before writing
|
|
21
|
+
- Mirror `.claude/` content to `.ai/` after every sync
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Phase 1 — Introspect Source Code
|
|
26
|
+
|
|
27
|
+
Read all of the following files to build a complete picture of the current public API:
|
|
28
|
+
|
|
29
|
+
### Barrel Exports
|
|
30
|
+
|
|
31
|
+
- `packages/oxygen-ui/src/index.ts`
|
|
32
|
+
- `packages/oxygen-ui/src/components/index.ts`
|
|
33
|
+
|
|
34
|
+
### Themes
|
|
35
|
+
|
|
36
|
+
- `packages/oxygen-ui/src/styles/Themes/index.ts`
|
|
37
|
+
- If theme names have changed, read the individual theme files referenced by the index
|
|
38
|
+
|
|
39
|
+
### Hooks
|
|
40
|
+
|
|
41
|
+
- `packages/oxygen-ui/src/hooks/index.ts`
|
|
42
|
+
|
|
43
|
+
### Contexts
|
|
44
|
+
|
|
45
|
+
- `packages/oxygen-ui/src/contexts/index.ts`
|
|
46
|
+
|
|
47
|
+
### Utils
|
|
48
|
+
|
|
49
|
+
- `packages/oxygen-ui/src/utils/index.ts`
|
|
50
|
+
|
|
51
|
+
### Animations
|
|
52
|
+
|
|
53
|
+
- `packages/oxygen-ui/src/animations/index.ts`
|
|
54
|
+
|
|
55
|
+
### Compound Components
|
|
56
|
+
|
|
57
|
+
Read the `index.ts` for each compound component directory:
|
|
58
|
+
|
|
59
|
+
- `packages/oxygen-ui/src/components/AppShell/index.ts`
|
|
60
|
+
- `packages/oxygen-ui/src/components/Header/index.ts`
|
|
61
|
+
- `packages/oxygen-ui/src/components/Sidebar/index.ts`
|
|
62
|
+
- `packages/oxygen-ui/src/components/ListingTable/index.ts`
|
|
63
|
+
- `packages/oxygen-ui/src/components/NotificationPanel/index.ts`
|
|
64
|
+
- `packages/oxygen-ui/src/components/Form/index.ts`
|
|
65
|
+
- `packages/oxygen-ui/src/components/Footer/index.ts`
|
|
66
|
+
- `packages/oxygen-ui/src/components/UserMenu/index.ts`
|
|
67
|
+
|
|
68
|
+
Also check for any **new** component directories under `src/components/` that have their own `index.ts` (e.g., `CodeBlock`, `ColorSchemeImage`, `ColorSchemeToggle`, `ComplexSelect`, `ThemeSwitcher`, `NotificationBanner`, `PageContent`, `StatCard`, `PageTitle`, `SearchBar`, or others).
|
|
69
|
+
|
|
70
|
+
### Props (as needed)
|
|
71
|
+
|
|
72
|
+
For any component that appears new or changed, read the main `.tsx` file to extract prop interfaces.
|
|
73
|
+
|
|
74
|
+
### Skills
|
|
75
|
+
|
|
76
|
+
List the directories under `packages/oxygen-ui/.claude/skills/` to capture the current set of available skills.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Phase 2 — Read Current Docs
|
|
81
|
+
|
|
82
|
+
Read all existing documentation files to understand current state and format:
|
|
83
|
+
|
|
84
|
+
- `packages/oxygen-ui/.claude/CLAUDE.md`
|
|
85
|
+
- `packages/oxygen-ui/.claude/components.md`
|
|
86
|
+
- `packages/oxygen-ui/.claude/patterns.md`
|
|
87
|
+
- `packages/oxygen-ui/.claude/theming.md`
|
|
88
|
+
- `packages/oxygen-ui/.claude/migration.md`
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Phase 3 — Report Discrepancies
|
|
93
|
+
|
|
94
|
+
Before writing any files, compile a report of what changed:
|
|
95
|
+
|
|
96
|
+
- **New in source, missing from docs**: Components, hooks, themes, contexts, utils, animations, or type exports found in source but not documented
|
|
97
|
+
- **In docs, removed from source**: Items documented but no longer exported
|
|
98
|
+
- **Changed**: Props, sub-components, or type exports that have been modified
|
|
99
|
+
|
|
100
|
+
Present this report to the user and **ask for confirmation** before proceeding with writes.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Phase 4 — Regenerate Documentation
|
|
105
|
+
|
|
106
|
+
After the user confirms, update each file while preserving existing format conventions:
|
|
107
|
+
|
|
108
|
+
### `.claude/CLAUDE.md`
|
|
109
|
+
|
|
110
|
+
- Update the **Available Themes** list to match `src/styles/Themes/index.ts`
|
|
111
|
+
- Update the **Custom Oxygen Components** list to match `src/components/index.ts`
|
|
112
|
+
- Update the **Available Skills** list to match the directories in `.claude/skills/`
|
|
113
|
+
- Do NOT include `/oxygen-sync` in the Available Skills list (it is internal-only and already listed separately)
|
|
114
|
+
|
|
115
|
+
### `.claude/components.md`
|
|
116
|
+
|
|
117
|
+
- Update component API tables, props, sub-components, hooks, and type exports
|
|
118
|
+
- Add entries for new components found in source
|
|
119
|
+
- Remove entries for components no longer in source
|
|
120
|
+
- Use `src/components/index.ts` export order for ordering
|
|
121
|
+
|
|
122
|
+
### `.claude/patterns.md`
|
|
123
|
+
|
|
124
|
+
- Verify all code examples use current APIs (correct component names, prop names, imports)
|
|
125
|
+
- Update any examples that reference renamed or removed components/props
|
|
126
|
+
|
|
127
|
+
### `.claude/theming.md`
|
|
128
|
+
|
|
129
|
+
- Update the available themes table
|
|
130
|
+
- Update theme properties and CSS variables if changed
|
|
131
|
+
|
|
132
|
+
### `.claude/migration.md`
|
|
133
|
+
|
|
134
|
+
- Verify import examples are accurate
|
|
135
|
+
- Update any migration guidance affected by API changes
|
|
136
|
+
|
|
137
|
+
### Mirror to `.ai/`
|
|
138
|
+
|
|
139
|
+
After updating all `.claude/` files, mirror the content to `.ai/`:
|
|
140
|
+
|
|
141
|
+
| Source | Target | Notes |
|
|
142
|
+
|--------|--------|-------|
|
|
143
|
+
| `.claude/CLAUDE.md` | `.ai/AGENTS.md` | Adjust paths (`.claude/` -> `.ai/`), remove the Available Skills section |
|
|
144
|
+
| `.claude/components.md` | `.ai/components.md` | Copy as-is |
|
|
145
|
+
| `.claude/patterns.md` | `.ai/patterns.md` | Copy as-is |
|
|
146
|
+
| `.claude/theming.md` | `.ai/theming.md` | Copy as-is |
|
|
147
|
+
| `.claude/migration.md` | `.ai/migration.md` | Copy as-is |
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Phase 5 — Post-Sync Report
|
|
152
|
+
|
|
153
|
+
Summarize what was done:
|
|
154
|
+
|
|
155
|
+
- Files that were **modified** and what changed in each
|
|
156
|
+
- Files that were **already up to date** (no changes needed)
|
|
157
|
+
- Any items that need manual attention (e.g., complex prop changes that need human review)
|
package/.claude/theming.md
CHANGED
|
@@ -20,6 +20,9 @@
|
|
|
20
20
|
| Choreo | `ChoreoTheme` | Choreo product theme (indigo-violet gradient) |
|
|
21
21
|
| Classic | `ClassicTheme` | Standard flat design |
|
|
22
22
|
| High Contrast | `HighContrastTheme` | Accessibility-focused with high contrast colors |
|
|
23
|
+
| Pale Base | `PaleBaseTheme` | Minimal color palette for subtle interfaces |
|
|
24
|
+
| Pale Gray | `PaleGrayTheme` | Soft gray tones for a muted appearance |
|
|
25
|
+
| Pale Indigo | `PaleIndigoTheme` | Soft indigo tones for a calm interface |
|
|
23
26
|
|
|
24
27
|
```tsx
|
|
25
28
|
import {
|
|
@@ -28,7 +31,10 @@ import {
|
|
|
28
31
|
AcrylicPurpleTheme,
|
|
29
32
|
ChoreoTheme,
|
|
30
33
|
ClassicTheme,
|
|
31
|
-
HighContrastTheme
|
|
34
|
+
HighContrastTheme,
|
|
35
|
+
PaleBaseTheme,
|
|
36
|
+
PaleGrayTheme,
|
|
37
|
+
PaleIndigoTheme,
|
|
32
38
|
} from '@wso2/oxygen-ui';
|
|
33
39
|
```
|
|
34
40
|
|
|
@@ -61,8 +67,12 @@ import {
|
|
|
61
67
|
OxygenTheme,
|
|
62
68
|
AcrylicOrangeTheme,
|
|
63
69
|
AcrylicPurpleTheme,
|
|
70
|
+
ChoreoTheme,
|
|
64
71
|
ClassicTheme,
|
|
65
|
-
HighContrastTheme
|
|
72
|
+
HighContrastTheme,
|
|
73
|
+
PaleBaseTheme,
|
|
74
|
+
PaleGrayTheme,
|
|
75
|
+
PaleIndigoTheme,
|
|
66
76
|
} from '@wso2/oxygen-ui';
|
|
67
77
|
|
|
68
78
|
<OxygenUIThemeProvider
|
|
@@ -73,6 +83,9 @@ import {
|
|
|
73
83
|
{ key: 'choreo', label: 'Choreo', theme: ChoreoTheme },
|
|
74
84
|
{ key: 'classic', label: 'Classic', theme: ClassicTheme },
|
|
75
85
|
{ key: 'highContrast', label: 'High Contrast', theme: HighContrastTheme },
|
|
86
|
+
{ key: 'paleBase', label: 'Pale Base', theme: PaleBaseTheme },
|
|
87
|
+
{ key: 'paleGray', label: 'Pale Gray', theme: PaleGrayTheme },
|
|
88
|
+
{ key: 'paleIndigo', label: 'Pale Indigo', theme: PaleIndigoTheme },
|
|
76
89
|
]}
|
|
77
90
|
initialTheme="default"
|
|
78
91
|
>
|
package/bin/cli.js
CHANGED
|
@@ -136,6 +136,7 @@ function parseArgs() {
|
|
|
136
136
|
const command = args.find(arg => !arg.startsWith('--'));
|
|
137
137
|
const flags = {
|
|
138
138
|
claude: args.includes('--claude'),
|
|
139
|
+
internal: args.includes('--internal'),
|
|
139
140
|
};
|
|
140
141
|
return { command, flags };
|
|
141
142
|
}
|
|
@@ -320,7 +321,7 @@ function copyClaudeFiles() {
|
|
|
320
321
|
/**
|
|
321
322
|
* Copy skills directories (Claude mode)
|
|
322
323
|
*/
|
|
323
|
-
function copySkillsDir() {
|
|
324
|
+
function copySkillsDir(includeInternal = false) {
|
|
324
325
|
if (!existsSync(skillsSourceDir)) {
|
|
325
326
|
console.log(' No skills directory found in source.');
|
|
326
327
|
return 0;
|
|
@@ -331,10 +332,10 @@ function copySkillsDir() {
|
|
|
331
332
|
// Internal-only skills excluded from consumer distribution
|
|
332
333
|
const INTERNAL_SKILLS = ['oxygen-sync'];
|
|
333
334
|
|
|
334
|
-
// Get list of skill directories (
|
|
335
|
+
// Get list of skill directories (include internal skills when --internal flag is used)
|
|
335
336
|
const skillDirs = readdirSync(skillsSourceDir).filter(entry => {
|
|
336
337
|
const fullPath = join(skillsSourceDir, entry);
|
|
337
|
-
return statSync(fullPath).isDirectory() && !INTERNAL_SKILLS.includes(entry);
|
|
338
|
+
return statSync(fullPath).isDirectory() && (includeInternal || !INTERNAL_SKILLS.includes(entry));
|
|
338
339
|
});
|
|
339
340
|
|
|
340
341
|
let totalCopied = 0;
|
|
@@ -387,14 +388,14 @@ function initDefault() {
|
|
|
387
388
|
/**
|
|
388
389
|
* Initialize Oxygen UI AI documentation - Claude mode
|
|
389
390
|
*/
|
|
390
|
-
function initClaude() {
|
|
391
|
-
console.log(
|
|
391
|
+
function initClaude(includeInternal = false) {
|
|
392
|
+
console.log(`\nOxygen UI - AI Integration Setup (Claude Code${includeInternal ? ' + Internal' : ''})\n`);
|
|
392
393
|
|
|
393
394
|
// Copy .claude/ files
|
|
394
395
|
copyClaudeFiles();
|
|
395
396
|
|
|
396
|
-
// Copy skills
|
|
397
|
-
copySkillsDir();
|
|
397
|
+
// Copy skills (include internal skills when --internal flag is used)
|
|
398
|
+
copySkillsDir(includeInternal);
|
|
398
399
|
|
|
399
400
|
// Update root CLAUDE.md
|
|
400
401
|
console.log('Updating root CLAUDE.md...\n');
|
|
@@ -413,13 +414,17 @@ function initClaude() {
|
|
|
413
414
|
console.log(' - /oxygen-component Generate Oxygen UI components');
|
|
414
415
|
console.log(' - /oxygen-layout Generate app layouts');
|
|
415
416
|
console.log(' - /oxygen-form Generate forms with validation');
|
|
416
|
-
console.log(' - /oxygen-migrate Migrate MUI code to Oxygen UI
|
|
417
|
+
console.log(' - /oxygen-migrate Migrate MUI code to Oxygen UI');
|
|
418
|
+
if (includeInternal) {
|
|
419
|
+
console.log(' - /oxygen-sync Sync AI docs with source (internal)');
|
|
420
|
+
}
|
|
421
|
+
console.log('');
|
|
417
422
|
}
|
|
418
423
|
|
|
419
424
|
/**
|
|
420
425
|
* Initialize Oxygen UI AI documentation
|
|
421
426
|
*/
|
|
422
|
-
async function init(claudeFlag) {
|
|
427
|
+
async function init(claudeFlag, internalFlag = false) {
|
|
423
428
|
let claudeMode = claudeFlag;
|
|
424
429
|
|
|
425
430
|
if (!claudeFlag) {
|
|
@@ -428,8 +433,11 @@ async function init(claudeFlag) {
|
|
|
428
433
|
}
|
|
429
434
|
|
|
430
435
|
if (claudeMode) {
|
|
431
|
-
initClaude();
|
|
436
|
+
initClaude(internalFlag);
|
|
432
437
|
} else {
|
|
438
|
+
if (internalFlag) {
|
|
439
|
+
console.log('\n Note: --internal flag is only supported with Claude Code mode (--claude).\n');
|
|
440
|
+
}
|
|
433
441
|
initDefault();
|
|
434
442
|
}
|
|
435
443
|
}
|
|
@@ -449,14 +457,14 @@ function updateDefault() {
|
|
|
449
457
|
/**
|
|
450
458
|
* Update Oxygen UI AI documentation - Claude mode
|
|
451
459
|
*/
|
|
452
|
-
function updateClaude() {
|
|
453
|
-
console.log(
|
|
460
|
+
function updateClaude(includeInternal = false) {
|
|
461
|
+
console.log(`\nOxygen UI - Updating AI Documentation (Claude Code${includeInternal ? ' + Internal' : ''})\n`);
|
|
454
462
|
|
|
455
463
|
// Refresh .claude/ files
|
|
456
464
|
copyClaudeFiles();
|
|
457
465
|
|
|
458
|
-
// Refresh skills
|
|
459
|
-
copySkillsDir();
|
|
466
|
+
// Refresh skills (include internal skills when --internal flag is used)
|
|
467
|
+
copySkillsDir(includeInternal);
|
|
460
468
|
|
|
461
469
|
console.log('Update complete!\n');
|
|
462
470
|
}
|
|
@@ -464,7 +472,7 @@ function updateClaude() {
|
|
|
464
472
|
/**
|
|
465
473
|
* Update Oxygen UI AI documentation
|
|
466
474
|
*/
|
|
467
|
-
async function update(claudeFlag) {
|
|
475
|
+
async function update(claudeFlag, internalFlag = false) {
|
|
468
476
|
let claudeMode = claudeFlag;
|
|
469
477
|
|
|
470
478
|
if (!claudeFlag) {
|
|
@@ -485,7 +493,7 @@ async function update(claudeFlag) {
|
|
|
485
493
|
}
|
|
486
494
|
|
|
487
495
|
if (claudeMode) {
|
|
488
|
-
updateClaude();
|
|
496
|
+
updateClaude(internalFlag);
|
|
489
497
|
} else {
|
|
490
498
|
updateDefault();
|
|
491
499
|
}
|
|
@@ -506,7 +514,8 @@ Commands:
|
|
|
506
514
|
help Show this help message
|
|
507
515
|
|
|
508
516
|
Options:
|
|
509
|
-
--claude
|
|
517
|
+
--claude Skip prompt and use Claude Code mode directly
|
|
518
|
+
--internal Include internal/maintainer skills (e.g., /oxygen-sync)
|
|
510
519
|
|
|
511
520
|
Interactive Behavior:
|
|
512
521
|
init Prompts to select your AI assistant (Claude Code or Other)
|
|
@@ -531,6 +540,10 @@ Examples:
|
|
|
531
540
|
npx @wso2/oxygen-ui update # Auto-detects previous mode
|
|
532
541
|
npx @wso2/oxygen-ui update --claude # Force Claude mode update
|
|
533
542
|
|
|
543
|
+
Internal (WSO2 maintainers):
|
|
544
|
+
npx @wso2/oxygen-ui init --claude --internal # Include internal skills
|
|
545
|
+
npx @wso2/oxygen-ui update --claude --internal # Update with internal skills
|
|
546
|
+
|
|
534
547
|
Available Skills (Claude mode only):
|
|
535
548
|
/oxygen-component Generate Oxygen UI React components
|
|
536
549
|
/oxygen-layout Generate app layouts with AppShell
|
|
@@ -548,10 +561,10 @@ const { command, flags } = parseArgs();
|
|
|
548
561
|
(async () => {
|
|
549
562
|
switch (command) {
|
|
550
563
|
case 'init':
|
|
551
|
-
await init(flags.claude);
|
|
564
|
+
await init(flags.claude, flags.internal);
|
|
552
565
|
break;
|
|
553
566
|
case 'update':
|
|
554
|
-
await update(flags.claude);
|
|
567
|
+
await update(flags.claude, flags.internal);
|
|
555
568
|
break;
|
|
556
569
|
case 'help':
|
|
557
570
|
case '--help':
|
|
@@ -22,10 +22,11 @@ import { AppShellSidebar } from './AppShellSidebar';
|
|
|
22
22
|
import { AppShellMain } from './AppShellMain';
|
|
23
23
|
import { AppShellFooter } from './AppShellFooter';
|
|
24
24
|
import { AppShellNotificationPanel } from './AppShellNotificationPanel';
|
|
25
|
+
import { type UseAppShellOptions } from '../../hooks/useAppShell';
|
|
25
26
|
/**
|
|
26
27
|
* Props for AppShell component.
|
|
27
28
|
*/
|
|
28
|
-
export interface AppShellProps {
|
|
29
|
+
export interface AppShellProps extends UseAppShellOptions {
|
|
29
30
|
/** AppShell slot components (Navbar, Sidebar, Main, Footer, NotificationPanel) */
|
|
30
31
|
children: React.ReactNode;
|
|
31
32
|
/** Additional sx props for the root container */
|
|
@@ -37,9 +38,13 @@ export interface AppShellProps {
|
|
|
37
38
|
* Uses a compound component pattern where children define the layout slots.
|
|
38
39
|
* This reduces boilerplate compared to manually composing Layout components.
|
|
39
40
|
*
|
|
41
|
+
* AppShell automatically provides shell state management through context.
|
|
42
|
+
* Child components can use the `useAppShell()` hook to access and control
|
|
43
|
+
* the shell state (sidebar collapse, notification panel, active menu items).
|
|
44
|
+
*
|
|
40
45
|
* @example
|
|
41
46
|
* ```tsx
|
|
42
|
-
* <AppShell>
|
|
47
|
+
* <AppShell initialCollapsed={false} collapseOnSelectOnMobile={true}>
|
|
43
48
|
* <AppShell.Navbar>
|
|
44
49
|
* <Header>...</Header>
|
|
45
50
|
* </AppShell.Navbar>
|
|
@@ -47,14 +52,11 @@ export interface AppShellProps {
|
|
|
47
52
|
* <Sidebar collapsed={collapsed}>...</Sidebar>
|
|
48
53
|
* </AppShell.Sidebar>
|
|
49
54
|
* <AppShell.Main>
|
|
50
|
-
* <
|
|
55
|
+
* <MyPage /> {/* Can use useAppShell()
|
|
51
56
|
* </AppShell.Main>
|
|
52
57
|
* <AppShell.Footer>
|
|
53
58
|
* <Footer companyName="WSO2 LLC" />
|
|
54
59
|
* </AppShell.Footer>
|
|
55
|
-
* <AppShell.NotificationPanel>
|
|
56
|
-
* <NotificationPanel open={open} onClose={onClose}>...</NotificationPanel>
|
|
57
|
-
* </AppShell.NotificationPanel>
|
|
58
60
|
* </AppShell>
|
|
59
61
|
* ```
|
|
60
62
|
*/
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import * as React from 'react';
|
|
19
|
+
import type { UseAppShellReturn } from '../../hooks/useAppShell/useAppShell';
|
|
20
|
+
/**
|
|
21
|
+
* Context for sharing AppShell state across components.
|
|
22
|
+
* Allows child components to access the same shell state without prop drilling.
|
|
23
|
+
*/
|
|
24
|
+
export declare const AppShellContext: React.Context<UseAppShellReturn | undefined>;
|
|
25
|
+
/**
|
|
26
|
+
* Provider component for AppShell context.
|
|
27
|
+
* Wrap your app shell with this to share state with child components.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* function AppLayout() {
|
|
32
|
+
* const shell = useAppShell({ initialCollapsed: false });
|
|
33
|
+
*
|
|
34
|
+
* return (
|
|
35
|
+
* <AppShellProvider value={shell}>
|
|
36
|
+
* <AppShell>
|
|
37
|
+
* <Sidebar collapsed={shell.state.sidebarCollapsed} />
|
|
38
|
+
* <Outlet />
|
|
39
|
+
* </AppShell>
|
|
40
|
+
* </AppShellProvider>
|
|
41
|
+
* );
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare const AppShellProvider: React.FC<React.PropsWithChildren<{
|
|
46
|
+
value: UseAppShellReturn;
|
|
47
|
+
}>>;
|
|
48
|
+
/**
|
|
49
|
+
* Hook to access AppShell context with a helpful error message.
|
|
50
|
+
* Throws an error if used outside of AppShell component tree.
|
|
51
|
+
*
|
|
52
|
+
* @param componentName - Name of the component using the context (for error messages)
|
|
53
|
+
* @returns AppShell context value
|
|
54
|
+
* @throws Error if used outside AppShell
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```tsx
|
|
58
|
+
* function MyComponent() {
|
|
59
|
+
* const { state, actions } = useAppShellContext('MyComponent');
|
|
60
|
+
* // ...
|
|
61
|
+
* }
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export declare const useAppShellContext: (componentName: string) => UseAppShellReturn;
|
|
@@ -27,3 +27,4 @@ export { AppShellFooter } from './AppShellFooter';
|
|
|
27
27
|
export type { AppShellFooterProps } from './AppShellFooter';
|
|
28
28
|
export { AppShellNotificationPanel } from './AppShellNotificationPanel';
|
|
29
29
|
export type { AppShellNotificationPanelProps } from './AppShellNotificationPanel';
|
|
30
|
+
export { AppShellContext, AppShellProvider, useAppShellContext } from './context';
|
|
@@ -21,10 +21,10 @@ import type { SxProps, Theme } from '@mui/material/styles';
|
|
|
21
21
|
* Props for HeaderToggle component.
|
|
22
22
|
*/
|
|
23
23
|
export interface HeaderToggleProps {
|
|
24
|
-
/** Whether the sidebar is collapsed */
|
|
25
|
-
collapsed
|
|
26
|
-
/** Callback to toggle sidebar */
|
|
27
|
-
onToggle
|
|
24
|
+
/** Whether the sidebar is collapsed (optional, uses AppShell context if available) */
|
|
25
|
+
collapsed?: boolean;
|
|
26
|
+
/** Callback to toggle sidebar (optional, uses AppShell context if available) */
|
|
27
|
+
onToggle?: () => void;
|
|
28
28
|
/** Label for expanded state tooltip */
|
|
29
29
|
expandLabel?: string;
|
|
30
30
|
/** Label for collapsed state tooltip */
|
|
@@ -36,10 +36,10 @@ import { NotificationEmptyState } from './NotificationEmptyState';
|
|
|
36
36
|
* Props for the NotificationPanel component.
|
|
37
37
|
*/
|
|
38
38
|
export interface NotificationPanelProps {
|
|
39
|
-
/** Whether the panel is open */
|
|
40
|
-
open
|
|
41
|
-
/** Callback to close the panel */
|
|
42
|
-
onClose
|
|
39
|
+
/** Whether the panel is open (optional, uses AppShell context if available) */
|
|
40
|
+
open?: boolean;
|
|
41
|
+
/** Callback to close the panel (optional, uses AppShell context if available) */
|
|
42
|
+
onClose?: () => void;
|
|
43
43
|
/** Panel content */
|
|
44
44
|
children: React.ReactNode;
|
|
45
45
|
/** Panel width (default: 380) */
|
|
@@ -33,6 +33,8 @@ export interface SidebarItemProps {
|
|
|
33
33
|
depth?: number;
|
|
34
34
|
/** Additional sx props */
|
|
35
35
|
sx?: SxProps<Theme>;
|
|
36
|
+
/** Optional navigation link component to wrap the item button */
|
|
37
|
+
link?: React.ReactElement;
|
|
36
38
|
}
|
|
37
39
|
/**
|
|
38
40
|
* SidebarItem - Individual navigation menu item.
|
|
@@ -47,6 +49,14 @@ export interface SidebarItemProps {
|
|
|
47
49
|
* </Sidebar.Item>
|
|
48
50
|
* ```
|
|
49
51
|
*
|
|
52
|
+
* With navigation link:
|
|
53
|
+
* ```tsx
|
|
54
|
+
* <Sidebar.Item id="home" link={<Link to="/home" />}>
|
|
55
|
+
* <Sidebar.ItemIcon><Home size={20} /></Sidebar.ItemIcon>
|
|
56
|
+
* <Sidebar.ItemLabel>Home</Sidebar.ItemLabel>
|
|
57
|
+
* </Sidebar.Item>
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
50
60
|
* Theme tokens used:
|
|
51
61
|
* - `action.selected` - Active item background
|
|
52
62
|
* - `primary.main` - Active item icon color
|