@wso2/oxygen-ui 0.25.0 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.ai/AGENTS.md +2 -7
- package/.ai/components.md +36 -37
- package/.ai/patterns.md +0 -4
- package/.ai/theming.md +0 -11
- package/.claude/components.md +80 -37
- package/.claude/patterns.md +0 -4
- package/.claude/skills/oxygen-layout/SKILL.md +1 -1
- package/.claude/skills/oxygen-migrate/SKILL.md +1 -1
- package/.claude/theming.md +0 -8
- package/README.md +1 -1
- package/bin/cli.js +1 -1
- package/dist/animations/PageLoader/PageLoader.d.ts +92 -0
- package/dist/animations/PageLoader/PageLoaderIcon.d.ts +20 -0
- package/dist/animations/PageLoader/PageLoaderWordmark.d.ts +19 -0
- package/dist/animations/PageLoader/index.d.ts +4 -0
- package/dist/animations/index.d.ts +2 -0
- package/dist/components/AppShell/AppShell.d.ts +1 -1
- package/dist/components/AppShell/AppShellFooter.d.ts +1 -1
- package/dist/components/AppSwitcher/AppSwitcher.d.ts +12 -9
- package/dist/components/AppSwitcher/AppSwitcherApp.d.ts +19 -10
- package/dist/components/AppSwitcher/AppSwitcherFooter.d.ts +6 -6
- package/dist/components/AppSwitcher/AppSwitcherSection.d.ts +21 -7
- package/dist/components/AppSwitcher/AppSwitcherTrigger.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +19 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/ContextSwitcher/ContextSwitcher.d.ts +1 -1
- package/dist/components/Footer/FooterLink.d.ts +6 -2
- package/dist/components/HeaderBreadcrumbs/persistence.d.ts +1 -1
- package/dist/components/HeaderBreadcrumbs/useHeaderBreadcrumbs.d.ts +1 -1
- package/dist/components/StatusIllustration/StatusIllustration.d.ts +49 -0
- package/dist/components/StatusIllustration/illustrationStyles.d.ts +212 -0
- package/dist/components/StatusIllustration/illustrations/FailedIllustration.d.ts +3 -0
- package/dist/components/StatusIllustration/illustrations/Http200Illustration.d.ts +3 -0
- package/dist/components/StatusIllustration/illustrations/Http201Illustration.d.ts +3 -0
- package/dist/components/StatusIllustration/illustrations/Http204Illustration.d.ts +3 -0
- package/dist/components/StatusIllustration/illustrations/Http301Illustration.d.ts +3 -0
- package/dist/components/StatusIllustration/illustrations/Http302Illustration.d.ts +3 -0
- package/dist/components/StatusIllustration/illustrations/Http304Illustration.d.ts +3 -0
- package/dist/components/StatusIllustration/illustrations/Http400Illustration.d.ts +3 -0
- package/dist/components/StatusIllustration/illustrations/Http401Illustration.d.ts +3 -0
- package/dist/components/StatusIllustration/illustrations/Http403Illustration.d.ts +3 -0
- package/dist/components/StatusIllustration/illustrations/Http404Illustration.d.ts +3 -0
- package/dist/components/StatusIllustration/illustrations/Http405Illustration.d.ts +3 -0
- package/dist/components/StatusIllustration/illustrations/Http408Illustration.d.ts +3 -0
- package/dist/components/StatusIllustration/illustrations/Http409Illustration.d.ts +3 -0
- package/dist/components/StatusIllustration/illustrations/Http422Illustration.d.ts +3 -0
- package/dist/components/StatusIllustration/illustrations/Http429Illustration.d.ts +3 -0
- package/dist/components/StatusIllustration/illustrations/Http500Illustration.d.ts +3 -0
- package/dist/components/StatusIllustration/illustrations/Http502Illustration.d.ts +3 -0
- package/dist/components/StatusIllustration/illustrations/Http503Illustration.d.ts +3 -0
- package/dist/components/StatusIllustration/illustrations/Http504Illustration.d.ts +3 -0
- package/dist/components/StatusIllustration/illustrations/MailSentIllustration.d.ts +3 -0
- package/dist/components/StatusIllustration/illustrations/NoRecordsIllustration.d.ts +3 -0
- package/dist/components/StatusIllustration/illustrations/UnsuccessfulIllustration.d.ts +3 -0
- package/dist/components/StatusIllustration/illustrations/index.d.ts +12 -0
- package/dist/components/StatusIllustration/index.d.ts +2 -0
- package/dist/components/StatusIllustration/types.d.ts +2 -0
- package/dist/components/StatusIllustration/useIllustrationId.d.ts +5 -0
- package/dist/components/TimeRangeFilter/TimeRangeFilter.d.ts +3 -2
- package/dist/components/TrialBadge/TrialBadge.d.ts +8 -8
- package/dist/components/index.d.ts +4 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3931 -2961
- package/dist/index.js.map +4 -4
- package/dist/styles/OxygenThemeBase.d.ts +166 -1
- package/dist/styles/Themes/index.d.ts +0 -3
- package/dist/utils/createOxygenTheme.d.ts +2 -2
- package/package.json +5 -3
- package/dist/components/AppSwitcher/brand.d.ts +0 -49
- package/dist/styles/Themes/WSO2Theme.d.ts +0 -20
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { BoxProps } from '@mui/material';
|
|
3
|
+
/**
|
|
4
|
+
* Where the loader is in its sequence.
|
|
5
|
+
* - `loading`: the icon animates while the background task runs.
|
|
6
|
+
* - `settling`: the task is done; waiting for the icon to come to rest.
|
|
7
|
+
* - `revealing`: the title slides out and pushes the icon to the left.
|
|
8
|
+
* - `revealed`: the full logo is on screen, held for `holdDuration`.
|
|
9
|
+
* - `exiting`: `onComplete` has fired and the overlay fades out.
|
|
10
|
+
* - `done`: the overlay is gone and `children` are shown.
|
|
11
|
+
*/
|
|
12
|
+
export type PageLoaderPhase = 'loading' | 'settling' | 'revealing' | 'revealed' | 'exiting' | 'done';
|
|
13
|
+
export interface PageLoaderProps extends Omit<BoxProps, 'title' | 'children'> {
|
|
14
|
+
/**
|
|
15
|
+
* `true` while the background task runs. Set it to `false` when the task is done to
|
|
16
|
+
* start the reveal; `onComplete` fires once the full logo has been shown.
|
|
17
|
+
*/
|
|
18
|
+
loading: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Text or element revealed to the right of the icon. Defaults to the Oxygen UI wordmark.
|
|
21
|
+
* Text is set in the theme font, sized and tracked to match the wordmark.
|
|
22
|
+
*/
|
|
23
|
+
title?: React.ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* Replaces the animated mark. When it is not the default icon, the loader does not
|
|
26
|
+
* wait for it to come to rest before revealing.
|
|
27
|
+
*/
|
|
28
|
+
icon?: React.ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* Height of the icon in pixels. The title is sized to match.
|
|
31
|
+
* @default 48
|
|
32
|
+
*/
|
|
33
|
+
size?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Called once the full logo has been shown, before the overlay fades out.
|
|
36
|
+
*/
|
|
37
|
+
onComplete?: () => void;
|
|
38
|
+
/**
|
|
39
|
+
* Called on every phase change.
|
|
40
|
+
*/
|
|
41
|
+
onPhaseChange?: (phase: PageLoaderPhase) => void;
|
|
42
|
+
/**
|
|
43
|
+
* Length of the reveal, in milliseconds.
|
|
44
|
+
* @default 700
|
|
45
|
+
*/
|
|
46
|
+
revealDuration?: number;
|
|
47
|
+
/**
|
|
48
|
+
* How long the full logo stays on screen before `onComplete`, in milliseconds.
|
|
49
|
+
* @default 600
|
|
50
|
+
*/
|
|
51
|
+
holdDuration?: number;
|
|
52
|
+
/**
|
|
53
|
+
* Length of the fade out after `onComplete`, in milliseconds.
|
|
54
|
+
* @default 400
|
|
55
|
+
*/
|
|
56
|
+
exitDuration?: number;
|
|
57
|
+
/**
|
|
58
|
+
* Covers the viewport. Set to `false` to fill the parent instead.
|
|
59
|
+
* @default true
|
|
60
|
+
*/
|
|
61
|
+
fullScreen?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Label read out by screen readers while loading.
|
|
64
|
+
* @default 'Loading'
|
|
65
|
+
*/
|
|
66
|
+
loadingLabel?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Content shown once the loader has finished. It mounts when the overlay starts
|
|
69
|
+
* fading out, so it is already in place underneath.
|
|
70
|
+
*/
|
|
71
|
+
children?: React.ReactNode;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* PageLoader shows an animated icon in the middle of the page while a background task runs.
|
|
75
|
+
* When `loading` turns `false`, the icon comes to rest, the title slides out to its right
|
|
76
|
+
* pushing the icon to the left until the full logo is centred, and then `onComplete` fires.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```tsx
|
|
80
|
+
* const [loading, setLoading] = useState(true);
|
|
81
|
+
*
|
|
82
|
+
* useEffect(() => {
|
|
83
|
+
* bootstrap().finally(() => setLoading(false));
|
|
84
|
+
* }, []);
|
|
85
|
+
*
|
|
86
|
+
* <PageLoader loading={loading} onComplete={() => track('app-ready')}>
|
|
87
|
+
* <App />
|
|
88
|
+
* </PageLoader>
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
declare const PageLoader: React.ForwardRefExoticComponent<Omit<PageLoaderProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
92
|
+
export default PageLoader;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/** Length of one full loop, in seconds. */
|
|
3
|
+
export declare const PAGE_LOADER_ICON_CYCLE = 4.6;
|
|
4
|
+
/** Length of one step (a move followed by a hold), in seconds. */
|
|
5
|
+
export declare const PAGE_LOADER_ICON_STEP: number;
|
|
6
|
+
/** Part of each step spent moving; the rest is a hold where the mark is at rest. */
|
|
7
|
+
export declare const PAGE_LOADER_ICON_MOVE = 0.3;
|
|
8
|
+
export interface PageLoaderIconProps extends Omit<React.SVGProps<SVGSVGElement>, 'ref'> {
|
|
9
|
+
/**
|
|
10
|
+
* Height of the icon in pixels. The width follows the aspect ratio.
|
|
11
|
+
* @default 48
|
|
12
|
+
*/
|
|
13
|
+
size?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The animated Oxygen UI mark: ten ellipses rotating around a ring.
|
|
17
|
+
* Uses `currentColor`, so it follows the CSS `color` of its parent.
|
|
18
|
+
*/
|
|
19
|
+
declare const PageLoaderIcon: React.ForwardRefExoticComponent<PageLoaderIconProps & React.RefAttributes<SVGSVGElement>>;
|
|
20
|
+
export default PageLoaderIcon;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Space between the mark and the wordmark in the logo, as a share of the mark's height.
|
|
4
|
+
* The logo has a 48 unit gap; `PageLoaderIcon` already leaves about 3 units of padding on its right.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PAGE_LOADER_WORDMARK_GAP: number;
|
|
7
|
+
export interface PageLoaderWordmarkProps extends Omit<React.SVGProps<SVGSVGElement>, 'ref'> {
|
|
8
|
+
/**
|
|
9
|
+
* Height in pixels. Use the icon's size: the wordmark lines up with the mark the way it
|
|
10
|
+
* does in the logo.
|
|
11
|
+
* @default 48
|
|
12
|
+
*/
|
|
13
|
+
size?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The "Oxygen UI" wordmark from the Oxygen UI logo. Uses `currentColor`.
|
|
17
|
+
*/
|
|
18
|
+
declare const PageLoaderWordmark: React.FC<PageLoaderWordmarkProps>;
|
|
19
|
+
export default PageLoaderWordmark;
|
|
@@ -55,7 +55,7 @@ export interface AppShellProps extends UseAppShellOptions {
|
|
|
55
55
|
* <MyPage /> {/* Can use useAppShell()
|
|
56
56
|
* </AppShell.Main>
|
|
57
57
|
* <AppShell.Footer>
|
|
58
|
-
* <Footer companyName="
|
|
58
|
+
* <Footer companyName="Choreo Labs" />
|
|
59
59
|
* </AppShell.Footer>
|
|
60
60
|
* </AppShell>
|
|
61
61
|
* ```
|
|
@@ -27,7 +27,10 @@ import { AppSwitcherFooter } from './AppSwitcherFooter';
|
|
|
27
27
|
export interface AppSwitcherProps {
|
|
28
28
|
/** Switcher content (Trigger, Section, App, Footer) */
|
|
29
29
|
children: React.ReactNode;
|
|
30
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* Popover width in pixels from the `sm` breakpoint up. By default the popover
|
|
32
|
+
* fits its content: about 320px for two columns of services, 460px for three.
|
|
33
|
+
*/
|
|
31
34
|
width?: number;
|
|
32
35
|
/** Accessible name for the popover surface (default: `"Applications"`) */
|
|
33
36
|
'aria-label'?: string;
|
|
@@ -39,7 +42,7 @@ export interface AppSwitcherProps {
|
|
|
39
42
|
unavailableLabel?: React.ReactNode;
|
|
40
43
|
}
|
|
41
44
|
/**
|
|
42
|
-
* AppSwitcher - Popover for navigating between
|
|
45
|
+
* AppSwitcher - Popover for navigating between Choreo Labs Cloud applications.
|
|
43
46
|
*
|
|
44
47
|
* A compound component pairing a grid icon button in the header with a popover
|
|
45
48
|
* listing the available platforms. The trigger renders in place; every other
|
|
@@ -61,7 +64,7 @@ export interface AppSwitcherProps {
|
|
|
61
64
|
* ```tsx
|
|
62
65
|
* <AppSwitcher currentAppId="agent-manager">
|
|
63
66
|
* <AppSwitcher.Trigger label="Switch platforms" />
|
|
64
|
-
* <AppSwitcher.Section label="
|
|
67
|
+
* <AppSwitcher.Section label="Services" apps={platforms} loading={isLoading} />
|
|
65
68
|
* <AppSwitcher.Footer columns={2} links={cloudLinks} loading={isLoading} />
|
|
66
69
|
* </AppSwitcher>
|
|
67
70
|
* ```
|
|
@@ -71,14 +74,14 @@ export interface AppSwitcherProps {
|
|
|
71
74
|
* <Header.Actions>
|
|
72
75
|
* <AppSwitcher>
|
|
73
76
|
* <AppSwitcher.Trigger />
|
|
74
|
-
* <AppSwitcher.Section label="
|
|
75
|
-
* <AppSwitcher.App name="Agent
|
|
76
|
-
* <AppSwitcher.App name="API
|
|
77
|
-
* <AppSwitcher.App name="Analytics" disabled tooltip="Coming soon" />
|
|
77
|
+
* <AppSwitcher.Section label="Services">
|
|
78
|
+
* <AppSwitcher.App name="Agent Management" url="https://agent.example.com" icon={<Bot size={32} />} />
|
|
79
|
+
* <AppSwitcher.App name="API Management" url="https://api.example.com" icon={<Cpu size={32} />} />
|
|
80
|
+
* <AppSwitcher.App name="Analytics" disabled tooltip="Coming soon" icon={<ChartLine size={32} />} />
|
|
78
81
|
* </AppSwitcher.Section>
|
|
79
82
|
* <AppSwitcher.Footer columns={2}>
|
|
80
|
-
* <AppSwitcher.App name="Cloud home" url="https://console.
|
|
81
|
-
* <AppSwitcher.App name="Settings" url="https://console.
|
|
83
|
+
* <AppSwitcher.App name="Cloud home" url="https://console.example.com" icon={<Home size={16} />} />
|
|
84
|
+
* <AppSwitcher.App name="Settings" url="https://console.example.com/settings" icon={<Settings size={16} />} />
|
|
82
85
|
* </AppSwitcher.Footer>
|
|
83
86
|
* </AppSwitcher>
|
|
84
87
|
* </Header.Actions>
|
|
@@ -27,25 +27,30 @@ import * as React from 'react';
|
|
|
27
27
|
* Elevation:
|
|
28
28
|
* - `shadows[2]` - Hover elevation
|
|
29
29
|
*
|
|
30
|
-
*
|
|
31
|
-
* - `
|
|
32
|
-
* - `APP_SWITCHER_BRAND.focus` - Focus ring and the current app's border
|
|
30
|
+
* - `primary.main` - Hover border, focus ring, the current app's border and the Choreo Labs fallback mark
|
|
31
|
+
* - `text.secondary` / `text.disabled` - Card icons, and any mark of an unavailable card
|
|
33
32
|
*
|
|
34
33
|
* Typography / sizing:
|
|
35
34
|
* - `typography.body2` - Name text
|
|
36
35
|
* - `spacing()` / `shape.borderRadius` - Card and tile dimensions
|
|
37
36
|
*
|
|
38
|
-
* Layout follows the agreed
|
|
37
|
+
* Layout follows the agreed Choreo Labs Cloud design: the mark sits centered above a
|
|
39
38
|
* centered name. A card is a destination, so its whole
|
|
40
39
|
* surface is the hit target.
|
|
41
40
|
*/
|
|
42
41
|
/**
|
|
43
42
|
* Visual treatments a card can take.
|
|
44
43
|
*
|
|
45
|
-
* - `platform` - Large
|
|
44
|
+
* - `platform` - Large mark, used for the service grid
|
|
46
45
|
* - `manage` - Smaller neutral mark on a grey disc, used for the manage row
|
|
47
46
|
*/
|
|
48
47
|
export type AppSwitcherAppTone = 'platform' | 'manage';
|
|
48
|
+
/**
|
|
49
|
+
* Smallest width of a service tile from the `sm` breakpoint up, in
|
|
50
|
+
* `theme.spacing` units. The grid uses it as its column minimum, so the popover
|
|
51
|
+
* sizes itself around tiles of this width.
|
|
52
|
+
*/
|
|
53
|
+
export declare const APP_TILE_SIZE = 17;
|
|
49
54
|
/** Card height per tone, in `theme.spacing` units. Shared with the loading placeholders. */
|
|
50
55
|
export declare const APP_CARD_HEIGHT: Record<AppSwitcherAppTone, number>;
|
|
51
56
|
/**
|
|
@@ -54,7 +59,7 @@ export declare const APP_CARD_HEIGHT: Record<AppSwitcherAppTone, number>;
|
|
|
54
59
|
export interface AppSwitcherAppProps {
|
|
55
60
|
/** Identifier matched against the switcher's `currentAppId`. Not set as the DOM `id`. */
|
|
56
61
|
id?: string;
|
|
57
|
-
/** Application name (e.g. `"API
|
|
62
|
+
/** Application name (e.g. `"API Management"`) */
|
|
58
63
|
name: string;
|
|
59
64
|
/**
|
|
60
65
|
* Destination URL. The card renders as an anchor pointing at it.
|
|
@@ -65,7 +70,11 @@ export interface AppSwitcherAppProps {
|
|
|
65
70
|
* card disabled.
|
|
66
71
|
*/
|
|
67
72
|
url?: string | null;
|
|
68
|
-
/**
|
|
73
|
+
/**
|
|
74
|
+
* Mark shown above the name (default: the Choreo Labs mark). Give each service a
|
|
75
|
+
* matching glyph, e.g. `<Bot size={32} />` for Agent Management; it is drawn
|
|
76
|
+
* in a neutral color, so any icon fits.
|
|
77
|
+
*/
|
|
69
78
|
icon?: React.ReactNode;
|
|
70
79
|
/** Visual treatment (default: `"manage"` inside the footer, `"platform"` elsewhere) */
|
|
71
80
|
tone?: AppSwitcherAppTone;
|
|
@@ -123,9 +132,9 @@ export interface AppSwitcherAppItem extends Omit<AppSwitcherAppProps, 'id'> {
|
|
|
123
132
|
*
|
|
124
133
|
* @example
|
|
125
134
|
* ```tsx
|
|
126
|
-
* <AppSwitcher.App name="API
|
|
127
|
-
* <AppSwitcher.App name="Analytics
|
|
128
|
-
* <AppSwitcher.App id="agent-
|
|
135
|
+
* <AppSwitcher.App name="API Management" url="https://api.example.com" icon={<Cpu size={32} />} />
|
|
136
|
+
* <AppSwitcher.App name="Analytics" disabled tooltip="Coming soon" icon={<ChartLine size={32} />} />
|
|
137
|
+
* <AppSwitcher.App id="agent-management" name="Agent Management" url="https://agent.example.com" icon={<Bot size={32} />} />
|
|
129
138
|
* ```
|
|
130
139
|
*/
|
|
131
140
|
export declare const AppSwitcherApp: React.ForwardRefExoticComponent<AppSwitcherAppProps & React.RefAttributes<HTMLElement>>;
|
|
@@ -26,7 +26,7 @@ import type { AppSwitcherAppItem } from './AppSwitcherApp';
|
|
|
26
26
|
* row apart from the platform grid above it without reading as a grey block
|
|
27
27
|
*/
|
|
28
28
|
/**
|
|
29
|
-
* A single
|
|
29
|
+
* A single Choreo Labs Cloud destination in the footer.
|
|
30
30
|
*
|
|
31
31
|
* Same shape as `AppSwitcherAppItem`, but `id` is optional since existing
|
|
32
32
|
* links use `key`. A missing `url` keeps its old behavior, so existing
|
|
@@ -44,11 +44,11 @@ export interface AppSwitcherFooterLink extends Omit<AppSwitcherAppItem, 'id'> {
|
|
|
44
44
|
export interface AppSwitcherFooterProps {
|
|
45
45
|
/** Manage cards (typically `AppSwitcher.App` elements) */
|
|
46
46
|
children?: React.ReactNode;
|
|
47
|
-
/**
|
|
47
|
+
/** Choreo Labs Cloud destinations rendered as cards, as an alternative to `children` */
|
|
48
48
|
links?: AppSwitcherFooterLink[];
|
|
49
49
|
/**
|
|
50
50
|
* Heading above the links. Omit it to show the links under the divider alone,
|
|
51
|
-
* as in the
|
|
51
|
+
* as in the Choreo Labs Cloud design.
|
|
52
52
|
*/
|
|
53
53
|
label?: string;
|
|
54
54
|
/**
|
|
@@ -66,7 +66,7 @@ export interface AppSwitcherFooterProps {
|
|
|
66
66
|
/**
|
|
67
67
|
* AppSwitcher.Footer - Bottom section of the app switcher popover.
|
|
68
68
|
*
|
|
69
|
-
* Holds the
|
|
69
|
+
* Holds the Choreo Labs Cloud destinations (e.g. Cloud home and Settings) below a
|
|
70
70
|
* divider, as a grid of cards, using the same card as the platform grid so both rows
|
|
71
71
|
* behave identically. The neutral mark and lighter type keep them visually
|
|
72
72
|
* secondary to the platforms above.
|
|
@@ -77,8 +77,8 @@ export interface AppSwitcherFooterProps {
|
|
|
77
77
|
* @example
|
|
78
78
|
* ```tsx
|
|
79
79
|
* <AppSwitcher.Footer columns={2}>
|
|
80
|
-
* <AppSwitcher.App name="Cloud home" url="https://console.
|
|
81
|
-
* <AppSwitcher.App name="Settings" url="https://console.
|
|
80
|
+
* <AppSwitcher.App name="Cloud home" url="https://console.example.com" icon={<Home size={16} />} />
|
|
81
|
+
* <AppSwitcher.App name="Settings" url="https://console.example.com/settings" icon={<Settings size={16} />} />
|
|
82
82
|
* </AppSwitcher.Footer>
|
|
83
83
|
* ```
|
|
84
84
|
*/
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
18
|
import * as React from 'react';
|
|
19
|
-
import type { AppSwitcherAppItem } from './AppSwitcherApp';
|
|
19
|
+
import type { AppSwitcherAppItem, AppSwitcherAppTone } from './AppSwitcherApp';
|
|
20
20
|
/**
|
|
21
21
|
* Renders data items as cards.
|
|
22
22
|
*
|
|
@@ -42,15 +42,27 @@ export interface AppSwitcherSectionProps {
|
|
|
42
42
|
* `url`, `onClick` or `component` renders disabled.
|
|
43
43
|
*/
|
|
44
44
|
apps?: AppSwitcherAppItem[];
|
|
45
|
-
/** Section heading, rendered as an uppercase label (e.g. `"
|
|
45
|
+
/** Section heading, rendered as an uppercase label (e.g. `"Services"`) */
|
|
46
46
|
label?: string;
|
|
47
47
|
/**
|
|
48
48
|
* Accessible name for the grid when there is no visible `label`. Ignored
|
|
49
49
|
* when `label` is set, since the heading already names the grid.
|
|
50
50
|
*/
|
|
51
51
|
'aria-label'?: string;
|
|
52
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* Number of grid columns from the `sm` breakpoint up. Defaults to 3, or to 2
|
|
54
|
+
* when the section holds exactly four cards, so four lay out as an even 2×2
|
|
55
|
+
* grid rather than a row of three with one left over.
|
|
56
|
+
*/
|
|
53
57
|
columns?: number;
|
|
58
|
+
/**
|
|
59
|
+
* Visual treatment for the section and its cards (default: `"manage"` inside
|
|
60
|
+
* the footer, `"platform"` elsewhere). Use `"manage"` for the Choreo Labs Cloud row
|
|
61
|
+
* (Cloud home, organization settings) placed above the services: its cards
|
|
62
|
+
* take the smaller neutral glyph, and a divider separates it from the next
|
|
63
|
+
* section.
|
|
64
|
+
*/
|
|
65
|
+
tone?: AppSwitcherAppTone;
|
|
54
66
|
/** Shows placeholder cards, e.g. while the apps are fetched */
|
|
55
67
|
loading?: boolean;
|
|
56
68
|
/** Number of placeholder cards while `loading` (default: one row, `columns`) */
|
|
@@ -65,12 +77,14 @@ export interface AppSwitcherSectionProps {
|
|
|
65
77
|
*
|
|
66
78
|
* @example
|
|
67
79
|
* ```tsx
|
|
68
|
-
* <AppSwitcher.Section label="
|
|
69
|
-
* <AppSwitcher.App name="Agent
|
|
70
|
-
* <AppSwitcher.App name="API
|
|
80
|
+
* <AppSwitcher.Section label="Services">
|
|
81
|
+
* <AppSwitcher.App name="Agent Management" url="https://agent.example.com" icon={<Bot size={32} />} />
|
|
82
|
+
* <AppSwitcher.App name="API Management" url="https://api.example.com" icon={<Cpu size={32} />} />
|
|
71
83
|
* </AppSwitcher.Section>
|
|
72
84
|
*
|
|
73
|
-
* <AppSwitcher.Section label="
|
|
85
|
+
* <AppSwitcher.Section label="Services" apps={services} loading={isLoading} />
|
|
86
|
+
*
|
|
87
|
+
* <AppSwitcher.Section aria-label="Manage" tone="manage" columns={2} apps={cloudLinks} />
|
|
74
88
|
* ```
|
|
75
89
|
*/
|
|
76
90
|
export declare const AppSwitcherSection: React.FC<AppSwitcherSectionProps>;
|
|
@@ -29,7 +29,7 @@ export interface AppSwitcherTriggerProps extends Omit<React.ComponentProps<typeo
|
|
|
29
29
|
/**
|
|
30
30
|
* AppSwitcher.Trigger - Icon button that opens the app switcher popover.
|
|
31
31
|
*
|
|
32
|
-
* Renders the grid ("grip") icon used across
|
|
32
|
+
* Renders the grid ("grip") icon used across Choreo Labs Cloud headers. Extra props,
|
|
33
33
|
* including `aria-*` attributes and `ref`, are forwarded to the underlying button.
|
|
34
34
|
*
|
|
35
35
|
* @example
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import MuiButton, { type ButtonProps as MuiButtonProps } from '@mui/material/Button';
|
|
2
|
+
declare module '@mui/material/Button' {
|
|
3
|
+
interface ButtonOwnProps {
|
|
4
|
+
/**
|
|
5
|
+
* Animates the gradient of a `color="gradient"` button: the outline of an `outlined` button
|
|
6
|
+
* circles around it, and the fill of a `contained` button or the label of a `text` button flows
|
|
7
|
+
* across. Ignored for other colors, and held still when the user prefers reduced motion.
|
|
8
|
+
* @default false
|
|
9
|
+
*/
|
|
10
|
+
animated?: boolean;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export type ButtonProps = MuiButtonProps;
|
|
14
|
+
/**
|
|
15
|
+
* MUI's Button, with an `animated` prop for the `gradient` color. The prop is turned into a class
|
|
16
|
+
* rather than passed on, since MUI would otherwise forward it to the DOM element.
|
|
17
|
+
*/
|
|
18
|
+
declare const Button: typeof MuiButton;
|
|
19
|
+
export default Button;
|
|
@@ -52,7 +52,7 @@ export interface ContextSwitcherProps extends Omit<React.ComponentPropsWithoutRe
|
|
|
52
52
|
* <Header.Switchers>
|
|
53
53
|
* <ContextSwitcher value={value} onChange={setValue}>
|
|
54
54
|
* <ContextSwitcher.Level id="organization" label="Organization">
|
|
55
|
-
* <ContextSwitcher.Option value="
|
|
55
|
+
* <ContextSwitcher.Option value="choreo-labs">Choreo Labs</ContextSwitcher.Option>
|
|
56
56
|
* </ContextSwitcher.Level>
|
|
57
57
|
* <ContextSwitcher.Level id="project" label="Project">
|
|
58
58
|
* <ContextSwitcher.Option value="finance-web">Finance Web</ContextSwitcher.Option>
|
|
@@ -23,8 +23,11 @@ import { LinkProps } from '@mui/material/Link';
|
|
|
23
23
|
export interface FooterLinkProps extends Omit<LinkProps, 'underline'> {
|
|
24
24
|
/** Link text */
|
|
25
25
|
children: React.ReactNode;
|
|
26
|
-
/**
|
|
27
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Link URL. Leave it out for an action that is not a navigation, such as opening cookie settings:
|
|
28
|
+
* the link then renders as a `button` and runs `onClick`.
|
|
29
|
+
*/
|
|
30
|
+
href?: string;
|
|
28
31
|
}
|
|
29
32
|
/**
|
|
30
33
|
* FooterLink - Link element for the footer.
|
|
@@ -32,6 +35,7 @@ export interface FooterLinkProps extends Omit<LinkProps, 'underline'> {
|
|
|
32
35
|
* Usage:
|
|
33
36
|
* ```tsx
|
|
34
37
|
* <Footer.Link href="/terms">Terms & Conditions</Footer.Link>
|
|
38
|
+
* <Footer.Link onClick={openCookieSettings}>Cookie settings</Footer.Link>
|
|
35
39
|
* ```
|
|
36
40
|
*/
|
|
37
41
|
export declare const FooterLink: React.FC<FooterLinkProps>;
|
|
@@ -74,7 +74,7 @@ export declare const clearHeaderBreadcrumbsState: (options?: HeaderBreadcrumbsPe
|
|
|
74
74
|
*/
|
|
75
75
|
export declare const subscribeHeaderBreadcrumbsState: (listener: (state: HeaderBreadcrumbsStoredState | null) => void, options?: HeaderBreadcrumbsPersistOptions) => (() => void);
|
|
76
76
|
/**
|
|
77
|
-
* Returns the stored selection, such as `{ organization: '
|
|
77
|
+
* Returns the stored selection, such as `{ organization: 'choreo-labs', project: 'oxygen-ui' }`,
|
|
78
78
|
* and re-renders when it changes in this page, another tab or another app on the same
|
|
79
79
|
* origin. Returns an empty object when nothing is stored. Works without rendering
|
|
80
80
|
* HeaderBreadcrumbs, so any app can read the current context.
|
|
@@ -23,7 +23,7 @@ import type { HeaderBreadcrumbsItem, HeaderBreadcrumbsLevel, HeaderBreadcrumbsVa
|
|
|
23
23
|
* What `fetchItems` receives.
|
|
24
24
|
*/
|
|
25
25
|
export interface HeaderBreadcrumbsFetchContext {
|
|
26
|
-
/** Selected ids of the levels above this one, for example `{ organization: '
|
|
26
|
+
/** Selected ids of the levels above this one, for example `{ organization: 'choreo-labs' }`. */
|
|
27
27
|
parents: HeaderBreadcrumbsValue;
|
|
28
28
|
/** Aborted when the parents change, the level is refreshed again, or the hook unmounts. */
|
|
29
29
|
signal: AbortSignal;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { type ColorSchemeSVGProps } from '../ColorSchemeSVG';
|
|
3
|
+
import { type StatusIllustrationStatus } from './illustrations';
|
|
4
|
+
export type { StatusIllustrationHttpStatus, StatusIllustrationState, StatusIllustrationStatus, } from './illustrations';
|
|
5
|
+
export interface StatusIllustrationProps extends Omit<ColorSchemeSVGProps, 'svg' | 'children' | 'viewBox' | 'preserveAspectRatio' | 'xmlns' | 'xmlnsXlink'> {
|
|
6
|
+
/**
|
|
7
|
+
* The status to illustrate: an HTTP status code (`404`, `500`, ...)
|
|
8
|
+
* or an application state (`'no-records'`, `'failed'`, `'unsuccessful'`, `'mail-sent'`).
|
|
9
|
+
*/
|
|
10
|
+
status: StatusIllustrationStatus;
|
|
11
|
+
/**
|
|
12
|
+
* Accessible label read by screen readers. Defaults to the status name, such as "404 Not found".
|
|
13
|
+
*/
|
|
14
|
+
label?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Hide the illustration from assistive technology, for when nearby text already says the same thing.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
decorative?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Themable illustrations for HTTP status codes and common application states, such as error pages,
|
|
23
|
+
* empty states and confirmation screens. Renders through `ColorSchemeSVG` and takes its colours from
|
|
24
|
+
* the theme palette, so it matches the active theme in both light and dark mode.
|
|
25
|
+
*
|
|
26
|
+
* Any colour can be overridden by setting its CSS variable through `sx`: `--illustration-primary`,
|
|
27
|
+
* `--illustration-accent`, `--illustration-danger`, `--illustration-success`, `--illustration-warning`, `--illustration-neutral`,
|
|
28
|
+
* `--illustration-ink`, `--illustration-surface`, `--illustration-on-primary`, `--illustration-on-warning`,
|
|
29
|
+
* `--illustration-shade` and `--illustration-glow` (opacity of the background glow).
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* <StatusIllustration status={404} />
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* // Next to a heading that already describes the state
|
|
39
|
+
* <StatusIllustration status="no-records" width={240} decorative />
|
|
40
|
+
* <Typography variant="h5">No records found</Typography>
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```tsx
|
|
45
|
+
* // Override a colour
|
|
46
|
+
* <StatusIllustration status={500} sx={{'--illustration-danger': '#d32f2f'}} />
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export default function StatusIllustration({ status, label, decorative, width, height, sx, ...rest }: StatusIllustrationProps): JSX.Element | null;
|