@wso2/oxygen-ui 0.18.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 +4 -2
- package/.ai/components.md +332 -0
- package/.ai/patterns.md +12 -8
- package/.ai/theming.md +4 -4
- package/.claude/components.md +332 -0
- package/.claude/patterns.md +12 -8
- package/.claude/skills/oxygen-component/SKILL.md +86 -0
- package/.claude/skills/oxygen-form/SKILL.md +8 -0
- package/.claude/skills/oxygen-layout/SKILL.md +1 -0
- 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/DrawerPanel/DrawerPanel.d.ts +98 -0
- package/dist/components/DrawerPanel/DrawerPanelActions.d.ts +44 -0
- package/dist/components/DrawerPanel/DrawerPanelBody.d.ts +42 -0
- package/dist/components/DrawerPanel/DrawerPanelCloseButton.d.ts +44 -0
- package/dist/components/DrawerPanel/DrawerPanelExpandButton.d.ts +46 -0
- package/dist/components/DrawerPanel/DrawerPanelFooter.d.ts +41 -0
- package/dist/components/DrawerPanel/DrawerPanelHeader.d.ts +44 -0
- package/dist/components/DrawerPanel/DrawerPanelTitle.d.ts +45 -0
- package/dist/components/DrawerPanel/context.d.ts +42 -0
- package/dist/components/DrawerPanel/index.d.ts +35 -0
- package/dist/components/FullScreenWizard/FullScreenWizard.d.ts +85 -0
- package/dist/components/FullScreenWizard/FullScreenWizardContent.d.ts +70 -0
- package/dist/components/FullScreenWizard/FullScreenWizardFooter.d.ts +59 -0
- package/dist/components/FullScreenWizard/FullScreenWizardHeader.d.ts +59 -0
- package/dist/components/FullScreenWizard/FullScreenWizardPreview.d.ts +61 -0
- package/dist/components/FullScreenWizard/FullScreenWizardProgress.d.ts +61 -0
- package/dist/components/FullScreenWizard/context.d.ts +71 -0
- package/dist/components/FullScreenWizard/index.d.ts +33 -0
- package/dist/components/FullScreenWizard/useWizardSteps.d.ts +85 -0
- package/dist/components/ListingCard/ListingCard.d.ts +92 -0
- package/dist/components/ListingCard/index.d.ts +2 -0
- package/dist/components/LogViewer/LogFilterChip.d.ts +31 -0
- package/dist/components/LogViewer/LogLevelMarker.d.ts +16 -0
- package/dist/components/LogViewer/LogViewer.d.ts +178 -0
- package/dist/components/LogViewer/LogViewerControls.d.ts +121 -0
- package/dist/components/LogViewer/LogViewerDetails.d.ts +11 -0
- package/dist/components/LogViewer/LogViewerSearch.d.ts +42 -0
- package/dist/components/LogViewer/LogViewerStream.d.ts +132 -0
- package/dist/components/LogViewer/LogViewerToolbar.d.ts +56 -0
- package/dist/components/LogViewer/columns.d.ts +17 -0
- package/dist/components/LogViewer/context.d.ts +81 -0
- package/dist/components/LogViewer/download.d.ts +14 -0
- package/dist/components/LogViewer/filters.d.ts +11 -0
- package/dist/components/LogViewer/index.d.ts +8 -0
- package/dist/components/LogViewer/timestamps.d.ts +26 -0
- package/dist/components/LogViewer/types.d.ts +163 -0
- package/dist/components/SearchBar/SearchBar.d.ts +7 -0
- package/dist/components/Sidebar/Sidebar.d.ts +2 -0
- package/dist/components/Sidebar/SidebarCollapseToggle.d.ts +50 -0
- package/dist/components/Sidebar/index.d.ts +2 -0
- package/dist/components/TextField/TextField.d.ts +28 -0
- package/dist/components/TextField/index.d.ts +2 -0
- package/dist/components/index.d.ts +13 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +8520 -4539
- package/dist/index.js.map +4 -4
- package/dist/styles/OxygenThemeBase.d.ts +12 -0
- 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,69 @@
|
|
|
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
|
+
import { ContextSwitcherLevel } from './ContextSwitcherLevel';
|
|
21
|
+
import { ContextSwitcherGroup } from './ContextSwitcherGroup';
|
|
22
|
+
import { ContextSwitcherOption } from './ContextSwitcherOption';
|
|
23
|
+
/**
|
|
24
|
+
* Props for the context switcher.
|
|
25
|
+
*/
|
|
26
|
+
export interface ContextSwitcherProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'onChange' | 'children'> {
|
|
27
|
+
/** Selected option value for each level id. A missing id means that level is empty. */
|
|
28
|
+
value: ContextSwitcherValue;
|
|
29
|
+
/** Called with the next map when the selection changes. */
|
|
30
|
+
onChange: (value: ContextSwitcherValue) => void;
|
|
31
|
+
/**
|
|
32
|
+
* Join Back to the current level and keep the other levels on screen. The current
|
|
33
|
+
* level is the deepest level with a selection, or the empty level whose options are
|
|
34
|
+
* open. Back clears that level. An empty level is on screen only while its list is
|
|
35
|
+
* open. Off by default, which shows the chain and the next empty level.
|
|
36
|
+
*/
|
|
37
|
+
back?: boolean;
|
|
38
|
+
/** Levels, in order. */
|
|
39
|
+
children: React.ReactNode;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* ContextSwitcher - A chain of labeled fields for selecting through a hierarchy.
|
|
43
|
+
*
|
|
44
|
+
* Each visible level is a ComplexSelect in an AppBreadcrumbs trail separated by a
|
|
45
|
+
* slash. With Back, that trail stays on screen and Back is joined to the current
|
|
46
|
+
* level. Choosing an option opens the next level's list. The same option keeps the
|
|
47
|
+
* levels under it. A different option clears them. The product places the switcher,
|
|
48
|
+
* usually in `Header.Switchers`, and routes from `onChange`.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```tsx
|
|
52
|
+
* <Header.Switchers>
|
|
53
|
+
* <ContextSwitcher value={value} onChange={setValue}>
|
|
54
|
+
* <ContextSwitcher.Level id="organization" label="Organization">
|
|
55
|
+
* <ContextSwitcher.Option value="wso2">WSO2</ContextSwitcher.Option>
|
|
56
|
+
* </ContextSwitcher.Level>
|
|
57
|
+
* <ContextSwitcher.Level id="project" label="Project">
|
|
58
|
+
* <ContextSwitcher.Option value="finance-web">Finance Web</ContextSwitcher.Option>
|
|
59
|
+
* </ContextSwitcher.Level>
|
|
60
|
+
* </ContextSwitcher>
|
|
61
|
+
* </Header.Switchers>
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export declare const ContextSwitcher: React.ForwardRefExoticComponent<ContextSwitcherProps & React.RefAttributes<HTMLDivElement>> & {
|
|
65
|
+
Level: typeof ContextSwitcherLevel;
|
|
66
|
+
Group: typeof ContextSwitcherGroup;
|
|
67
|
+
Option: typeof ContextSwitcherOption;
|
|
68
|
+
};
|
|
69
|
+
export default ContextSwitcher;
|
|
@@ -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;
|
|
@@ -0,0 +1,98 @@
|
|
|
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 { SxProps, Theme } from '@mui/material/styles';
|
|
20
|
+
import { DrawerPanelHeader } from './DrawerPanelHeader';
|
|
21
|
+
import { DrawerPanelTitle } from './DrawerPanelTitle';
|
|
22
|
+
import { DrawerPanelActions } from './DrawerPanelActions';
|
|
23
|
+
import { DrawerPanelExpandButton } from './DrawerPanelExpandButton';
|
|
24
|
+
import { DrawerPanelCloseButton } from './DrawerPanelCloseButton';
|
|
25
|
+
import { DrawerPanelBody } from './DrawerPanelBody';
|
|
26
|
+
import { DrawerPanelFooter } from './DrawerPanelFooter';
|
|
27
|
+
/**
|
|
28
|
+
* Props for the DrawerPanel component.
|
|
29
|
+
*/
|
|
30
|
+
export interface DrawerPanelProps {
|
|
31
|
+
/** Whether the panel is open */
|
|
32
|
+
open: boolean;
|
|
33
|
+
/** Callback fired when the panel requests to close (close button, backdrop click, Escape) */
|
|
34
|
+
onClose: () => void;
|
|
35
|
+
/** Panel content, typically Header, Body and Footer */
|
|
36
|
+
children: React.ReactNode;
|
|
37
|
+
/** Panel width on sm+ screens (default: 560) */
|
|
38
|
+
width?: number | string;
|
|
39
|
+
/** Panel width on sm+ screens while expanded (default: `'100%'`) */
|
|
40
|
+
expandedWidth?: number | string;
|
|
41
|
+
/** Whether the panel is expanded (controlled) */
|
|
42
|
+
expanded?: boolean;
|
|
43
|
+
/** Initial expanded state when uncontrolled (default: false) */
|
|
44
|
+
defaultExpanded?: boolean;
|
|
45
|
+
/** Callback fired when the expand button toggles the width */
|
|
46
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
47
|
+
/** Drawer anchor position (default: 'right') */
|
|
48
|
+
anchor?: 'left' | 'right';
|
|
49
|
+
/** Drawer variant (default: 'temporary') */
|
|
50
|
+
variant?: 'temporary' | 'persistent';
|
|
51
|
+
/**
|
|
52
|
+
* Accessible name for the drawer. When provided, it takes precedence over
|
|
53
|
+
* `DrawerPanel.Title`; otherwise the title names the drawer.
|
|
54
|
+
*/
|
|
55
|
+
'aria-label'?: string;
|
|
56
|
+
/** Additional sx props */
|
|
57
|
+
sx?: SxProps<Theme>;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* DrawerPanel - Slide-out side panel compound component.
|
|
61
|
+
*
|
|
62
|
+
* Use it to show details or secondary tasks for an item without leaving the
|
|
63
|
+
* current page (for example build details, log entries or resource settings).
|
|
64
|
+
*
|
|
65
|
+
* Features:
|
|
66
|
+
* - Right-anchored drawer that slides in over the page
|
|
67
|
+
* - Title with optional icon that names the drawer for assistive technology
|
|
68
|
+
* - Optional expand button that widens the panel (controlled or uncontrolled)
|
|
69
|
+
* - Close button wired to `onClose` through context
|
|
70
|
+
* - Fixed header and footer with a scrollable body
|
|
71
|
+
* - Responsive width (full on mobile, fixed on desktop)
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* <DrawerPanel open={open} onClose={handleClose}>
|
|
75
|
+
* <DrawerPanel.Header>
|
|
76
|
+
* <DrawerPanel.Title icon={<ListTree size={20} />}>Build details</DrawerPanel.Title>
|
|
77
|
+
* <DrawerPanel.Actions>
|
|
78
|
+
* <DrawerPanel.ExpandButton />
|
|
79
|
+
* <DrawerPanel.CloseButton />
|
|
80
|
+
* </DrawerPanel.Actions>
|
|
81
|
+
* </DrawerPanel.Header>
|
|
82
|
+
* <DrawerPanel.Body>...</DrawerPanel.Body>
|
|
83
|
+
* <DrawerPanel.Footer>
|
|
84
|
+
* <Button variant="contained">Rerun build</Button>
|
|
85
|
+
* </DrawerPanel.Footer>
|
|
86
|
+
* </DrawerPanel>
|
|
87
|
+
*/
|
|
88
|
+
declare const DrawerPanel: React.FC<DrawerPanelProps> & {
|
|
89
|
+
Header: typeof DrawerPanelHeader;
|
|
90
|
+
Title: typeof DrawerPanelTitle;
|
|
91
|
+
Actions: typeof DrawerPanelActions;
|
|
92
|
+
ExpandButton: typeof DrawerPanelExpandButton;
|
|
93
|
+
CloseButton: typeof DrawerPanelCloseButton;
|
|
94
|
+
Body: typeof DrawerPanelBody;
|
|
95
|
+
Footer: typeof DrawerPanelFooter;
|
|
96
|
+
};
|
|
97
|
+
export { DrawerPanel };
|
|
98
|
+
export default DrawerPanel;
|
|
@@ -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 { SxProps, Theme } from '@mui/material/styles';
|
|
20
|
+
/**
|
|
21
|
+
* Props for DrawerPanelActions component.
|
|
22
|
+
*/
|
|
23
|
+
export interface DrawerPanelActionsProps {
|
|
24
|
+
/** Action buttons; keep `ExpandButton` and `CloseButton` last, in that order */
|
|
25
|
+
children: React.ReactNode;
|
|
26
|
+
/** Additional sx props */
|
|
27
|
+
sx?: SxProps<Theme>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* DrawerPanelActions - Right-aligned group of header actions.
|
|
31
|
+
*
|
|
32
|
+
* Place any extra actions (for example a "More actions" menu) before the
|
|
33
|
+
* expand and close buttons so the close button always stays rightmost.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```tsx
|
|
37
|
+
* <DrawerPanel.Actions>
|
|
38
|
+
* <DrawerPanel.ExpandButton />
|
|
39
|
+
* <DrawerPanel.CloseButton />
|
|
40
|
+
* </DrawerPanel.Actions>
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare const DrawerPanelActions: React.FC<DrawerPanelActionsProps>;
|
|
44
|
+
export default DrawerPanelActions;
|
|
@@ -0,0 +1,42 @@
|
|
|
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 { SxProps, Theme } from '@mui/material/styles';
|
|
20
|
+
/**
|
|
21
|
+
* Props for DrawerPanelBody component.
|
|
22
|
+
*/
|
|
23
|
+
export interface DrawerPanelBodyProps {
|
|
24
|
+
/** Main panel content */
|
|
25
|
+
children: React.ReactNode;
|
|
26
|
+
/** Additional sx props */
|
|
27
|
+
sx?: SxProps<Theme>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* DrawerPanelBody - Scrollable main content of the drawer panel.
|
|
31
|
+
*
|
|
32
|
+
* The header and footer stay in place while the body scrolls.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* <DrawerPanel.Body>
|
|
37
|
+
* <Typography>Panel content</Typography>
|
|
38
|
+
* </DrawerPanel.Body>
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare const DrawerPanelBody: React.FC<DrawerPanelBodyProps>;
|
|
42
|
+
export default DrawerPanelBody;
|
|
@@ -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 { SxProps, Theme } from '@mui/material/styles';
|
|
20
|
+
/**
|
|
21
|
+
* Props for DrawerPanelCloseButton component.
|
|
22
|
+
*/
|
|
23
|
+
export interface DrawerPanelCloseButtonProps {
|
|
24
|
+
/** Tooltip and accessible name (default: `"Close"`) */
|
|
25
|
+
label?: string;
|
|
26
|
+
/** Click handler (overrides context onClose) */
|
|
27
|
+
onClick?: () => void;
|
|
28
|
+
/** Additional sx props */
|
|
29
|
+
sx?: SxProps<Theme>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* DrawerPanelCloseButton - Closes the drawer panel.
|
|
33
|
+
*
|
|
34
|
+
* Uses `onClose` from the parent `DrawerPanel` unless `onClick` is given.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* <DrawerPanel.Actions>
|
|
39
|
+
* <DrawerPanel.CloseButton />
|
|
40
|
+
* </DrawerPanel.Actions>
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare const DrawerPanelCloseButton: React.FC<DrawerPanelCloseButtonProps>;
|
|
44
|
+
export default DrawerPanelCloseButton;
|
|
@@ -0,0 +1,46 @@
|
|
|
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 { SxProps, Theme } from '@mui/material/styles';
|
|
20
|
+
/**
|
|
21
|
+
* Props for DrawerPanelExpandButton component.
|
|
22
|
+
*/
|
|
23
|
+
export interface DrawerPanelExpandButtonProps {
|
|
24
|
+
/** Label shown while collapsed (default: `"Expand"`) */
|
|
25
|
+
expandLabel?: string;
|
|
26
|
+
/** Label shown while expanded (default: `"Collapse"`) */
|
|
27
|
+
collapseLabel?: string;
|
|
28
|
+
/** Additional sx props */
|
|
29
|
+
sx?: SxProps<Theme>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* DrawerPanelExpandButton - Toggles the panel between its default and expanded width.
|
|
33
|
+
*
|
|
34
|
+
* Reads and updates `expanded` through the DrawerPanel context, so it works
|
|
35
|
+
* whether the parent `DrawerPanel` is controlled or uncontrolled.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* <DrawerPanel.Actions>
|
|
40
|
+
* <DrawerPanel.ExpandButton />
|
|
41
|
+
* <DrawerPanel.CloseButton />
|
|
42
|
+
* </DrawerPanel.Actions>
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare const DrawerPanelExpandButton: React.FC<DrawerPanelExpandButtonProps>;
|
|
46
|
+
export default DrawerPanelExpandButton;
|
|
@@ -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
|
+
import type { SxProps, Theme } from '@mui/material/styles';
|
|
20
|
+
/**
|
|
21
|
+
* Props for DrawerPanelFooter component.
|
|
22
|
+
*/
|
|
23
|
+
export interface DrawerPanelFooterProps {
|
|
24
|
+
/** Footer actions; put the primary action last */
|
|
25
|
+
children: React.ReactNode;
|
|
26
|
+
/** Additional sx props */
|
|
27
|
+
sx?: SxProps<Theme>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* DrawerPanelFooter - Sticky footer for panel-level actions.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* <DrawerPanel.Footer>
|
|
35
|
+
* <Button variant="outlined">Cancel</Button>
|
|
36
|
+
* <Button variant="contained">Save</Button>
|
|
37
|
+
* </DrawerPanel.Footer>
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare const DrawerPanelFooter: React.FC<DrawerPanelFooterProps>;
|
|
41
|
+
export default DrawerPanelFooter;
|