@wso2/oxygen-ui 0.9.1 → 0.10.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.
@@ -0,0 +1,98 @@
1
+ import { BoxProps } from '@mui/material/Box';
2
+ import { ComponentType, JSX, ReactNode, SVGProps } from 'react';
3
+ /**
4
+ * Props for the ColorSchemeSVG component.
5
+ * Extends BoxProps to inherit Box component properties for styling.
6
+ */
7
+ export interface ColorSchemeSVGProps extends Omit<BoxProps, 'component' | 'children'> {
8
+ /**
9
+ * SVG elements as children. Use this OR the svg prop.
10
+ */
11
+ children?: ReactNode;
12
+ /**
13
+ * SVG component imported with ?react suffix. Use this OR children.
14
+ */
15
+ svg?: ComponentType<SVGProps<SVGSVGElement>>;
16
+ /**
17
+ * Width of the SVG. Can be a number (treated as pixels) or a string.
18
+ */
19
+ width?: number | string;
20
+ /**
21
+ * Height of the SVG. Can be a number (treated as pixels) or a string.
22
+ */
23
+ height?: number | string;
24
+ /**
25
+ * ViewBox attribute for the SVG element.
26
+ * Defines the coordinate system and aspect ratio.
27
+ */
28
+ viewBox?: string;
29
+ /**
30
+ * PreserveAspectRatio attribute for the SVG element.
31
+ */
32
+ preserveAspectRatio?: string;
33
+ /**
34
+ * Xmlns attribute for the SVG element.
35
+ */
36
+ xmlns?: string;
37
+ /**
38
+ * XmlnsXlink attribute for the SVG element.
39
+ */
40
+ xmlnsXlink?: string;
41
+ }
42
+ /**
43
+ * A theme-aware SVG component that applies color scheme to SVG elements.
44
+ * Automatically maps fill and stroke attributes to theme colors for both light and dark modes.
45
+ *
46
+ * Supported color values (use with fill or stroke attributes):
47
+ * - `primary`, `secondary`, `accent`, `muted` - Theme colors
48
+ * - `text-primary`, `text-secondary`, `text-disabled` - Text colors
49
+ * - `background`, `surface` - Background colors
50
+ * - `error`, `warning`, `info`, `success` - Status colors
51
+ * - `border` - Divider color (stroke only)
52
+ * - `highlight`, `hover` - Action colors (fill only)
53
+ *
54
+ * @param props - The component props
55
+ * @param props.children - SVG elements to render (use this OR svg prop)
56
+ * @param props.svg - SVG component to render (use this OR children)
57
+ * @param props.width - Width of the SVG
58
+ * @param props.height - Height of the SVG
59
+ * @param props.viewBox - ViewBox attribute for the SVG
60
+ * @param props.sx - Additional MUI sx styles
61
+ * @param props.rest - Additional SVG attributes
62
+ * @returns A theme-aware SVG component
63
+ *
64
+ * @example
65
+ * ```tsx
66
+ * // With inline SVG elements
67
+ * <ColorSchemeSVG width={200} height={100} viewBox="0 0 200 100">
68
+ * <rect fill="primary" x="0" y="0" width="100" height="100" />
69
+ * <circle stroke="secondary" fill="none" strokeWidth="2" cx="150" cy="50" r="40" />
70
+ * </ColorSchemeSVG>
71
+ * ```
72
+ *
73
+ * @example
74
+ * ```tsx
75
+ * // With imported SVG component
76
+ * import MyLogo from './logo.svg?react';
77
+ *
78
+ * <ColorSchemeSVG svg={MyLogo} width={200} />
79
+ * ```
80
+ *
81
+ * @example
82
+ * ```tsx
83
+ * // With custom styles
84
+ * <ColorSchemeSVG
85
+ * width={400}
86
+ * height={300}
87
+ * viewBox="0 0 400 300"
88
+ * sx={{
89
+ * maxWidth: '100%',
90
+ * height: 'auto',
91
+ * }}
92
+ * >
93
+ * <rect fill="background" width="400" height="300" />
94
+ * <circle fill="primary" cx="200" cy="150" r="50" />
95
+ * </ColorSchemeSVG>
96
+ * ```
97
+ */
98
+ export default function ColorSchemeSVG({ children, svg: SvgComponent, width, height, sx, ...rest }: ColorSchemeSVGProps): JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { default } from './ColorSchemeSVG';
2
+ export * from './ColorSchemeSVG';
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ import { TextFieldProps } from '@mui/material/TextField';
3
+ export interface SearchBarBaseProps extends Omit<TextFieldProps, 'variant'> {
4
+ endAdornment?: React.ReactNode;
5
+ }
6
+ export declare function SearchBarBase({ placeholder, endAdornment, slotProps, sx, ...props }: SearchBarBaseProps): import("react/jsx-runtime").JSX.Element;
7
+ export default SearchBarBase;
@@ -0,0 +1,4 @@
1
+ export { SearchBar, SearchBarProps } from './SearchBar';
2
+ export { SearchBarBase, SearchBarBaseProps } from './SearchBarBase';
3
+ export { SearchBarWithAdvancedFilter, type SearchBarWithAdvancedFilterProps, type AdvancedFilterOption, type AdvancedFilterState, } from './SearchBarWithAdvancedFilter';
4
+ export { default } from './SearchBar';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
2
+ * Copyright (c) 2025-2026, WSO2 LLC. (https://www.wso2.com).
3
3
  *
4
4
  * WSO2 LLC. licenses this file to you under the Apache License,
5
5
  * Version 2.0 (the "License"); you may not use this file except
@@ -19,6 +19,8 @@ export { default as CodeBlock } from './CodeBlock';
19
19
  export type { CodeBlockProps } from './CodeBlock';
20
20
  export { default as ColorSchemeImage } from './ColorSchemeImage';
21
21
  export type { ColorSchemeImageProps, ColorSchemeImageAttribute } from './ColorSchemeImage';
22
+ export { default as ColorSchemeSVG } from './ColorSchemeSVG';
23
+ export type { ColorSchemeSVGProps } from './ColorSchemeSVG';
22
24
  export { ColorSchemeToggle, default as ColorSchemeToggleDefault } from './ColorSchemeToggle';
23
25
  export { default as ComplexSelect } from './ComplexSelect';
24
26
  export type { ComplexSelectProps } from './ComplexSelect';
@@ -36,7 +38,7 @@ export { default as SearchBar } from './SearchBar/SearchBar';
36
38
  export type { SearchBarProps } from './SearchBar/SearchBar';
37
39
  export { Header } from './Header';
38
40
  export type { HeaderProps, HeaderSpacerProps, HeaderToggleProps, HeaderBrandProps, HeaderBrandLogoProps, HeaderBrandTitleProps, HeaderSwitchersProps, HeaderActionsProps, HeaderContextValue, } from './Header';
39
- export { Sidebar } from './Sidebar';
41
+ export { Sidebar, useSidebar } from './Sidebar';
40
42
  export type { SidebarProps, SidebarNavProps, SidebarCategoryProps, SidebarCategoryLabelProps, SidebarItemProps, SidebarItemIconProps, SidebarItemLabelProps, SidebarItemBadgeProps, SidebarFooterProps, SidebarUserProps, SidebarUserAvatarProps, SidebarUserNameProps, SidebarUserEmailProps, SidebarContextValue, SidebarItemContextValue, } from './Sidebar';
41
43
  export { NotificationPanel } from './NotificationPanel';
42
44
  export type { NotificationPanelProps, NotificationHeaderProps, NotificationHeaderIconProps, NotificationHeaderTitleProps, NotificationHeaderBadgeProps, NotificationHeaderCloseProps, NotificationTabsProps, NotificationTabConfig, NotificationActionsProps, NotificationListProps, NotificationItemProps, NotificationItemAvatarProps, NotificationItemTitleProps, NotificationItemMessageProps, NotificationItemTimestampProps, NotificationItemActionProps, NotificationItemContextValue, NotificationEmptyStateProps, NotificationPanelContextValue, NotificationType, NotificationTypeProps, } from './NotificationPanel';
@@ -10,9 +10,10 @@ export interface ThemeOption {
10
10
  */
11
11
  label: string;
12
12
  /**
13
- * The theme object
13
+ * The theme object or a string path to load the theme from.
14
+ * If a string path is provided, the theme will be loaded asynchronously.
14
15
  */
15
- theme: Theme;
16
+ theme: Theme | string;
16
17
  }
17
18
  export interface ThemeSwitcherContextValue {
18
19
  /**
@@ -58,6 +59,11 @@ interface OxygenUIThemeProviderProps {
58
59
  * Defaults to the first theme in the themes array.
59
60
  */
60
61
  initialTheme?: string;
62
+ /**
63
+ * Callback fired when themes are loaded and resolved.
64
+ * Receives the array of resolved theme configurations.
65
+ */
66
+ onThemesLoaded?: (themes: ThemeOption[]) => void;
61
67
  }
62
- export default function OxygenUIThemeProvider({ children, theme, themes, initialTheme, }: OxygenUIThemeProviderProps): import("react/jsx-runtime").JSX.Element;
68
+ export default function OxygenUIThemeProvider({ children, theme, themes, initialTheme, onThemesLoaded, }: OxygenUIThemeProviderProps): import("react/jsx-runtime").JSX.Element | null;
63
69
  export {};