@wso2/oxygen-ui 0.18.0 → 0.20.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 +4 -2
- package/.ai/components.md +332 -0
- package/.ai/patterns.md +12 -8
- package/.ai/theming.md +4 -4
- package/.claude/components.md +332 -0
- package/.claude/patterns.md +12 -8
- 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/.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/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/SearchBar/SearchBar.d.ts +7 -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/index.d.ts +13 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +8520 -4539
- package/dist/index.js.map +4 -4
- package/dist/styles/OxygenThemeBase.d.ts +12 -0
- package/dist/styles/Themes/ChoreoLabsTheme.d.ts +20 -0
- package/dist/styles/Themes/index.d.ts +1 -0
- package/package.json +3 -2
package/.claude/components.md
CHANGED
|
@@ -12,8 +12,11 @@ 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)
|
|
18
|
+
- [FullScreenWizard](#fullscreenwizard)
|
|
19
|
+
- [DrawerPanel](#drawerpanel)
|
|
17
20
|
- [NotificationPanel](#notificationpanel)
|
|
18
21
|
- [NotificationBanner](#notificationbanner)
|
|
19
22
|
- [ParticleBackground](#particlebackground)
|
|
@@ -554,6 +557,223 @@ interface WizardProps {
|
|
|
554
557
|
|
|
555
558
|
---
|
|
556
559
|
|
|
560
|
+
## FullScreenWizard
|
|
561
|
+
|
|
562
|
+
Full-screen layout for create and onboarding flows: a progress bar, a header with a close button,
|
|
563
|
+
a scrolling content column with an actions footer, and an optional live preview beside the form.
|
|
564
|
+
|
|
565
|
+
```tsx
|
|
566
|
+
import { FullScreenWizard, useWizardSteps } from '@wso2/oxygen-ui';
|
|
567
|
+
```
|
|
568
|
+
|
|
569
|
+
### Compound component
|
|
570
|
+
|
|
571
|
+
- `FullScreenWizard.Progress` — determinate progress bar or segments; leave it out for a single-step form
|
|
572
|
+
- `FullScreenWizard.Header` — `<header>` with the built-in close button, then breadcrumbs or a title
|
|
573
|
+
- `FullScreenWizard.Content` — scroll region holding the active step; `<main>` in page mode
|
|
574
|
+
- `FullScreenWizard.Footer` — actions row, under the step in the content column or as a full-width bar
|
|
575
|
+
- `FullScreenWizard.Preview` — `<aside>` side panel (live preview, step rail, tips); adding it switches to a split layout
|
|
576
|
+
|
|
577
|
+
The wizard is stateless: the consumer owns the steps, or uses `useWizardSteps`. It has no routing
|
|
578
|
+
and no product logic, so confirming a close or warning about unsaved changes happens in `onClose`.
|
|
579
|
+
Use it for flows that take over the screen; use `Form.Wizard` for a stepper inside a page, and a
|
|
580
|
+
regular `Dialog` for a short task that keeps the page in view.
|
|
581
|
+
|
|
582
|
+
### FullScreenWizard Props
|
|
583
|
+
|
|
584
|
+
| Prop | Type | Default | Description |
|
|
585
|
+
|------|------|---------|-------------|
|
|
586
|
+
| `children` | `ReactNode` | required | Progress, Header, Content, Footer and an optional Preview |
|
|
587
|
+
| `onClose` | `() => void` | - | Called by the close button and, in modal mode, by `Esc`. No close button without it |
|
|
588
|
+
| `closeLabel` | `string` | `'Close'` | Accessible name of the close button |
|
|
589
|
+
| `modal` | `boolean` | `false` | Renders the wizard in MUI's full-screen `Dialog` |
|
|
590
|
+
| `open` | `boolean` | `false` | Whether the dialog is open (modal only) |
|
|
591
|
+
| `DialogProps` | `Partial<DialogProps>` | - | Extra props for the `Dialog` (modal only) |
|
|
592
|
+
| `aria-label` | `string` | - | Names the dialog in modal mode, the `main` region in page mode |
|
|
593
|
+
| `aria-labelledby` | `string` | - | Id of the element naming the wizard; wins over `aria-label` |
|
|
594
|
+
| `sx` | `SxProps<Theme>` | - | Additional styles for the root |
|
|
595
|
+
|
|
596
|
+
The root forwards its `ref` and passes other attributes (`id`, `className`, `data-*`) to its element.
|
|
597
|
+
Page mode fills `100dvh`. Every part forwards its `ref` and accepts `sx` and its element's attributes,
|
|
598
|
+
and the theme can restyle each slot through `components.MuiFullScreenWizard.styleOverrides`.
|
|
599
|
+
|
|
600
|
+
Parts are found by `displayName` among the wizard's children and inside fragments. A product
|
|
601
|
+
component that wraps a part must set the same `displayName` (for example
|
|
602
|
+
`'FullScreenWizard.Footer'`) and pass props such as `variant` or `position` through. Use one `Content`.
|
|
603
|
+
|
|
604
|
+
### FullScreenWizard.Progress Props
|
|
605
|
+
|
|
606
|
+
| Prop | Type | Default | Description |
|
|
607
|
+
|------|------|---------|-------------|
|
|
608
|
+
| `value` | `number` | required | Progress from 0 to 100; clamped |
|
|
609
|
+
| `valueText` | `string` | - | Read in place of the percentage, e.g. `"Step 2 of 3"` |
|
|
610
|
+
| `progressLabel` | `string` | `'Progress'` | Accessible name of the bar |
|
|
611
|
+
| `variant` | `'bar' \| 'segmented'` | `'bar'` | `bar` is a thin full-width bar; `segmented` shows one segment per step, inset to line up with the header |
|
|
612
|
+
| `steps` | `number` | - | Number of segments in the `segmented` variant |
|
|
613
|
+
|
|
614
|
+
Other `LinearProgress` props are forwarded in the `bar` variant.
|
|
615
|
+
|
|
616
|
+
### FullScreenWizard.Header Props
|
|
617
|
+
|
|
618
|
+
| Prop | Type | Default | Description |
|
|
619
|
+
|------|------|---------|-------------|
|
|
620
|
+
| `children` | `ReactNode` | - | Breadcrumbs, a title or a stepper, shown beside the close button |
|
|
621
|
+
| `closePosition` | `'start' \| 'end'` | `'start'` | Side of the header the close button sits on |
|
|
622
|
+
| `closeIcon` | `ReactNode` | `<X size={20} />` | Icon of the close button |
|
|
623
|
+
| `CloseButtonProps` | `Partial<IconButtonProps>` | - | Extra props for the close button (`size`, `color`, `sx`); its name and handler come from the wizard |
|
|
624
|
+
| `sx` | `SxProps<Theme>` | - | Additional styles |
|
|
625
|
+
|
|
626
|
+
### FullScreenWizard.Content Props
|
|
627
|
+
|
|
628
|
+
| Prop | Type | Default | Description |
|
|
629
|
+
|------|------|---------|-------------|
|
|
630
|
+
| `component` | `ElementType` | `'main'` (page), `'div'` (modal) | Element the region renders as; `'div'` when the page already has a `main`, such as an `AppShell` |
|
|
631
|
+
| `maxWidth` | `Breakpoint \| number \| false` | `'md'` | Width cap of the content column; `xs` is at least 444px, as in `Container`; `false` fills the width |
|
|
632
|
+
| `align` | `'start' \| 'center'` | `'start'` | `start` keeps the column left-aligned; `center` centres it in both directions, for a welcome or picker screen |
|
|
633
|
+
| `focusKey` | `string \| number` | - | When it changes, focus moves to the region and it scrolls to the top |
|
|
634
|
+
| `sx` | `SxProps<Theme>` | - | Additional styles |
|
|
635
|
+
|
|
636
|
+
Content forwards its `ref`. It is a plain region inside the dialog in modal mode.
|
|
637
|
+
|
|
638
|
+
### FullScreenWizard.Footer Props
|
|
639
|
+
|
|
640
|
+
| Prop | Type | Default | Description |
|
|
641
|
+
|------|------|---------|-------------|
|
|
642
|
+
| `sticky` | `boolean` | `false` | Pins the footer to the bottom of the scroll region for long forms |
|
|
643
|
+
| `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 |
|
|
644
|
+
| `sx` | `SxProps<Theme>` | - | Additional styles |
|
|
645
|
+
|
|
646
|
+
Actions are end-aligned; push a Back button to the start with `sx={{ mr: 'auto' }}`.
|
|
647
|
+
|
|
648
|
+
### FullScreenWizard.Preview Props
|
|
649
|
+
|
|
650
|
+
| Prop | Type | Default | Description |
|
|
651
|
+
|------|------|---------|-------------|
|
|
652
|
+
| `hideBelow` | `Breakpoint \| false` | `'md'` | Hides the preview below this breakpoint; `false` always shows it |
|
|
653
|
+
| `position` | `'start' \| 'end'` | `'end'` | Side of the form the panel sits on; with a narrower `flexBasis` in `sx`, `start` makes a step rail |
|
|
654
|
+
| `previewLabel` | `string` | `'Preview'` | Accessible name of the `aside` |
|
|
655
|
+
| `sx` | `SxProps<Theme>` | - | Additional styles |
|
|
656
|
+
|
|
657
|
+
### useWizardSteps
|
|
658
|
+
|
|
659
|
+
```tsx
|
|
660
|
+
const wizard = useWizardSteps(['details', { id: 'access', skip: !needsAccess }, 'review'], {
|
|
661
|
+
initialStep: 'details',
|
|
662
|
+
});
|
|
663
|
+
// { activeStep, activeIndex, steps, count, isFirst, isLast, next, back, goTo, progress }
|
|
664
|
+
```
|
|
665
|
+
|
|
666
|
+
Skipped steps are left out of navigation, `count` and `progress`. `next` and `back` clamp at the
|
|
667
|
+
ends, `goTo` ignores unknown and skipped ids, and if the active step becomes skipped the wizard
|
|
668
|
+
moves to the next visible step (or the previous one at the end). `progress` is
|
|
669
|
+
`(activeIndex + 1) / count * 100`.
|
|
670
|
+
|
|
671
|
+
### Usage
|
|
672
|
+
|
|
673
|
+
```tsx
|
|
674
|
+
import { AppBreadcrumbs, Button, FullScreenWizard, useWizardSteps } from '@wso2/oxygen-ui';
|
|
675
|
+
|
|
676
|
+
const wizard = useWizardSteps(['details', 'access', 'review']);
|
|
677
|
+
|
|
678
|
+
<FullScreenWizard onClose={handleClose} aria-label="Create project">
|
|
679
|
+
<FullScreenWizard.Progress
|
|
680
|
+
value={wizard.progress}
|
|
681
|
+
valueText={`Step ${wizard.activeIndex + 1} of ${wizard.count}`}
|
|
682
|
+
/>
|
|
683
|
+
<FullScreenWizard.Header>
|
|
684
|
+
<AppBreadcrumbs items={breadcrumbs} />
|
|
685
|
+
</FullScreenWizard.Header>
|
|
686
|
+
<FullScreenWizard.Content focusKey={wizard.activeStep}>
|
|
687
|
+
{wizard.activeStep && stepContent[wizard.activeStep]}
|
|
688
|
+
</FullScreenWizard.Content>
|
|
689
|
+
<FullScreenWizard.Footer>
|
|
690
|
+
{!wizard.isFirst && (
|
|
691
|
+
<Button variant="outlined" onClick={wizard.back} sx={{ mr: 'auto' }}>Back</Button>
|
|
692
|
+
)}
|
|
693
|
+
<Button variant="contained" onClick={wizard.isLast ? handleCreate : wizard.next}>
|
|
694
|
+
{wizard.isLast ? 'Create' : 'Continue'}
|
|
695
|
+
</Button>
|
|
696
|
+
</FullScreenWizard.Footer>
|
|
697
|
+
<FullScreenWizard.Preview>{preview}</FullScreenWizard.Preview>
|
|
698
|
+
</FullScreenWizard>
|
|
699
|
+
```
|
|
700
|
+
|
|
701
|
+
### Keyboard & Accessibility
|
|
702
|
+
|
|
703
|
+
| Key | Behavior |
|
|
704
|
+
| --- | --- |
|
|
705
|
+
| `Tab` | Moves through the close button, the step's fields and the footer actions |
|
|
706
|
+
| `Enter` / `Space` | Activates the focused button |
|
|
707
|
+
| `Esc` | Calls `onClose` in modal mode |
|
|
708
|
+
|
|
709
|
+
- 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.
|
|
710
|
+
- The close button is named (`closeLabel`); the progress bar has a label and `aria-valuetext`.
|
|
711
|
+
- Changing `focusKey` moves focus to the new step, so screen readers start there.
|
|
712
|
+
- Modal mode traps focus, locks page scroll, and names the dialog by `aria-label` or `aria-labelledby`.
|
|
713
|
+
|
|
714
|
+
---
|
|
715
|
+
|
|
716
|
+
## DrawerPanel
|
|
717
|
+
|
|
718
|
+
Slide-out side panel for item details or secondary tasks, with a title, optional expand button and close button.
|
|
719
|
+
|
|
720
|
+
```tsx
|
|
721
|
+
import { DrawerPanel } from '@wso2/oxygen-ui';
|
|
722
|
+
```
|
|
723
|
+
|
|
724
|
+
### Sub-components
|
|
725
|
+
|
|
726
|
+
| Component | Description |
|
|
727
|
+
|-----------|-------------|
|
|
728
|
+
| `DrawerPanel.Header` | Top row with the title and action buttons only |
|
|
729
|
+
| `DrawerPanel.Title` | Panel heading with optional `icon`; names the drawer |
|
|
730
|
+
| `DrawerPanel.Actions` | Right-aligned header actions |
|
|
731
|
+
| `DrawerPanel.ExpandButton` | Toggles between `width` and `expandedWidth` (hidden on mobile) |
|
|
732
|
+
| `DrawerPanel.CloseButton` | Calls `onClose` (or its own `onClick`) |
|
|
733
|
+
| `DrawerPanel.Body` | Scrollable main content |
|
|
734
|
+
| `DrawerPanel.Footer` | Sticky footer for panel actions |
|
|
735
|
+
|
|
736
|
+
### Props
|
|
737
|
+
|
|
738
|
+
| Prop | Type | Default | Description |
|
|
739
|
+
|------|------|---------|-------------|
|
|
740
|
+
| `open` | `boolean` | required | Panel visibility |
|
|
741
|
+
| `onClose` | `() => void` | required | Close handler |
|
|
742
|
+
| `width` | `number \| string` | `560` | Width on sm+ screens |
|
|
743
|
+
| `expandedWidth` | `number \| string` | `'100%'` | Width on sm+ screens while expanded |
|
|
744
|
+
| `expanded` | `boolean` | - | Controlled expanded state |
|
|
745
|
+
| `defaultExpanded` | `boolean` | `false` | Initial expanded state when uncontrolled |
|
|
746
|
+
| `onExpandedChange` | `(expanded: boolean) => void` | - | Called when the expand button toggles |
|
|
747
|
+
| `anchor` | `'left' \| 'right'` | `'right'` | Drawer side |
|
|
748
|
+
| `variant` | `'temporary' \| 'persistent'` | `'temporary'` | Drawer variant |
|
|
749
|
+
| `aria-label` | `string` | - | Accessible name when there is no `DrawerPanel.Title` |
|
|
750
|
+
|
|
751
|
+
### Usage
|
|
752
|
+
|
|
753
|
+
```tsx
|
|
754
|
+
<DrawerPanel open={open} onClose={() => setOpen(false)}>
|
|
755
|
+
<DrawerPanel.Header>
|
|
756
|
+
<DrawerPanel.Title icon={<ListTree size={20} />}>Build details</DrawerPanel.Title>
|
|
757
|
+
<DrawerPanel.Actions>
|
|
758
|
+
<DrawerPanel.ExpandButton />
|
|
759
|
+
<DrawerPanel.CloseButton />
|
|
760
|
+
</DrawerPanel.Actions>
|
|
761
|
+
</DrawerPanel.Header>
|
|
762
|
+
<DrawerPanel.Body>
|
|
763
|
+
<RelativeTime action="Triggered" time="about 1 hour ago" />
|
|
764
|
+
{/* content */}
|
|
765
|
+
</DrawerPanel.Body>
|
|
766
|
+
<DrawerPanel.Footer>
|
|
767
|
+
<Button variant="contained">Rerun build</Button>
|
|
768
|
+
</DrawerPanel.Footer>
|
|
769
|
+
</DrawerPanel>
|
|
770
|
+
```
|
|
771
|
+
|
|
772
|
+
- Keep `CloseButton` rightmost; put extra icon actions (with `Tooltip` and `aria-label`) before `ExpandButton`
|
|
773
|
+
- Add `ExpandButton` only when content benefits from more room (logs, tables, diffs)
|
|
774
|
+
|
|
775
|
+
---
|
|
776
|
+
|
|
557
777
|
## NotificationPanel
|
|
558
778
|
|
|
559
779
|
Slide-out notification panel with tabs and compound component pattern.
|
|
@@ -675,6 +895,8 @@ import { SearchBar, SearchBarWithAdvancedFilter } from '@wso2/oxygen-ui';
|
|
|
675
895
|
| `value` | `string` | - | Search input value |
|
|
676
896
|
| `onChange` | `(value: string) => void` | - | Change handler |
|
|
677
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` |
|
|
678
900
|
|
|
679
901
|
### SearchBarWithAdvancedFilter Props
|
|
680
902
|
|
|
@@ -1022,6 +1244,116 @@ import { UserIcon, SettingsIcon, LogOutIcon } from '@wso2/oxygen-ui-icons-react'
|
|
|
1022
1244
|
</UserMenu>
|
|
1023
1245
|
```
|
|
1024
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
|
+
|
|
1025
1357
|
## AppSwitcher
|
|
1026
1358
|
|
|
1027
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 },
|
|
@@ -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]
|
|
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), 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)
|
|
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
|
|
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
|
|
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
|
|
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
|
|
76
|
+
- Icon buttons always have a `Tooltip` and an `aria-label`
|
|
77
|
+
- Use one date format across tables (`28 Oct 2026, 04:29 UTC`) and always show the time zone
|
|
78
|
+
|
|
79
|
+
```tsx
|
|
80
|
+
import { Button, IconButton, ListingTable, TextField, Tooltip, useListingTableRequired } from '@wso2/oxygen-ui';
|
|
81
|
+
import { ChevronDown, RefreshCw } from '@wso2/oxygen-ui-icons-react';
|
|
82
|
+
|
|
83
|
+
// Render inside ListingTable.Provider so search reaches the table
|
|
84
|
+
function UsersToolbar() {
|
|
85
|
+
const { searchValue, onSearchChange } = useListingTableRequired();
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<ListingTable.Toolbar
|
|
89
|
+
actions={
|
|
90
|
+
<>
|
|
91
|
+
<Tooltip title="Refresh">
|
|
92
|
+
<IconButton size="small" aria-label="Refresh"><RefreshCw size={18} /></IconButton>
|
|
93
|
+
</Tooltip>
|
|
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
|
|
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
|
}
|