@wso2/oxygen-ui 0.4.0 → 0.6.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 +18 -15
- package/.ai/components.md +706 -73
- package/.ai/migration.md +4 -2
- package/.ai/patterns.md +20 -8
- package/.ai/theming.md +18 -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 +18 -2
- package/bin/cli.js +143 -43
- package/dist/components/ComplexSelect/ComplexSelectDivider.d.ts +3 -0
- package/dist/components/ComplexSelect/ComplexSelectListHeader.d.ts +3 -0
- package/dist/components/ComplexSelect/ComplexSelectMenuItemAvatar.d.ts +3 -0
- package/dist/components/ComplexSelect/ComplexSelectMenuItemIcon.d.ts +3 -0
- package/dist/components/ComplexSelect/ComplexSelectMenuItemText.d.ts +3 -0
- package/dist/components/Footer/Footer.d.ts +29 -26
- package/dist/components/Footer/FooterCopyright.d.ts +37 -0
- package/dist/components/Footer/FooterDivider.d.ts +28 -0
- package/dist/components/Footer/FooterLink.d.ts +38 -0
- package/dist/components/Footer/FooterVersion.d.ts +35 -0
- package/dist/components/Footer/index.d.ts +7 -0
- package/dist/components/UserMenu/UserMenu.d.ts +27 -32
- package/dist/components/UserMenu/UserMenuContext.d.ts +33 -0
- package/dist/components/UserMenu/UserMenuDivider.d.ts +22 -0
- package/dist/components/UserMenu/UserMenuHeader.d.ts +35 -0
- package/dist/components/UserMenu/UserMenuItem.d.ts +35 -0
- package/dist/components/UserMenu/UserMenuLogout.d.ts +33 -0
- package/dist/components/UserMenu/UserMenuTrigger.d.ts +33 -0
- package/dist/components/UserMenu/index.d.ts +9 -0
- package/dist/index.js +1480 -593
- package/dist/index.js.map +4 -4
- package/dist/styles/Themes/ChoreoTheme.d.ts +20 -0
- package/dist/styles/Themes/PaleBaseTheme.d.ts +25 -0
- package/dist/styles/Themes/PaleGray.d.ts +20 -0
- package/dist/styles/Themes/PaleIndigo.d.ts +20 -0
- package/dist/styles/Themes/index.d.ts +4 -0
- 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
|
@@ -17,16 +17,24 @@
|
|
|
17
17
|
| OxygenTheme | `OxygenTheme` | Default theme (Acrylic Base) |
|
|
18
18
|
| Acrylic Orange | `AcrylicOrangeTheme` | Glass-morphism effects, orange primary |
|
|
19
19
|
| Acrylic Purple | `AcrylicPurpleTheme` | Glass-morphism with purple accents |
|
|
20
|
+
| Choreo | `ChoreoTheme` | Choreo product theme (indigo-violet gradient) |
|
|
20
21
|
| Classic | `ClassicTheme` | Standard flat design |
|
|
21
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 |
|
|
22
26
|
|
|
23
27
|
```tsx
|
|
24
28
|
import {
|
|
25
29
|
OxygenTheme,
|
|
26
30
|
AcrylicOrangeTheme,
|
|
27
31
|
AcrylicPurpleTheme,
|
|
32
|
+
ChoreoTheme,
|
|
28
33
|
ClassicTheme,
|
|
29
|
-
HighContrastTheme
|
|
34
|
+
HighContrastTheme,
|
|
35
|
+
PaleBaseTheme,
|
|
36
|
+
PaleGrayTheme,
|
|
37
|
+
PaleIndigoTheme,
|
|
30
38
|
} from '@wso2/oxygen-ui';
|
|
31
39
|
```
|
|
32
40
|
|
|
@@ -59,8 +67,12 @@ import {
|
|
|
59
67
|
OxygenTheme,
|
|
60
68
|
AcrylicOrangeTheme,
|
|
61
69
|
AcrylicPurpleTheme,
|
|
70
|
+
ChoreoTheme,
|
|
62
71
|
ClassicTheme,
|
|
63
|
-
HighContrastTheme
|
|
72
|
+
HighContrastTheme,
|
|
73
|
+
PaleBaseTheme,
|
|
74
|
+
PaleGrayTheme,
|
|
75
|
+
PaleIndigoTheme,
|
|
64
76
|
} from '@wso2/oxygen-ui';
|
|
65
77
|
|
|
66
78
|
<OxygenUIThemeProvider
|
|
@@ -68,8 +80,12 @@ import {
|
|
|
68
80
|
{ key: 'default', label: 'Default', theme: OxygenTheme },
|
|
69
81
|
{ key: 'orange', label: 'Acrylic Orange', theme: AcrylicOrangeTheme },
|
|
70
82
|
{ key: 'purple', label: 'Acrylic Purple', theme: AcrylicPurpleTheme },
|
|
83
|
+
{ key: 'choreo', label: 'Choreo', theme: ChoreoTheme },
|
|
71
84
|
{ key: 'classic', label: 'Classic', theme: ClassicTheme },
|
|
72
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 },
|
|
73
89
|
]}
|
|
74
90
|
initialTheme="default"
|
|
75
91
|
>
|
package/bin/cli.js
CHANGED
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
import { fileURLToPath } from 'url';
|
|
24
24
|
import { dirname, join, resolve } from 'path';
|
|
25
|
+
import { createInterface } from 'readline';
|
|
25
26
|
import {
|
|
26
27
|
existsSync,
|
|
27
28
|
mkdirSync,
|
|
@@ -73,6 +74,56 @@ For Oxygen UI component guidelines and patterns, see [.ai/oxygen-ui/components.m
|
|
|
73
74
|
const CLAUDE_IMPORT_MARKER = '.claude/oxygen-ui/CLAUDE.md';
|
|
74
75
|
const AGENTS_IMPORT_MARKER = '.ai/oxygen-ui/';
|
|
75
76
|
|
|
77
|
+
// ============================================================================
|
|
78
|
+
// Interactive Prompt
|
|
79
|
+
// ============================================================================
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Prompt the user to select their AI assistant.
|
|
83
|
+
* Returns true for Claude mode, false for universal mode.
|
|
84
|
+
* Falls back to universal mode in non-interactive environments (CI/CD).
|
|
85
|
+
*/
|
|
86
|
+
function promptSelection() {
|
|
87
|
+
// Non-interactive environment — default to universal mode
|
|
88
|
+
if (!process.stdin.isTTY) {
|
|
89
|
+
return Promise.resolve(false);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return new Promise((resolve) => {
|
|
93
|
+
const rl = createInterface({
|
|
94
|
+
input: process.stdin,
|
|
95
|
+
output: process.stdout,
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
console.log('\n? Which AI assistant are you using?\n');
|
|
99
|
+
console.log(' 1. Claude Code (recommended \u2014 includes skills & Claude-specific docs)');
|
|
100
|
+
console.log(' 2. Other AI assistant (universal docs for any AI tool)\n');
|
|
101
|
+
|
|
102
|
+
rl.question('Select [1-2]: ', (answer) => {
|
|
103
|
+
rl.close();
|
|
104
|
+
const choice = answer.trim();
|
|
105
|
+
if (choice === '1') {
|
|
106
|
+
resolve(true);
|
|
107
|
+
} else {
|
|
108
|
+
resolve(false);
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Detect previous setup mode by checking for existing project directories.
|
|
116
|
+
* Returns 'claude' | 'other' | null.
|
|
117
|
+
*/
|
|
118
|
+
function detectPreviousMode() {
|
|
119
|
+
const claudeExists = existsSync(resolve(process.cwd(), '.claude', 'oxygen-ui'));
|
|
120
|
+
const aiExists = existsSync(resolve(process.cwd(), '.ai', 'oxygen-ui'));
|
|
121
|
+
|
|
122
|
+
if (claudeExists) return 'claude';
|
|
123
|
+
if (aiExists) return 'other';
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
|
|
76
127
|
// ============================================================================
|
|
77
128
|
// Argument Parsing
|
|
78
129
|
// ============================================================================
|
|
@@ -85,6 +136,7 @@ function parseArgs() {
|
|
|
85
136
|
const command = args.find(arg => !arg.startsWith('--'));
|
|
86
137
|
const flags = {
|
|
87
138
|
claude: args.includes('--claude'),
|
|
139
|
+
internal: args.includes('--internal'),
|
|
88
140
|
};
|
|
89
141
|
return { command, flags };
|
|
90
142
|
}
|
|
@@ -269,7 +321,7 @@ function copyClaudeFiles() {
|
|
|
269
321
|
/**
|
|
270
322
|
* Copy skills directories (Claude mode)
|
|
271
323
|
*/
|
|
272
|
-
function copySkillsDir() {
|
|
324
|
+
function copySkillsDir(includeInternal = false) {
|
|
273
325
|
if (!existsSync(skillsSourceDir)) {
|
|
274
326
|
console.log(' No skills directory found in source.');
|
|
275
327
|
return 0;
|
|
@@ -277,10 +329,13 @@ function copySkillsDir() {
|
|
|
277
329
|
|
|
278
330
|
console.log('Copying Claude Code skills...\n');
|
|
279
331
|
|
|
280
|
-
//
|
|
332
|
+
// Internal-only skills excluded from consumer distribution
|
|
333
|
+
const INTERNAL_SKILLS = ['oxygen-sync'];
|
|
334
|
+
|
|
335
|
+
// Get list of skill directories (include internal skills when --internal flag is used)
|
|
281
336
|
const skillDirs = readdirSync(skillsSourceDir).filter(entry => {
|
|
282
337
|
const fullPath = join(skillsSourceDir, entry);
|
|
283
|
-
return statSync(fullPath).isDirectory();
|
|
338
|
+
return statSync(fullPath).isDirectory() && (includeInternal || !INTERNAL_SKILLS.includes(entry));
|
|
284
339
|
});
|
|
285
340
|
|
|
286
341
|
let totalCopied = 0;
|
|
@@ -328,20 +383,19 @@ function initDefault() {
|
|
|
328
383
|
console.log(' - .ai/oxygen-ui/patterns.md (common patterns)');
|
|
329
384
|
console.log(' - .ai/oxygen-ui/theming.md (theme customization)');
|
|
330
385
|
console.log(' - .ai/oxygen-ui/migration.md (migration guide)\n');
|
|
331
|
-
console.log('For Claude Code with skills: npx @wso2/oxygen-ui init --claude\n');
|
|
332
386
|
}
|
|
333
387
|
|
|
334
388
|
/**
|
|
335
389
|
* Initialize Oxygen UI AI documentation - Claude mode
|
|
336
390
|
*/
|
|
337
|
-
function initClaude() {
|
|
338
|
-
console.log(
|
|
391
|
+
function initClaude(includeInternal = false) {
|
|
392
|
+
console.log(`\nOxygen UI - AI Integration Setup (Claude Code${includeInternal ? ' + Internal' : ''})\n`);
|
|
339
393
|
|
|
340
394
|
// Copy .claude/ files
|
|
341
395
|
copyClaudeFiles();
|
|
342
396
|
|
|
343
|
-
// Copy skills
|
|
344
|
-
copySkillsDir();
|
|
397
|
+
// Copy skills (include internal skills when --internal flag is used)
|
|
398
|
+
copySkillsDir(includeInternal);
|
|
345
399
|
|
|
346
400
|
// Update root CLAUDE.md
|
|
347
401
|
console.log('Updating root CLAUDE.md...\n');
|
|
@@ -360,16 +414,30 @@ function initClaude() {
|
|
|
360
414
|
console.log(' - /oxygen-component Generate Oxygen UI components');
|
|
361
415
|
console.log(' - /oxygen-layout Generate app layouts');
|
|
362
416
|
console.log(' - /oxygen-form Generate forms with validation');
|
|
363
|
-
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('');
|
|
364
422
|
}
|
|
365
423
|
|
|
366
424
|
/**
|
|
367
425
|
* Initialize Oxygen UI AI documentation
|
|
368
426
|
*/
|
|
369
|
-
function init(
|
|
427
|
+
async function init(claudeFlag, internalFlag = false) {
|
|
428
|
+
let claudeMode = claudeFlag;
|
|
429
|
+
|
|
430
|
+
if (!claudeFlag) {
|
|
431
|
+
console.log('\nOxygen UI - AI Integration Setup');
|
|
432
|
+
claudeMode = await promptSelection();
|
|
433
|
+
}
|
|
434
|
+
|
|
370
435
|
if (claudeMode) {
|
|
371
|
-
initClaude();
|
|
436
|
+
initClaude(internalFlag);
|
|
372
437
|
} else {
|
|
438
|
+
if (internalFlag) {
|
|
439
|
+
console.log('\n Note: --internal flag is only supported with Claude Code mode (--claude).\n');
|
|
440
|
+
}
|
|
373
441
|
initDefault();
|
|
374
442
|
}
|
|
375
443
|
}
|
|
@@ -389,14 +457,14 @@ function updateDefault() {
|
|
|
389
457
|
/**
|
|
390
458
|
* Update Oxygen UI AI documentation - Claude mode
|
|
391
459
|
*/
|
|
392
|
-
function updateClaude() {
|
|
393
|
-
console.log(
|
|
460
|
+
function updateClaude(includeInternal = false) {
|
|
461
|
+
console.log(`\nOxygen UI - Updating AI Documentation (Claude Code${includeInternal ? ' + Internal' : ''})\n`);
|
|
394
462
|
|
|
395
463
|
// Refresh .claude/ files
|
|
396
464
|
copyClaudeFiles();
|
|
397
465
|
|
|
398
|
-
// Refresh skills
|
|
399
|
-
copySkillsDir();
|
|
466
|
+
// Refresh skills (include internal skills when --internal flag is used)
|
|
467
|
+
copySkillsDir(includeInternal);
|
|
400
468
|
|
|
401
469
|
console.log('Update complete!\n');
|
|
402
470
|
}
|
|
@@ -404,9 +472,28 @@ function updateClaude() {
|
|
|
404
472
|
/**
|
|
405
473
|
* Update Oxygen UI AI documentation
|
|
406
474
|
*/
|
|
407
|
-
function update(
|
|
475
|
+
async function update(claudeFlag, internalFlag = false) {
|
|
476
|
+
let claudeMode = claudeFlag;
|
|
477
|
+
|
|
478
|
+
if (!claudeFlag) {
|
|
479
|
+
const previousMode = detectPreviousMode();
|
|
480
|
+
|
|
481
|
+
if (previousMode === 'claude') {
|
|
482
|
+
console.log('\nOxygen UI - Updating AI Documentation');
|
|
483
|
+
console.log('\nDetected previous Claude Code setup. Updating Claude docs...');
|
|
484
|
+
claudeMode = true;
|
|
485
|
+
} else if (previousMode === 'other') {
|
|
486
|
+
console.log('\nOxygen UI - Updating AI Documentation');
|
|
487
|
+
console.log('\nDetected previous universal setup. Updating universal docs...');
|
|
488
|
+
claudeMode = false;
|
|
489
|
+
} else {
|
|
490
|
+
console.log('\nOxygen UI - Updating AI Documentation');
|
|
491
|
+
claudeMode = await promptSelection();
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
|
|
408
495
|
if (claudeMode) {
|
|
409
|
-
updateClaude();
|
|
496
|
+
updateClaude(internalFlag);
|
|
410
497
|
} else {
|
|
411
498
|
updateDefault();
|
|
412
499
|
}
|
|
@@ -427,24 +514,35 @@ Commands:
|
|
|
427
514
|
help Show this help message
|
|
428
515
|
|
|
429
516
|
Options:
|
|
430
|
-
--claude
|
|
517
|
+
--claude Skip prompt and use Claude Code mode directly
|
|
518
|
+
--internal Include internal/maintainer skills (e.g., /oxygen-sync)
|
|
519
|
+
|
|
520
|
+
Interactive Behavior:
|
|
521
|
+
init Prompts to select your AI assistant (Claude Code or Other)
|
|
522
|
+
update Auto-detects previous setup mode from project files;
|
|
523
|
+
prompts only if no prior setup is found
|
|
524
|
+
--claude Bypasses the interactive prompt for CI/CD or scripted usage
|
|
431
525
|
|
|
432
526
|
Modes:
|
|
433
|
-
|
|
527
|
+
Universal (Other AI assistant):
|
|
434
528
|
- Creates AGENTS.md at project root
|
|
435
529
|
- Creates .ai/oxygen-ui/ folder with documentation
|
|
436
530
|
- Works with any AI assistant
|
|
437
531
|
|
|
438
|
-
Claude
|
|
532
|
+
Claude Code:
|
|
439
533
|
- Creates .claude/oxygen-ui/ folder with documentation
|
|
440
534
|
- Creates .claude/skills/ with invokable skills
|
|
441
535
|
- Updates root CLAUDE.md with reference
|
|
442
536
|
|
|
443
537
|
Examples:
|
|
444
|
-
npx @wso2/oxygen-ui init
|
|
445
|
-
npx @wso2/oxygen-ui init --claude
|
|
446
|
-
npx @wso2/oxygen-ui update
|
|
447
|
-
npx @wso2/oxygen-ui update --claude #
|
|
538
|
+
npx @wso2/oxygen-ui init # Interactive — choose your AI assistant
|
|
539
|
+
npx @wso2/oxygen-ui init --claude # Claude Code setup (skip prompt)
|
|
540
|
+
npx @wso2/oxygen-ui update # Auto-detects previous mode
|
|
541
|
+
npx @wso2/oxygen-ui update --claude # Force Claude mode update
|
|
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
|
|
448
546
|
|
|
449
547
|
Available Skills (Claude mode only):
|
|
450
548
|
/oxygen-component Generate Oxygen UI React components
|
|
@@ -460,22 +558,24 @@ Available Skills (Claude mode only):
|
|
|
460
558
|
|
|
461
559
|
const { command, flags } = parseArgs();
|
|
462
560
|
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
init
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
update
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
561
|
+
(async () => {
|
|
562
|
+
switch (command) {
|
|
563
|
+
case 'init':
|
|
564
|
+
await init(flags.claude, flags.internal);
|
|
565
|
+
break;
|
|
566
|
+
case 'update':
|
|
567
|
+
await update(flags.claude, flags.internal);
|
|
568
|
+
break;
|
|
569
|
+
case 'help':
|
|
570
|
+
case '--help':
|
|
571
|
+
case '-h':
|
|
572
|
+
showHelp();
|
|
573
|
+
break;
|
|
574
|
+
default:
|
|
575
|
+
if (command) {
|
|
576
|
+
console.error(`Unknown command: ${command}\n`);
|
|
577
|
+
}
|
|
578
|
+
showHelp();
|
|
579
|
+
process.exit(command ? 1 : 0);
|
|
580
|
+
}
|
|
581
|
+
})();
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { DividerProps } from '@mui/material/Divider';
|
|
2
2
|
export type ComplexSelectDividerProps = DividerProps;
|
|
3
3
|
export declare function ComplexSelectDivider({ ...props }: ComplexSelectDividerProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare namespace ComplexSelectDivider {
|
|
5
|
+
var displayName: string;
|
|
6
|
+
}
|
|
4
7
|
export default ComplexSelectDivider;
|
|
@@ -4,4 +4,7 @@ export interface ComplexSelectListHeaderProps extends ListSubheaderProps {
|
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
}
|
|
6
6
|
export declare function ComplexSelectListHeader({ children, ...props }: ComplexSelectListHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare namespace ComplexSelectListHeader {
|
|
8
|
+
var displayName: string;
|
|
9
|
+
}
|
|
7
10
|
export default ComplexSelectListHeader;
|
|
@@ -4,4 +4,7 @@ export interface ComplexSelectMenuItemAvatarProps extends AvatarProps {
|
|
|
4
4
|
children?: ReactNode;
|
|
5
5
|
}
|
|
6
6
|
export declare function ComplexSelectMenuItemAvatar({ children, ...props }: ComplexSelectMenuItemAvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare namespace ComplexSelectMenuItemAvatar {
|
|
8
|
+
var displayName: string;
|
|
9
|
+
}
|
|
7
10
|
export default ComplexSelectMenuItemAvatar;
|