@wso2/oxygen-ui 0.0.1-alpha.9 → 0.2.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.
Files changed (169) hide show
  1. package/.ai/AGENTS.md +78 -0
  2. package/.ai/components.md +798 -0
  3. package/.ai/migration.md +279 -0
  4. package/.ai/patterns.md +1185 -0
  5. package/.ai/theming.md +318 -0
  6. package/.claude/components.md +798 -0
  7. package/.claude/migration.md +279 -0
  8. package/.claude/patterns.md +1185 -0
  9. package/.claude/skills/oxygen-component/SKILL.md +141 -0
  10. package/.claude/skills/oxygen-form/SKILL.md +410 -0
  11. package/.claude/skills/oxygen-layout/SKILL.md +233 -0
  12. package/.claude/skills/oxygen-migrate/SKILL.md +277 -0
  13. package/.claude/theming.md +318 -0
  14. package/README.md +182 -2
  15. package/bin/cli.js +480 -0
  16. package/dist/animations/ParticleBackground/ParticleBackground.d.ts +66 -0
  17. package/dist/animations/ParticleBackground/index.d.ts +19 -0
  18. package/dist/animations/index.d.ts +18 -0
  19. package/dist/components/AppShell/AppShell.d.ts +69 -0
  20. package/dist/components/AppShell/AppShellFooter.d.ts +41 -0
  21. package/dist/components/AppShell/AppShellMain.d.ts +41 -0
  22. package/dist/components/AppShell/AppShellNavbar.d.ts +41 -0
  23. package/dist/components/AppShell/AppShellNotificationPanel.d.ts +41 -0
  24. package/dist/components/AppShell/AppShellSidebar.d.ts +41 -0
  25. package/dist/components/AppShell/index.d.ts +29 -0
  26. package/dist/components/CodeBlock/CodeBlock.d.ts +47 -0
  27. package/dist/components/CodeBlock/index.d.ts +19 -0
  28. package/dist/components/ColorSchemeImage/index.d.ts +19 -0
  29. package/dist/components/ColorSchemeToggle/index.d.ts +18 -0
  30. package/dist/components/ComplexSelect/ComplexSelect.d.ts +25 -0
  31. package/dist/components/ComplexSelect/ComplexSelectDivider.d.ts +4 -0
  32. package/dist/components/ComplexSelect/ComplexSelectListHeader.d.ts +7 -0
  33. package/dist/components/ComplexSelect/ComplexSelectMenuItem.d.ts +16 -0
  34. package/dist/components/ComplexSelect/ComplexSelectMenuItemAvatar.d.ts +7 -0
  35. package/dist/components/ComplexSelect/ComplexSelectMenuItemIcon.d.ts +7 -0
  36. package/dist/components/ComplexSelect/ComplexSelectMenuItemText.d.ts +8 -0
  37. package/dist/components/ComplexSelect/index.d.ts +21 -0
  38. package/dist/components/Footer/Footer.d.ts +71 -0
  39. package/dist/components/Footer/index.d.ts +19 -0
  40. package/dist/components/Form/CardButton.d.ts +30 -0
  41. package/dist/components/Form/ElementWrapper.d.ts +24 -0
  42. package/dist/components/Form/Section.d.ts +21 -0
  43. package/dist/components/Form/Stack.d.ts +19 -0
  44. package/dist/components/Form/Typography.d.ts +21 -0
  45. package/dist/components/Form/Wizard.d.ts +27 -0
  46. package/dist/components/Form/index.d.ts +38 -0
  47. package/dist/components/Header/Header.d.ts +89 -0
  48. package/dist/components/Header/HeaderActions.d.ts +42 -0
  49. package/dist/components/Header/HeaderBrand.d.ts +48 -0
  50. package/dist/components/Header/HeaderBrandLogo.d.ts +45 -0
  51. package/dist/components/Header/HeaderBrandTitle.d.ts +45 -0
  52. package/dist/components/Header/HeaderSwitchers.d.ts +45 -0
  53. package/dist/components/Header/HeaderToggle.d.ts +52 -0
  54. package/dist/components/Header/context.d.ts +34 -0
  55. package/dist/components/Header/index.d.ts +33 -0
  56. package/dist/components/ListingTable/ListingTable/ListingTable.d.ts +54 -0
  57. package/dist/components/ListingTable/ListingTable/ListingTableBody.d.ts +6 -0
  58. package/dist/components/ListingTable/ListingTable/ListingTableCell.d.ts +15 -0
  59. package/dist/components/ListingTable/ListingTable/ListingTableContainer.d.ts +17 -0
  60. package/dist/components/ListingTable/ListingTable/ListingTableFooter.d.ts +6 -0
  61. package/dist/components/ListingTable/ListingTable/ListingTableHead.d.ts +6 -0
  62. package/dist/components/ListingTable/ListingTable/ListingTableRow.d.ts +18 -0
  63. package/dist/components/ListingTable/ListingTable/index.d.ts +21 -0
  64. package/dist/components/ListingTable/ListingTableProvider.d.ts +28 -0
  65. package/dist/components/ListingTable/context.d.ts +78 -0
  66. package/dist/components/ListingTable/index.d.ts +22 -0
  67. package/dist/components/ListingTable/shared/ListingTableCellIcon.d.ts +31 -0
  68. package/dist/components/ListingTable/shared/ListingTableDensityControl.d.ts +26 -0
  69. package/dist/components/ListingTable/shared/ListingTableEmptyState.d.ts +32 -0
  70. package/dist/components/ListingTable/shared/ListingTableRowActions.d.ts +24 -0
  71. package/dist/components/ListingTable/shared/ListingTableSortLabel.d.ts +37 -0
  72. package/dist/components/ListingTable/shared/ListingTableToolbar.d.ts +52 -0
  73. package/dist/components/ListingTable/shared/index.d.ts +14 -0
  74. package/dist/components/ListingTable/shared/types.d.ts +5 -0
  75. package/dist/components/NotificationBanner/NotificationBanner.d.ts +69 -0
  76. package/dist/components/NotificationBanner/index.d.ts +19 -0
  77. package/dist/components/NotificationPanel/NotificationActions.d.ts +44 -0
  78. package/dist/components/NotificationPanel/NotificationEmptyState.d.ts +41 -0
  79. package/dist/components/NotificationPanel/NotificationHeader.d.ts +47 -0
  80. package/dist/components/NotificationPanel/NotificationHeaderBadge.d.ts +46 -0
  81. package/dist/components/NotificationPanel/NotificationHeaderClose.d.ts +46 -0
  82. package/dist/components/NotificationPanel/NotificationHeaderIcon.d.ts +43 -0
  83. package/dist/components/NotificationPanel/NotificationHeaderTitle.d.ts +43 -0
  84. package/dist/components/NotificationPanel/NotificationItem.d.ts +64 -0
  85. package/dist/components/NotificationPanel/NotificationItemAction.d.ts +46 -0
  86. package/dist/components/NotificationPanel/NotificationItemAvatar.d.ts +44 -0
  87. package/dist/components/NotificationPanel/NotificationItemContext.d.ts +52 -0
  88. package/dist/components/NotificationPanel/NotificationItemMessage.d.ts +47 -0
  89. package/dist/components/NotificationPanel/NotificationItemTimestamp.d.ts +46 -0
  90. package/dist/components/NotificationPanel/NotificationItemTitle.d.ts +49 -0
  91. package/dist/components/NotificationPanel/NotificationList.d.ts +37 -0
  92. package/dist/components/NotificationPanel/NotificationPanel.d.ts +122 -0
  93. package/dist/components/NotificationPanel/NotificationTabs.d.ts +51 -0
  94. package/dist/components/NotificationPanel/context.d.ts +34 -0
  95. package/dist/components/NotificationPanel/index.d.ts +55 -0
  96. package/dist/components/NotificationPanel/utils.d.ts +46 -0
  97. package/dist/components/PageContent/PageContent.d.ts +71 -0
  98. package/dist/components/PageContent/index.d.ts +2 -0
  99. package/dist/components/PageTitle/PageTitle.d.ts +34 -0
  100. package/dist/components/PageTitle/PageTitleAvatar.d.ts +16 -0
  101. package/dist/components/PageTitle/PageTitleHeader.d.ts +16 -0
  102. package/dist/components/PageTitle/PageTitleLink.d.ts +20 -0
  103. package/dist/components/PageTitle/PageTitleSubHeader.d.ts +16 -0
  104. package/dist/components/PageTitle/index.d.ts +27 -0
  105. package/dist/components/SearchBar/SearchBar.d.ts +5 -0
  106. package/dist/components/SearchBar/SearchBarWithAdvancedFilter.d.ts +26 -0
  107. package/dist/components/Sidebar/Sidebar.d.ts +120 -0
  108. package/dist/components/Sidebar/SidebarCategory.d.ts +47 -0
  109. package/dist/components/Sidebar/SidebarCategoryLabel.d.ts +47 -0
  110. package/dist/components/Sidebar/SidebarFooter.d.ts +38 -0
  111. package/dist/components/Sidebar/SidebarItem.d.ts +61 -0
  112. package/dist/components/Sidebar/SidebarItemBadge.d.ts +47 -0
  113. package/dist/components/Sidebar/SidebarItemContext.d.ts +49 -0
  114. package/dist/components/Sidebar/SidebarItemIcon.d.ts +47 -0
  115. package/dist/components/Sidebar/SidebarItemLabel.d.ts +44 -0
  116. package/dist/components/Sidebar/SidebarNav.d.ts +42 -0
  117. package/dist/components/Sidebar/SidebarUser.d.ts +57 -0
  118. package/dist/components/Sidebar/SidebarUserAvatar.d.ts +51 -0
  119. package/dist/components/Sidebar/SidebarUserEmail.d.ts +48 -0
  120. package/dist/components/Sidebar/SidebarUserName.d.ts +45 -0
  121. package/dist/components/Sidebar/context.d.ts +42 -0
  122. package/dist/components/Sidebar/index.d.ts +47 -0
  123. package/dist/components/StatCard/StatCard.d.ts +48 -0
  124. package/dist/components/StatCard/index.d.ts +2 -0
  125. package/dist/components/ThemeSwitcher/ThemeSelect.d.ts +37 -0
  126. package/dist/components/ThemeSwitcher/ThemeSwitcher.d.ts +65 -0
  127. package/dist/components/ThemeSwitcher/index.d.ts +4 -0
  128. package/dist/components/UserMenu/UserMenu.d.ts +74 -0
  129. package/dist/components/UserMenu/index.d.ts +19 -0
  130. package/dist/components/index.d.ts +54 -0
  131. package/dist/contexts/OxygenUIThemeProvider/OxygenUIThemeProvider.d.ts +58 -3
  132. package/dist/contexts/OxygenUIThemeProvider/index.d.ts +20 -0
  133. package/dist/contexts/index.d.ts +19 -0
  134. package/dist/hooks/index.d.ts +22 -0
  135. package/dist/hooks/useAppShell/index.d.ts +19 -0
  136. package/dist/hooks/useAppShell/useAppShell.d.ts +81 -0
  137. package/dist/hooks/useNotifications/index.d.ts +19 -0
  138. package/dist/hooks/useNotifications/useNotifications.d.ts +105 -0
  139. package/dist/hooks/useThemeContent/index.d.ts +18 -0
  140. package/dist/hooks/useThemeContent/useThemeContent.d.ts +57 -0
  141. package/dist/index.d.ts +8 -4
  142. package/dist/index.js +5189 -252
  143. package/dist/index.js.map +4 -4
  144. package/dist/layouts/Layout.d.ts +3 -0
  145. package/dist/layouts/LayoutContent.d.ts +3 -0
  146. package/dist/layouts/LayoutHeader.d.ts +3 -0
  147. package/dist/layouts/LayoutNavbar.d.ts +3 -0
  148. package/dist/layouts/LayoutSidebar.d.ts +3 -0
  149. package/dist/styles/Themes/AcrylicBaseTheme.d.ts +25 -0
  150. package/dist/styles/Themes/AcrylicOrangeTheme.d.ts +17 -0
  151. package/dist/styles/Themes/AcrylicPurpleTheme.d.ts +20 -0
  152. package/dist/styles/Themes/ClassicTheme.d.ts +24 -0
  153. package/dist/styles/Themes/HighContrastTheme.d.ts +20 -0
  154. package/dist/styles/Themes/OxygenThemeBase.d.ts +70 -0
  155. package/dist/styles/Themes/index.d.ts +22 -0
  156. package/dist/styles/index.d.ts +18 -0
  157. package/dist/utils/formatRelativeTime.d.ts +34 -0
  158. package/dist/utils/index.d.ts +19 -0
  159. package/dist/utils/pxToRem.d.ts +23 -0
  160. package/package.json +20 -12
  161. package/dist/components/ColorSchemeImage/ColorSchemeImage.js +0 -57
  162. package/dist/components/ColorSchemeImage/ColorSchemeImage.js.map +0 -7
  163. package/dist/components/ColorSchemeToggle/ColorSchemeToggle.js +0 -76
  164. package/dist/components/ColorSchemeToggle/ColorSchemeToggle.js.map +0 -7
  165. package/dist/contexts/OxygenUIThemeProvider/OxygenUIThemeProvider.js +0 -378
  166. package/dist/contexts/OxygenUIThemeProvider/OxygenUIThemeProvider.js.map +0 -7
  167. package/dist/styles/OxygenTheme/OxygenTheme.d.ts +0 -38
  168. package/dist/styles/OxygenTheme/OxygenTheme.js +0 -356
  169. package/dist/styles/OxygenTheme/OxygenTheme.js.map +0 -7
@@ -0,0 +1,279 @@
1
+ # Migration Guide to Oxygen UI
2
+
3
+ ## Table of Contents
4
+ - [Overview](#overview)
5
+ - [Install Packages](#install-packages)
6
+ - [Update Imports](#update-imports)
7
+ - [ESLint Plugin Setup](#eslint-plugin-setup)
8
+ - [Common Patterns](#common-patterns)
9
+
10
+ ---
11
+
12
+ ## Overview
13
+
14
+ Migrating to Oxygen UI involves:
15
+ 1. Installing Oxygen UI packages
16
+ 2. Replacing direct `@mui/*` imports with `@wso2/oxygen-ui`
17
+ 3. Replacing `lucide-react` imports with `@wso2/oxygen-ui-icons-react`
18
+ 4. Wrapping app with `OxygenUIThemeProvider`
19
+ 5. Setting up ESLint plugin to prevent regressions
20
+
21
+ ---
22
+
23
+ ## Install Packages
24
+
25
+ ```bash
26
+ # Add Oxygen UI packages
27
+ pnpm add @wso2/oxygen-ui @wso2/oxygen-ui-icons-react
28
+
29
+ # Add ESLint plugin (dev dependency)
30
+ pnpm add -D @wso2/eslint-plugin-oxygen-ui
31
+
32
+ # Ensure peer dependencies
33
+ pnpm add @emotion/react @emotion/styled date-fns
34
+ ```
35
+
36
+ ---
37
+
38
+ ## Update Imports
39
+
40
+ ### MUI Components
41
+
42
+ **Before:**
43
+ ```tsx
44
+ import { Box, Stack, Button } from '@mui/material';
45
+ import Typography from '@mui/material/Typography';
46
+ ```
47
+
48
+ **After:**
49
+ ```tsx
50
+ import { Box, Stack, Button, Typography } from '@wso2/oxygen-ui';
51
+ ```
52
+
53
+ ### MUI X Components
54
+
55
+ **Before:**
56
+ ```tsx
57
+ import { DataGrid } from '@mui/x-data-grid';
58
+ import { DatePicker } from '@mui/x-date-pickers';
59
+ import { BarChart } from '@mui/x-charts';
60
+ ```
61
+
62
+ **After:**
63
+ ```tsx
64
+ import { DataGrid, DatePickers, Charts } from '@wso2/oxygen-ui';
65
+
66
+ const { DataGrid: DataGridComponent } = DataGrid;
67
+ const { DatePicker } = DatePickers;
68
+ const { BarChart } = Charts;
69
+ ```
70
+
71
+ ### Icons
72
+
73
+ **Before:**
74
+ ```tsx
75
+ import { Settings, Bell, User } from 'lucide-react';
76
+ ```
77
+
78
+ **After:**
79
+ ```tsx
80
+ import { Settings, Bell, User } from '@wso2/oxygen-ui-icons-react';
81
+ ```
82
+
83
+ ### Theme Provider
84
+
85
+ **Before:**
86
+ ```tsx
87
+ import { ThemeProvider, createTheme } from '@mui/material';
88
+
89
+ const theme = createTheme({ ... });
90
+
91
+ <ThemeProvider theme={theme}>
92
+ <App />
93
+ </ThemeProvider>
94
+ ```
95
+
96
+ **After:**
97
+ ```tsx
98
+ import { OxygenUIThemeProvider } from '@wso2/oxygen-ui';
99
+
100
+ <OxygenUIThemeProvider>
101
+ <App />
102
+ </OxygenUIThemeProvider>
103
+ ```
104
+
105
+ ---
106
+
107
+ ## ESLint Plugin Setup
108
+
109
+ ### ESLint 9+ (Flat Config)
110
+
111
+ ```js
112
+ // eslint.config.js
113
+ import oxygenUIPlugin from '@wso2/eslint-plugin-oxygen-ui';
114
+
115
+ export default [
116
+ oxygenUIPlugin.configs.recommended,
117
+ // ... other configs
118
+ ];
119
+ ```
120
+
121
+ ### Custom Configuration
122
+
123
+ ```js
124
+ // eslint.config.js
125
+ import oxygenUIPlugin from '@wso2/eslint-plugin-oxygen-ui';
126
+
127
+ export default [
128
+ {
129
+ plugins: {
130
+ '@wso2/oxygen-ui': oxygenUIPlugin,
131
+ },
132
+ rules: {
133
+ '@wso2/oxygen-ui/no-direct-mui-imports': ['error', {
134
+ suggestedPackage: '@wso2/oxygen-ui',
135
+ allowedPackages: [], // Temporarily allow specific MUI packages during migration
136
+ }],
137
+ '@wso2/oxygen-ui/no-direct-lucide-imports': ['error', {
138
+ suggestedPackage: '@wso2/oxygen-ui-icons-react',
139
+ }],
140
+ },
141
+ },
142
+ ];
143
+ ```
144
+
145
+ ### Auto-fix Imports
146
+
147
+ ```bash
148
+ # Find violations
149
+ pnpm eslint src/
150
+
151
+ # Auto-fix imports
152
+ pnpm eslint src/ --fix
153
+ ```
154
+
155
+ ### Gradual Migration
156
+
157
+ During migration, temporarily allow specific MUI packages:
158
+
159
+ ```js
160
+ '@wso2/oxygen-ui/no-direct-mui-imports': ['warn', {
161
+ allowedPackages: ['@mui/x-data-grid', '@mui/x-date-pickers'],
162
+ }],
163
+ ```
164
+
165
+ ---
166
+
167
+ ## Common Patterns
168
+
169
+ ### Layout Migration
170
+
171
+ **Before (custom layout):**
172
+ ```tsx
173
+ <Box sx={{ display: 'flex' }}>
174
+ <AppBar>...</AppBar>
175
+ <Drawer>...</Drawer>
176
+ <Box component="main">...</Box>
177
+ </Box>
178
+ ```
179
+
180
+ **After (Oxygen AppShell):**
181
+ ```tsx
182
+ import { AppShell, Header, Sidebar } from '@wso2/oxygen-ui';
183
+
184
+ <AppShell>
185
+ <AppShell.Navbar>
186
+ <Header>...</Header>
187
+ </AppShell.Navbar>
188
+ <AppShell.Sidebar>
189
+ <Sidebar>...</Sidebar>
190
+ </AppShell.Sidebar>
191
+ <AppShell.Main>...</AppShell.Main>
192
+ </AppShell>
193
+ ```
194
+
195
+ ### Theme Customization Migration
196
+
197
+ **Before:**
198
+ ```tsx
199
+ const theme = createTheme({
200
+ palette: {
201
+ primary: { main: '#1976d2' },
202
+ },
203
+ });
204
+ ```
205
+
206
+ **After:**
207
+ ```tsx
208
+ import { extendTheme } from '@mui/material/styles';
209
+ import { OxygenThemeBase, OxygenUIThemeProvider } from '@wso2/oxygen-ui';
210
+
211
+ const customTheme = extendTheme({
212
+ ...OxygenThemeBase,
213
+ colorSchemes: {
214
+ light: {
215
+ palette: { primary: { main: '#1976d2' } },
216
+ },
217
+ },
218
+ });
219
+
220
+ <OxygenUIThemeProvider theme={customTheme}>
221
+ <App />
222
+ </OxygenUIThemeProvider>
223
+ ```
224
+
225
+ ### Icon Button Migration
226
+
227
+ **Before:**
228
+ ```tsx
229
+ import IconButton from '@mui/material/IconButton';
230
+ import SettingsIcon from '@mui/icons-material/Settings';
231
+
232
+ <IconButton><SettingsIcon /></IconButton>
233
+ ```
234
+
235
+ **After:**
236
+ ```tsx
237
+ import { IconButton } from '@wso2/oxygen-ui';
238
+ import { Settings } from '@wso2/oxygen-ui-icons-react';
239
+
240
+ <IconButton><Settings size={20} /></IconButton>
241
+ ```
242
+
243
+ ### Color Mode Migration
244
+
245
+ **Before:**
246
+ ```tsx
247
+ import { useColorScheme } from '@mui/material';
248
+
249
+ const { mode, setMode } = useColorScheme();
250
+ ```
251
+
252
+ **After:**
253
+ ```tsx
254
+ import { ColorSchemeToggle, useThemeContent } from '@wso2/oxygen-ui';
255
+
256
+ // Simple toggle
257
+ <ColorSchemeToggle />
258
+
259
+ // Conditional content
260
+ const content = useThemeContent({
261
+ light: 'Light content',
262
+ dark: 'Dark content',
263
+ });
264
+ ```
265
+
266
+ ---
267
+
268
+ ## Migration Checklist
269
+
270
+ - [ ] Install `@wso2/oxygen-ui` and `@wso2/oxygen-ui-icons-react`
271
+ - [ ] Install peer dependencies (`@emotion/react`, `@emotion/styled`, `date-fns`)
272
+ - [ ] Wrap root component with `OxygenUIThemeProvider`
273
+ - [ ] Replace `@mui/material` imports with `@wso2/oxygen-ui`
274
+ - [ ] Replace `@mui/icons-material` or `lucide-react` with `@wso2/oxygen-ui-icons-react`
275
+ - [ ] Update MUI X imports to use namespaced exports
276
+ - [ ] Install and configure `@wso2/eslint-plugin-oxygen-ui`
277
+ - [ ] Run ESLint with `--fix` to auto-correct remaining imports
278
+ - [ ] Test light/dark mode functionality
279
+ - [ ] Verify theme styling matches expectations