@wso2/oxygen-ui 0.13.0 → 0.14.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/components.md +235 -0
- package/.claude/components.md +235 -0
- package/dist/components/AppSwitcher/AppSwitcher.d.ts +79 -0
- package/dist/components/AppSwitcher/AppSwitcherApp.d.ts +101 -0
- package/dist/components/AppSwitcher/AppSwitcherFooter.d.ts +88 -0
- package/dist/components/AppSwitcher/AppSwitcherSection.d.ts +46 -0
- package/dist/components/AppSwitcher/AppSwitcherTrigger.d.ts +44 -0
- package/dist/components/AppSwitcher/brand.d.ts +48 -0
- package/dist/components/AppSwitcher/context.d.ts +49 -0
- package/dist/components/AppSwitcher/index.d.ts +29 -0
- package/dist/components/ColorSchemeToggle/ColorSchemeToggle.d.ts +2 -1
- package/dist/components/Header/HeaderBrand.d.ts +2 -0
- package/dist/components/NotificationPanel/NotificationList.d.ts +3 -0
- package/dist/components/NotificationPanel/NotificationPanel.d.ts +11 -0
- package/dist/components/NotificationPanel/context.d.ts +7 -0
- package/dist/components/SearchBar/SearchBar.d.ts +2 -1
- package/dist/components/SearchBar/SearchBarBase.d.ts +1 -1
- package/dist/components/UserMenu/UserMenu.d.ts +6 -2
- package/dist/components/UserMenu/UserMenuHeader.d.ts +5 -1
- package/dist/components/UserMenu/UserMenuLogout.d.ts +1 -1
- package/dist/components/UserMenu/UserMenuTrigger.d.ts +8 -3
- package/dist/components/UserMenu/getUserMenuAvatarProps.d.ts +39 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/index.js +1650 -840
- package/dist/index.js.map +4 -4
- package/package.json +4 -4
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import * as React from 'react';
|
|
19
|
+
/**
|
|
20
|
+
* Theme tokens used in this component:
|
|
21
|
+
*
|
|
22
|
+
* Colors:
|
|
23
|
+
* - `divider` - Top separator
|
|
24
|
+
* - A 2% wash of the foreground color - Footer background, setting the manage
|
|
25
|
+
* row apart from the platform grid above it without reading as a grey block
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* A single WSO2 Cloud destination in the footer.
|
|
29
|
+
*/
|
|
30
|
+
export interface AppSwitcherFooterLink {
|
|
31
|
+
/** Stable identifier, used as the React key */
|
|
32
|
+
key: string;
|
|
33
|
+
/** Link name (e.g. `"Users & roles"`) */
|
|
34
|
+
name: string;
|
|
35
|
+
/** Destination URL. Renders the card as an anchor. */
|
|
36
|
+
url?: string;
|
|
37
|
+
/** Mark shown above the name (default: the WSO2 logo) */
|
|
38
|
+
icon?: React.ReactNode;
|
|
39
|
+
/** Anchor target (default: `"_blank"`) */
|
|
40
|
+
target?: string;
|
|
41
|
+
/** Blocks navigation, e.g. for a tab the user cannot reach */
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
/** Tooltip shown on hover and focus, e.g. explaining a disabled link */
|
|
44
|
+
tooltip?: React.ReactNode;
|
|
45
|
+
/** Custom root component, e.g. a router `Link`, for client-side navigation */
|
|
46
|
+
component?: React.ElementType;
|
|
47
|
+
/**
|
|
48
|
+
* Extra props forwarded to `component`, for routers that use their own
|
|
49
|
+
* navigation prop instead of `href` (e.g. React Router's `to`).
|
|
50
|
+
*/
|
|
51
|
+
componentProps?: Record<string, unknown>;
|
|
52
|
+
/** Click handler. The popover stays open after it runs. */
|
|
53
|
+
onClick?: (event: React.MouseEvent<HTMLElement>) => void;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Props for the AppSwitcher.Footer component.
|
|
57
|
+
*/
|
|
58
|
+
export interface AppSwitcherFooterProps {
|
|
59
|
+
/** Manage cards (typically `AppSwitcher.App` elements) */
|
|
60
|
+
children?: React.ReactNode;
|
|
61
|
+
/** WSO2 Cloud destinations rendered as cards, as an alternative to `children` */
|
|
62
|
+
links?: AppSwitcherFooterLink[];
|
|
63
|
+
/** Heading above the links (default: `"Manage"`) */
|
|
64
|
+
label?: string;
|
|
65
|
+
/** Number of grid columns from the `sm` breakpoint up (default: 3) */
|
|
66
|
+
columns?: number;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* AppSwitcher.Footer - Bottom section of the app switcher popover.
|
|
70
|
+
*
|
|
71
|
+
* Holds the WSO2 Cloud destinations (organizations, users, billing) as a
|
|
72
|
+
* labelled grid of cards, using the same card as the platform grid so both rows
|
|
73
|
+
* behave identically. The neutral mark and lighter type keep them visually
|
|
74
|
+
* secondary to the platforms above.
|
|
75
|
+
*
|
|
76
|
+
* Cards composed as children pick up the `manage` treatment automatically, so
|
|
77
|
+
* they do not need to repeat `tone="manage"`.
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```tsx
|
|
81
|
+
* <AppSwitcher.Footer label="Manage">
|
|
82
|
+
* <AppSwitcher.App name="Organizations" url="https://console.wso2.com/organizations" />
|
|
83
|
+
* <AppSwitcher.App name="Billing" url="https://console.wso2.com/billing" />
|
|
84
|
+
* </AppSwitcher.Footer>
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
export declare const AppSwitcherFooter: React.FC<AppSwitcherFooterProps>;
|
|
88
|
+
export default AppSwitcherFooter;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import * as React from 'react';
|
|
19
|
+
/**
|
|
20
|
+
* Props for the AppSwitcher.Section component.
|
|
21
|
+
*/
|
|
22
|
+
export interface AppSwitcherSectionProps {
|
|
23
|
+
/** App cards (typically `AppSwitcher.App` elements) */
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
/** Section heading, rendered as an uppercase label (e.g. `"Platforms"`) */
|
|
26
|
+
label?: string;
|
|
27
|
+
/** Number of grid columns from the `sm` breakpoint up (default: 3) */
|
|
28
|
+
columns?: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* AppSwitcher.Section - Labelled grid of applications inside the popover.
|
|
32
|
+
*
|
|
33
|
+
* Renders its children as a semantic list so assistive technology announces the
|
|
34
|
+
* number of available applications. The grid collapses to a single column on
|
|
35
|
+
* narrow viewports.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* <AppSwitcher.Section label="Platforms">
|
|
40
|
+
* <AppSwitcher.App name="Agent Manager" url="https://agent.wso2.com" />
|
|
41
|
+
* <AppSwitcher.App name="API Platform" url="https://api.wso2.com" />
|
|
42
|
+
* </AppSwitcher.Section>
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare const AppSwitcherSection: React.FC<AppSwitcherSectionProps>;
|
|
46
|
+
export default AppSwitcherSection;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import * as React from 'react';
|
|
19
|
+
import IconButton from '@mui/material/IconButton';
|
|
20
|
+
/**
|
|
21
|
+
* Props for the AppSwitcher.Trigger component.
|
|
22
|
+
*/
|
|
23
|
+
export interface AppSwitcherTriggerProps extends Omit<React.ComponentProps<typeof IconButton>, 'children'> {
|
|
24
|
+
/** Tooltip and accessible label for the trigger (default: `"Switch Platforms"`) */
|
|
25
|
+
label?: string;
|
|
26
|
+
/** Custom icon replacing the default grid icon */
|
|
27
|
+
icon?: React.ReactNode;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* AppSwitcher.Trigger - Icon button that opens the app switcher popover.
|
|
31
|
+
*
|
|
32
|
+
* Renders the grid ("grip") icon used across WSO2 Cloud headers. Extra props,
|
|
33
|
+
* including `aria-*` attributes and `ref`, are forwarded to the underlying button.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```tsx
|
|
37
|
+
* <AppSwitcher>
|
|
38
|
+
* <AppSwitcher.Trigger />
|
|
39
|
+
* ...
|
|
40
|
+
* </AppSwitcher>
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare const AppSwitcherTrigger: React.ForwardRefExoticComponent<Omit<AppSwitcherTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
44
|
+
export default AppSwitcherTrigger;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* WSO2 brand colors used by the AppSwitcher.
|
|
20
|
+
*
|
|
21
|
+
* These are deliberately fixed rather than read from `palette.primary`: the
|
|
22
|
+
* switcher is WSO2 Cloud chrome, so it shows the brand orange even in a product
|
|
23
|
+
* running an indigo or grey theme.
|
|
24
|
+
*
|
|
25
|
+
* Contrast (WCAG 2.1 AA needs 4.5:1 for normal text): `main` (#FF7300) is
|
|
26
|
+
* 2.73:1 on white, so it is used only for decorative surfaces — the WSO2 mark
|
|
27
|
+
* and the hover border. Any brand-colored *text* would need a darker shade;
|
|
28
|
+
* the switcher has none.
|
|
29
|
+
*
|
|
30
|
+
* The focus indicator is author-defined, so WCAG 2.1 SC 1.4.11 holds it to
|
|
31
|
+
* 3:1 against the adjacent surface. `main` misses that, so `focus` (#E56800)
|
|
32
|
+
* carries the ring instead: 3.33:1 on the light card (#FFFFFF) and 5.63:1 on
|
|
33
|
+
* the dark one (#121212).
|
|
34
|
+
*
|
|
35
|
+
* See https://github.com/wso2/oxygen-ui/issues/558 for the palette-wide
|
|
36
|
+
* contrast discussion.
|
|
37
|
+
*/
|
|
38
|
+
export declare const APP_SWITCHER_BRAND: {
|
|
39
|
+
/** Full-strength WSO2 orange. Decorative surfaces only. */
|
|
40
|
+
readonly main: "#FF7300";
|
|
41
|
+
/**
|
|
42
|
+
* Darker orange reserved for the focus ring, where 3:1 against the card
|
|
43
|
+
* surface is required. Do not swap it back to `main`.
|
|
44
|
+
*/
|
|
45
|
+
readonly focus: "#E56800";
|
|
46
|
+
/** Faded orange for the mark of a platform that is not yet available. */
|
|
47
|
+
readonly surfaceMark: "#FFC199";
|
|
48
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import * as React from 'react';
|
|
19
|
+
/**
|
|
20
|
+
* Context value for the AppSwitcher compound component.
|
|
21
|
+
*/
|
|
22
|
+
export interface AppSwitcherContextValue {
|
|
23
|
+
/** Whether the popover is open */
|
|
24
|
+
open: boolean;
|
|
25
|
+
/** Element the popover is anchored to */
|
|
26
|
+
anchorEl: HTMLElement | null;
|
|
27
|
+
/** Id of the popover surface, used for `aria-controls` on the trigger */
|
|
28
|
+
popoverId: string;
|
|
29
|
+
/** Opens the popover, anchoring it to the event target */
|
|
30
|
+
handleOpen: (event: React.MouseEvent<HTMLElement>) => void;
|
|
31
|
+
/** Closes the popover */
|
|
32
|
+
handleClose: () => void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Context for sharing state between AppSwitcher compound components.
|
|
36
|
+
*/
|
|
37
|
+
export declare const AppSwitcherContext: React.Context<AppSwitcherContextValue | null>;
|
|
38
|
+
/**
|
|
39
|
+
* Hook to access AppSwitcher context.
|
|
40
|
+
* @throws Error if used outside AppSwitcher
|
|
41
|
+
*/
|
|
42
|
+
export declare const useAppSwitcher: () => AppSwitcherContextValue;
|
|
43
|
+
/**
|
|
44
|
+
* Context marking the subtree inside `AppSwitcher.Footer`.
|
|
45
|
+
*
|
|
46
|
+
* Lets a composed `AppSwitcher.App` pick up the footer's `manage` treatment
|
|
47
|
+
* without every card repeating `tone="manage"`.
|
|
48
|
+
*/
|
|
49
|
+
export declare const AppSwitcherFooterContext: React.Context<boolean>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
export { AppSwitcher, default } from './AppSwitcher';
|
|
19
|
+
export type { AppSwitcherProps } from './AppSwitcher';
|
|
20
|
+
export { AppSwitcherTrigger } from './AppSwitcherTrigger';
|
|
21
|
+
export type { AppSwitcherTriggerProps } from './AppSwitcherTrigger';
|
|
22
|
+
export { AppSwitcherSection } from './AppSwitcherSection';
|
|
23
|
+
export type { AppSwitcherSectionProps } from './AppSwitcherSection';
|
|
24
|
+
export { AppSwitcherApp } from './AppSwitcherApp';
|
|
25
|
+
export type { AppSwitcherAppProps, AppSwitcherAppTone } from './AppSwitcherApp';
|
|
26
|
+
export { AppSwitcherFooter } from './AppSwitcherFooter';
|
|
27
|
+
export type { AppSwitcherFooterProps, AppSwitcherFooterLink } from './AppSwitcherFooter';
|
|
28
|
+
export { AppSwitcherContext, useAppSwitcher } from './context';
|
|
29
|
+
export type { AppSwitcherContextValue } from './context';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { IconButtonProps } from '@mui/material/IconButton';
|
|
2
3
|
/**
|
|
3
4
|
* Props for the ColorSchemeToggle component.
|
|
@@ -9,5 +10,5 @@ interface ColorSchemeToggleProps extends IconButtonProps {
|
|
|
9
10
|
lightModeIcon?: React.ReactNode;
|
|
10
11
|
systemModeIcon?: React.ReactNode;
|
|
11
12
|
}
|
|
12
|
-
export declare const ColorSchemeToggle: React.
|
|
13
|
+
export declare const ColorSchemeToggle: React.ForwardRefExoticComponent<Omit<ColorSchemeToggleProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
13
14
|
export default ColorSchemeToggle;
|
|
@@ -25,6 +25,8 @@ import { HeaderBrandTitle } from './HeaderBrandTitle';
|
|
|
25
25
|
export interface HeaderBrandProps {
|
|
26
26
|
/** Click handler for brand area */
|
|
27
27
|
onClick?: () => void;
|
|
28
|
+
/** Accessible name for the brand button when onClick is provided */
|
|
29
|
+
'aria-label'?: string;
|
|
28
30
|
/** Child components (BrandLogo, BrandTitle) */
|
|
29
31
|
children: React.ReactNode;
|
|
30
32
|
/** Additional sx props */
|
|
@@ -32,6 +32,9 @@ export interface NotificationListProps {
|
|
|
32
32
|
* NotificationList - Scrollable container for notification items.
|
|
33
33
|
*
|
|
34
34
|
* Renders a list of NotificationItem components with optional dividers.
|
|
35
|
+
* Does not auto-announce list changes (filtering/tabs can change child count
|
|
36
|
+
* without new arrivals). Consumers should publish via `liveAnnouncement` or
|
|
37
|
+
* `useNotificationPanel().setLiveAnnouncement` when items actually arrive.
|
|
35
38
|
*/
|
|
36
39
|
export declare const NotificationList: React.FC<NotificationListProps>;
|
|
37
40
|
export default NotificationList;
|
|
@@ -48,6 +48,17 @@ export interface NotificationPanelProps {
|
|
|
48
48
|
anchor?: 'left' | 'right';
|
|
49
49
|
/** Drawer variant (default: 'temporary') */
|
|
50
50
|
variant?: 'permanent' | 'persistent' | 'temporary';
|
|
51
|
+
/**
|
|
52
|
+
* Accessible name for the drawer dialog (default: `"Notifications"`).
|
|
53
|
+
* Override when the visible header title differs.
|
|
54
|
+
*/
|
|
55
|
+
'aria-label'?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Polite live-region message for status updates (e.g. new arrivals or sync).
|
|
58
|
+
* List child-count changes are not announced automatically — publish here
|
|
59
|
+
* (or via `useNotificationPanel().setLiveAnnouncement`) when items arrive.
|
|
60
|
+
*/
|
|
61
|
+
liveAnnouncement?: string;
|
|
51
62
|
/** Additional sx props */
|
|
52
63
|
sx?: SxProps<Theme>;
|
|
53
64
|
}
|
|
@@ -22,6 +22,13 @@ import * as React from 'react';
|
|
|
22
22
|
export interface NotificationPanelContextValue {
|
|
23
23
|
/** Callback to close the panel */
|
|
24
24
|
onClose: () => void;
|
|
25
|
+
/** Whether the panel drawer is open */
|
|
26
|
+
open: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Announce a status message via the panel's polite live region.
|
|
29
|
+
* Use when new notifications arrive (list child-count changes are not auto-announced).
|
|
30
|
+
*/
|
|
31
|
+
setLiveAnnouncement: (message: string) => void;
|
|
25
32
|
}
|
|
26
33
|
/**
|
|
27
34
|
* Context for sharing state between NotificationPanel compound components.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { TextFieldProps } from '@mui/material/TextField';
|
|
2
3
|
export interface SearchBarProps extends Omit<TextFieldProps, 'variant'> {
|
|
3
4
|
}
|
|
4
|
-
export declare
|
|
5
|
+
export declare const SearchBar: React.ForwardRefExoticComponent<Omit<SearchBarProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
6
|
export default SearchBar;
|
|
@@ -3,5 +3,5 @@ import { TextFieldProps } from '@mui/material/TextField';
|
|
|
3
3
|
export interface SearchBarBaseProps extends Omit<TextFieldProps, 'variant'> {
|
|
4
4
|
endAdornment?: React.ReactNode;
|
|
5
5
|
}
|
|
6
|
-
export declare
|
|
6
|
+
export declare const SearchBarBase: React.ForwardRefExoticComponent<Omit<SearchBarBaseProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
7
|
export default SearchBarBase;
|
|
@@ -29,7 +29,11 @@ export interface UserMenuUser {
|
|
|
29
29
|
name: string;
|
|
30
30
|
/** User email address */
|
|
31
31
|
email: string;
|
|
32
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* Avatar image URL or initials text.
|
|
34
|
+
* Image-like values (`http(s):`, `/`, `data:`, `blob:`) are used as `src`.
|
|
35
|
+
* Other strings (e.g. `"JD"`) are shown as initials. If omitted, falls back to the first letter of `name`.
|
|
36
|
+
*/
|
|
33
37
|
avatar?: string;
|
|
34
38
|
/** Role or plan badge (e.g., "Pro", "Admin") */
|
|
35
39
|
role?: string;
|
|
@@ -54,7 +58,7 @@ export interface UserMenuProps {
|
|
|
54
58
|
* <UserMenu.Item icon={<UserIcon />} label="Profile" onClick={...} />
|
|
55
59
|
* <UserMenu.Item icon={<Settings />} label="Settings" onClick={...} />
|
|
56
60
|
* <UserMenu.Divider />
|
|
57
|
-
* <UserMenu.
|
|
61
|
+
* <UserMenu.Logout icon={<LogOut />} label="Log out" onClick={...} />
|
|
58
62
|
* </UserMenu>
|
|
59
63
|
* ```
|
|
60
64
|
*/
|
|
@@ -24,7 +24,11 @@ export interface UserMenuHeaderProps {
|
|
|
24
24
|
name: string;
|
|
25
25
|
/** User email address */
|
|
26
26
|
email: string;
|
|
27
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Avatar image URL or initials text.
|
|
29
|
+
* Image-like values (`http(s):`, `/`, `data:`, `blob:`) are used as `src`.
|
|
30
|
+
* Other strings (e.g. `"JD"`) are shown as initials. If omitted, falls back to the first letter of `name`.
|
|
31
|
+
*/
|
|
28
32
|
avatar?: string | null;
|
|
29
33
|
/** Role or plan badge (e.g., "Pro", "Admin") */
|
|
30
34
|
role?: string;
|
|
@@ -28,6 +28,6 @@ export interface UserMenuLogoutProps {
|
|
|
28
28
|
onClick?: () => void;
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
|
-
* UserMenu.Logout -
|
|
31
|
+
* UserMenu.Logout - Menu item for the sign-out action.
|
|
32
32
|
*/
|
|
33
33
|
export declare const UserMenuLogout: React.FC<UserMenuLogoutProps>;
|
|
@@ -16,13 +16,18 @@
|
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
18
|
import * as React from 'react';
|
|
19
|
+
import IconButton from '@mui/material/IconButton';
|
|
19
20
|
/**
|
|
20
21
|
* Props for the UserMenu.Trigger component.
|
|
21
22
|
*/
|
|
22
|
-
export interface UserMenuTriggerProps {
|
|
23
|
+
export interface UserMenuTriggerProps extends Omit<React.ComponentProps<typeof IconButton>, 'children'> {
|
|
23
24
|
/** User display name */
|
|
24
25
|
name: string;
|
|
25
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* Avatar image URL or initials text.
|
|
28
|
+
* Image-like values (`http(s):`, `/`, `data:`, `blob:`) are used as `src`.
|
|
29
|
+
* Other strings (e.g. `"JD"`) are shown as initials. If omitted, falls back to the first letter of `name`.
|
|
30
|
+
*/
|
|
26
31
|
avatar?: string | null;
|
|
27
32
|
/** Whether to show the name text after the avatar */
|
|
28
33
|
showName?: boolean;
|
|
@@ -30,4 +35,4 @@ export interface UserMenuTriggerProps {
|
|
|
30
35
|
/**
|
|
31
36
|
* UserMenu.Trigger - Avatar button that opens the menu.
|
|
32
37
|
*/
|
|
33
|
-
export declare const UserMenuTrigger: React.
|
|
38
|
+
export declare const UserMenuTrigger: React.ForwardRefExoticComponent<Omit<UserMenuTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Props resolved for MUI Avatar from a UserMenu `avatar` value.
|
|
20
|
+
*/
|
|
21
|
+
export interface UserMenuAvatarProps {
|
|
22
|
+
/** Image URL when `avatar` looks like a URL; otherwise undefined */
|
|
23
|
+
src?: string;
|
|
24
|
+
/** Initials or fallback letter shown when there is no image (or image fails) */
|
|
25
|
+
children: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Returns whether a string should be treated as an avatar image URL.
|
|
29
|
+
*/
|
|
30
|
+
export declare function isUserMenuAvatarImageUrl(value: string): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Resolves MUI Avatar `src` and children from a UserMenu `avatar` value.
|
|
33
|
+
*
|
|
34
|
+
* - Image-like values (`http(s):`, `/`, `data:`, `blob:`) are used as `src`,
|
|
35
|
+
* with the name initial as children for failed loads.
|
|
36
|
+
* - Other non-empty strings (e.g. `"JD"`) are treated as initials children.
|
|
37
|
+
* - Null/undefined falls back to the first character of `name`.
|
|
38
|
+
*/
|
|
39
|
+
export declare function getUserMenuAvatarProps(name: string, avatar?: string | null): UserMenuAvatarProps;
|
|
@@ -40,6 +40,8 @@ export { default as SearchBar } from './SearchBar/SearchBar';
|
|
|
40
40
|
export type { SearchBarProps } from './SearchBar/SearchBar';
|
|
41
41
|
export { Header } from './Header';
|
|
42
42
|
export type { HeaderProps, HeaderSpacerProps, HeaderToggleProps, HeaderBrandProps, HeaderBrandLogoProps, HeaderBrandTitleProps, HeaderSwitchersProps, HeaderActionsProps, HeaderContextValue, } from './Header';
|
|
43
|
+
export { AppSwitcher } from './AppSwitcher';
|
|
44
|
+
export type { AppSwitcherProps, AppSwitcherTriggerProps, AppSwitcherSectionProps, AppSwitcherAppProps, AppSwitcherAppTone, AppSwitcherFooterProps, AppSwitcherFooterLink, AppSwitcherContextValue, } from './AppSwitcher';
|
|
43
45
|
export { Sidebar, useSidebar } from './Sidebar';
|
|
44
46
|
export type { SidebarProps, SidebarNavProps, SidebarCategoryProps, SidebarCategoryLabelProps, SidebarItemProps, SidebarItemIconProps, SidebarItemLabelProps, SidebarItemBadgeProps, SidebarFooterProps, SidebarUserProps, SidebarUserAvatarProps, SidebarUserNameProps, SidebarUserEmailProps, SidebarContextValue, SidebarItemContextValue, } from './Sidebar';
|
|
45
47
|
export { NotificationPanel } from './NotificationPanel';
|