@wso2/oxygen-ui 0.15.0 → 0.16.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.
@@ -18,6 +18,41 @@ description: Generate application layouts with AppShell, Header, and Sidebar. Us
18
18
  - Use compound component pattern for `AppShell`, `Header`, `Sidebar`
19
19
  - Import icons from `@wso2/oxygen-ui-icons-react`
20
20
  - Use theme tokens for all styling
21
+ - Set a browser tab title on every page using `[Specific page/resource] | [Product]` (see below)
22
+
23
+ ## Browser Tab Title
24
+
25
+ Every page must set a browser tab title in this format, so users can tell tabs, bookmarks, and history entries apart. Render a React 19 `<title>` element in the page component rather than assigning `document.title`:
26
+
27
+ ```text
28
+ [Specific page/resource] | [Product]
29
+ ```
30
+
31
+ Examples:
32
+
33
+ ```text
34
+ All Projects | Acme Console
35
+ Environments | Acme Console
36
+ ```
37
+
38
+ - Put the specific page or resource first and the product name last
39
+ - Separate them with ` | ` (space, pipe, space)
40
+ - Use the same product name on every page
41
+ - On the product home or landing page, use the product name only: `Acme Console`
42
+ - For nested resources, go from most to least specific: `Environments | Payments API | Acme Console`
43
+ - For dynamic names, use the resource name once it loads; until then show the page type (`Project | Acme Console`), never `Loading...`
44
+ - On error pages, name the error: `Page Not Found | Acme Console`
45
+
46
+ ```tsx
47
+ function ProjectsPage() {
48
+ return (
49
+ <>
50
+ <title>All Projects | Acme Console</title>
51
+ {/* page content */}
52
+ </>
53
+ );
54
+ }
55
+ ```
21
56
 
22
57
  ## Complete App Shell Layout
23
58
 
@@ -42,6 +77,16 @@ import {
42
77
  FileIcon,
43
78
  } from '@wso2/oxygen-ui-icons-react';
44
79
 
80
+ function ProjectsPage() {
81
+ return (
82
+ <>
83
+ <title>All Projects | My Application</title>
84
+ {/* Page content goes here */}
85
+ <h1>All Projects</h1>
86
+ </>
87
+ );
88
+ }
89
+
45
90
  function App() {
46
91
  const [collapsed, setCollapsed] = useState(false);
47
92
  const [activeItem, setActiveItem] = useState('home');
@@ -116,8 +161,7 @@ function App() {
116
161
 
117
162
  <AppShell.Main>
118
163
  <Box sx={{ p: 3 }}>
119
- {/* Page content goes here */}
120
- <h1>Welcome</h1>
164
+ <ProjectsPage />
121
165
  </Box>
122
166
  </AppShell.Main>
123
167
 
@@ -39,11 +39,11 @@ export interface HeaderToggleProps {
39
39
  /**
40
40
  * HeaderToggle - Sidebar toggle button for the header.
41
41
  *
42
- * Displays an icon that indicates the current sidebar state
42
+ * Displays a hamburger icon; state is conveyed via tooltip and `aria-expanded`
43
43
  * and toggles between expanded/collapsed states.
44
44
  *
45
45
  * Custom icons can be provided via `expandIcon` and `collapseIcon` props.
46
- * Defaults: `Menu` when collapsed (expand), `PanelLeftClose` when expanded (collapse).
46
+ * Defaults to `Menu` in both states.
47
47
  *
48
48
  * Theme tokens used:
49
49
  * - `text.secondary` - Icon color
@@ -1,6 +1,18 @@
1
- import { ReactElement } from 'react';
1
+ import { ReactElement, ReactNode } from 'react';
2
2
  import { TableBodyProps as MuiTableBodyProps } from '@mui/material/TableBody';
3
3
  export interface ListingTableBodyProps extends MuiTableBodyProps {
4
+ /** Active search query; falls back to the ListingTable.Provider value */
5
+ searchValue?: string;
6
+ /** Skips the no-results state while data is loading; falls back to the ListingTable.Provider value */
7
+ loading?: boolean;
8
+ /** @default 'No results found' */
9
+ noSearchResultsText?: string;
10
+ /** @default 'Try a different keyword' */
11
+ noSearchResultsDescription?: string;
12
+ /** @default <Search /> */
13
+ noSearchResultsIcon?: ReactNode;
14
+ /** @default 1000 */
15
+ emptyStateColSpan?: number;
4
16
  }
5
- export declare function ListingTableBody({ children, ...props }: ListingTableBodyProps): ReactElement;
17
+ export declare function ListingTableBody({ children, searchValue, loading, noSearchResultsText, noSearchResultsDescription, noSearchResultsIcon, emptyStateColSpan, ...props }: ListingTableBodyProps): ReactElement;
6
18
  export default ListingTableBody;
@@ -0,0 +1,61 @@
1
+ import * as React from 'react';
2
+ import type { SxProps, Theme } from '@mui/material/styles';
3
+ /**
4
+ * Props for the RelativeTime component
5
+ */
6
+ export interface RelativeTimeProps {
7
+ /**
8
+ * The relative time text to display, provided by the consumer (e.g. "3 weeks ago").
9
+ */
10
+ time: React.ReactNode;
11
+ /**
12
+ * Optional operation shown before the time (e.g. "Created", "Updated", "Deleted").
13
+ */
14
+ action?: React.ReactNode;
15
+ /**
16
+ * Machine-readable date/time for the `<time>` element (e.g. an ISO 8601 string).
17
+ */
18
+ dateTime?: string;
19
+ /**
20
+ * Optional tooltip content, typically the full absolute date.
21
+ */
22
+ tooltip?: React.ReactNode;
23
+ /**
24
+ * Custom icon. Defaults to a clock icon.
25
+ */
26
+ icon?: React.ReactNode;
27
+ /**
28
+ * Hides the icon.
29
+ * @default false
30
+ */
31
+ hideIcon?: boolean;
32
+ /**
33
+ * Size of the text and icon.
34
+ * @default 'medium'
35
+ */
36
+ size?: 'small' | 'medium';
37
+ /**
38
+ * Custom styles for the root element.
39
+ */
40
+ sx?: SxProps<Theme>;
41
+ }
42
+ /**
43
+ * RelativeTime component - Displays a clock icon with an optional action and a relative time
44
+ *
45
+ * @example
46
+ * ```tsx
47
+ * <RelativeTime time="3 weeks ago" />
48
+ * ```
49
+ *
50
+ * @example
51
+ * ```tsx
52
+ * <RelativeTime
53
+ * action="Updated"
54
+ * time="5 minutes ago"
55
+ * dateTime="2026-10-08T09:15:00Z"
56
+ * tooltip="October 8, 2026, 9:15 AM"
57
+ * />
58
+ * ```
59
+ */
60
+ declare const RelativeTime: React.FC<RelativeTimeProps>;
61
+ export default RelativeTime;
@@ -0,0 +1,2 @@
1
+ export { default } from './RelativeTime';
2
+ export * from './RelativeTime';
@@ -30,6 +30,8 @@ export { default as PageContent } from './PageContent';
30
30
  export type { PageContentProps } from './PageContent';
31
31
  export { default as PageTitle } from './PageTitle';
32
32
  export type { PageTitleProps, PageTitleAvatarProps, PageTitleHeaderProps, PageTitleSubHeaderProps, PageTitleLinkProps } from './PageTitle';
33
+ export { default as RelativeTime } from './RelativeTime';
34
+ export type { RelativeTimeProps } from './RelativeTime';
33
35
  export { default as StatCard } from './StatCard';
34
36
  export type { StatCardProps } from './StatCard';
35
37
  export { default as ThemeSwitcher, ThemeSelect } from './ThemeSwitcher';