@wso2/oxygen-ui 0.19.0 → 0.21.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 -1
- package/.ai/components.md +113 -0
- package/.ai/patterns.md +12 -8
- package/.ai/theming.md +4 -4
- package/.claude/components.md +113 -0
- package/.claude/patterns.md +12 -8
- package/.claude/skills/oxygen-component/SKILL.md +4 -4
- package/.claude/theming.md +4 -4
- package/README.md +3 -3
- package/dist/components/AppBreadcrumbs/AppBreadcrumbs.d.ts +15 -2
- package/dist/components/ContextSwitcher/ContextSwitcher.d.ts +69 -0
- package/dist/components/ContextSwitcher/ContextSwitcherGroup.d.ts +39 -0
- package/dist/components/ContextSwitcher/ContextSwitcherLevel.d.ts +51 -0
- package/dist/components/ContextSwitcher/ContextSwitcherOption.d.ts +41 -0
- package/dist/components/ContextSwitcher/OverflowTooltip.d.ts +38 -0
- package/dist/components/ContextSwitcher/context.d.ts +41 -0
- package/dist/components/ContextSwitcher/index.d.ts +26 -0
- package/dist/components/ContextSwitcher/model.d.ts +44 -0
- package/dist/components/SearchBar/SearchBar.d.ts +7 -0
- package/dist/components/TrialBadge/TrialBadge.d.ts +39 -2
- package/dist/components/index.d.ts +3 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2025 -845
- package/dist/index.js.map +4 -4
- package/dist/styles/Themes/ChoreoLabsTheme.d.ts +20 -0
- package/dist/styles/Themes/index.d.ts +1 -0
- package/package.json +3 -2
package/.ai/AGENTS.md
CHANGED
|
@@ -54,7 +54,7 @@ import { DataGrid, DatePickers, TreeView } from '@wso2/oxygen-ui';
|
|
|
54
54
|
- `OxygenTheme` - Default theme (recommended)
|
|
55
55
|
- `AcrylicOrangeTheme` - Orange accent variant
|
|
56
56
|
- `AcrylicPurpleTheme` - Purple accent variant
|
|
57
|
-
- `
|
|
57
|
+
- `ChoreoLabsTheme` - Choreo Labs brand theme (Acrylic look with Choreo Labs colours and Sora font)
|
|
58
58
|
- `ClassicTheme` - Traditional styling
|
|
59
59
|
- `HighContrastTheme` - Accessibility-focused
|
|
60
60
|
- `PaleBaseTheme` - Minimal color palette
|
|
@@ -71,6 +71,7 @@ import { DataGrid, DatePickers, TreeView } from '@wso2/oxygen-ui';
|
|
|
71
71
|
- **Panels**: `DrawerPanel`
|
|
72
72
|
- **Theming**: `OxygenUIThemeProvider`, `ThemeSwitcher`, `ColorSchemeToggle`, `ColorSchemeImage`
|
|
73
73
|
- **User**: `UserMenu`
|
|
74
|
+
- **Navigation**: `ContextSwitcher`
|
|
74
75
|
- **Animations**: `ParticleBackground`
|
|
75
76
|
|
|
76
77
|
## Detailed Documentation
|
package/.ai/components.md
CHANGED
|
@@ -12,6 +12,7 @@ Complete API reference for custom Oxygen UI components. For MUI components, refe
|
|
|
12
12
|
- [Sidebar](#sidebar)
|
|
13
13
|
- [Footer](#footer)
|
|
14
14
|
- [UserMenu](#usermenu)
|
|
15
|
+
- [ContextSwitcher](#contextswitcher)
|
|
15
16
|
- [AppSwitcher](#appswitcher)
|
|
16
17
|
- [Form](#form)
|
|
17
18
|
- [FullScreenWizard](#fullscreenwizard)
|
|
@@ -894,6 +895,8 @@ import { SearchBar, SearchBarWithAdvancedFilter } from '@wso2/oxygen-ui';
|
|
|
894
895
|
| `value` | `string` | - | Search input value |
|
|
895
896
|
| `onChange` | `(value: string) => void` | - | Change handler |
|
|
896
897
|
| `placeholder` | `string` | `'Search...'` | Placeholder text |
|
|
898
|
+
| `width` | `'auto' \| 'standard'` | `'auto'` | `'standard'` sizes search to 400px, shrinking in narrower containers. Use it for list and grid page search |
|
|
899
|
+
| `fullWidth` | `boolean` | `false` | Stretches search across its container. Takes precedence over `width` |
|
|
897
900
|
|
|
898
901
|
### SearchBarWithAdvancedFilter Props
|
|
899
902
|
|
|
@@ -1241,6 +1244,116 @@ import { UserIcon, SettingsIcon, LogOutIcon } from '@wso2/oxygen-ui-icons-react'
|
|
|
1241
1244
|
</UserMenu>
|
|
1242
1245
|
```
|
|
1243
1246
|
|
|
1247
|
+
## ContextSwitcher
|
|
1248
|
+
|
|
1249
|
+
Shows where a person is in a product's hierarchy, such as organization, project, and component, and lets them choose another place in it. It belongs in `Header.Switchers`.
|
|
1250
|
+
|
|
1251
|
+
```tsx
|
|
1252
|
+
import { ContextSwitcher } from '@wso2/oxygen-ui';
|
|
1253
|
+
import type { ContextSwitcherValue } from '@wso2/oxygen-ui';
|
|
1254
|
+
```
|
|
1255
|
+
|
|
1256
|
+
### Compound component
|
|
1257
|
+
|
|
1258
|
+
- `ContextSwitcher.Level` — one named step in the hierarchy: a field, and the panel that picks its value
|
|
1259
|
+
- `ContextSwitcher.Group` — a labelled cluster of options inside a level's panel
|
|
1260
|
+
- `ContextSwitcher.Option` — one choice in a level's panel
|
|
1261
|
+
|
|
1262
|
+
The switcher is controlled. `value` maps each level `id` to the selected option `value`; a missing id is an empty level. The product routes from `onChange`.
|
|
1263
|
+
|
|
1264
|
+
Choosing a field opens its panel: a search box, then options and groups in the order they are written. Choosing an option opens the next level's panel. The same option keeps the levels under it; a different option clears them.
|
|
1265
|
+
|
|
1266
|
+
**Two variants:**
|
|
1267
|
+
|
|
1268
|
+
- **Chain** (default): the levels sit side by side with a slash between them. An empty level stays on screen as "Select project", in a quieter fill, and opens like any other level.
|
|
1269
|
+
- **Back** (`back`): only the current level is on screen, with Back in front of it in one bordered field. The current level is the deepest level with a selection, or the empty level whose options are open. Back clears the current level and steps up one level; the first level has no Back.
|
|
1270
|
+
|
|
1271
|
+
A name that does not fit ends in an ellipsis at 180px. Hovering it, focusing the field with the keyboard, or highlighting the option with the arrow keys shows the full text.
|
|
1272
|
+
|
|
1273
|
+
### ContextSwitcher Props
|
|
1274
|
+
|
|
1275
|
+
| Prop | Type | Default | Description |
|
|
1276
|
+
|------|------|---------|-------------|
|
|
1277
|
+
| `value` | `ContextSwitcherValue` | required | Selected option value for each level id (`Record<string, string>`) |
|
|
1278
|
+
| `onChange` | `(value: ContextSwitcherValue) => void` | required | Called with the next map when the selection changes |
|
|
1279
|
+
| `back` | `boolean` | `false` | Show only the current level, with Back in front of it |
|
|
1280
|
+
| `children` | `ReactNode` | required | `ContextSwitcher.Level` elements, in order |
|
|
1281
|
+
|
|
1282
|
+
Other `div` props and `ref` are forwarded to the root.
|
|
1283
|
+
|
|
1284
|
+
### ContextSwitcher.Level Props
|
|
1285
|
+
|
|
1286
|
+
| Prop | Type | Default | Description |
|
|
1287
|
+
|------|------|---------|-------------|
|
|
1288
|
+
| `id` | `string` | required | Key used in the `value` map |
|
|
1289
|
+
| `label` | `string` | required | Name shown on the field, such as `"Organization"` |
|
|
1290
|
+
| `loading` | `boolean` | `false` | The panel shows a progress indicator instead of the options |
|
|
1291
|
+
| `searchPlaceholder` | `string` | `'Search'` | Placeholder in the panel search box |
|
|
1292
|
+
| `searchLabel` | `string` | `` `Search ${label}` `` | Accessible name of the search box |
|
|
1293
|
+
| `noOptionsText` | `string` | `'No options'` | Shown when the level has no options |
|
|
1294
|
+
| `noMatchesText` | `string` | `'No matches'` | Shown when the search matches nothing |
|
|
1295
|
+
| `loadingLabel` | `string` | `` `Loading ${label}` `` | Accessible name of the progress indicator |
|
|
1296
|
+
| `promptText` | `string` | `` `Select ${label}` `` | Shown on the field while the level has no selection |
|
|
1297
|
+
| `backLabel` | `string` | `` `Go to the ${label} level` `` | Name of the Back control that returns to this level |
|
|
1298
|
+
| `children` | `ReactNode` | - | Options and groups, in the order they should appear |
|
|
1299
|
+
|
|
1300
|
+
### ContextSwitcher.Group Props
|
|
1301
|
+
|
|
1302
|
+
| Prop | Type | Default | Description |
|
|
1303
|
+
|------|------|---------|-------------|
|
|
1304
|
+
| `label` | `string` | required | Visible heading and accessible name of the group |
|
|
1305
|
+
| `children` | `ReactNode` | required | `ContextSwitcher.Option` elements |
|
|
1306
|
+
|
|
1307
|
+
The group is omitted when search filters out all of its options.
|
|
1308
|
+
|
|
1309
|
+
### ContextSwitcher.Option Props
|
|
1310
|
+
|
|
1311
|
+
| Prop | Type | Default | Description |
|
|
1312
|
+
|------|------|---------|-------------|
|
|
1313
|
+
| `value` | `string` | required | Value written into the `value` map when picked |
|
|
1314
|
+
| `disabled` | `boolean` | `false` | Shown, but cannot be picked |
|
|
1315
|
+
| `children` | `ReactNode` | required | Label; search filters this text |
|
|
1316
|
+
|
|
1317
|
+
### Type Exports
|
|
1318
|
+
|
|
1319
|
+
`ContextSwitcherProps`, `ContextSwitcherValue`, `ContextSwitcherLevelProps`, `ContextSwitcherGroupProps`, `ContextSwitcherOptionProps`
|
|
1320
|
+
|
|
1321
|
+
### Usage
|
|
1322
|
+
|
|
1323
|
+
```tsx
|
|
1324
|
+
import { ContextSwitcher, Header } from '@wso2/oxygen-ui';
|
|
1325
|
+
import type { ContextSwitcherValue } from '@wso2/oxygen-ui';
|
|
1326
|
+
|
|
1327
|
+
const [value, setValue] = useState<ContextSwitcherValue>({
|
|
1328
|
+
organization: 'wso2',
|
|
1329
|
+
project: 'finance-web',
|
|
1330
|
+
});
|
|
1331
|
+
|
|
1332
|
+
<Header.Switchers>
|
|
1333
|
+
<ContextSwitcher value={value} onChange={setValue}>
|
|
1334
|
+
<ContextSwitcher.Level id="organization" label="Organization">
|
|
1335
|
+
<ContextSwitcher.Option value="personal">Personal</ContextSwitcher.Option>
|
|
1336
|
+
<ContextSwitcher.Group label="Invited organizations">
|
|
1337
|
+
<ContextSwitcher.Option value="wso2">WSO2</ContextSwitcher.Option>
|
|
1338
|
+
<ContextSwitcher.Option value="demo">Demo Organization</ContextSwitcher.Option>
|
|
1339
|
+
</ContextSwitcher.Group>
|
|
1340
|
+
</ContextSwitcher.Level>
|
|
1341
|
+
<ContextSwitcher.Level id="project" label="Project" loading={projectsLoading}>
|
|
1342
|
+
{projects.map((project) => (
|
|
1343
|
+
<ContextSwitcher.Option key={project.id} value={project.id}>
|
|
1344
|
+
{project.name}
|
|
1345
|
+
</ContextSwitcher.Option>
|
|
1346
|
+
))}
|
|
1347
|
+
</ContextSwitcher.Level>
|
|
1348
|
+
</ContextSwitcher>
|
|
1349
|
+
</Header.Switchers>
|
|
1350
|
+
|
|
1351
|
+
// One level with Back
|
|
1352
|
+
<ContextSwitcher back value={value} onChange={setValue}>
|
|
1353
|
+
{/* same levels */}
|
|
1354
|
+
</ContextSwitcher>
|
|
1355
|
+
```
|
|
1356
|
+
|
|
1244
1357
|
## AppSwitcher
|
|
1245
1358
|
|
|
1246
1359
|
Popover for navigating between WSO2 Cloud platforms.
|
package/.ai/patterns.md
CHANGED
|
@@ -429,7 +429,7 @@ function DashboardCharts() {
|
|
|
429
429
|
|
|
430
430
|
```tsx
|
|
431
431
|
import { useState, useMemo } from 'react';
|
|
432
|
-
import { ListingTable, Button, IconButton, Chip } from '@wso2/oxygen-ui';
|
|
432
|
+
import { ListingTable, Button, IconButton, Chip, PageTitle } from '@wso2/oxygen-ui';
|
|
433
433
|
import { EditIcon, TrashIcon, MoreVerticalIcon } from '@wso2/oxygen-ui-icons-react';
|
|
434
434
|
|
|
435
435
|
interface User {
|
|
@@ -476,6 +476,14 @@ function UsersTable({ users }: { users: User[] }) {
|
|
|
476
476
|
);
|
|
477
477
|
|
|
478
478
|
return (
|
|
479
|
+
<>
|
|
480
|
+
{/* The primary action goes in the page header, not the table toolbar */}
|
|
481
|
+
<PageTitle>
|
|
482
|
+
<PageTitle.Header>Users</PageTitle.Header>
|
|
483
|
+
<PageTitle.Actions>
|
|
484
|
+
<Button variant="contained">Add user</Button>
|
|
485
|
+
</PageTitle.Actions>
|
|
486
|
+
</PageTitle>
|
|
479
487
|
<ListingTable.Provider
|
|
480
488
|
searchValue={search}
|
|
481
489
|
onSearchChange={setSearch}
|
|
@@ -495,11 +503,6 @@ function UsersTable({ users }: { users: User[] }) {
|
|
|
495
503
|
<ListingTable.Toolbar
|
|
496
504
|
showSearch
|
|
497
505
|
searchPlaceholder="Search users..."
|
|
498
|
-
actions={
|
|
499
|
-
<Button variant="contained" size="small">
|
|
500
|
-
Add User
|
|
501
|
-
</Button>
|
|
502
|
-
}
|
|
503
506
|
/>
|
|
504
507
|
|
|
505
508
|
<ListingTable>
|
|
@@ -554,6 +557,7 @@ function UsersTable({ users }: { users: User[] }) {
|
|
|
554
557
|
</ListingTable>
|
|
555
558
|
</ListingTable.Container>
|
|
556
559
|
</ListingTable.Provider>
|
|
560
|
+
</>
|
|
557
561
|
);
|
|
558
562
|
}
|
|
559
563
|
```
|
|
@@ -1140,7 +1144,7 @@ import {
|
|
|
1140
1144
|
OxygenTheme,
|
|
1141
1145
|
AcrylicOrangeTheme,
|
|
1142
1146
|
AcrylicPurpleTheme,
|
|
1143
|
-
|
|
1147
|
+
ChoreoLabsTheme,
|
|
1144
1148
|
ClassicTheme,
|
|
1145
1149
|
HighContrastTheme,
|
|
1146
1150
|
PaleBaseTheme,
|
|
@@ -1155,7 +1159,7 @@ const themes = [
|
|
|
1155
1159
|
{ key: 'default', label: 'Default', theme: OxygenTheme },
|
|
1156
1160
|
{ key: 'orange', label: 'Acrylic Orange', theme: AcrylicOrangeTheme },
|
|
1157
1161
|
{ key: 'purple', label: 'Acrylic Purple', theme: AcrylicPurpleTheme },
|
|
1158
|
-
{ key: '
|
|
1162
|
+
{ key: 'choreoLabs', label: 'Choreo Labs', theme: ChoreoLabsTheme },
|
|
1159
1163
|
{ key: 'classic', label: 'Classic', theme: ClassicTheme },
|
|
1160
1164
|
{ key: 'highContrast', label: 'High Contrast', theme: HighContrastTheme },
|
|
1161
1165
|
{ key: 'paleBase', label: 'Pale Base', theme: PaleBaseTheme },
|
package/.ai/theming.md
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
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 | `
|
|
20
|
+
| Choreo Labs | `ChoreoLabsTheme` | Choreo Labs brand theme (Acrylic look with Choreo Labs colours and Sora font) |
|
|
21
21
|
| Classic | `ClassicTheme` | Standard flat design |
|
|
22
22
|
| High Contrast | `HighContrastTheme` | Accessibility-focused with high contrast colors |
|
|
23
23
|
| Pale Base | `PaleBaseTheme` | Minimal color palette for subtle interfaces |
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
OxygenTheme,
|
|
30
30
|
AcrylicOrangeTheme,
|
|
31
31
|
AcrylicPurpleTheme,
|
|
32
|
-
|
|
32
|
+
ChoreoLabsTheme,
|
|
33
33
|
ClassicTheme,
|
|
34
34
|
HighContrastTheme,
|
|
35
35
|
PaleBaseTheme,
|
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
OxygenTheme,
|
|
68
68
|
AcrylicOrangeTheme,
|
|
69
69
|
AcrylicPurpleTheme,
|
|
70
|
-
|
|
70
|
+
ChoreoLabsTheme,
|
|
71
71
|
ClassicTheme,
|
|
72
72
|
HighContrastTheme,
|
|
73
73
|
PaleBaseTheme,
|
|
@@ -80,7 +80,7 @@ import {
|
|
|
80
80
|
{ key: 'default', label: 'Default', theme: OxygenTheme },
|
|
81
81
|
{ key: 'orange', label: 'Acrylic Orange', theme: AcrylicOrangeTheme },
|
|
82
82
|
{ key: 'purple', label: 'Acrylic Purple', theme: AcrylicPurpleTheme },
|
|
83
|
-
{ key: '
|
|
83
|
+
{ key: 'choreoLabs', label: 'Choreo Labs', theme: ChoreoLabsTheme },
|
|
84
84
|
{ key: 'classic', label: 'Classic', theme: ClassicTheme },
|
|
85
85
|
{ key: 'highContrast', label: 'High Contrast', theme: HighContrastTheme },
|
|
86
86
|
{ key: 'paleBase', label: 'Pale Base', theme: PaleBaseTheme },
|
package/.claude/components.md
CHANGED
|
@@ -12,6 +12,7 @@ Complete API reference for custom Oxygen UI components. For MUI components, refe
|
|
|
12
12
|
- [Sidebar](#sidebar)
|
|
13
13
|
- [Footer](#footer)
|
|
14
14
|
- [UserMenu](#usermenu)
|
|
15
|
+
- [ContextSwitcher](#contextswitcher)
|
|
15
16
|
- [AppSwitcher](#appswitcher)
|
|
16
17
|
- [Form](#form)
|
|
17
18
|
- [FullScreenWizard](#fullscreenwizard)
|
|
@@ -894,6 +895,8 @@ import { SearchBar, SearchBarWithAdvancedFilter } from '@wso2/oxygen-ui';
|
|
|
894
895
|
| `value` | `string` | - | Search input value |
|
|
895
896
|
| `onChange` | `(value: string) => void` | - | Change handler |
|
|
896
897
|
| `placeholder` | `string` | `'Search...'` | Placeholder text |
|
|
898
|
+
| `width` | `'auto' \| 'standard'` | `'auto'` | `'standard'` sizes search to 400px, shrinking in narrower containers. Use it for list and grid page search |
|
|
899
|
+
| `fullWidth` | `boolean` | `false` | Stretches search across its container. Takes precedence over `width` |
|
|
897
900
|
|
|
898
901
|
### SearchBarWithAdvancedFilter Props
|
|
899
902
|
|
|
@@ -1241,6 +1244,116 @@ import { UserIcon, SettingsIcon, LogOutIcon } from '@wso2/oxygen-ui-icons-react'
|
|
|
1241
1244
|
</UserMenu>
|
|
1242
1245
|
```
|
|
1243
1246
|
|
|
1247
|
+
## ContextSwitcher
|
|
1248
|
+
|
|
1249
|
+
Shows where a person is in a product's hierarchy, such as organization, project, and component, and lets them choose another place in it. It belongs in `Header.Switchers`.
|
|
1250
|
+
|
|
1251
|
+
```tsx
|
|
1252
|
+
import { ContextSwitcher } from '@wso2/oxygen-ui';
|
|
1253
|
+
import type { ContextSwitcherValue } from '@wso2/oxygen-ui';
|
|
1254
|
+
```
|
|
1255
|
+
|
|
1256
|
+
### Compound component
|
|
1257
|
+
|
|
1258
|
+
- `ContextSwitcher.Level` — one named step in the hierarchy: a field, and the panel that picks its value
|
|
1259
|
+
- `ContextSwitcher.Group` — a labelled cluster of options inside a level's panel
|
|
1260
|
+
- `ContextSwitcher.Option` — one choice in a level's panel
|
|
1261
|
+
|
|
1262
|
+
The switcher is controlled. `value` maps each level `id` to the selected option `value`; a missing id is an empty level. The product routes from `onChange`.
|
|
1263
|
+
|
|
1264
|
+
Choosing a field opens its panel: a search box, then options and groups in the order they are written. Choosing an option opens the next level's panel. The same option keeps the levels under it; a different option clears them.
|
|
1265
|
+
|
|
1266
|
+
**Two variants:**
|
|
1267
|
+
|
|
1268
|
+
- **Chain** (default): the levels sit side by side with a slash between them. An empty level stays on screen as "Select project", in a quieter fill, and opens like any other level.
|
|
1269
|
+
- **Back** (`back`): only the current level is on screen, with Back in front of it in one bordered field. The current level is the deepest level with a selection, or the empty level whose options are open. Back clears the current level and steps up one level; the first level has no Back.
|
|
1270
|
+
|
|
1271
|
+
A name that does not fit ends in an ellipsis at 180px. Hovering it, focusing the field with the keyboard, or highlighting the option with the arrow keys shows the full text.
|
|
1272
|
+
|
|
1273
|
+
### ContextSwitcher Props
|
|
1274
|
+
|
|
1275
|
+
| Prop | Type | Default | Description |
|
|
1276
|
+
|------|------|---------|-------------|
|
|
1277
|
+
| `value` | `ContextSwitcherValue` | required | Selected option value for each level id (`Record<string, string>`) |
|
|
1278
|
+
| `onChange` | `(value: ContextSwitcherValue) => void` | required | Called with the next map when the selection changes |
|
|
1279
|
+
| `back` | `boolean` | `false` | Show only the current level, with Back in front of it |
|
|
1280
|
+
| `children` | `ReactNode` | required | `ContextSwitcher.Level` elements, in order |
|
|
1281
|
+
|
|
1282
|
+
Other `div` props and `ref` are forwarded to the root.
|
|
1283
|
+
|
|
1284
|
+
### ContextSwitcher.Level Props
|
|
1285
|
+
|
|
1286
|
+
| Prop | Type | Default | Description |
|
|
1287
|
+
|------|------|---------|-------------|
|
|
1288
|
+
| `id` | `string` | required | Key used in the `value` map |
|
|
1289
|
+
| `label` | `string` | required | Name shown on the field, such as `"Organization"` |
|
|
1290
|
+
| `loading` | `boolean` | `false` | The panel shows a progress indicator instead of the options |
|
|
1291
|
+
| `searchPlaceholder` | `string` | `'Search'` | Placeholder in the panel search box |
|
|
1292
|
+
| `searchLabel` | `string` | `` `Search ${label}` `` | Accessible name of the search box |
|
|
1293
|
+
| `noOptionsText` | `string` | `'No options'` | Shown when the level has no options |
|
|
1294
|
+
| `noMatchesText` | `string` | `'No matches'` | Shown when the search matches nothing |
|
|
1295
|
+
| `loadingLabel` | `string` | `` `Loading ${label}` `` | Accessible name of the progress indicator |
|
|
1296
|
+
| `promptText` | `string` | `` `Select ${label}` `` | Shown on the field while the level has no selection |
|
|
1297
|
+
| `backLabel` | `string` | `` `Go to the ${label} level` `` | Name of the Back control that returns to this level |
|
|
1298
|
+
| `children` | `ReactNode` | - | Options and groups, in the order they should appear |
|
|
1299
|
+
|
|
1300
|
+
### ContextSwitcher.Group Props
|
|
1301
|
+
|
|
1302
|
+
| Prop | Type | Default | Description |
|
|
1303
|
+
|------|------|---------|-------------|
|
|
1304
|
+
| `label` | `string` | required | Visible heading and accessible name of the group |
|
|
1305
|
+
| `children` | `ReactNode` | required | `ContextSwitcher.Option` elements |
|
|
1306
|
+
|
|
1307
|
+
The group is omitted when search filters out all of its options.
|
|
1308
|
+
|
|
1309
|
+
### ContextSwitcher.Option Props
|
|
1310
|
+
|
|
1311
|
+
| Prop | Type | Default | Description |
|
|
1312
|
+
|------|------|---------|-------------|
|
|
1313
|
+
| `value` | `string` | required | Value written into the `value` map when picked |
|
|
1314
|
+
| `disabled` | `boolean` | `false` | Shown, but cannot be picked |
|
|
1315
|
+
| `children` | `ReactNode` | required | Label; search filters this text |
|
|
1316
|
+
|
|
1317
|
+
### Type Exports
|
|
1318
|
+
|
|
1319
|
+
`ContextSwitcherProps`, `ContextSwitcherValue`, `ContextSwitcherLevelProps`, `ContextSwitcherGroupProps`, `ContextSwitcherOptionProps`
|
|
1320
|
+
|
|
1321
|
+
### Usage
|
|
1322
|
+
|
|
1323
|
+
```tsx
|
|
1324
|
+
import { ContextSwitcher, Header } from '@wso2/oxygen-ui';
|
|
1325
|
+
import type { ContextSwitcherValue } from '@wso2/oxygen-ui';
|
|
1326
|
+
|
|
1327
|
+
const [value, setValue] = useState<ContextSwitcherValue>({
|
|
1328
|
+
organization: 'wso2',
|
|
1329
|
+
project: 'finance-web',
|
|
1330
|
+
});
|
|
1331
|
+
|
|
1332
|
+
<Header.Switchers>
|
|
1333
|
+
<ContextSwitcher value={value} onChange={setValue}>
|
|
1334
|
+
<ContextSwitcher.Level id="organization" label="Organization">
|
|
1335
|
+
<ContextSwitcher.Option value="personal">Personal</ContextSwitcher.Option>
|
|
1336
|
+
<ContextSwitcher.Group label="Invited organizations">
|
|
1337
|
+
<ContextSwitcher.Option value="wso2">WSO2</ContextSwitcher.Option>
|
|
1338
|
+
<ContextSwitcher.Option value="demo">Demo Organization</ContextSwitcher.Option>
|
|
1339
|
+
</ContextSwitcher.Group>
|
|
1340
|
+
</ContextSwitcher.Level>
|
|
1341
|
+
<ContextSwitcher.Level id="project" label="Project" loading={projectsLoading}>
|
|
1342
|
+
{projects.map((project) => (
|
|
1343
|
+
<ContextSwitcher.Option key={project.id} value={project.id}>
|
|
1344
|
+
{project.name}
|
|
1345
|
+
</ContextSwitcher.Option>
|
|
1346
|
+
))}
|
|
1347
|
+
</ContextSwitcher.Level>
|
|
1348
|
+
</ContextSwitcher>
|
|
1349
|
+
</Header.Switchers>
|
|
1350
|
+
|
|
1351
|
+
// One level with Back
|
|
1352
|
+
<ContextSwitcher back value={value} onChange={setValue}>
|
|
1353
|
+
{/* same levels */}
|
|
1354
|
+
</ContextSwitcher>
|
|
1355
|
+
```
|
|
1356
|
+
|
|
1244
1357
|
## AppSwitcher
|
|
1245
1358
|
|
|
1246
1359
|
Popover for navigating between WSO2 Cloud platforms.
|
package/.claude/patterns.md
CHANGED
|
@@ -429,7 +429,7 @@ function DashboardCharts() {
|
|
|
429
429
|
|
|
430
430
|
```tsx
|
|
431
431
|
import { useState, useMemo } from 'react';
|
|
432
|
-
import { ListingTable, Button, IconButton, Chip } from '@wso2/oxygen-ui';
|
|
432
|
+
import { ListingTable, Button, IconButton, Chip, PageTitle } from '@wso2/oxygen-ui';
|
|
433
433
|
import { EditIcon, TrashIcon, MoreVerticalIcon } from '@wso2/oxygen-ui-icons-react';
|
|
434
434
|
|
|
435
435
|
interface User {
|
|
@@ -476,6 +476,14 @@ function UsersTable({ users }: { users: User[] }) {
|
|
|
476
476
|
);
|
|
477
477
|
|
|
478
478
|
return (
|
|
479
|
+
<>
|
|
480
|
+
{/* The primary action goes in the page header, not the table toolbar */}
|
|
481
|
+
<PageTitle>
|
|
482
|
+
<PageTitle.Header>Users</PageTitle.Header>
|
|
483
|
+
<PageTitle.Actions>
|
|
484
|
+
<Button variant="contained">Add user</Button>
|
|
485
|
+
</PageTitle.Actions>
|
|
486
|
+
</PageTitle>
|
|
479
487
|
<ListingTable.Provider
|
|
480
488
|
searchValue={search}
|
|
481
489
|
onSearchChange={setSearch}
|
|
@@ -495,11 +503,6 @@ function UsersTable({ users }: { users: User[] }) {
|
|
|
495
503
|
<ListingTable.Toolbar
|
|
496
504
|
showSearch
|
|
497
505
|
searchPlaceholder="Search users..."
|
|
498
|
-
actions={
|
|
499
|
-
<Button variant="contained" size="small">
|
|
500
|
-
Add User
|
|
501
|
-
</Button>
|
|
502
|
-
}
|
|
503
506
|
/>
|
|
504
507
|
|
|
505
508
|
<ListingTable>
|
|
@@ -554,6 +557,7 @@ function UsersTable({ users }: { users: User[] }) {
|
|
|
554
557
|
</ListingTable>
|
|
555
558
|
</ListingTable.Container>
|
|
556
559
|
</ListingTable.Provider>
|
|
560
|
+
</>
|
|
557
561
|
);
|
|
558
562
|
}
|
|
559
563
|
```
|
|
@@ -1140,7 +1144,7 @@ import {
|
|
|
1140
1144
|
OxygenTheme,
|
|
1141
1145
|
AcrylicOrangeTheme,
|
|
1142
1146
|
AcrylicPurpleTheme,
|
|
1143
|
-
|
|
1147
|
+
ChoreoLabsTheme,
|
|
1144
1148
|
ClassicTheme,
|
|
1145
1149
|
HighContrastTheme,
|
|
1146
1150
|
PaleBaseTheme,
|
|
@@ -1155,7 +1159,7 @@ const themes = [
|
|
|
1155
1159
|
{ key: 'default', label: 'Default', theme: OxygenTheme },
|
|
1156
1160
|
{ key: 'orange', label: 'Acrylic Orange', theme: AcrylicOrangeTheme },
|
|
1157
1161
|
{ key: 'purple', label: 'Acrylic Purple', theme: AcrylicPurpleTheme },
|
|
1158
|
-
{ key: '
|
|
1162
|
+
{ key: 'choreoLabs', label: 'Choreo Labs', theme: ChoreoLabsTheme },
|
|
1159
1163
|
{ key: 'classic', label: 'Classic', theme: ClassicTheme },
|
|
1160
1164
|
{ key: 'highContrast', label: 'High Contrast', theme: HighContrastTheme },
|
|
1161
1165
|
{ key: 'paleBase', label: 'Pale Base', theme: PaleBaseTheme },
|
|
@@ -53,7 +53,7 @@ Pick the table type by what users do with the data:
|
|
|
53
53
|
Every data table toolbar uses the same element order. Leave out elements a table doesn't need; never reorder the rest, except search and filters:
|
|
54
54
|
|
|
55
55
|
```text
|
|
56
|
-
[Scope] [Search] [Filters] ······ [View toggles] [Utility icons] [Secondary]
|
|
56
|
+
[Scope] [Search] [Filters] ······ [View toggles] [Utility icons] [Secondary]
|
|
57
57
|
[Applied filter chips] [Clear all]
|
|
58
58
|
```
|
|
59
59
|
|
|
@@ -67,11 +67,12 @@ Every data table toolbar uses the same element order. Leave out elements a table
|
|
|
67
67
|
- Scope control (time range, workspace, region) comes first; its label shows the value (`Time: Last 24 hours`); at most one per table; never shown as a chip
|
|
68
68
|
- Search is always visible; placeholder names what is searched (`Search by name`, `Search events`)
|
|
69
69
|
- Prefer column header filters; use toolbar filters only when no column matches; a filter lives in one place only; max 3 toolbar filters, the rest under `More filters`
|
|
70
|
-
- Right side order: view toggles (segmented control), utility icon buttons (export, column settings, refresh; refresh last), secondary actions (outlined or text, more than 2 go to an overflow menu)
|
|
70
|
+
- Right side order: view toggles (segmented control), utility icon buttons (export, column settings, refresh; refresh last), then secondary actions (outlined or text, more than 2 go to an overflow menu)
|
|
71
|
+
- The primary action (`Add user`) is not in the toolbar; put it in `PageTitle.Actions` at the top right of the page header, vertically centered with the title block (header and subheader)
|
|
71
72
|
- Applied filters show as `Label: value` chips in a row below the toolbar; show `Clear all` at 2+ chips (clears filters only, not scope or search); hide the row when empty
|
|
72
73
|
- Put the result count in the footer next to pagination (`1–25 of 120`, or `25 events loaded` without pagination), never in the toolbar
|
|
73
74
|
- When rows are selected, a bulk actions bar replaces the toolbar: count and `Select all` on the left, actions on the right with destructive ones last and confirmed
|
|
74
|
-
- On narrow screens collapse in order: secondary actions, toolbar filters (into `Filters · 2`), view toggles and utility icons (refresh stays); scope
|
|
75
|
+
- On narrow screens collapse in order: secondary actions, toolbar filters (into `Filters · 2`), view toggles and utility icons (refresh stays); scope and search never collapse
|
|
75
76
|
- Icon buttons always have a `Tooltip` and an `aria-label`
|
|
76
77
|
- Use one date format across tables (`28 Oct 2026, 04:29 UTC`) and always show the time zone
|
|
77
78
|
|
|
@@ -90,7 +91,6 @@ function UsersToolbar() {
|
|
|
90
91
|
<Tooltip title="Refresh">
|
|
91
92
|
<IconButton size="small" aria-label="Refresh"><RefreshCw size={18} /></IconButton>
|
|
92
93
|
</Tooltip>
|
|
93
|
-
<Button variant="contained">Add user</Button>
|
|
94
94
|
</>
|
|
95
95
|
}
|
|
96
96
|
>
|
package/.claude/theming.md
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
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 | `
|
|
20
|
+
| Choreo Labs | `ChoreoLabsTheme` | Choreo Labs brand theme (Acrylic look with Choreo Labs colours and Sora font) |
|
|
21
21
|
| Classic | `ClassicTheme` | Standard flat design |
|
|
22
22
|
| High Contrast | `HighContrastTheme` | Accessibility-focused with high contrast colors |
|
|
23
23
|
| Pale Base | `PaleBaseTheme` | Minimal color palette for subtle interfaces |
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
OxygenTheme,
|
|
30
30
|
AcrylicOrangeTheme,
|
|
31
31
|
AcrylicPurpleTheme,
|
|
32
|
-
|
|
32
|
+
ChoreoLabsTheme,
|
|
33
33
|
ClassicTheme,
|
|
34
34
|
HighContrastTheme,
|
|
35
35
|
PaleBaseTheme,
|
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
OxygenTheme,
|
|
68
68
|
AcrylicOrangeTheme,
|
|
69
69
|
AcrylicPurpleTheme,
|
|
70
|
-
|
|
70
|
+
ChoreoLabsTheme,
|
|
71
71
|
ClassicTheme,
|
|
72
72
|
HighContrastTheme,
|
|
73
73
|
PaleBaseTheme,
|
|
@@ -80,7 +80,7 @@ import {
|
|
|
80
80
|
{ key: 'default', label: 'Default', theme: OxygenTheme },
|
|
81
81
|
{ key: 'orange', label: 'Acrylic Orange', theme: AcrylicOrangeTheme },
|
|
82
82
|
{ key: 'purple', label: 'Acrylic Purple', theme: AcrylicPurpleTheme },
|
|
83
|
-
{ key: '
|
|
83
|
+
{ key: 'choreoLabs', label: 'Choreo Labs', theme: ChoreoLabsTheme },
|
|
84
84
|
{ key: 'classic', label: 'Classic', theme: ClassicTheme },
|
|
85
85
|
{ key: 'highContrast', label: 'High Contrast', theme: HighContrastTheme },
|
|
86
86
|
{ key: 'paleBase', label: 'Pale Base', theme: PaleBaseTheme },
|
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ yarn add @wso2/oxygen-ui @emotion/react @emotion/styled @mui/material
|
|
|
12
12
|
pnpm add @wso2/oxygen-ui @emotion/react @emotion/styled @mui/material
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
**Note:** The Inter Variable
|
|
15
|
+
**Note:** The Inter Variable and Sora Variable (used by `ChoreoLabsTheme`) fonts are automatically bundled and loaded when you import from `@wso2/oxygen-ui`. No additional setup required!
|
|
16
16
|
|
|
17
17
|
### Peer Dependencies
|
|
18
18
|
|
|
@@ -323,7 +323,7 @@ Content-Security-Policy:
|
|
|
323
323
|
|
|
324
324
|
- **`style-src-elem`** — Emotion injects `<style>` elements; each needs a matching nonce.
|
|
325
325
|
- **`style-src-attr 'unsafe-inline'`** — MUI components apply dynamic inline `style` attributes (dimensions, CSS custom properties, positioning). Nonces cannot cover style attributes.
|
|
326
|
-
- **`font-src 'self' data:`** — The bundled Inter
|
|
326
|
+
- **`font-src 'self' data:`** — The bundled Sora and Inter fonts are embedded as base64 `data:` URIs. Without `data:` in `font-src` (which otherwise falls back to `default-src 'self'`), the browser blocks the fonts even when the style tag itself is allowed.
|
|
327
327
|
- **`script-src 'nonce-...'`** — Only required if your app uses MUI's `InitColorSchemeScript`. Oxygen UI does not ship that script.
|
|
328
328
|
|
|
329
329
|
### Using the `nonce` prop
|
|
@@ -377,7 +377,7 @@ Generate a unique nonce per request on the server, include it in the CSP header,
|
|
|
377
377
|
|
|
378
378
|
### Bundled fonts and theme CSS
|
|
379
379
|
|
|
380
|
-
The bundled CSS — the Inter Variable font styles and the theme CSS — is injected as separate `<style>` tags when the package is imported (before React renders), so the nonce for those tags is resolved from well-known conventions instead of a prop:
|
|
380
|
+
The bundled CSS — the Sora and Inter Variable font styles and the theme CSS — is injected as separate `<style>` tags when the package is imported (before React renders), so the nonce for those tags is resolved from well-known conventions instead of a prop:
|
|
381
381
|
|
|
382
382
|
1. The `__webpack_nonce__` global ([webpack convention](https://webpack.js.org/guides/csp/))
|
|
383
383
|
2. A `<meta property="csp-nonce" nonce="...">` tag ([Vite convention](https://vite.dev/guide/features.html#content-security-policy-csp)); `content` is also accepted as a fallback
|
|
@@ -16,11 +16,20 @@
|
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
18
|
import type { SxProps, Theme } from '@mui/material';
|
|
19
|
-
import type { JSX } from 'react';
|
|
19
|
+
import type { JSX, ReactNode } from 'react';
|
|
20
20
|
export interface BreadcrumbItem {
|
|
21
21
|
key: string;
|
|
22
|
+
/**
|
|
23
|
+
* Text for page trails and for the overflow menu. When `field` is set, this
|
|
24
|
+
* string is not drawn in the trail.
|
|
25
|
+
*/
|
|
22
26
|
label: string;
|
|
23
27
|
onClick?: () => void;
|
|
28
|
+
/**
|
|
29
|
+
* When set, the trail renders this node instead of the string label. The
|
|
30
|
+
* string label still names the item in the overflow menu.
|
|
31
|
+
*/
|
|
32
|
+
field?: ReactNode;
|
|
24
33
|
}
|
|
25
34
|
export interface AppBreadcrumbsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
26
35
|
/**
|
|
@@ -32,12 +41,16 @@ export interface AppBreadcrumbsProps extends React.HTMLAttributes<HTMLDivElement
|
|
|
32
41
|
* @default 4
|
|
33
42
|
*/
|
|
34
43
|
maxItems?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Separator between items. Defaults to a chevron.
|
|
46
|
+
*/
|
|
47
|
+
separator?: ReactNode;
|
|
35
48
|
/**
|
|
36
49
|
* The sx prop for styling with Material-UI system.
|
|
37
50
|
*/
|
|
38
51
|
sx?: SxProps<Theme>;
|
|
39
52
|
}
|
|
40
|
-
declare function AppBreadcrumbs({ items, maxItems, sx, ...props }: AppBreadcrumbsProps): JSX.Element;
|
|
53
|
+
declare function AppBreadcrumbs({ items, maxItems, separator, sx, ...props }: AppBreadcrumbsProps): JSX.Element;
|
|
41
54
|
declare namespace AppBreadcrumbs {
|
|
42
55
|
var displayName: string;
|
|
43
56
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
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 ContextSwitcherValue } from './context';
|
|
20
|
+
import { ContextSwitcherLevel } from './ContextSwitcherLevel';
|
|
21
|
+
import { ContextSwitcherGroup } from './ContextSwitcherGroup';
|
|
22
|
+
import { ContextSwitcherOption } from './ContextSwitcherOption';
|
|
23
|
+
/**
|
|
24
|
+
* Props for the context switcher.
|
|
25
|
+
*/
|
|
26
|
+
export interface ContextSwitcherProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'onChange' | 'children'> {
|
|
27
|
+
/** Selected option value for each level id. A missing id means that level is empty. */
|
|
28
|
+
value: ContextSwitcherValue;
|
|
29
|
+
/** Called with the next map when the selection changes. */
|
|
30
|
+
onChange: (value: ContextSwitcherValue) => void;
|
|
31
|
+
/**
|
|
32
|
+
* Join Back to the current level and keep the other levels on screen. The current
|
|
33
|
+
* level is the deepest level with a selection, or the empty level whose options are
|
|
34
|
+
* open. Back clears that level. An empty level is on screen only while its list is
|
|
35
|
+
* open. Off by default, which shows the chain and the next empty level.
|
|
36
|
+
*/
|
|
37
|
+
back?: boolean;
|
|
38
|
+
/** Levels, in order. */
|
|
39
|
+
children: React.ReactNode;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* ContextSwitcher - A chain of labeled fields for selecting through a hierarchy.
|
|
43
|
+
*
|
|
44
|
+
* Each visible level is a ComplexSelect in an AppBreadcrumbs trail separated by a
|
|
45
|
+
* slash. With Back, that trail stays on screen and Back is joined to the current
|
|
46
|
+
* level. Choosing an option opens the next level's list. The same option keeps the
|
|
47
|
+
* levels under it. A different option clears them. The product places the switcher,
|
|
48
|
+
* usually in `Header.Switchers`, and routes from `onChange`.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```tsx
|
|
52
|
+
* <Header.Switchers>
|
|
53
|
+
* <ContextSwitcher value={value} onChange={setValue}>
|
|
54
|
+
* <ContextSwitcher.Level id="organization" label="Organization">
|
|
55
|
+
* <ContextSwitcher.Option value="wso2">WSO2</ContextSwitcher.Option>
|
|
56
|
+
* </ContextSwitcher.Level>
|
|
57
|
+
* <ContextSwitcher.Level id="project" label="Project">
|
|
58
|
+
* <ContextSwitcher.Option value="finance-web">Finance Web</ContextSwitcher.Option>
|
|
59
|
+
* </ContextSwitcher.Level>
|
|
60
|
+
* </ContextSwitcher>
|
|
61
|
+
* </Header.Switchers>
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export declare const ContextSwitcher: React.ForwardRefExoticComponent<ContextSwitcherProps & React.RefAttributes<HTMLDivElement>> & {
|
|
65
|
+
Level: typeof ContextSwitcherLevel;
|
|
66
|
+
Group: typeof ContextSwitcherGroup;
|
|
67
|
+
Option: typeof ContextSwitcherOption;
|
|
68
|
+
};
|
|
69
|
+
export default ContextSwitcher;
|