@wso2/oxygen-ui 0.13.0 → 0.13.1
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/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 +5 -1
- package/dist/components/UserMenu/UserMenuHeader.d.ts +5 -1
- package/dist/components/UserMenu/UserMenuTrigger.d.ts +8 -3
- package/dist/components/UserMenu/getUserMenuAvatarProps.d.ts +39 -0
- package/dist/index.js +755 -413
- package/dist/index.js.map +4 -4
- package/package.json +2 -2
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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;
|