@wso2/oxygen-ui 0.9.0 → 0.10.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/dist/components/ColorSchemeSVG/ColorSchemeSVG.d.ts +98 -0
- package/dist/components/ColorSchemeSVG/index.d.ts +2 -0
- package/dist/components/SearchBar/SearchBarBase.d.ts +7 -0
- package/dist/components/SearchBar/index.d.ts +4 -0
- package/dist/components/index.d.ts +3 -1
- package/dist/contexts/OxygenUIThemeProvider/OxygenUIThemeProvider.d.ts +9 -3
- package/dist/index.js +1210 -729
- package/dist/index.js.map +4 -4
- package/dist/styles/{Themes/OxygenThemeBase.d.ts → OxygenThemeBase.d.ts} +3 -2
- package/dist/styles/Themes/AcrylicBaseTheme.d.ts +2 -2
- package/dist/styles/Themes/AcrylicOrangeTheme.d.ts +2 -17
- package/dist/styles/Themes/AcrylicPurpleTheme.d.ts +2 -3
- package/dist/styles/Themes/ChoreoTheme.d.ts +2 -2
- package/dist/styles/Themes/ClassicTheme.d.ts +3 -4
- package/dist/styles/Themes/HighContrastTheme.d.ts +2 -2
- package/dist/styles/Themes/PaleBaseTheme.d.ts +3 -3
- package/dist/styles/Themes/PaleGray.d.ts +1 -2
- package/dist/styles/Themes/PaleIndigo.d.ts +1 -2
- package/dist/styles/Themes/WSO2Theme.d.ts +20 -0
- package/dist/styles/Themes/index.d.ts +2 -1
- package/dist/styles/index.d.ts +2 -1
- package/dist/utils/createOxygenTheme.d.ts +56 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +4 -3
|
@@ -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,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';
|
|
@@ -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 {};
|