@wso2/oxygen-ui 0.19.0 → 0.21.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,39 @@
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 a labelled cluster of options.
21
+ */
22
+ export interface ContextSwitcherGroupProps {
23
+ /** Name of the group in the list. */
24
+ label: string;
25
+ /** Options in this group. */
26
+ children: React.ReactNode;
27
+ }
28
+ /** True when the child is a `ContextSwitcher.Group`. */
29
+ export declare const isContextSwitcherGroup: (child: React.ReactNode) => child is React.ReactElement<ContextSwitcherGroupProps>;
30
+ /**
31
+ * ContextSwitcher.Group - A labelled cluster of options inside a level.
32
+ *
33
+ * A marker the level reads. It must sit inside a level and is never drawn on its own.
34
+ */
35
+ export declare const ContextSwitcherGroup: {
36
+ (_props: ContextSwitcherGroupProps): React.ReactElement | null;
37
+ displayName: string;
38
+ };
39
+ export default ContextSwitcherGroup;
@@ -0,0 +1,51 @@
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 one level in the chain.
21
+ */
22
+ export interface ContextSwitcherLevelProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'id' | 'children' | 'onChange'> {
23
+ /** Key used in the context value. */
24
+ id: string;
25
+ /** Name shown on the field, such as Organization. */
26
+ label: string;
27
+ /** The list shows a progress indicator instead of the options. */
28
+ loading?: boolean;
29
+ /** Shown when the level has no options. */
30
+ noOptionsText?: string;
31
+ /** Accessible name of the progress indicator. Defaults to `Loading ${label}`. */
32
+ loadingLabel?: string;
33
+ /** Shown on the field while the level has no selection. Defaults to `Select ${label}`. */
34
+ promptText?: string;
35
+ /**
36
+ * Name of the Back control that returns to this level. Defaults to
37
+ * `Go to the ${label} level`.
38
+ */
39
+ backLabel?: string;
40
+ /** Options and groups for this level, in the order they should appear. */
41
+ children?: React.ReactNode;
42
+ }
43
+ /**
44
+ * ContextSwitcher.Level - One field in the chain, drawn as a ComplexSelect.
45
+ *
46
+ * The level name sits inside the field. The chosen option sits under it. An empty
47
+ * level reads the prompt. A long name stops at 180px, and hovering shows the full
48
+ * text. Groups become list headers. Options become menu items.
49
+ */
50
+ export declare const ContextSwitcherLevel: React.ForwardRefExoticComponent<ContextSwitcherLevelProps & React.RefAttributes<HTMLDivElement>>;
51
+ export default ContextSwitcherLevel;
@@ -0,0 +1,41 @@
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 a single choice in a level.
21
+ */
22
+ export interface ContextSwitcherOptionProps {
23
+ /** Value written into the context map when this option is picked. */
24
+ value: string;
25
+ /** Shown, but cannot be picked. */
26
+ disabled?: boolean;
27
+ /** Label shown in the field and in the list. */
28
+ children: React.ReactNode;
29
+ }
30
+ /** True when the child is a `ContextSwitcher.Option`. */
31
+ export declare const isContextSwitcherOption: (child: React.ReactNode) => child is React.ReactElement<ContextSwitcherOptionProps>;
32
+ /**
33
+ * ContextSwitcher.Option - One choice in a level.
34
+ *
35
+ * A marker the level reads. It must sit inside a level and is never drawn on its own.
36
+ */
37
+ export declare const ContextSwitcherOption: {
38
+ (_props: ContextSwitcherOptionProps): React.ReactElement | null;
39
+ displayName: string;
40
+ };
41
+ export default ContextSwitcherOption;
@@ -0,0 +1,38 @@
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 { type TooltipProps } from '@mui/material/Tooltip';
20
+ /** True when the element is clipping its text. */
21
+ export declare const isTruncated: (node: HTMLElement | null) => boolean;
22
+ /** Collapse whitespace so the tooltip matches the accessible name. */
23
+ export declare const tooltipLabel: (value: string) => string;
24
+ interface OverflowTooltipProps {
25
+ /** Full text. Shown only while `open` is true. */
26
+ title: string;
27
+ open: boolean;
28
+ onClose: () => void;
29
+ /** Where the full name sits relative to the cut-off text. */
30
+ placement?: TooltipProps['placement'];
31
+ children: React.ReactElement;
32
+ }
33
+ /**
34
+ * Tooltip for a name that has already been cut with an ellipsis.
35
+ * The caller sets `open` after measuring the text, so a name that fits stays quiet.
36
+ */
37
+ export declare const OverflowTooltip: ({ title, open, onClose, placement, children, }: OverflowTooltipProps) => React.ReactElement;
38
+ export {};
@@ -0,0 +1,41 @@
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
+ /** Map of level id to the selected option value. A missing id is an empty level. */
20
+ export type ContextSwitcherValue = Record<string, string>;
21
+ export interface ContextSwitcherContextValue {
22
+ /** Selection with orphan levels removed. */
23
+ value: ContextSwitcherValue;
24
+ /** Level ids in child order. */
25
+ levelIds: readonly string[];
26
+ /** Id of the level whose list is open, if any. */
27
+ openId: string | null;
28
+ /** Id of the level that shares a border with Back, if any. */
29
+ joinedId: string | null;
30
+ setOpenId: React.Dispatch<React.SetStateAction<string | null>>;
31
+ onChange: (value: ContextSwitcherValue) => void;
32
+ /** Move focus to the neighboring stop. Stays put at either end. */
33
+ moveFocus: (from: HTMLElement, direction: -1 | 1) => void;
34
+ /**
35
+ * Applies a pick. The same option keeps the levels under it. A different
36
+ * option clears them. Either way the next level's list opens.
37
+ */
38
+ applyPick: (levelId: string, optionValue: string) => void;
39
+ }
40
+ export declare const ContextSwitcherContext: React.Context<ContextSwitcherContextValue | null>;
41
+ export declare const useContextSwitcher: () => ContextSwitcherContextValue;
@@ -0,0 +1,26 @@
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 { ContextSwitcher, default } from './ContextSwitcher';
19
+ export type { ContextSwitcherProps } from './ContextSwitcher';
20
+ export type { ContextSwitcherValue } from './context';
21
+ export { ContextSwitcherLevel } from './ContextSwitcherLevel';
22
+ export type { ContextSwitcherLevelProps } from './ContextSwitcherLevel';
23
+ export { ContextSwitcherGroup } from './ContextSwitcherGroup';
24
+ export type { ContextSwitcherGroupProps } from './ContextSwitcherGroup';
25
+ export { ContextSwitcherOption } from './ContextSwitcherOption';
26
+ export type { ContextSwitcherOptionProps } from './ContextSwitcherOption';
@@ -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 type { ContextSwitcherValue } from './context';
20
+ /**
21
+ * Elements in child order. A fragment is transparent. Text and empty slots are skipped.
22
+ */
23
+ export declare const flattenElements: (children: React.ReactNode) => React.ReactElement[];
24
+ /**
25
+ * Visible text of a React node, used to name an option.
26
+ */
27
+ export declare const nodeText: (node: React.ReactNode) => string;
28
+ /**
29
+ * Keeps selections from the first level up to, but not including, the first
30
+ * level that has no selection. A later value whose parent is empty is ignored.
31
+ */
32
+ export declare const normalizeValue: (levelIds: readonly string[], value: ContextSwitcherValue) => ContextSwitcherValue;
33
+ /**
34
+ * How many levels have a selection, stopping at the first empty level.
35
+ */
36
+ export declare const selectedLevelCount: (levelIds: readonly string[], value: ContextSwitcherValue) => number;
37
+ /**
38
+ * Drops a level and every level after it.
39
+ */
40
+ export declare const clearFrom: (levelIds: readonly string[], value: ContextSwitcherValue, levelId: string) => ContextSwitcherValue;
41
+ /**
42
+ * Sets a level and drops every level after it. Earlier levels stay.
43
+ */
44
+ export declare const selectLevel: (levelIds: readonly string[], value: ContextSwitcherValue, levelId: string, optionValue: string) => ContextSwitcherValue;
@@ -1,6 +1,13 @@
1
1
  import * as React from 'react';
2
2
  import { TextFieldProps } from '@mui/material/TextField';
3
3
  export interface SearchBarProps extends Omit<TextFieldProps, 'variant'> {
4
+ /**
5
+ * `standard` sizes the field to 400px, shrinking in narrower containers.
6
+ * Use it for list and grid page search so it looks the same across the product.
7
+ * `fullWidth` takes precedence when both are set.
8
+ * @default 'auto'
9
+ */
10
+ width?: 'auto' | 'standard';
4
11
  }
5
12
  export declare const SearchBar: React.ForwardRefExoticComponent<Omit<SearchBarProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
6
13
  export default SearchBar;
@@ -91,6 +91,34 @@ export interface TrialBadgeUsageItem {
91
91
  */
92
92
  limit: number;
93
93
  }
94
+ /**
95
+ * A run of resources inside a section, optionally under a sub-heading.
96
+ *
97
+ * One level only: a group holds rows, never further groups. Use a titled group
98
+ * to name a related run of rows ("Gateways") without promoting them to a
99
+ * section of their own, which would separate them from the rest of their
100
+ * section.
101
+ *
102
+ * An untitled group renders its rows plainly — no sub-heading, no indent, the
103
+ * same as a section's own `items`. That is how a section orders its content:
104
+ * loose `items` always come first, so a plain row that must follow a titled
105
+ * group goes in a trailing untitled group instead.
106
+ */
107
+ export interface TrialBadgeUsageGroup {
108
+ /**
109
+ * Stable key for the group. Falls back to the title.
110
+ */
111
+ key?: string;
112
+ /**
113
+ * Sub-heading shown above the group's rows, which are indented beneath it.
114
+ * Omit for a plain run of rows with no sub-heading.
115
+ */
116
+ title?: React.ReactNode;
117
+ /**
118
+ * The resources to list in this group.
119
+ */
120
+ items: TrialBadgeUsageItem[];
121
+ }
94
122
  /**
95
123
  * A titled group of resources in the usage panel.
96
124
  */
@@ -104,12 +132,21 @@ export interface TrialBadgeUsageSection {
104
132
  */
105
133
  title: React.ReactNode;
106
134
  /**
107
- * The resources to list. The section total is the sum of their counts and limits.
135
+ * The resources listed directly under the section heading, above any `groups`.
136
+ * Optional so a section can hold nothing but groups.
108
137
  */
109
- items: TrialBadgeUsageItem[];
138
+ items?: TrialBadgeUsageItem[];
139
+ /**
140
+ * Further runs of rows, rendered in order after `items`. A group may carry a
141
+ * sub-heading or not; an untitled one is the way to place a plain row below a
142
+ * titled group.
143
+ */
144
+ groups?: TrialBadgeUsageGroup[];
110
145
  /**
111
146
  * Text after the section total, e.g. `left` gives "14 of 30 left".
112
147
  * The total is shown only when this is passed.
148
+ *
149
+ * The total covers every row in the section, `groups` included.
113
150
  */
114
151
  totalSuffix?: React.ReactNode;
115
152
  }
@@ -41,7 +41,7 @@ export type { TextFieldProps, TextFieldLabelPlacement } from './TextField';
41
41
  export { default as StatCard } from './StatCard';
42
42
  export type { StatCardProps } from './StatCard';
43
43
  export { default as TrialBadge, getTrialBadgeStatus } from './TrialBadge';
44
- export type { TrialBadgeProps, TrialBadgeStatus, TrialBadgeUsage, TrialBadgeUsageItem, TrialBadgeUsageSection, TrialBadgeUsageTone, } from './TrialBadge';
44
+ export type { TrialBadgeProps, TrialBadgeStatus, TrialBadgeUsage, TrialBadgeUsageGroup, TrialBadgeUsageItem, TrialBadgeUsageSection, TrialBadgeUsageTone, } from './TrialBadge';
45
45
  export { default as ThemeSwitcher, ThemeSelect } from './ThemeSwitcher';
46
46
  export type { ThemeSwitcherProps, ThemeSelectProps } from './ThemeSwitcher';
47
47
  export { default as TimeRangeFilter } from './TimeRangeFilter';
@@ -52,6 +52,8 @@ export { default as SearchBar } from './SearchBar/SearchBar';
52
52
  export type { SearchBarProps } from './SearchBar/SearchBar';
53
53
  export { Header } from './Header';
54
54
  export type { HeaderProps, HeaderSpacerProps, HeaderToggleProps, HeaderBrandProps, HeaderBrandLogoProps, HeaderBrandTitleProps, HeaderSwitchersProps, HeaderActionsProps, HeaderContextValue, } from './Header';
55
+ export { ContextSwitcher } from './ContextSwitcher';
56
+ export type { ContextSwitcherProps, ContextSwitcherValue, ContextSwitcherLevelProps, ContextSwitcherGroupProps, ContextSwitcherOptionProps, } from './ContextSwitcher';
55
57
  export { AppSwitcher } from './AppSwitcher';
56
58
  export type { AppSwitcherProps, AppSwitcherTriggerProps, AppSwitcherSectionProps, AppSwitcherAppProps, AppSwitcherAppItem, AppSwitcherAppTone, AppSwitcherFooterProps, AppSwitcherFooterLink, AppSwitcherContextValue, } from './AppSwitcher';
57
59
  export { Sidebar, useSidebar } from './Sidebar';
package/dist/index.d.ts CHANGED
@@ -16,6 +16,7 @@
16
16
  * under the License.
17
17
  */
18
18
  import './fonts.css';
19
+ import './fonts-sora.css';
19
20
  export declare const version: string;
20
21
  export * from "./styles";
21
22
  export * from "./contexts";