@wso2/oxygen-ui 0.13.1 → 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.
@@ -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';
@@ -58,7 +58,7 @@ export interface UserMenuProps {
58
58
  * <UserMenu.Item icon={<UserIcon />} label="Profile" onClick={...} />
59
59
  * <UserMenu.Item icon={<Settings />} label="Settings" onClick={...} />
60
60
  * <UserMenu.Divider />
61
- * <UserMenu.Item icon={<LogOut />} label="Log out" destructive onClick={...} />
61
+ * <UserMenu.Logout icon={<LogOut />} label="Log out" onClick={...} />
62
62
  * </UserMenu>
63
63
  * ```
64
64
  */
@@ -28,6 +28,6 @@ export interface UserMenuLogoutProps {
28
28
  onClick?: () => void;
29
29
  }
30
30
  /**
31
- * UserMenu.Logout - Destructive menu item for logout action.
31
+ * UserMenu.Logout - Menu item for the sign-out action.
32
32
  */
33
33
  export declare const UserMenuLogout: React.FC<UserMenuLogoutProps>;
@@ -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';