@wso2/oxygen-ui 0.19.0 → 0.20.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/.ai/AGENTS.md +2 -1
- package/.ai/components.md +113 -0
- package/.ai/patterns.md +12 -8
- package/.ai/theming.md +4 -4
- package/.claude/components.md +113 -0
- package/.claude/patterns.md +12 -8
- package/.claude/skills/oxygen-component/SKILL.md +4 -4
- package/.claude/theming.md +4 -4
- package/README.md +3 -3
- package/dist/components/AppBreadcrumbs/AppBreadcrumbs.d.ts +15 -2
- package/dist/components/ContextSwitcher/ContextSwitcher.d.ts +69 -0
- package/dist/components/ContextSwitcher/ContextSwitcherGroup.d.ts +39 -0
- package/dist/components/ContextSwitcher/ContextSwitcherLevel.d.ts +51 -0
- package/dist/components/ContextSwitcher/ContextSwitcherOption.d.ts +41 -0
- package/dist/components/ContextSwitcher/OverflowTooltip.d.ts +38 -0
- package/dist/components/ContextSwitcher/context.d.ts +41 -0
- package/dist/components/ContextSwitcher/index.d.ts +26 -0
- package/dist/components/ContextSwitcher/model.d.ts +44 -0
- package/dist/components/SearchBar/SearchBar.d.ts +7 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1813 -764
- package/dist/index.js.map +4 -4
- package/dist/styles/Themes/ChoreoLabsTheme.d.ts +20 -0
- package/dist/styles/Themes/index.d.ts +1 -0
- package/package.json +3 -2
|
@@ -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;
|
|
@@ -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';
|