@wso2/oxygen-ui 0.17.0 → 0.19.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 +219 -0
- package/.claude/components.md +219 -0
- package/.claude/skills/oxygen-component/SKILL.md +86 -0
- package/.claude/skills/oxygen-form/SKILL.md +8 -0
- package/.claude/skills/oxygen-layout/SKILL.md +1 -0
- package/dist/components/DrawerPanel/DrawerPanel.d.ts +98 -0
- package/dist/components/DrawerPanel/DrawerPanelActions.d.ts +44 -0
- package/dist/components/DrawerPanel/DrawerPanelBody.d.ts +42 -0
- package/dist/components/DrawerPanel/DrawerPanelCloseButton.d.ts +44 -0
- package/dist/components/DrawerPanel/DrawerPanelExpandButton.d.ts +46 -0
- package/dist/components/DrawerPanel/DrawerPanelFooter.d.ts +41 -0
- package/dist/components/DrawerPanel/DrawerPanelHeader.d.ts +44 -0
- package/dist/components/DrawerPanel/DrawerPanelTitle.d.ts +45 -0
- package/dist/components/DrawerPanel/context.d.ts +42 -0
- package/dist/components/DrawerPanel/index.d.ts +35 -0
- package/dist/components/FullScreenWizard/FullScreenWizard.d.ts +85 -0
- package/dist/components/FullScreenWizard/FullScreenWizardContent.d.ts +70 -0
- package/dist/components/FullScreenWizard/FullScreenWizardFooter.d.ts +59 -0
- package/dist/components/FullScreenWizard/FullScreenWizardHeader.d.ts +59 -0
- package/dist/components/FullScreenWizard/FullScreenWizardPreview.d.ts +61 -0
- package/dist/components/FullScreenWizard/FullScreenWizardProgress.d.ts +61 -0
- package/dist/components/FullScreenWizard/context.d.ts +71 -0
- package/dist/components/FullScreenWizard/index.d.ts +33 -0
- package/dist/components/FullScreenWizard/useWizardSteps.d.ts +85 -0
- package/dist/components/ListingCard/ListingCard.d.ts +92 -0
- package/dist/components/ListingCard/index.d.ts +2 -0
- package/dist/components/LogViewer/LogFilterChip.d.ts +31 -0
- package/dist/components/LogViewer/LogLevelMarker.d.ts +16 -0
- package/dist/components/LogViewer/LogViewer.d.ts +178 -0
- package/dist/components/LogViewer/LogViewerControls.d.ts +121 -0
- package/dist/components/LogViewer/LogViewerDetails.d.ts +11 -0
- package/dist/components/LogViewer/LogViewerSearch.d.ts +42 -0
- package/dist/components/LogViewer/LogViewerStream.d.ts +132 -0
- package/dist/components/LogViewer/LogViewerToolbar.d.ts +56 -0
- package/dist/components/LogViewer/columns.d.ts +17 -0
- package/dist/components/LogViewer/context.d.ts +81 -0
- package/dist/components/LogViewer/download.d.ts +14 -0
- package/dist/components/LogViewer/filters.d.ts +11 -0
- package/dist/components/LogViewer/index.d.ts +8 -0
- package/dist/components/LogViewer/timestamps.d.ts +26 -0
- package/dist/components/LogViewer/types.d.ts +163 -0
- package/dist/components/Sidebar/Sidebar.d.ts +2 -0
- package/dist/components/Sidebar/SidebarCollapseToggle.d.ts +50 -0
- package/dist/components/Sidebar/index.d.ts +2 -0
- package/dist/components/TextField/TextField.d.ts +28 -0
- package/dist/components/TextField/index.d.ts +2 -0
- package/dist/components/TrialBadge/TrialBadge.d.ts +192 -0
- package/dist/components/TrialBadge/index.d.ts +2 -0
- package/dist/components/index.d.ts +13 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6612 -3133
- package/dist/index.js.map +4 -4
- package/dist/styles/OxygenThemeBase.d.ts +12 -0
- package/package.json +2 -2
package/.ai/AGENTS.md
CHANGED
|
@@ -65,9 +65,10 @@ import { DataGrid, DatePickers, TreeView } from '@wso2/oxygen-ui';
|
|
|
65
65
|
|
|
66
66
|
- **Layout**: `AppShell`, `Layout`, `Header`, `Sidebar`, `Footer`, `PageContent`
|
|
67
67
|
- **Data Display**: `ListingTable`, `PageTitle`, `CodeBlock`, `StatCard`
|
|
68
|
-
- **Forms**: `Form.CardButton`, `Form.Section`, `Form.Stack`, `Form.Wizard`
|
|
68
|
+
- **Forms**: `Form.CardButton`, `Form.Section`, `Form.Stack`, `Form.Wizard`, `FullScreenWizard`
|
|
69
69
|
- **Inputs**: `SearchBar`, `SearchBarWithAdvancedFilter`, `ComplexSelect`
|
|
70
70
|
- **Feedback**: `NotificationPanel`, `NotificationBanner`
|
|
71
|
+
- **Panels**: `DrawerPanel`
|
|
71
72
|
- **Theming**: `OxygenUIThemeProvider`, `ThemeSwitcher`, `ColorSchemeToggle`, `ColorSchemeImage`
|
|
72
73
|
- **User**: `UserMenu`
|
|
73
74
|
- **Animations**: `ParticleBackground`
|
package/.ai/components.md
CHANGED
|
@@ -14,6 +14,8 @@ Complete API reference for custom Oxygen UI components. For MUI components, refe
|
|
|
14
14
|
- [UserMenu](#usermenu)
|
|
15
15
|
- [AppSwitcher](#appswitcher)
|
|
16
16
|
- [Form](#form)
|
|
17
|
+
- [FullScreenWizard](#fullscreenwizard)
|
|
18
|
+
- [DrawerPanel](#drawerpanel)
|
|
17
19
|
- [NotificationPanel](#notificationpanel)
|
|
18
20
|
- [NotificationBanner](#notificationbanner)
|
|
19
21
|
- [ParticleBackground](#particlebackground)
|
|
@@ -554,6 +556,223 @@ interface WizardProps {
|
|
|
554
556
|
|
|
555
557
|
---
|
|
556
558
|
|
|
559
|
+
## FullScreenWizard
|
|
560
|
+
|
|
561
|
+
Full-screen layout for create and onboarding flows: a progress bar, a header with a close button,
|
|
562
|
+
a scrolling content column with an actions footer, and an optional live preview beside the form.
|
|
563
|
+
|
|
564
|
+
```tsx
|
|
565
|
+
import { FullScreenWizard, useWizardSteps } from '@wso2/oxygen-ui';
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
### Compound component
|
|
569
|
+
|
|
570
|
+
- `FullScreenWizard.Progress` — determinate progress bar or segments; leave it out for a single-step form
|
|
571
|
+
- `FullScreenWizard.Header` — `<header>` with the built-in close button, then breadcrumbs or a title
|
|
572
|
+
- `FullScreenWizard.Content` — scroll region holding the active step; `<main>` in page mode
|
|
573
|
+
- `FullScreenWizard.Footer` — actions row, under the step in the content column or as a full-width bar
|
|
574
|
+
- `FullScreenWizard.Preview` — `<aside>` side panel (live preview, step rail, tips); adding it switches to a split layout
|
|
575
|
+
|
|
576
|
+
The wizard is stateless: the consumer owns the steps, or uses `useWizardSteps`. It has no routing
|
|
577
|
+
and no product logic, so confirming a close or warning about unsaved changes happens in `onClose`.
|
|
578
|
+
Use it for flows that take over the screen; use `Form.Wizard` for a stepper inside a page, and a
|
|
579
|
+
regular `Dialog` for a short task that keeps the page in view.
|
|
580
|
+
|
|
581
|
+
### FullScreenWizard Props
|
|
582
|
+
|
|
583
|
+
| Prop | Type | Default | Description |
|
|
584
|
+
|------|------|---------|-------------|
|
|
585
|
+
| `children` | `ReactNode` | required | Progress, Header, Content, Footer and an optional Preview |
|
|
586
|
+
| `onClose` | `() => void` | - | Called by the close button and, in modal mode, by `Esc`. No close button without it |
|
|
587
|
+
| `closeLabel` | `string` | `'Close'` | Accessible name of the close button |
|
|
588
|
+
| `modal` | `boolean` | `false` | Renders the wizard in MUI's full-screen `Dialog` |
|
|
589
|
+
| `open` | `boolean` | `false` | Whether the dialog is open (modal only) |
|
|
590
|
+
| `DialogProps` | `Partial<DialogProps>` | - | Extra props for the `Dialog` (modal only) |
|
|
591
|
+
| `aria-label` | `string` | - | Names the dialog in modal mode, the `main` region in page mode |
|
|
592
|
+
| `aria-labelledby` | `string` | - | Id of the element naming the wizard; wins over `aria-label` |
|
|
593
|
+
| `sx` | `SxProps<Theme>` | - | Additional styles for the root |
|
|
594
|
+
|
|
595
|
+
The root forwards its `ref` and passes other attributes (`id`, `className`, `data-*`) to its element.
|
|
596
|
+
Page mode fills `100dvh`. Every part forwards its `ref` and accepts `sx` and its element's attributes,
|
|
597
|
+
and the theme can restyle each slot through `components.MuiFullScreenWizard.styleOverrides`.
|
|
598
|
+
|
|
599
|
+
Parts are found by `displayName` among the wizard's children and inside fragments. A product
|
|
600
|
+
component that wraps a part must set the same `displayName` (for example
|
|
601
|
+
`'FullScreenWizard.Footer'`) and pass props such as `variant` or `position` through. Use one `Content`.
|
|
602
|
+
|
|
603
|
+
### FullScreenWizard.Progress Props
|
|
604
|
+
|
|
605
|
+
| Prop | Type | Default | Description |
|
|
606
|
+
|------|------|---------|-------------|
|
|
607
|
+
| `value` | `number` | required | Progress from 0 to 100; clamped |
|
|
608
|
+
| `valueText` | `string` | - | Read in place of the percentage, e.g. `"Step 2 of 3"` |
|
|
609
|
+
| `progressLabel` | `string` | `'Progress'` | Accessible name of the bar |
|
|
610
|
+
| `variant` | `'bar' \| 'segmented'` | `'bar'` | `bar` is a thin full-width bar; `segmented` shows one segment per step, inset to line up with the header |
|
|
611
|
+
| `steps` | `number` | - | Number of segments in the `segmented` variant |
|
|
612
|
+
|
|
613
|
+
Other `LinearProgress` props are forwarded in the `bar` variant.
|
|
614
|
+
|
|
615
|
+
### FullScreenWizard.Header Props
|
|
616
|
+
|
|
617
|
+
| Prop | Type | Default | Description |
|
|
618
|
+
|------|------|---------|-------------|
|
|
619
|
+
| `children` | `ReactNode` | - | Breadcrumbs, a title or a stepper, shown beside the close button |
|
|
620
|
+
| `closePosition` | `'start' \| 'end'` | `'start'` | Side of the header the close button sits on |
|
|
621
|
+
| `closeIcon` | `ReactNode` | `<X size={20} />` | Icon of the close button |
|
|
622
|
+
| `CloseButtonProps` | `Partial<IconButtonProps>` | - | Extra props for the close button (`size`, `color`, `sx`); its name and handler come from the wizard |
|
|
623
|
+
| `sx` | `SxProps<Theme>` | - | Additional styles |
|
|
624
|
+
|
|
625
|
+
### FullScreenWizard.Content Props
|
|
626
|
+
|
|
627
|
+
| Prop | Type | Default | Description |
|
|
628
|
+
|------|------|---------|-------------|
|
|
629
|
+
| `component` | `ElementType` | `'main'` (page), `'div'` (modal) | Element the region renders as; `'div'` when the page already has a `main`, such as an `AppShell` |
|
|
630
|
+
| `maxWidth` | `Breakpoint \| number \| false` | `'md'` | Width cap of the content column; `xs` is at least 444px, as in `Container`; `false` fills the width |
|
|
631
|
+
| `align` | `'start' \| 'center'` | `'start'` | `start` keeps the column left-aligned; `center` centres it in both directions, for a welcome or picker screen |
|
|
632
|
+
| `focusKey` | `string \| number` | - | When it changes, focus moves to the region and it scrolls to the top |
|
|
633
|
+
| `sx` | `SxProps<Theme>` | - | Additional styles |
|
|
634
|
+
|
|
635
|
+
Content forwards its `ref`. It is a plain region inside the dialog in modal mode.
|
|
636
|
+
|
|
637
|
+
### FullScreenWizard.Footer Props
|
|
638
|
+
|
|
639
|
+
| Prop | Type | Default | Description |
|
|
640
|
+
|------|------|---------|-------------|
|
|
641
|
+
| `sticky` | `boolean` | `false` | Pins the footer to the bottom of the scroll region for long forms |
|
|
642
|
+
| `variant` | `'inline' \| 'bar'` | `'inline'` | `inline` sits under the step in the content column; `bar` is a full-width bar along the bottom of the form column, outside the scroll |
|
|
643
|
+
| `sx` | `SxProps<Theme>` | - | Additional styles |
|
|
644
|
+
|
|
645
|
+
Actions are end-aligned; push a Back button to the start with `sx={{ mr: 'auto' }}`.
|
|
646
|
+
|
|
647
|
+
### FullScreenWizard.Preview Props
|
|
648
|
+
|
|
649
|
+
| Prop | Type | Default | Description |
|
|
650
|
+
|------|------|---------|-------------|
|
|
651
|
+
| `hideBelow` | `Breakpoint \| false` | `'md'` | Hides the preview below this breakpoint; `false` always shows it |
|
|
652
|
+
| `position` | `'start' \| 'end'` | `'end'` | Side of the form the panel sits on; with a narrower `flexBasis` in `sx`, `start` makes a step rail |
|
|
653
|
+
| `previewLabel` | `string` | `'Preview'` | Accessible name of the `aside` |
|
|
654
|
+
| `sx` | `SxProps<Theme>` | - | Additional styles |
|
|
655
|
+
|
|
656
|
+
### useWizardSteps
|
|
657
|
+
|
|
658
|
+
```tsx
|
|
659
|
+
const wizard = useWizardSteps(['details', { id: 'access', skip: !needsAccess }, 'review'], {
|
|
660
|
+
initialStep: 'details',
|
|
661
|
+
});
|
|
662
|
+
// { activeStep, activeIndex, steps, count, isFirst, isLast, next, back, goTo, progress }
|
|
663
|
+
```
|
|
664
|
+
|
|
665
|
+
Skipped steps are left out of navigation, `count` and `progress`. `next` and `back` clamp at the
|
|
666
|
+
ends, `goTo` ignores unknown and skipped ids, and if the active step becomes skipped the wizard
|
|
667
|
+
moves to the next visible step (or the previous one at the end). `progress` is
|
|
668
|
+
`(activeIndex + 1) / count * 100`.
|
|
669
|
+
|
|
670
|
+
### Usage
|
|
671
|
+
|
|
672
|
+
```tsx
|
|
673
|
+
import { AppBreadcrumbs, Button, FullScreenWizard, useWizardSteps } from '@wso2/oxygen-ui';
|
|
674
|
+
|
|
675
|
+
const wizard = useWizardSteps(['details', 'access', 'review']);
|
|
676
|
+
|
|
677
|
+
<FullScreenWizard onClose={handleClose} aria-label="Create project">
|
|
678
|
+
<FullScreenWizard.Progress
|
|
679
|
+
value={wizard.progress}
|
|
680
|
+
valueText={`Step ${wizard.activeIndex + 1} of ${wizard.count}`}
|
|
681
|
+
/>
|
|
682
|
+
<FullScreenWizard.Header>
|
|
683
|
+
<AppBreadcrumbs items={breadcrumbs} />
|
|
684
|
+
</FullScreenWizard.Header>
|
|
685
|
+
<FullScreenWizard.Content focusKey={wizard.activeStep}>
|
|
686
|
+
{wizard.activeStep && stepContent[wizard.activeStep]}
|
|
687
|
+
</FullScreenWizard.Content>
|
|
688
|
+
<FullScreenWizard.Footer>
|
|
689
|
+
{!wizard.isFirst && (
|
|
690
|
+
<Button variant="outlined" onClick={wizard.back} sx={{ mr: 'auto' }}>Back</Button>
|
|
691
|
+
)}
|
|
692
|
+
<Button variant="contained" onClick={wizard.isLast ? handleCreate : wizard.next}>
|
|
693
|
+
{wizard.isLast ? 'Create' : 'Continue'}
|
|
694
|
+
</Button>
|
|
695
|
+
</FullScreenWizard.Footer>
|
|
696
|
+
<FullScreenWizard.Preview>{preview}</FullScreenWizard.Preview>
|
|
697
|
+
</FullScreenWizard>
|
|
698
|
+
```
|
|
699
|
+
|
|
700
|
+
### Keyboard & Accessibility
|
|
701
|
+
|
|
702
|
+
| Key | Behavior |
|
|
703
|
+
| --- | --- |
|
|
704
|
+
| `Tab` | Moves through the close button, the step's fields and the footer actions |
|
|
705
|
+
| `Enter` / `Space` | Activates the focused button |
|
|
706
|
+
| `Esc` | Calls `onClose` in modal mode |
|
|
707
|
+
|
|
708
|
+
- Landmarks: `header`, `main` (page mode, named by `aria-label`) and `aside` for the preview. Inside a page that already has a `main`, pass `component="div"` to Content.
|
|
709
|
+
- The close button is named (`closeLabel`); the progress bar has a label and `aria-valuetext`.
|
|
710
|
+
- Changing `focusKey` moves focus to the new step, so screen readers start there.
|
|
711
|
+
- Modal mode traps focus, locks page scroll, and names the dialog by `aria-label` or `aria-labelledby`.
|
|
712
|
+
|
|
713
|
+
---
|
|
714
|
+
|
|
715
|
+
## DrawerPanel
|
|
716
|
+
|
|
717
|
+
Slide-out side panel for item details or secondary tasks, with a title, optional expand button and close button.
|
|
718
|
+
|
|
719
|
+
```tsx
|
|
720
|
+
import { DrawerPanel } from '@wso2/oxygen-ui';
|
|
721
|
+
```
|
|
722
|
+
|
|
723
|
+
### Sub-components
|
|
724
|
+
|
|
725
|
+
| Component | Description |
|
|
726
|
+
|-----------|-------------|
|
|
727
|
+
| `DrawerPanel.Header` | Top row with the title and action buttons only |
|
|
728
|
+
| `DrawerPanel.Title` | Panel heading with optional `icon`; names the drawer |
|
|
729
|
+
| `DrawerPanel.Actions` | Right-aligned header actions |
|
|
730
|
+
| `DrawerPanel.ExpandButton` | Toggles between `width` and `expandedWidth` (hidden on mobile) |
|
|
731
|
+
| `DrawerPanel.CloseButton` | Calls `onClose` (or its own `onClick`) |
|
|
732
|
+
| `DrawerPanel.Body` | Scrollable main content |
|
|
733
|
+
| `DrawerPanel.Footer` | Sticky footer for panel actions |
|
|
734
|
+
|
|
735
|
+
### Props
|
|
736
|
+
|
|
737
|
+
| Prop | Type | Default | Description |
|
|
738
|
+
|------|------|---------|-------------|
|
|
739
|
+
| `open` | `boolean` | required | Panel visibility |
|
|
740
|
+
| `onClose` | `() => void` | required | Close handler |
|
|
741
|
+
| `width` | `number \| string` | `560` | Width on sm+ screens |
|
|
742
|
+
| `expandedWidth` | `number \| string` | `'100%'` | Width on sm+ screens while expanded |
|
|
743
|
+
| `expanded` | `boolean` | - | Controlled expanded state |
|
|
744
|
+
| `defaultExpanded` | `boolean` | `false` | Initial expanded state when uncontrolled |
|
|
745
|
+
| `onExpandedChange` | `(expanded: boolean) => void` | - | Called when the expand button toggles |
|
|
746
|
+
| `anchor` | `'left' \| 'right'` | `'right'` | Drawer side |
|
|
747
|
+
| `variant` | `'temporary' \| 'persistent'` | `'temporary'` | Drawer variant |
|
|
748
|
+
| `aria-label` | `string` | - | Accessible name when there is no `DrawerPanel.Title` |
|
|
749
|
+
|
|
750
|
+
### Usage
|
|
751
|
+
|
|
752
|
+
```tsx
|
|
753
|
+
<DrawerPanel open={open} onClose={() => setOpen(false)}>
|
|
754
|
+
<DrawerPanel.Header>
|
|
755
|
+
<DrawerPanel.Title icon={<ListTree size={20} />}>Build details</DrawerPanel.Title>
|
|
756
|
+
<DrawerPanel.Actions>
|
|
757
|
+
<DrawerPanel.ExpandButton />
|
|
758
|
+
<DrawerPanel.CloseButton />
|
|
759
|
+
</DrawerPanel.Actions>
|
|
760
|
+
</DrawerPanel.Header>
|
|
761
|
+
<DrawerPanel.Body>
|
|
762
|
+
<RelativeTime action="Triggered" time="about 1 hour ago" />
|
|
763
|
+
{/* content */}
|
|
764
|
+
</DrawerPanel.Body>
|
|
765
|
+
<DrawerPanel.Footer>
|
|
766
|
+
<Button variant="contained">Rerun build</Button>
|
|
767
|
+
</DrawerPanel.Footer>
|
|
768
|
+
</DrawerPanel>
|
|
769
|
+
```
|
|
770
|
+
|
|
771
|
+
- Keep `CloseButton` rightmost; put extra icon actions (with `Tooltip` and `aria-label`) before `ExpandButton`
|
|
772
|
+
- Add `ExpandButton` only when content benefits from more room (logs, tables, diffs)
|
|
773
|
+
|
|
774
|
+
---
|
|
775
|
+
|
|
557
776
|
## NotificationPanel
|
|
558
777
|
|
|
559
778
|
Slide-out notification panel with tabs and compound component pattern.
|
package/.claude/components.md
CHANGED
|
@@ -14,6 +14,8 @@ Complete API reference for custom Oxygen UI components. For MUI components, refe
|
|
|
14
14
|
- [UserMenu](#usermenu)
|
|
15
15
|
- [AppSwitcher](#appswitcher)
|
|
16
16
|
- [Form](#form)
|
|
17
|
+
- [FullScreenWizard](#fullscreenwizard)
|
|
18
|
+
- [DrawerPanel](#drawerpanel)
|
|
17
19
|
- [NotificationPanel](#notificationpanel)
|
|
18
20
|
- [NotificationBanner](#notificationbanner)
|
|
19
21
|
- [ParticleBackground](#particlebackground)
|
|
@@ -554,6 +556,223 @@ interface WizardProps {
|
|
|
554
556
|
|
|
555
557
|
---
|
|
556
558
|
|
|
559
|
+
## FullScreenWizard
|
|
560
|
+
|
|
561
|
+
Full-screen layout for create and onboarding flows: a progress bar, a header with a close button,
|
|
562
|
+
a scrolling content column with an actions footer, and an optional live preview beside the form.
|
|
563
|
+
|
|
564
|
+
```tsx
|
|
565
|
+
import { FullScreenWizard, useWizardSteps } from '@wso2/oxygen-ui';
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
### Compound component
|
|
569
|
+
|
|
570
|
+
- `FullScreenWizard.Progress` — determinate progress bar or segments; leave it out for a single-step form
|
|
571
|
+
- `FullScreenWizard.Header` — `<header>` with the built-in close button, then breadcrumbs or a title
|
|
572
|
+
- `FullScreenWizard.Content` — scroll region holding the active step; `<main>` in page mode
|
|
573
|
+
- `FullScreenWizard.Footer` — actions row, under the step in the content column or as a full-width bar
|
|
574
|
+
- `FullScreenWizard.Preview` — `<aside>` side panel (live preview, step rail, tips); adding it switches to a split layout
|
|
575
|
+
|
|
576
|
+
The wizard is stateless: the consumer owns the steps, or uses `useWizardSteps`. It has no routing
|
|
577
|
+
and no product logic, so confirming a close or warning about unsaved changes happens in `onClose`.
|
|
578
|
+
Use it for flows that take over the screen; use `Form.Wizard` for a stepper inside a page, and a
|
|
579
|
+
regular `Dialog` for a short task that keeps the page in view.
|
|
580
|
+
|
|
581
|
+
### FullScreenWizard Props
|
|
582
|
+
|
|
583
|
+
| Prop | Type | Default | Description |
|
|
584
|
+
|------|------|---------|-------------|
|
|
585
|
+
| `children` | `ReactNode` | required | Progress, Header, Content, Footer and an optional Preview |
|
|
586
|
+
| `onClose` | `() => void` | - | Called by the close button and, in modal mode, by `Esc`. No close button without it |
|
|
587
|
+
| `closeLabel` | `string` | `'Close'` | Accessible name of the close button |
|
|
588
|
+
| `modal` | `boolean` | `false` | Renders the wizard in MUI's full-screen `Dialog` |
|
|
589
|
+
| `open` | `boolean` | `false` | Whether the dialog is open (modal only) |
|
|
590
|
+
| `DialogProps` | `Partial<DialogProps>` | - | Extra props for the `Dialog` (modal only) |
|
|
591
|
+
| `aria-label` | `string` | - | Names the dialog in modal mode, the `main` region in page mode |
|
|
592
|
+
| `aria-labelledby` | `string` | - | Id of the element naming the wizard; wins over `aria-label` |
|
|
593
|
+
| `sx` | `SxProps<Theme>` | - | Additional styles for the root |
|
|
594
|
+
|
|
595
|
+
The root forwards its `ref` and passes other attributes (`id`, `className`, `data-*`) to its element.
|
|
596
|
+
Page mode fills `100dvh`. Every part forwards its `ref` and accepts `sx` and its element's attributes,
|
|
597
|
+
and the theme can restyle each slot through `components.MuiFullScreenWizard.styleOverrides`.
|
|
598
|
+
|
|
599
|
+
Parts are found by `displayName` among the wizard's children and inside fragments. A product
|
|
600
|
+
component that wraps a part must set the same `displayName` (for example
|
|
601
|
+
`'FullScreenWizard.Footer'`) and pass props such as `variant` or `position` through. Use one `Content`.
|
|
602
|
+
|
|
603
|
+
### FullScreenWizard.Progress Props
|
|
604
|
+
|
|
605
|
+
| Prop | Type | Default | Description |
|
|
606
|
+
|------|------|---------|-------------|
|
|
607
|
+
| `value` | `number` | required | Progress from 0 to 100; clamped |
|
|
608
|
+
| `valueText` | `string` | - | Read in place of the percentage, e.g. `"Step 2 of 3"` |
|
|
609
|
+
| `progressLabel` | `string` | `'Progress'` | Accessible name of the bar |
|
|
610
|
+
| `variant` | `'bar' \| 'segmented'` | `'bar'` | `bar` is a thin full-width bar; `segmented` shows one segment per step, inset to line up with the header |
|
|
611
|
+
| `steps` | `number` | - | Number of segments in the `segmented` variant |
|
|
612
|
+
|
|
613
|
+
Other `LinearProgress` props are forwarded in the `bar` variant.
|
|
614
|
+
|
|
615
|
+
### FullScreenWizard.Header Props
|
|
616
|
+
|
|
617
|
+
| Prop | Type | Default | Description |
|
|
618
|
+
|------|------|---------|-------------|
|
|
619
|
+
| `children` | `ReactNode` | - | Breadcrumbs, a title or a stepper, shown beside the close button |
|
|
620
|
+
| `closePosition` | `'start' \| 'end'` | `'start'` | Side of the header the close button sits on |
|
|
621
|
+
| `closeIcon` | `ReactNode` | `<X size={20} />` | Icon of the close button |
|
|
622
|
+
| `CloseButtonProps` | `Partial<IconButtonProps>` | - | Extra props for the close button (`size`, `color`, `sx`); its name and handler come from the wizard |
|
|
623
|
+
| `sx` | `SxProps<Theme>` | - | Additional styles |
|
|
624
|
+
|
|
625
|
+
### FullScreenWizard.Content Props
|
|
626
|
+
|
|
627
|
+
| Prop | Type | Default | Description |
|
|
628
|
+
|------|------|---------|-------------|
|
|
629
|
+
| `component` | `ElementType` | `'main'` (page), `'div'` (modal) | Element the region renders as; `'div'` when the page already has a `main`, such as an `AppShell` |
|
|
630
|
+
| `maxWidth` | `Breakpoint \| number \| false` | `'md'` | Width cap of the content column; `xs` is at least 444px, as in `Container`; `false` fills the width |
|
|
631
|
+
| `align` | `'start' \| 'center'` | `'start'` | `start` keeps the column left-aligned; `center` centres it in both directions, for a welcome or picker screen |
|
|
632
|
+
| `focusKey` | `string \| number` | - | When it changes, focus moves to the region and it scrolls to the top |
|
|
633
|
+
| `sx` | `SxProps<Theme>` | - | Additional styles |
|
|
634
|
+
|
|
635
|
+
Content forwards its `ref`. It is a plain region inside the dialog in modal mode.
|
|
636
|
+
|
|
637
|
+
### FullScreenWizard.Footer Props
|
|
638
|
+
|
|
639
|
+
| Prop | Type | Default | Description |
|
|
640
|
+
|------|------|---------|-------------|
|
|
641
|
+
| `sticky` | `boolean` | `false` | Pins the footer to the bottom of the scroll region for long forms |
|
|
642
|
+
| `variant` | `'inline' \| 'bar'` | `'inline'` | `inline` sits under the step in the content column; `bar` is a full-width bar along the bottom of the form column, outside the scroll |
|
|
643
|
+
| `sx` | `SxProps<Theme>` | - | Additional styles |
|
|
644
|
+
|
|
645
|
+
Actions are end-aligned; push a Back button to the start with `sx={{ mr: 'auto' }}`.
|
|
646
|
+
|
|
647
|
+
### FullScreenWizard.Preview Props
|
|
648
|
+
|
|
649
|
+
| Prop | Type | Default | Description |
|
|
650
|
+
|------|------|---------|-------------|
|
|
651
|
+
| `hideBelow` | `Breakpoint \| false` | `'md'` | Hides the preview below this breakpoint; `false` always shows it |
|
|
652
|
+
| `position` | `'start' \| 'end'` | `'end'` | Side of the form the panel sits on; with a narrower `flexBasis` in `sx`, `start` makes a step rail |
|
|
653
|
+
| `previewLabel` | `string` | `'Preview'` | Accessible name of the `aside` |
|
|
654
|
+
| `sx` | `SxProps<Theme>` | - | Additional styles |
|
|
655
|
+
|
|
656
|
+
### useWizardSteps
|
|
657
|
+
|
|
658
|
+
```tsx
|
|
659
|
+
const wizard = useWizardSteps(['details', { id: 'access', skip: !needsAccess }, 'review'], {
|
|
660
|
+
initialStep: 'details',
|
|
661
|
+
});
|
|
662
|
+
// { activeStep, activeIndex, steps, count, isFirst, isLast, next, back, goTo, progress }
|
|
663
|
+
```
|
|
664
|
+
|
|
665
|
+
Skipped steps are left out of navigation, `count` and `progress`. `next` and `back` clamp at the
|
|
666
|
+
ends, `goTo` ignores unknown and skipped ids, and if the active step becomes skipped the wizard
|
|
667
|
+
moves to the next visible step (or the previous one at the end). `progress` is
|
|
668
|
+
`(activeIndex + 1) / count * 100`.
|
|
669
|
+
|
|
670
|
+
### Usage
|
|
671
|
+
|
|
672
|
+
```tsx
|
|
673
|
+
import { AppBreadcrumbs, Button, FullScreenWizard, useWizardSteps } from '@wso2/oxygen-ui';
|
|
674
|
+
|
|
675
|
+
const wizard = useWizardSteps(['details', 'access', 'review']);
|
|
676
|
+
|
|
677
|
+
<FullScreenWizard onClose={handleClose} aria-label="Create project">
|
|
678
|
+
<FullScreenWizard.Progress
|
|
679
|
+
value={wizard.progress}
|
|
680
|
+
valueText={`Step ${wizard.activeIndex + 1} of ${wizard.count}`}
|
|
681
|
+
/>
|
|
682
|
+
<FullScreenWizard.Header>
|
|
683
|
+
<AppBreadcrumbs items={breadcrumbs} />
|
|
684
|
+
</FullScreenWizard.Header>
|
|
685
|
+
<FullScreenWizard.Content focusKey={wizard.activeStep}>
|
|
686
|
+
{wizard.activeStep && stepContent[wizard.activeStep]}
|
|
687
|
+
</FullScreenWizard.Content>
|
|
688
|
+
<FullScreenWizard.Footer>
|
|
689
|
+
{!wizard.isFirst && (
|
|
690
|
+
<Button variant="outlined" onClick={wizard.back} sx={{ mr: 'auto' }}>Back</Button>
|
|
691
|
+
)}
|
|
692
|
+
<Button variant="contained" onClick={wizard.isLast ? handleCreate : wizard.next}>
|
|
693
|
+
{wizard.isLast ? 'Create' : 'Continue'}
|
|
694
|
+
</Button>
|
|
695
|
+
</FullScreenWizard.Footer>
|
|
696
|
+
<FullScreenWizard.Preview>{preview}</FullScreenWizard.Preview>
|
|
697
|
+
</FullScreenWizard>
|
|
698
|
+
```
|
|
699
|
+
|
|
700
|
+
### Keyboard & Accessibility
|
|
701
|
+
|
|
702
|
+
| Key | Behavior |
|
|
703
|
+
| --- | --- |
|
|
704
|
+
| `Tab` | Moves through the close button, the step's fields and the footer actions |
|
|
705
|
+
| `Enter` / `Space` | Activates the focused button |
|
|
706
|
+
| `Esc` | Calls `onClose` in modal mode |
|
|
707
|
+
|
|
708
|
+
- Landmarks: `header`, `main` (page mode, named by `aria-label`) and `aside` for the preview. Inside a page that already has a `main`, pass `component="div"` to Content.
|
|
709
|
+
- The close button is named (`closeLabel`); the progress bar has a label and `aria-valuetext`.
|
|
710
|
+
- Changing `focusKey` moves focus to the new step, so screen readers start there.
|
|
711
|
+
- Modal mode traps focus, locks page scroll, and names the dialog by `aria-label` or `aria-labelledby`.
|
|
712
|
+
|
|
713
|
+
---
|
|
714
|
+
|
|
715
|
+
## DrawerPanel
|
|
716
|
+
|
|
717
|
+
Slide-out side panel for item details or secondary tasks, with a title, optional expand button and close button.
|
|
718
|
+
|
|
719
|
+
```tsx
|
|
720
|
+
import { DrawerPanel } from '@wso2/oxygen-ui';
|
|
721
|
+
```
|
|
722
|
+
|
|
723
|
+
### Sub-components
|
|
724
|
+
|
|
725
|
+
| Component | Description |
|
|
726
|
+
|-----------|-------------|
|
|
727
|
+
| `DrawerPanel.Header` | Top row with the title and action buttons only |
|
|
728
|
+
| `DrawerPanel.Title` | Panel heading with optional `icon`; names the drawer |
|
|
729
|
+
| `DrawerPanel.Actions` | Right-aligned header actions |
|
|
730
|
+
| `DrawerPanel.ExpandButton` | Toggles between `width` and `expandedWidth` (hidden on mobile) |
|
|
731
|
+
| `DrawerPanel.CloseButton` | Calls `onClose` (or its own `onClick`) |
|
|
732
|
+
| `DrawerPanel.Body` | Scrollable main content |
|
|
733
|
+
| `DrawerPanel.Footer` | Sticky footer for panel actions |
|
|
734
|
+
|
|
735
|
+
### Props
|
|
736
|
+
|
|
737
|
+
| Prop | Type | Default | Description |
|
|
738
|
+
|------|------|---------|-------------|
|
|
739
|
+
| `open` | `boolean` | required | Panel visibility |
|
|
740
|
+
| `onClose` | `() => void` | required | Close handler |
|
|
741
|
+
| `width` | `number \| string` | `560` | Width on sm+ screens |
|
|
742
|
+
| `expandedWidth` | `number \| string` | `'100%'` | Width on sm+ screens while expanded |
|
|
743
|
+
| `expanded` | `boolean` | - | Controlled expanded state |
|
|
744
|
+
| `defaultExpanded` | `boolean` | `false` | Initial expanded state when uncontrolled |
|
|
745
|
+
| `onExpandedChange` | `(expanded: boolean) => void` | - | Called when the expand button toggles |
|
|
746
|
+
| `anchor` | `'left' \| 'right'` | `'right'` | Drawer side |
|
|
747
|
+
| `variant` | `'temporary' \| 'persistent'` | `'temporary'` | Drawer variant |
|
|
748
|
+
| `aria-label` | `string` | - | Accessible name when there is no `DrawerPanel.Title` |
|
|
749
|
+
|
|
750
|
+
### Usage
|
|
751
|
+
|
|
752
|
+
```tsx
|
|
753
|
+
<DrawerPanel open={open} onClose={() => setOpen(false)}>
|
|
754
|
+
<DrawerPanel.Header>
|
|
755
|
+
<DrawerPanel.Title icon={<ListTree size={20} />}>Build details</DrawerPanel.Title>
|
|
756
|
+
<DrawerPanel.Actions>
|
|
757
|
+
<DrawerPanel.ExpandButton />
|
|
758
|
+
<DrawerPanel.CloseButton />
|
|
759
|
+
</DrawerPanel.Actions>
|
|
760
|
+
</DrawerPanel.Header>
|
|
761
|
+
<DrawerPanel.Body>
|
|
762
|
+
<RelativeTime action="Triggered" time="about 1 hour ago" />
|
|
763
|
+
{/* content */}
|
|
764
|
+
</DrawerPanel.Body>
|
|
765
|
+
<DrawerPanel.Footer>
|
|
766
|
+
<Button variant="contained">Rerun build</Button>
|
|
767
|
+
</DrawerPanel.Footer>
|
|
768
|
+
</DrawerPanel>
|
|
769
|
+
```
|
|
770
|
+
|
|
771
|
+
- Keep `CloseButton` rightmost; put extra icon actions (with `Tooltip` and `aria-label`) before `ExpandButton`
|
|
772
|
+
- Add `ExpandButton` only when content benefits from more room (logs, tables, diffs)
|
|
773
|
+
|
|
774
|
+
---
|
|
775
|
+
|
|
557
776
|
## NotificationPanel
|
|
558
777
|
|
|
559
778
|
Slide-out notification panel with tabs and compound component pattern.
|
|
@@ -48,6 +48,92 @@ Pick the table type by what users do with the data:
|
|
|
48
48
|
- Do not use `striped` or `bordered` with the card variant
|
|
49
49
|
- Use one table type for the same kind of data across the product
|
|
50
50
|
|
|
51
|
+
## Table Toolbar
|
|
52
|
+
|
|
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
|
+
|
|
55
|
+
```text
|
|
56
|
+
[Scope] [Search] [Filters] ······ [View toggles] [Utility icons] [Secondary] [Primary]
|
|
57
|
+
[Applied filter chips] [Clear all]
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Search and filters swap by page context.** Put whichever users rely on more first, right after scope:
|
|
61
|
+
|
|
62
|
+
- Search first when users look up a specific item by name (users, resources)
|
|
63
|
+
- Filters first when users narrow by an attribute (logs by level, events by type)
|
|
64
|
+
- Scope always stays first; use the same order for the same kind of page across the product
|
|
65
|
+
- If the page's purpose doesn't make the choice clear, default to search first
|
|
66
|
+
|
|
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
|
+
- Search is always visible; placeholder names what is searched (`Search by name`, `Search events`)
|
|
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), then one filled primary action rightmost
|
|
71
|
+
- 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
|
+
- 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
|
+
- 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, search, and primary action never collapse
|
|
75
|
+
- Icon buttons always have a `Tooltip` and an `aria-label`
|
|
76
|
+
- Use one date format across tables (`28 Oct 2026, 04:29 UTC`) and always show the time zone
|
|
77
|
+
|
|
78
|
+
```tsx
|
|
79
|
+
import { Button, IconButton, ListingTable, TextField, Tooltip, useListingTableRequired } from '@wso2/oxygen-ui';
|
|
80
|
+
import { ChevronDown, RefreshCw } from '@wso2/oxygen-ui-icons-react';
|
|
81
|
+
|
|
82
|
+
// Render inside ListingTable.Provider so search reaches the table
|
|
83
|
+
function UsersToolbar() {
|
|
84
|
+
const { searchValue, onSearchChange } = useListingTableRequired();
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<ListingTable.Toolbar
|
|
88
|
+
actions={
|
|
89
|
+
<>
|
|
90
|
+
<Tooltip title="Refresh">
|
|
91
|
+
<IconButton size="small" aria-label="Refresh"><RefreshCw size={18} /></IconButton>
|
|
92
|
+
</Tooltip>
|
|
93
|
+
<Button variant="contained">Add user</Button>
|
|
94
|
+
</>
|
|
95
|
+
}
|
|
96
|
+
>
|
|
97
|
+
<Button variant="outlined" endIcon={<ChevronDown size={16} />}>Region: All regions</Button>
|
|
98
|
+
<TextField
|
|
99
|
+
size="small"
|
|
100
|
+
placeholder="Search by name"
|
|
101
|
+
value={searchValue ?? ''}
|
|
102
|
+
onChange={(event) => onSearchChange?.(event.target.value)}
|
|
103
|
+
slotProps={{ htmlInput: { 'aria-label': 'Search by name' } }}
|
|
104
|
+
/>
|
|
105
|
+
</ListingTable.Toolbar>
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
`ListingTable.Toolbar` renders `showSearch` before `children`, so when a table has a scope control or puts filters first, render search as a child in the right position instead of using `showSearch`.
|
|
111
|
+
|
|
112
|
+
## Choosing a Container
|
|
113
|
+
|
|
114
|
+
Use the lightest container that fits the task: modal → right drawer → page form → full page wizard. Ask in order and stop at the first "yes":
|
|
115
|
+
|
|
116
|
+
1. Quick decision or 1 to 3 fields, with no scrolling content and no need to reference other pages? Use a modal
|
|
117
|
+
2. Must the page behind stay visible, and is the task a single step? Use a right drawer
|
|
118
|
+
3. Do later steps depend on earlier choices? Use a full page wizard
|
|
119
|
+
4. Otherwise, use a page form with a back button
|
|
120
|
+
|
|
121
|
+
| Pattern | Use when | Avoid when | Typical size |
|
|
122
|
+
|---------|----------|------------|--------------|
|
|
123
|
+
| Modal | Confirm, delete, rename, 1 to 3 fields | Scrolling content, referencing other pages, nested dialogs | Small to medium |
|
|
124
|
+
| Right drawer | Viewing or editing an item while keeping context visible | Long or multi-step forms, complex validation | 400 to 600px wide |
|
|
125
|
+
| Page form | Creating or editing one entity with many fields | Quick edits | Full content area |
|
|
126
|
+
| Wizard | Sequential setup with dependent steps | Under 3 steps, non-linear editing | Full page, 3 to 7 steps |
|
|
127
|
+
|
|
128
|
+
- Modal: one task, one decision; if it needs scrolling, it is not a modal. Title states the action (`Delete item?`), body explains the consequence. Buttons use specific verbs, never `OK` or `Yes`. Destructive actions use danger styling; high-impact deletes require typing the resource name. Trap focus, close on Esc, return focus to the trigger. Never nest modals or use them for unprompted interruptions
|
|
129
|
+
- Right drawer: content relates to the page behind it (details, filters, settings, short edit forms). One standard width; wider variant only when content requires it. Sticky header (title, close) and sticky footer (primary and secondary actions). Warn about unsaved changes on close, Esc, or outside click. Don't stack drawers; open a modal from a drawer only for confirmations. Move focus in on open; return it to the trigger on close
|
|
130
|
+
- Page form: back returns to the originating page and restores its state (filters, scroll, pagination). Clear page title (`Create …`, `Edit …`); breadcrumbs when navigation is deep. Group fields into titled sections; progressive disclosure for advanced settings. Keep the primary action reachable on long forms (sticky footer or top right). Prompt on unsaved changes for back button, browser back, and in-app links. Inline validation on blur; on submit, summarize errors at the top with links to fields
|
|
131
|
+
- Wizard: stepper with step names and current position; 3 to 7 steps. Back never loses data; validate each step before Next. Order steps by dependency; optional steps last or skippable. Review step before final submit, with edit links per step. Cancel always available, confirms if progress will be lost; save drafts for long flows. Success state with clear next actions
|
|
132
|
+
- Editing a resource with 5 to 6 fields defaults to a right drawer. Switch to a page form for long content (rich text, code or JSON editor, spec files), fields that depend on each other, an edit likely to grow or that sits alongside other settings, or when users must reference other pages while editing
|
|
133
|
+
- Use the same pattern for the same task type across the product
|
|
134
|
+
- Every editable container guards against unsaved changes the same way
|
|
135
|
+
- Support keyboard use, visible focus, and labelled controls; meet WCAG 2.2 AA
|
|
136
|
+
|
|
51
137
|
## Component Template
|
|
52
138
|
|
|
53
139
|
```tsx
|
|
@@ -246,6 +246,14 @@ function LoginForm() {
|
|
|
246
246
|
|
|
247
247
|
## Multi-Step Wizard
|
|
248
248
|
|
|
249
|
+
Use a wizard only when later steps depend on earlier choices; otherwise use a page form (see Choosing a Container in the oxygen-component skill). The example below shows the stepper structure; real wizards also need:
|
|
250
|
+
|
|
251
|
+
- 3 to 7 named steps; order by dependency, optional steps last or skippable
|
|
252
|
+
- Validate each step before Next; Back never loses data
|
|
253
|
+
- A review step before submit, with an edit link per step
|
|
254
|
+
- Cancel always available, confirming if progress will be lost; save drafts for long flows
|
|
255
|
+
- A success state with clear next actions
|
|
256
|
+
|
|
249
257
|
```tsx
|
|
250
258
|
import { useState } from 'react';
|
|
251
259
|
import {
|
|
@@ -92,6 +92,7 @@ Collapsible groups:
|
|
|
92
92
|
|
|
93
93
|
General:
|
|
94
94
|
- Put Settings, Notifications, and Help in `Sidebar.Footer`, outside the scrolling `Sidebar.Nav`
|
|
95
|
+
- To let users collapse the sidebar from the bottom, put `<Sidebar.CollapseToggle />` last in `Sidebar.Footer`; it uses the AppShell `toggleSidebar` action, or pass `onToggle`
|
|
95
96
|
- Add a menu search when the panel has many items
|
|
96
97
|
- Don't mix the rules: titles never toggle, collapsible parents never navigate
|
|
97
98
|
|