@wso2/oxygen-ui 0.24.0 → 0.26.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 +2 -7
- package/.ai/components.md +4 -4
- package/.ai/patterns.md +0 -4
- package/.ai/theming.md +0 -11
- package/.claude/components.md +128 -4
- package/.claude/patterns.md +0 -4
- package/.claude/theming.md +0 -8
- package/README.md +1 -1
- package/bin/cli.js +1 -1
- package/dist/animations/PageLoader/PageLoader.d.ts +92 -0
- package/dist/animations/PageLoader/PageLoaderIcon.d.ts +20 -0
- package/dist/animations/PageLoader/PageLoaderWordmark.d.ts +19 -0
- package/dist/animations/PageLoader/index.d.ts +4 -0
- package/dist/animations/index.d.ts +2 -0
- package/dist/components/HeaderBreadcrumbs/HeaderBreadcrumbs.d.ts +100 -0
- package/dist/components/HeaderBreadcrumbs/HeaderBreadcrumbsSegment.d.ts +54 -0
- package/dist/components/HeaderBreadcrumbs/index.d.ts +26 -0
- package/dist/components/HeaderBreadcrumbs/persistence.d.ts +87 -0
- package/dist/components/HeaderBreadcrumbs/types.d.ts +125 -0
- package/dist/components/HeaderBreadcrumbs/useHeaderBreadcrumbs.d.ts +150 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/index.js +3001 -2388
- package/dist/index.js.map +4 -4
- package/dist/styles/OxygenThemeBase.d.ts +16 -1
- package/dist/styles/Themes/index.d.ts +0 -3
- package/dist/utils/createOxygenTheme.d.ts +2 -2
- package/package.json +5 -3
- package/dist/styles/Themes/WSO2Theme.d.ts +0 -20
package/.ai/AGENTS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Oxygen UI - AI Development Guide
|
|
1
|
+
# Choreo Oxygen UI - AI Development Guide
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Choreo Labs' React component library built on Material-UI v7
|
|
4
4
|
|
|
5
5
|
## Quick Start
|
|
6
6
|
|
|
@@ -55,13 +55,8 @@ import { DataGrid, DatePickers, TreeView } from '@wso2/oxygen-ui';
|
|
|
55
55
|
## Available Themes
|
|
56
56
|
|
|
57
57
|
- `OxygenTheme` - Default theme (recommended): brand colours, Sora font and flat surfaces
|
|
58
|
-
- `AcrylicOrangeTheme` - Orange accent variant
|
|
59
|
-
- `AcrylicPurpleTheme` - Purple accent variant
|
|
60
58
|
- `ClassicTheme` - Traditional styling
|
|
61
59
|
- `HighContrastTheme` - Accessibility-focused
|
|
62
|
-
- `PaleBaseTheme` - Minimal color palette
|
|
63
|
-
- `PaleGrayTheme` - Soft gray tones
|
|
64
|
-
- `PaleIndigoTheme` - Soft indigo tones
|
|
65
60
|
|
|
66
61
|
## Custom Oxygen Components
|
|
67
62
|
|
package/.ai/components.md
CHANGED
|
@@ -69,14 +69,14 @@ interface ThemeOption {
|
|
|
69
69
|
import {
|
|
70
70
|
OxygenUIThemeProvider,
|
|
71
71
|
OxygenTheme,
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
ClassicTheme,
|
|
73
|
+
HighContrastTheme,
|
|
74
74
|
} from '@wso2/oxygen-ui';
|
|
75
75
|
|
|
76
76
|
const themes = [
|
|
77
77
|
{ key: 'default', label: 'Default', theme: OxygenTheme },
|
|
78
|
-
{ key: '
|
|
79
|
-
{ key: '
|
|
78
|
+
{ key: 'classic', label: 'Classic', theme: ClassicTheme },
|
|
79
|
+
{ key: 'highContrast', label: 'High Contrast', theme: HighContrastTheme },
|
|
80
80
|
];
|
|
81
81
|
|
|
82
82
|
<OxygenUIThemeProvider themes={themes} initialTheme="default">
|
package/.ai/patterns.md
CHANGED
|
@@ -1142,8 +1142,6 @@ function TabNavigation() {
|
|
|
1142
1142
|
import {
|
|
1143
1143
|
OxygenUIThemeProvider,
|
|
1144
1144
|
OxygenTheme,
|
|
1145
|
-
AcrylicOrangeTheme,
|
|
1146
|
-
AcrylicPurpleTheme,
|
|
1147
1145
|
ClassicTheme,
|
|
1148
1146
|
HighContrastTheme,
|
|
1149
1147
|
PaleBaseTheme,
|
|
@@ -1156,8 +1154,6 @@ import {
|
|
|
1156
1154
|
|
|
1157
1155
|
const themes = [
|
|
1158
1156
|
{ key: 'default', label: 'Default', theme: OxygenTheme },
|
|
1159
|
-
{ key: 'orange', label: 'Acrylic Orange', theme: AcrylicOrangeTheme },
|
|
1160
|
-
{ key: 'purple', label: 'Acrylic Purple', theme: AcrylicPurpleTheme },
|
|
1161
1157
|
{ key: 'classic', label: 'Classic', theme: ClassicTheme },
|
|
1162
1158
|
{ key: 'highContrast', label: 'High Contrast', theme: HighContrastTheme },
|
|
1163
1159
|
{ key: 'paleBase', label: 'Pale Base', theme: PaleBaseTheme },
|
package/.ai/theming.md
CHANGED
|
@@ -15,19 +15,12 @@
|
|
|
15
15
|
| Theme | Import | Description |
|
|
16
16
|
|-------|--------|-------------|
|
|
17
17
|
| OxygenTheme | `OxygenTheme` | Default theme (brand colours, Sora font and flat surfaces) |
|
|
18
|
-
| Acrylic Orange | `AcrylicOrangeTheme` | Glass-morphism effects, orange primary |
|
|
19
|
-
| Acrylic Purple | `AcrylicPurpleTheme` | Glass-morphism with purple accents |
|
|
20
18
|
| Classic | `ClassicTheme` | Standard flat design |
|
|
21
19
|
| High Contrast | `HighContrastTheme` | Accessibility-focused with high contrast colors |
|
|
22
|
-
| Pale Base | `PaleBaseTheme` | Minimal color palette for subtle interfaces |
|
|
23
|
-
| Pale Gray | `PaleGrayTheme` | Soft gray tones for a muted appearance |
|
|
24
|
-
| Pale Indigo | `PaleIndigoTheme` | Soft indigo tones for a calm interface |
|
|
25
20
|
|
|
26
21
|
```tsx
|
|
27
22
|
import {
|
|
28
23
|
OxygenTheme,
|
|
29
|
-
AcrylicOrangeTheme,
|
|
30
|
-
AcrylicPurpleTheme,
|
|
31
24
|
ClassicTheme,
|
|
32
25
|
HighContrastTheme,
|
|
33
26
|
PaleBaseTheme,
|
|
@@ -63,8 +56,6 @@ import { OxygenUIThemeProvider, ClassicTheme } from '@wso2/oxygen-ui';
|
|
|
63
56
|
import {
|
|
64
57
|
OxygenUIThemeProvider,
|
|
65
58
|
OxygenTheme,
|
|
66
|
-
AcrylicOrangeTheme,
|
|
67
|
-
AcrylicPurpleTheme,
|
|
68
59
|
ClassicTheme,
|
|
69
60
|
HighContrastTheme,
|
|
70
61
|
PaleBaseTheme,
|
|
@@ -75,8 +66,6 @@ import {
|
|
|
75
66
|
<OxygenUIThemeProvider
|
|
76
67
|
themes={[
|
|
77
68
|
{ key: 'default', label: 'Default', theme: OxygenTheme },
|
|
78
|
-
{ key: 'orange', label: 'Acrylic Orange', theme: AcrylicOrangeTheme },
|
|
79
|
-
{ key: 'purple', label: 'Acrylic Purple', theme: AcrylicPurpleTheme },
|
|
80
69
|
{ key: 'classic', label: 'Classic', theme: ClassicTheme },
|
|
81
70
|
{ key: 'highContrast', label: 'High Contrast', theme: HighContrastTheme },
|
|
82
71
|
{ key: 'paleBase', label: 'Pale Base', theme: PaleBaseTheme },
|
package/.claude/components.md
CHANGED
|
@@ -13,12 +13,14 @@ Complete API reference for custom Oxygen UI components. For MUI components, refe
|
|
|
13
13
|
- [Footer](#footer)
|
|
14
14
|
- [UserMenu](#usermenu)
|
|
15
15
|
- [ContextSwitcher](#contextswitcher)
|
|
16
|
+
- [HeaderBreadcrumbs](#headerbreadcrumbs)
|
|
16
17
|
- [AppSwitcher](#appswitcher)
|
|
17
18
|
- [Form](#form)
|
|
18
19
|
- [FullScreenWizard](#fullscreenwizard)
|
|
19
20
|
- [DrawerPanel](#drawerpanel)
|
|
20
21
|
- [NotificationPanel](#notificationpanel)
|
|
21
22
|
- [NotificationBanner](#notificationbanner)
|
|
23
|
+
- [PageLoader](#pageloader)
|
|
22
24
|
- [ParticleBackground](#particlebackground)
|
|
23
25
|
- [Other Components](#other-components)
|
|
24
26
|
- [MUI X Namespaces](#mui-x-namespaces)
|
|
@@ -69,14 +71,14 @@ interface ThemeOption {
|
|
|
69
71
|
import {
|
|
70
72
|
OxygenUIThemeProvider,
|
|
71
73
|
OxygenTheme,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
+
ClassicTheme,
|
|
75
|
+
HighContrastTheme,
|
|
74
76
|
} from '@wso2/oxygen-ui';
|
|
75
77
|
|
|
76
78
|
const themes = [
|
|
77
79
|
{ key: 'default', label: 'Default', theme: OxygenTheme },
|
|
78
|
-
{ key: '
|
|
79
|
-
{ key: '
|
|
80
|
+
{ key: 'classic', label: 'Classic', theme: ClassicTheme },
|
|
81
|
+
{ key: 'highContrast', label: 'High Contrast', theme: HighContrastTheme },
|
|
80
82
|
];
|
|
81
83
|
|
|
82
84
|
<OxygenUIThemeProvider themes={themes} initialTheme="default">
|
|
@@ -1064,6 +1066,49 @@ import { NotificationBanner } from '@wso2/oxygen-ui';
|
|
|
1064
1066
|
|
|
1065
1067
|
---
|
|
1066
1068
|
|
|
1069
|
+
## PageLoader
|
|
1070
|
+
|
|
1071
|
+
Full-page loader. Animates the Oxygen UI mark in the centre while a background task runs. When `loading` turns `false`, the mark comes to rest, the title slides out to its right (pushing the mark left until the full logo is centred), and after `holdDuration` it calls `onComplete`, fades out and shows `children`. Honours `prefers-reduced-motion`.
|
|
1072
|
+
|
|
1073
|
+
```tsx
|
|
1074
|
+
import { PageLoader, PageLoaderIcon } from '@wso2/oxygen-ui';
|
|
1075
|
+
```
|
|
1076
|
+
|
|
1077
|
+
### Props
|
|
1078
|
+
|
|
1079
|
+
| Prop | Type | Default | Description |
|
|
1080
|
+
|------|------|---------|-------------|
|
|
1081
|
+
| `loading` | `boolean` | required | `true` while the task runs; `false` starts the reveal |
|
|
1082
|
+
| `title` | `ReactNode` | Oxygen UI wordmark | Revealed to the right of the icon. A string is set in the theme font, sized and tracked to match the wordmark |
|
|
1083
|
+
| `icon` | `ReactNode` | `<PageLoaderIcon />` | Replaces the animated mark |
|
|
1084
|
+
| `size` | `number` | `48` | Icon height in px; the title scales with it |
|
|
1085
|
+
| `onComplete` | `() => void` | - | Called once the full logo has been shown, before the fade out |
|
|
1086
|
+
| `onPhaseChange` | `(phase: PageLoaderPhase) => void` | - | `loading` → `settling` → `revealing` → `revealed` → `exiting` → `done` |
|
|
1087
|
+
| `revealDuration` | `number` | `700` | Reveal length in ms |
|
|
1088
|
+
| `holdDuration` | `number` | `600` | How long the full logo stays before `onComplete`, in ms |
|
|
1089
|
+
| `exitDuration` | `number` | `400` | Fade out length in ms |
|
|
1090
|
+
| `fullScreen` | `boolean` | `true` | Cover the viewport; `false` fills a positioned parent |
|
|
1091
|
+
| `loadingLabel` | `string` | `'Loading'` | Screen reader label while loading |
|
|
1092
|
+
| `children` | `ReactNode` | - | Shown once the loader finishes |
|
|
1093
|
+
|
|
1094
|
+
`PageLoaderIcon` takes `size` (default `48`) plus any SVG props, and uses `currentColor`.
|
|
1095
|
+
|
|
1096
|
+
### Usage
|
|
1097
|
+
|
|
1098
|
+
```tsx
|
|
1099
|
+
const [loading, setLoading] = useState(true);
|
|
1100
|
+
|
|
1101
|
+
useEffect(() => {
|
|
1102
|
+
Promise.all([loadUser(), loadConfig()]).finally(() => setLoading(false));
|
|
1103
|
+
}, []);
|
|
1104
|
+
|
|
1105
|
+
<PageLoader loading={loading} onComplete={() => track('app-ready')}>
|
|
1106
|
+
<App />
|
|
1107
|
+
</PageLoader>
|
|
1108
|
+
```
|
|
1109
|
+
|
|
1110
|
+
---
|
|
1111
|
+
|
|
1067
1112
|
## ParticleBackground
|
|
1068
1113
|
|
|
1069
1114
|
Animated particle canvas background with mouse interaction. Adapts to light/dark color scheme.
|
|
@@ -1361,6 +1406,85 @@ const [value, setValue] = useState<ContextSwitcherValue>({
|
|
|
1361
1406
|
</ContextSwitcher>
|
|
1362
1407
|
```
|
|
1363
1408
|
|
|
1409
|
+
## HeaderBreadcrumbs
|
|
1410
|
+
|
|
1411
|
+
A trail of the current organization / project / component, like `thunder-id / thunderid ▾`. Each segment has two targets: the name goes to that entry's page, and the caret opens a menu to switch to another entry of the same level. After the trail, a › button opens the next level's menu; its tooltip and accessible name are "Open project" (on an organization) or "Open component" (on a project). Use it when the header should read as plain text. Use `ContextSwitcher` when each level should be a labeled field.
|
|
1412
|
+
|
|
1413
|
+
```tsx
|
|
1414
|
+
import { HeaderBreadcrumbs, useHeaderBreadcrumbs, readHeaderBreadcrumbsState, clearHeaderBreadcrumbsState } from '@wso2/oxygen-ui';
|
|
1415
|
+
import type { HeaderBreadcrumbsItem, HeaderBreadcrumbsLevel, HeaderBreadcrumbsValue } from '@wso2/oxygen-ui';
|
|
1416
|
+
```
|
|
1417
|
+
|
|
1418
|
+
### HeaderBreadcrumbs Props
|
|
1419
|
+
|
|
1420
|
+
| Prop | Type | Default | Description |
|
|
1421
|
+
|------|------|---------|-------------|
|
|
1422
|
+
| `levels` | `HeaderBreadcrumbsLevel[]` | required | Levels in order. The trail runs up to the first level without `selectedId`, which shows as a › button. Leave a level out to remove it |
|
|
1423
|
+
| `onNavigate` | `(levelId, item) => void` | - | A name was clicked |
|
|
1424
|
+
| `onSelect` | `(levelId, item) => void` | - | A different entry was picked in a switch menu |
|
|
1425
|
+
| `onOpen` | `(levelId) => void` | - | A switch menu opened |
|
|
1426
|
+
| `onCreate` | `(levelId, { levelId, value }) => void` | - | Adds "New {label}" to every level's menu, such as "New project" |
|
|
1427
|
+
| `onManage` | `(levelId, { levelId, value }) => void` | - | Adds "Manage {pluralLabel}" to every level's menu, such as "Manage projects" |
|
|
1428
|
+
| `showLabels` | `boolean` | `false` | Show each level's name (Organization, Project) in small text above it |
|
|
1429
|
+
| `showIcons` | `boolean` | `true` | Show each level's `icon` before its name. Set `false` to hide them; `showLabels` replaces them. Hovering the icon shows the level name; screen readers hear it through `aria-describedby` |
|
|
1430
|
+
| `linkComponent` | `ElementType` | `'a'` | Used for items with `href`, such as a router `Link` |
|
|
1431
|
+
| `separator` | `ReactNode` | `'/'` | Node between segments |
|
|
1432
|
+
|
|
1433
|
+
`HeaderBreadcrumbsLevel`: `id`, `label`, `icon`, `items`, `selectedId`, `selectedItem` (name fallback before items load), `openLabel`, `loading`, `error`, `emptyText`, `menuTitle`, `searchPlaceholder`, `searchable` (`'auto'` shows search above 6 items), `pluralLabel`, `createAction` and `manageAction` (relabel, add `href`, own `onClick`, or `false` to hide the built-in action for that level), and `actions` (more `{ key, label, icon, href, onClick }` items).
|
|
1434
|
+
|
|
1435
|
+
Every action's `onClick(event, { levelId, value })` runs after the menu closes. With `href`, the action renders through `linkComponent`; call `event.preventDefault()` to run your own logic instead of navigating. A level's own `onClick` wins over `onCreate` / `onManage`.
|
|
1436
|
+
|
|
1437
|
+
`HeaderBreadcrumbsItem`: `id`, `name`, `description`, `avatar`, `href`, `disabled`.
|
|
1438
|
+
|
|
1439
|
+
### useHeaderBreadcrumbs
|
|
1440
|
+
|
|
1441
|
+
Holds the selection, fetches each level from its parents' selection, and aborts stale requests. Picking a different entry clears the levels under it. Clicking a name drops the levels under it (`truncateOnNavigate`, default `true`).
|
|
1442
|
+
|
|
1443
|
+
| Option | Type | Description |
|
|
1444
|
+
|--------|------|-------------|
|
|
1445
|
+
| `levels` | `HeaderBreadcrumbsLevelConfig[]` | Level display props plus `fetchItems({ parents, signal })` or fixed `items` |
|
|
1446
|
+
| `value` / `defaultValue` | `HeaderBreadcrumbsValue` | Controlled or initial selection (`Record<levelId, itemId>`) |
|
|
1447
|
+
| `onChange` | `(value, change) => void` | `change.type` is `select`, `navigate`, `clear` or `set` |
|
|
1448
|
+
| `onNavigate` | `(levelId, item) => void` | A name was clicked |
|
|
1449
|
+
| `refreshOnOpen` | `boolean` | Fetch a level again each time its menu opens |
|
|
1450
|
+
| `formatError` | `(error, levelId) => ReactNode` | Message for a failed fetch |
|
|
1451
|
+
| `persist` | `boolean \| { key?, storage?, sync? }` | Keep the selected ids (not the items) in `localStorage` (default key `oxygen-ui:header-breadcrumbs`). Apps on the same origin share it and, with `sync` (default `true`), follow each other's changes; `onChange` gets type `sync`. Uncontrolled, the stored value wins over `defaultValue` |
|
|
1452
|
+
|
|
1453
|
+
Returns `value`, `levels`, `selected` (item per level), `select`, `clear`, `setValue`, `refresh`, `setItems`, `addItem`, `updateItem`, `removeItem`, and `breadcrumbProps` to spread on `HeaderBreadcrumbs`.
|
|
1454
|
+
|
|
1455
|
+
### Usage
|
|
1456
|
+
|
|
1457
|
+
```tsx
|
|
1458
|
+
const breadcrumb = useHeaderBreadcrumbs({
|
|
1459
|
+
levels: [
|
|
1460
|
+
{ id: 'organization', label: 'Organization', fetchItems: ({ signal }) => api.organizations({ signal }) },
|
|
1461
|
+
{ id: 'project', label: 'Project', fetchItems: ({ parents, signal }) => api.projects(parents.organization, { signal }) },
|
|
1462
|
+
{ id: 'component', label: 'Component', fetchItems: ({ parents, signal }) => api.components(parents.project, { signal }) },
|
|
1463
|
+
],
|
|
1464
|
+
value: valueFromRoute,
|
|
1465
|
+
onChange: (next) => navigate(routeFor(next)),
|
|
1466
|
+
});
|
|
1467
|
+
|
|
1468
|
+
<Header.Switchers>
|
|
1469
|
+
<HeaderBreadcrumbs {...breadcrumb.breadcrumbProps} />
|
|
1470
|
+
</Header.Switchers>
|
|
1471
|
+
|
|
1472
|
+
// After creating, renaming or deleting:
|
|
1473
|
+
breadcrumb.addItem('project', created);
|
|
1474
|
+
breadcrumb.updateItem('project', id, { name: 'New name' });
|
|
1475
|
+
breadcrumb.removeItem('project', id);
|
|
1476
|
+
|
|
1477
|
+
// Share the selection across apps on the same origin:
|
|
1478
|
+
useHeaderBreadcrumbs({ levels, persist: true });
|
|
1479
|
+
const { organization, project } = useHeaderBreadcrumbsValue(); // from any app, re-renders on change
|
|
1480
|
+
readHeaderBreadcrumbsState()?.value.organization; // outside React
|
|
1481
|
+
clearHeaderBreadcrumbsState(); // on sign-out
|
|
1482
|
+
```
|
|
1483
|
+
|
|
1484
|
+
localStorage is per origin (protocol, host and port), so apps on different subdomains do not share it.
|
|
1485
|
+
|
|
1486
|
+
---
|
|
1487
|
+
|
|
1364
1488
|
## AppSwitcher
|
|
1365
1489
|
|
|
1366
1490
|
Popover for navigating between WSO2 Cloud platforms.
|
package/.claude/patterns.md
CHANGED
|
@@ -1142,8 +1142,6 @@ function TabNavigation() {
|
|
|
1142
1142
|
import {
|
|
1143
1143
|
OxygenUIThemeProvider,
|
|
1144
1144
|
OxygenTheme,
|
|
1145
|
-
AcrylicOrangeTheme,
|
|
1146
|
-
AcrylicPurpleTheme,
|
|
1147
1145
|
ClassicTheme,
|
|
1148
1146
|
HighContrastTheme,
|
|
1149
1147
|
PaleBaseTheme,
|
|
@@ -1156,8 +1154,6 @@ import {
|
|
|
1156
1154
|
|
|
1157
1155
|
const themes = [
|
|
1158
1156
|
{ key: 'default', label: 'Default', theme: OxygenTheme },
|
|
1159
|
-
{ key: 'orange', label: 'Acrylic Orange', theme: AcrylicOrangeTheme },
|
|
1160
|
-
{ key: 'purple', label: 'Acrylic Purple', theme: AcrylicPurpleTheme },
|
|
1161
1157
|
{ key: 'classic', label: 'Classic', theme: ClassicTheme },
|
|
1162
1158
|
{ key: 'highContrast', label: 'High Contrast', theme: HighContrastTheme },
|
|
1163
1159
|
{ key: 'paleBase', label: 'Pale Base', theme: PaleBaseTheme },
|
package/.claude/theming.md
CHANGED
|
@@ -15,8 +15,6 @@
|
|
|
15
15
|
| Theme | Import | Description |
|
|
16
16
|
|-------|--------|-------------|
|
|
17
17
|
| OxygenTheme | `OxygenTheme` | Default theme (brand colours, Sora font and flat surfaces) |
|
|
18
|
-
| Acrylic Orange | `AcrylicOrangeTheme` | Glass-morphism effects, orange primary |
|
|
19
|
-
| Acrylic Purple | `AcrylicPurpleTheme` | Glass-morphism with purple accents |
|
|
20
18
|
| Classic | `ClassicTheme` | Standard flat design |
|
|
21
19
|
| High Contrast | `HighContrastTheme` | Accessibility-focused with high contrast colors |
|
|
22
20
|
| Pale Base | `PaleBaseTheme` | Minimal color palette for subtle interfaces |
|
|
@@ -26,8 +24,6 @@
|
|
|
26
24
|
```tsx
|
|
27
25
|
import {
|
|
28
26
|
OxygenTheme,
|
|
29
|
-
AcrylicOrangeTheme,
|
|
30
|
-
AcrylicPurpleTheme,
|
|
31
27
|
ClassicTheme,
|
|
32
28
|
HighContrastTheme,
|
|
33
29
|
PaleBaseTheme,
|
|
@@ -63,8 +59,6 @@ import { OxygenUIThemeProvider, ClassicTheme } from '@wso2/oxygen-ui';
|
|
|
63
59
|
import {
|
|
64
60
|
OxygenUIThemeProvider,
|
|
65
61
|
OxygenTheme,
|
|
66
|
-
AcrylicOrangeTheme,
|
|
67
|
-
AcrylicPurpleTheme,
|
|
68
62
|
ClassicTheme,
|
|
69
63
|
HighContrastTheme,
|
|
70
64
|
PaleBaseTheme,
|
|
@@ -75,8 +69,6 @@ import {
|
|
|
75
69
|
<OxygenUIThemeProvider
|
|
76
70
|
themes={[
|
|
77
71
|
{ key: 'default', label: 'Default', theme: OxygenTheme },
|
|
78
|
-
{ key: 'orange', label: 'Acrylic Orange', theme: AcrylicOrangeTheme },
|
|
79
|
-
{ key: 'purple', label: 'Acrylic Purple', theme: AcrylicPurpleTheme },
|
|
80
72
|
{ key: 'classic', label: 'Classic', theme: ClassicTheme },
|
|
81
73
|
{ key: 'highContrast', label: 'High Contrast', theme: HighContrastTheme },
|
|
82
74
|
{ key: 'paleBase', label: 'Pale Base', theme: PaleBaseTheme },
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @wso2/oxygen-ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Choreo Oxygen UI React component library - A comprehensive design system powered by Material-UI with TypeScript support.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
package/bin/cli.js
CHANGED
|
@@ -542,7 +542,7 @@ Examples:
|
|
|
542
542
|
npx @wso2/oxygen-ui update # Auto-detects previous mode
|
|
543
543
|
npx @wso2/oxygen-ui update --claude # Force Claude mode update
|
|
544
544
|
|
|
545
|
-
Internal (
|
|
545
|
+
Internal (Choreo Labs maintainers):
|
|
546
546
|
npx @wso2/oxygen-ui init --claude --internal # Include internal skills
|
|
547
547
|
npx @wso2/oxygen-ui update --claude --internal # Update with internal skills
|
|
548
548
|
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { BoxProps } from '@mui/material';
|
|
3
|
+
/**
|
|
4
|
+
* Where the loader is in its sequence.
|
|
5
|
+
* - `loading`: the icon animates while the background task runs.
|
|
6
|
+
* - `settling`: the task is done; waiting for the icon to come to rest.
|
|
7
|
+
* - `revealing`: the title slides out and pushes the icon to the left.
|
|
8
|
+
* - `revealed`: the full logo is on screen, held for `holdDuration`.
|
|
9
|
+
* - `exiting`: `onComplete` has fired and the overlay fades out.
|
|
10
|
+
* - `done`: the overlay is gone and `children` are shown.
|
|
11
|
+
*/
|
|
12
|
+
export type PageLoaderPhase = 'loading' | 'settling' | 'revealing' | 'revealed' | 'exiting' | 'done';
|
|
13
|
+
export interface PageLoaderProps extends Omit<BoxProps, 'title' | 'children'> {
|
|
14
|
+
/**
|
|
15
|
+
* `true` while the background task runs. Set it to `false` when the task is done to
|
|
16
|
+
* start the reveal; `onComplete` fires once the full logo has been shown.
|
|
17
|
+
*/
|
|
18
|
+
loading: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Text or element revealed to the right of the icon. Defaults to the Oxygen UI wordmark.
|
|
21
|
+
* Text is set in the theme font, sized and tracked to match the wordmark.
|
|
22
|
+
*/
|
|
23
|
+
title?: React.ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* Replaces the animated mark. When it is not the default icon, the loader does not
|
|
26
|
+
* wait for it to come to rest before revealing.
|
|
27
|
+
*/
|
|
28
|
+
icon?: React.ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* Height of the icon in pixels. The title is sized to match.
|
|
31
|
+
* @default 48
|
|
32
|
+
*/
|
|
33
|
+
size?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Called once the full logo has been shown, before the overlay fades out.
|
|
36
|
+
*/
|
|
37
|
+
onComplete?: () => void;
|
|
38
|
+
/**
|
|
39
|
+
* Called on every phase change.
|
|
40
|
+
*/
|
|
41
|
+
onPhaseChange?: (phase: PageLoaderPhase) => void;
|
|
42
|
+
/**
|
|
43
|
+
* Length of the reveal, in milliseconds.
|
|
44
|
+
* @default 700
|
|
45
|
+
*/
|
|
46
|
+
revealDuration?: number;
|
|
47
|
+
/**
|
|
48
|
+
* How long the full logo stays on screen before `onComplete`, in milliseconds.
|
|
49
|
+
* @default 600
|
|
50
|
+
*/
|
|
51
|
+
holdDuration?: number;
|
|
52
|
+
/**
|
|
53
|
+
* Length of the fade out after `onComplete`, in milliseconds.
|
|
54
|
+
* @default 400
|
|
55
|
+
*/
|
|
56
|
+
exitDuration?: number;
|
|
57
|
+
/**
|
|
58
|
+
* Covers the viewport. Set to `false` to fill the parent instead.
|
|
59
|
+
* @default true
|
|
60
|
+
*/
|
|
61
|
+
fullScreen?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Label read out by screen readers while loading.
|
|
64
|
+
* @default 'Loading'
|
|
65
|
+
*/
|
|
66
|
+
loadingLabel?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Content shown once the loader has finished. It mounts when the overlay starts
|
|
69
|
+
* fading out, so it is already in place underneath.
|
|
70
|
+
*/
|
|
71
|
+
children?: React.ReactNode;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* PageLoader shows an animated icon in the middle of the page while a background task runs.
|
|
75
|
+
* When `loading` turns `false`, the icon comes to rest, the title slides out to its right
|
|
76
|
+
* pushing the icon to the left until the full logo is centred, and then `onComplete` fires.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```tsx
|
|
80
|
+
* const [loading, setLoading] = useState(true);
|
|
81
|
+
*
|
|
82
|
+
* useEffect(() => {
|
|
83
|
+
* bootstrap().finally(() => setLoading(false));
|
|
84
|
+
* }, []);
|
|
85
|
+
*
|
|
86
|
+
* <PageLoader loading={loading} onComplete={() => track('app-ready')}>
|
|
87
|
+
* <App />
|
|
88
|
+
* </PageLoader>
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
declare const PageLoader: React.ForwardRefExoticComponent<Omit<PageLoaderProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
92
|
+
export default PageLoader;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/** Length of one full loop, in seconds. */
|
|
3
|
+
export declare const PAGE_LOADER_ICON_CYCLE = 4.6;
|
|
4
|
+
/** Length of one step (a move followed by a hold), in seconds. */
|
|
5
|
+
export declare const PAGE_LOADER_ICON_STEP: number;
|
|
6
|
+
/** Part of each step spent moving; the rest is a hold where the mark is at rest. */
|
|
7
|
+
export declare const PAGE_LOADER_ICON_MOVE = 0.3;
|
|
8
|
+
export interface PageLoaderIconProps extends Omit<React.SVGProps<SVGSVGElement>, 'ref'> {
|
|
9
|
+
/**
|
|
10
|
+
* Height of the icon in pixels. The width follows the aspect ratio.
|
|
11
|
+
* @default 48
|
|
12
|
+
*/
|
|
13
|
+
size?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The animated Oxygen UI mark: ten ellipses rotating around a ring.
|
|
17
|
+
* Uses `currentColor`, so it follows the CSS `color` of its parent.
|
|
18
|
+
*/
|
|
19
|
+
declare const PageLoaderIcon: React.ForwardRefExoticComponent<PageLoaderIconProps & React.RefAttributes<SVGSVGElement>>;
|
|
20
|
+
export default PageLoaderIcon;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Space between the mark and the wordmark in the logo, as a share of the mark's height.
|
|
4
|
+
* The logo has a 48 unit gap; `PageLoaderIcon` already leaves about 3 units of padding on its right.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PAGE_LOADER_WORDMARK_GAP: number;
|
|
7
|
+
export interface PageLoaderWordmarkProps extends Omit<React.SVGProps<SVGSVGElement>, 'ref'> {
|
|
8
|
+
/**
|
|
9
|
+
* Height in pixels. Use the icon's size: the wordmark lines up with the mark the way it
|
|
10
|
+
* does in the logo.
|
|
11
|
+
* @default 48
|
|
12
|
+
*/
|
|
13
|
+
size?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The "Oxygen UI" wordmark from the Oxygen UI logo. Uses `currentColor`.
|
|
17
|
+
*/
|
|
18
|
+
declare const PageLoaderWordmark: React.FC<PageLoaderWordmarkProps>;
|
|
19
|
+
export default PageLoaderWordmark;
|
|
@@ -0,0 +1,100 @@
|
|
|
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 { SxProps, Theme } from '@mui/material/styles';
|
|
20
|
+
import type { HeaderBreadcrumbsActionContext, HeaderBreadcrumbsItem, HeaderBreadcrumbsLevel } from './types';
|
|
21
|
+
/**
|
|
22
|
+
* Props for HeaderBreadcrumbs.
|
|
23
|
+
*/
|
|
24
|
+
export interface HeaderBreadcrumbsProps extends Omit<React.ComponentPropsWithoutRef<'nav'>, 'onSelect'> {
|
|
25
|
+
/**
|
|
26
|
+
* Levels in order, for example organization, project and component. The trail
|
|
27
|
+
* runs up to the first level without a selection, which shows as a › button. Leave
|
|
28
|
+
* a level out to remove it, such as the component level in an app without one.
|
|
29
|
+
*/
|
|
30
|
+
levels: HeaderBreadcrumbsLevel[];
|
|
31
|
+
/** Called when a name is clicked, to go to that entry's page. */
|
|
32
|
+
onNavigate?: (levelId: string, item: HeaderBreadcrumbsItem) => void;
|
|
33
|
+
/** Called when a different entry is picked in a level's switch menu. */
|
|
34
|
+
onSelect?: (levelId: string, item: HeaderBreadcrumbsItem) => void;
|
|
35
|
+
/** Called when a level's switch menu opens. Use it to load or refresh that level. */
|
|
36
|
+
onOpen?: (levelId: string) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Adds "New {label}" to every level's menu, such as "New project". Called with the
|
|
39
|
+
* level and the current selection, so you can open a dialog or navigate. A level's
|
|
40
|
+
* `createAction` can relabel, link or hide it.
|
|
41
|
+
*/
|
|
42
|
+
onCreate?: (levelId: string, context: HeaderBreadcrumbsActionContext) => void;
|
|
43
|
+
/**
|
|
44
|
+
* Adds "Manage {pluralLabel}" to every level's menu, such as "Manage projects". A
|
|
45
|
+
* level's `manageAction` can relabel, link or hide it.
|
|
46
|
+
*/
|
|
47
|
+
onManage?: (levelId: string, context: HeaderBreadcrumbsActionContext) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Show each level's name (such as "Organization") in small text above it, so users
|
|
50
|
+
* can tell the levels apart.
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
showLabels?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Show each level's `icon` before its name, so users can tell the levels apart
|
|
56
|
+
* without labels. Hovering an icon shows the level name. Levels without an `icon`
|
|
57
|
+
* show none, and `showLabels` replaces the icons.
|
|
58
|
+
* @default true
|
|
59
|
+
*/
|
|
60
|
+
showIcons?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Element used for items with an `href`, such as a router `Link`.
|
|
63
|
+
* @default 'a'
|
|
64
|
+
*/
|
|
65
|
+
linkComponent?: React.ElementType;
|
|
66
|
+
/**
|
|
67
|
+
* Node between segments.
|
|
68
|
+
* @default '/'
|
|
69
|
+
*/
|
|
70
|
+
separator?: React.ReactNode;
|
|
71
|
+
/** The sx prop for styling with the MUI system. */
|
|
72
|
+
sx?: SxProps<Theme>;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* HeaderBreadcrumbs - A trail of the current organization, project and component.
|
|
76
|
+
*
|
|
77
|
+
* Each segment has two targets. The name goes to that entry's page. The caret opens a
|
|
78
|
+
* menu to switch to another entry of the same level. The last segment is the current
|
|
79
|
+
* page. While a level has no selection, it shows as a › button after the trail,
|
|
80
|
+
* named "Open {label}", such as "Open project" on an organization page. Pair it with `useHeaderBreadcrumbs` to fetch each level's items and keep the
|
|
81
|
+
* selection, and place it in `Header.Switchers`.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```tsx
|
|
85
|
+
* const breadcrumb = useHeaderBreadcrumbs({
|
|
86
|
+
* levels: [
|
|
87
|
+
* { id: 'organization', label: 'Organization', fetchItems: fetchOrganizations },
|
|
88
|
+
* { id: 'project', label: 'Project', fetchItems: ({ parents }) => fetchProjects(parents.organization) },
|
|
89
|
+
* ],
|
|
90
|
+
* defaultValue: { organization: 'thunder-id', project: 'thunderid' },
|
|
91
|
+
* onNavigate: (levelId, item) => navigate(item.href!),
|
|
92
|
+
* });
|
|
93
|
+
*
|
|
94
|
+
* <Header.Switchers>
|
|
95
|
+
* <HeaderBreadcrumbs {...breadcrumb.breadcrumbProps} />
|
|
96
|
+
* </Header.Switchers>
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
export declare const HeaderBreadcrumbs: React.ForwardRefExoticComponent<HeaderBreadcrumbsProps & React.RefAttributes<HTMLElement>>;
|
|
100
|
+
export default HeaderBreadcrumbs;
|
|
@@ -0,0 +1,54 @@
|
|
|
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 { HeaderBreadcrumbsActionContext, HeaderBreadcrumbsItem, HeaderBreadcrumbsLevel, HeaderBreadcrumbsValue } from './types';
|
|
20
|
+
/** Height of the name row with labels, so names, carets and the open button line up. */
|
|
21
|
+
export declare const LABELED_ROW_HEIGHT = 32;
|
|
22
|
+
/**
|
|
23
|
+
* Props for one segment of the trail.
|
|
24
|
+
*/
|
|
25
|
+
export interface HeaderBreadcrumbsSegmentProps {
|
|
26
|
+
/** The level this segment shows. */
|
|
27
|
+
level: HeaderBreadcrumbsLevel;
|
|
28
|
+
/** The last segment is the current page, marked with `aria-current="page"`. */
|
|
29
|
+
current: boolean;
|
|
30
|
+
/** Element used for items with an `href`. */
|
|
31
|
+
linkComponent: React.ElementType;
|
|
32
|
+
/** Called when the name is clicked. */
|
|
33
|
+
onNavigate?: (levelId: string, item: HeaderBreadcrumbsItem) => void;
|
|
34
|
+
/** Called when an entry in the switch menu is picked. */
|
|
35
|
+
onSelect?: (levelId: string, item: HeaderBreadcrumbsItem) => void;
|
|
36
|
+
/** Called when the switch menu opens. */
|
|
37
|
+
onOpen?: (levelId: string) => void;
|
|
38
|
+
/** Show the level name in small text above the segment. */
|
|
39
|
+
showLabel?: boolean;
|
|
40
|
+
/** Show the level's `icon` before the name. Hovering the icon shows the level name. */
|
|
41
|
+
showIcon?: boolean;
|
|
42
|
+
/** Selected id of every level, passed to action handlers. */
|
|
43
|
+
value?: HeaderBreadcrumbsValue;
|
|
44
|
+
/** Adds "New {label}" to the menu. */
|
|
45
|
+
onCreate?: (levelId: string, context: HeaderBreadcrumbsActionContext) => void;
|
|
46
|
+
/** Adds "Manage {pluralLabel}" to the menu. */
|
|
47
|
+
onManage?: (levelId: string, context: HeaderBreadcrumbsActionContext) => void;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* HeaderBreadcrumbsSegment - The name of the selected entry, and a caret that opens
|
|
51
|
+
* a menu to switch to another entry of the same level.
|
|
52
|
+
*/
|
|
53
|
+
export declare const HeaderBreadcrumbsSegment: React.FC<HeaderBreadcrumbsSegmentProps>;
|
|
54
|
+
export default HeaderBreadcrumbsSegment;
|