@wso2/oxygen-ui 0.2.1 → 0.4.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/PageTitle/PageTitle.d.ts +38 -0
- package/dist/components/PageTitle/PageTitleActions.d.ts +26 -0
- package/dist/components/PageTitle/PageTitleBackButton.d.ts +67 -0
- package/dist/components/PageTitle/index.d.ts +4 -0
- package/dist/components/index.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +880 -598
- package/dist/index.js.map +4 -4
- package/package.json +5 -5
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { SxProps, Theme } from '@mui/material';
|
|
2
3
|
import PageTitleHeader from './PageTitleHeader';
|
|
3
4
|
import PageTitleSubHeader from './PageTitleSubHeader';
|
|
4
5
|
import PageTitleAvatar from './PageTitleAvatar';
|
|
5
6
|
import PageTitleLink from './PageTitleLink';
|
|
7
|
+
import PageTitleActions from './PageTitleActions';
|
|
8
|
+
import PageTitleBackButton from './PageTitleBackButton';
|
|
6
9
|
/**
|
|
7
10
|
* Props for the PageTitle root component
|
|
8
11
|
*/
|
|
@@ -11,6 +14,10 @@ export interface PageTitleProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
11
14
|
* The content of the page title (can include Avatar, Header, SubHeader, and Link)
|
|
12
15
|
*/
|
|
13
16
|
children: React.ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* The sx prop for styling with Material-UI system
|
|
19
|
+
*/
|
|
20
|
+
sx?: SxProps<Theme>;
|
|
14
21
|
}
|
|
15
22
|
/**
|
|
16
23
|
* PageTitle component with compound pattern support
|
|
@@ -24,11 +31,42 @@ export interface PageTitleProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
24
31
|
* <PageTitle.Link href="/docs" icon={<LinkIcon />}>View Documentation</PageTitle.Link>
|
|
25
32
|
* </PageTitle>
|
|
26
33
|
* ```
|
|
34
|
+
*
|
|
35
|
+
* @example With Actions
|
|
36
|
+
* ```tsx
|
|
37
|
+
* <PageTitle>
|
|
38
|
+
* <PageTitle.Header>Dashboard</PageTitle.Header>
|
|
39
|
+
* <PageTitle.Actions>
|
|
40
|
+
* <Button>Action 1</Button>
|
|
41
|
+
* <Button>Action 2</Button>
|
|
42
|
+
* </PageTitle.Actions>
|
|
43
|
+
* </PageTitle>
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* @example With BackButton
|
|
47
|
+
* ```tsx
|
|
48
|
+
* <PageTitle>
|
|
49
|
+
* <Link to="/back">
|
|
50
|
+
* <PageTitle.BackButton />
|
|
51
|
+
* </Link>
|
|
52
|
+
* <PageTitle.Avatar>A</PageTitle.Avatar>
|
|
53
|
+
* <PageTitle.Header>Page Title</PageTitle.Header>
|
|
54
|
+
* </PageTitle>
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @example With BackButton and custom text
|
|
58
|
+
* ```tsx
|
|
59
|
+
* <Link to="/back">
|
|
60
|
+
* <PageTitle.BackButton>Go Back</PageTitle.BackButton>
|
|
61
|
+
* </Link>
|
|
62
|
+
* ```
|
|
27
63
|
*/
|
|
28
64
|
declare const PageTitle: React.FC<PageTitleProps> & {
|
|
29
65
|
Avatar: typeof PageTitleAvatar;
|
|
30
66
|
Header: typeof PageTitleHeader;
|
|
31
67
|
SubHeader: typeof PageTitleSubHeader;
|
|
32
68
|
Link: typeof PageTitleLink;
|
|
69
|
+
Actions: typeof PageTitleActions;
|
|
70
|
+
BackButton: typeof PageTitleBackButton;
|
|
33
71
|
};
|
|
34
72
|
export default PageTitle;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the PageTitleActions component
|
|
4
|
+
*/
|
|
5
|
+
export interface PageTitleActionsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
/**
|
|
7
|
+
* The action elements (buttons, switches, etc.)
|
|
8
|
+
*/
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* PageTitleActions component for rendering action elements in PageTitle
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* <PageTitle>
|
|
17
|
+
* <PageTitle.Header>My Page</PageTitle.Header>
|
|
18
|
+
* <PageTitle.Actions>
|
|
19
|
+
* <Button>Action 1</Button>
|
|
20
|
+
* <Button>Action 2</Button>
|
|
21
|
+
* </PageTitle.Actions>
|
|
22
|
+
* </PageTitle>
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
declare const PageTitleActions: React.FC<PageTitleActionsProps>;
|
|
26
|
+
export default PageTitleActions;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the PageTitleBackButton component
|
|
4
|
+
*/
|
|
5
|
+
import type { ButtonProps } from '@mui/material/Button';
|
|
6
|
+
export interface PageTitleBackButtonProps extends Omit<ButtonProps, 'component'> {
|
|
7
|
+
/**
|
|
8
|
+
* The text to display for the back button. Defaults to "Back"
|
|
9
|
+
*/
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Custom component to use as wrapper (e.g., React Router Link)
|
|
13
|
+
* Can be a component class or a React element
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* // With React element
|
|
17
|
+
* component={<Link to="/path" />}
|
|
18
|
+
*/
|
|
19
|
+
component?: React.ComponentType<{
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
style?: React.CSSProperties;
|
|
22
|
+
}> | React.ReactElement<{
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
}>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* PageTitleBackButton component for rendering a back button in PageTitle
|
|
28
|
+
*
|
|
29
|
+
* Supports multiple usage patterns:
|
|
30
|
+
* 1. Standalone - requires parent to handle navigation
|
|
31
|
+
* 2. With component class - pass Link component and `to` prop separately
|
|
32
|
+
* 3. With React element - pass configured Link element with `to` prop
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* // With component class (React Router v7+)
|
|
37
|
+
* import { Link } from 'react-router'
|
|
38
|
+
*
|
|
39
|
+
* <PageTitle>
|
|
40
|
+
* <PageTitle.BackButton component={Link} to="/analytics" />
|
|
41
|
+
* <PageTitle.Header>My Page</PageTitle.Header>
|
|
42
|
+
* </PageTitle>
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @example With React element
|
|
46
|
+
* ```tsx
|
|
47
|
+
* import { Link } from 'react-router'
|
|
48
|
+
*
|
|
49
|
+
* <PageTitle.BackButton component={<Link to="/analytics" />} />
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @example With custom text
|
|
53
|
+
* ```tsx
|
|
54
|
+
* <PageTitle.BackButton component={<Link to="/back" />}>
|
|
55
|
+
* Go Back
|
|
56
|
+
* </PageTitle.BackButton>
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* @example Standalone (manual Link wrapping)
|
|
60
|
+
* ```tsx
|
|
61
|
+
* <Link to="/analytics">
|
|
62
|
+
* <PageTitle.BackButton />
|
|
63
|
+
* </Link>
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
declare const PageTitleBackButton: React.FC<PageTitleBackButtonProps>;
|
|
67
|
+
export default PageTitleBackButton;
|
|
@@ -25,3 +25,7 @@ export { default as PageTitleSubHeader } from './PageTitleSubHeader';
|
|
|
25
25
|
export type { PageTitleSubHeaderProps } from './PageTitleSubHeader';
|
|
26
26
|
export { default as PageTitleLink } from './PageTitleLink';
|
|
27
27
|
export type { PageTitleLinkProps } from './PageTitleLink';
|
|
28
|
+
export { default as PageTitleActions } from './PageTitleActions';
|
|
29
|
+
export type { PageTitleActionsProps } from './PageTitleActions';
|
|
30
|
+
export { default as PageTitleBackButton } from './PageTitleBackButton';
|
|
31
|
+
export type { PageTitleBackButtonProps } from './PageTitleBackButton';
|
|
@@ -31,7 +31,7 @@ export type { StatCardProps } from './StatCard';
|
|
|
31
31
|
export { default as ThemeSwitcher, ThemeSelect } from './ThemeSwitcher';
|
|
32
32
|
export type { ThemeSwitcherProps, ThemeSelectProps } from './ThemeSwitcher';
|
|
33
33
|
export { default as SearchBarWithAdvancedFilter } from './SearchBar/SearchBarWithAdvancedFilter';
|
|
34
|
-
export type { SearchBarWithAdvancedFilterProps } from './SearchBar/SearchBarWithAdvancedFilter';
|
|
34
|
+
export type { SearchBarWithAdvancedFilterProps, AdvancedFilterState } from './SearchBar/SearchBarWithAdvancedFilter';
|
|
35
35
|
export { default as SearchBar } from './SearchBar/SearchBar';
|
|
36
36
|
export type { SearchBarProps } from './SearchBar/SearchBar';
|
|
37
37
|
export { Header } from './Header';
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
18
|
import './fonts.css';
|
|
19
|
+
export declare const version: string;
|
|
19
20
|
export * from "./styles";
|
|
20
21
|
export * from "./contexts";
|
|
21
22
|
export * from "./components";
|
|
@@ -25,7 +26,6 @@ export * from "./hooks";
|
|
|
25
26
|
export * from "./utils";
|
|
26
27
|
export * from '@mui/material';
|
|
27
28
|
export * as colors from '@mui/material/colors';
|
|
28
|
-
export * as Charts from '@mui/x-charts';
|
|
29
29
|
export * as DataGrid from '@mui/x-data-grid';
|
|
30
30
|
export * as DatePickers from '@mui/x-date-pickers';
|
|
31
31
|
export { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
|