@omniviewdev/ui 0.1.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/LICENSE +661 -0
- package/dist/Button-Dmu1cikC.cjs +1 -0
- package/dist/Button-lr02bh_m.js +51 -0
- package/dist/CodeBlock-B1iQO7zU.js +73 -0
- package/dist/CodeBlock-CIyG0DbW.cjs +2 -0
- package/dist/CopyButton-CACe3RCF.cjs +1 -0
- package/dist/CopyButton-DPBgL0K8.js +77 -0
- package/dist/ErrorState-CexYrMpy.js +188 -0
- package/dist/ErrorState-CnIR-1xa.cjs +1 -0
- package/dist/HotkeyHint-6SOi-MaU.js +37 -0
- package/dist/HotkeyHint-DrTOTrIM.cjs +1 -0
- package/dist/Icon-CKdIOrjZ.cjs +1 -0
- package/dist/Icon-CuO9W7cA.js +27 -0
- package/dist/SearchInput-CFBBNdI2.cjs +1 -0
- package/dist/SearchInput-D3AsCI5H.js +41 -0
- package/dist/Select-CnRBSc5w.cjs +1 -0
- package/dist/Select-DTUF31OP.js +206 -0
- package/dist/Skeleton-BUYyXUiC.js +32 -0
- package/dist/Skeleton-CfdQWLQM.cjs +1 -0
- package/dist/StatusDot-CYyJxjJK.cjs +1 -0
- package/dist/StatusDot-CncykBAY.js +68 -0
- package/dist/StatusPill-C1NaiCzd.js +29 -0
- package/dist/StatusPill-C7yn7dSA.cjs +1 -0
- package/dist/TabPanel-CkUSl6Bt.cjs +1 -0
- package/dist/TabPanel-DLHbgKpl.js +124 -0
- package/dist/Text-By4P3in5.js +71 -0
- package/dist/Text-Mk6Uyg1w.cjs +1 -0
- package/dist/Tooltip-44-P5KfQ.cjs +1 -0
- package/dist/Tooltip-BEVuYuZ3.js +41 -0
- package/dist/_commonjsHelpers-CvWRHxnb.js +26 -0
- package/dist/_commonjsHelpers-D3HyQheV.cjs +1 -0
- package/dist/buttons/ActionMenu.d.ts +21 -0
- package/dist/buttons/Button.d.ts +31 -0
- package/dist/buttons/ButtonGroup.d.ts +18 -0
- package/dist/buttons/ConfirmButton.d.ts +10 -0
- package/dist/buttons/CopyButton.d.ts +11 -0
- package/dist/buttons/IconButton.d.ts +21 -0
- package/dist/buttons/SearchBar.d.ts +22 -0
- package/dist/buttons/ToggleButton.d.ts +18 -0
- package/dist/buttons/ToggleGroup.d.ts +23 -0
- package/dist/buttons/Toolbar.d.ts +15 -0
- package/dist/buttons/ToolbarGroup.d.ts +11 -0
- package/dist/buttons/index.d.ts +22 -0
- package/dist/buttons.cjs +1 -0
- package/dist/buttons.js +430 -0
- package/dist/cells/BadgesCell.d.ts +19 -0
- package/dist/cells/ChipCell.d.ts +16 -0
- package/dist/cells/SelectBoxHeader.d.ts +11 -0
- package/dist/cells/SelectBoxRow.d.ts +11 -0
- package/dist/cells/TextCell.d.ts +25 -0
- package/dist/cells/index.d.ts +5 -0
- package/dist/cells.cjs +1 -0
- package/dist/cells.js +284 -0
- package/dist/charts/BarChart.d.ts +15 -0
- package/dist/charts/ChartContainer.d.ts +12 -0
- package/dist/charts/ChartLegend.d.ts +11 -0
- package/dist/charts/GaugeCard.d.ts +18 -0
- package/dist/charts/MetricsPanel.d.ts +61 -0
- package/dist/charts/PieChart.d.ts +13 -0
- package/dist/charts/ScatterChart.d.ts +25 -0
- package/dist/charts/Sparkline.d.ts +16 -0
- package/dist/charts/StackedAreaChart.d.ts +18 -0
- package/dist/charts/TimeSeriesChart.d.ts +43 -0
- package/dist/charts/formatters.d.ts +17 -0
- package/dist/charts/index.d.ts +21 -0
- package/dist/charts/palette.d.ts +7 -0
- package/dist/charts/types.d.ts +67 -0
- package/dist/charts/useChartTheme.d.ts +13 -0
- package/dist/charts.cjs +1 -0
- package/dist/charts.js +967 -0
- package/dist/components/ActionCard.d.ts +22 -0
- package/dist/components/AspectRatio.d.ts +13 -0
- package/dist/components/Avatar.d.ts +19 -0
- package/dist/components/Badge.d.ts +22 -0
- package/dist/components/Card.d.ts +24 -0
- package/dist/components/Chip.d.ts +32 -0
- package/dist/components/ClipboardText.d.ts +14 -0
- package/dist/components/DetailsCard.d.ts +25 -0
- package/dist/components/EmptySearch.d.ts +12 -0
- package/dist/components/ExpandableSections.d.ts +51 -0
- package/dist/components/FileIcon.d.ts +12 -0
- package/dist/components/HotkeyHint.d.ts +8 -0
- package/dist/components/Icon.d.ts +7 -0
- package/dist/components/InlineEdit.d.ts +14 -0
- package/dist/components/KVCard.d.ts +12 -0
- package/dist/components/Kbd.d.ts +8 -0
- package/dist/components/List.d.ts +29 -0
- package/dist/components/ListCard.d.ts +30 -0
- package/dist/components/ListItem.d.ts +27 -0
- package/dist/components/LoadingOverlay.d.ts +14 -0
- package/dist/components/MediaCard.d.ts +24 -0
- package/dist/components/MetricsSection.d.ts +37 -0
- package/dist/components/OverflowText.d.ts +12 -0
- package/dist/components/StatCard.d.ts +26 -0
- package/dist/components/StatusCard.d.ts +29 -0
- package/dist/components/TruncatedList.d.ts +13 -0
- package/dist/domain/DescriptionList.d.ts +12 -0
- package/dist/domain/EventsList.d.ts +11 -0
- package/dist/domain/FilterBar.d.ts +23 -0
- package/dist/domain/LogsViewer.d.ts +15 -0
- package/dist/domain/MetricCard.d.ts +14 -0
- package/dist/domain/ObjectInspector.d.ts +19 -0
- package/dist/domain/ResourceBreadcrumb.d.ts +19 -0
- package/dist/domain/ResourceRef.d.ts +15 -0
- package/dist/domain/ResourceStatus.d.ts +17 -0
- package/dist/domain/SecretValueMask.d.ts +11 -0
- package/dist/domain/Timeline.d.ts +21 -0
- package/dist/domain/index.d.ts +23 -0
- package/dist/domain/types.d.ts +25 -0
- package/dist/domain.cjs +1 -0
- package/dist/domain.js +871 -0
- package/dist/editors/CodeEditor.d.ts +19 -0
- package/dist/editors/CommandPalette.d.ts +22 -0
- package/dist/editors/DiffViewer.d.ts +14 -0
- package/dist/editors/MarkdownPreview.d.ts +9 -0
- package/dist/editors/Terminal.d.ts +18 -0
- package/dist/editors/index.d.ts +11 -0
- package/dist/editors/themes.d.ts +4 -0
- package/dist/editors.cjs +42 -0
- package/dist/editors.js +38396 -0
- package/dist/feedback/Alert.d.ts +21 -0
- package/dist/feedback/ConnectionIndicator.d.ts +15 -0
- package/dist/feedback/EmptyState.d.ts +17 -0
- package/dist/feedback/ErrorState.d.ts +12 -0
- package/dist/feedback/IDEStatusFooter.d.ts +104 -0
- package/dist/feedback/NotificationStack.d.ts +32 -0
- package/dist/feedback/ProgressBar.d.ts +16 -0
- package/dist/feedback/ProgressRing.d.ts +26 -0
- package/dist/feedback/RunButton.d.ts +17 -0
- package/dist/feedback/Skeleton.d.ts +13 -0
- package/dist/feedback/StatusBar.d.ts +12 -0
- package/dist/feedback/StatusBarItem.d.ts +18 -0
- package/dist/feedback/StatusDot.d.ts +14 -0
- package/dist/feedback/StatusPill.d.ts +13 -0
- package/dist/feedback/index.d.ts +29 -0
- package/dist/feedback.cjs +1 -0
- package/dist/feedback.js +1011 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +54 -0
- package/dist/index.js +1632 -0
- package/dist/inputs/Autocomplete.d.ts +30 -0
- package/dist/inputs/Checkbox.d.ts +17 -0
- package/dist/inputs/ColorPicker.d.ts +13 -0
- package/dist/inputs/DebouncedInput.d.ts +10 -0
- package/dist/inputs/FormField.d.ts +15 -0
- package/dist/inputs/FormSection.d.ts +14 -0
- package/dist/inputs/KeyValueEditor.d.ts +17 -0
- package/dist/inputs/RadioGroup.d.ts +23 -0
- package/dist/inputs/SearchInput.d.ts +14 -0
- package/dist/inputs/Select.d.ts +32 -0
- package/dist/inputs/Slider.d.ts +24 -0
- package/dist/inputs/Switch.d.ts +17 -0
- package/dist/inputs/TagInput.d.ts +18 -0
- package/dist/inputs/TextArea.d.ts +26 -0
- package/dist/inputs/TextField.d.ts +39 -0
- package/dist/inputs/TimeRangePicker.d.ts +21 -0
- package/dist/inputs/index.d.ts +31 -0
- package/dist/inputs.cjs +21 -0
- package/dist/inputs.js +15834 -0
- package/dist/layout/AppShell.d.ts +18 -0
- package/dist/layout/DockLayout.d.ts +23 -0
- package/dist/layout/Inline.d.ts +15 -0
- package/dist/layout/Panel.d.ts +17 -0
- package/dist/layout/ResizableSplitPane.d.ts +18 -0
- package/dist/layout/Spacer.d.ts +9 -0
- package/dist/layout/Stack.d.ts +19 -0
- package/dist/layout/index.d.ts +16 -0
- package/dist/layout/useResizablePanel.d.ts +18 -0
- package/dist/layout.cjs +5 -0
- package/dist/layout.js +378 -0
- package/dist/menus/ContextMenu.d.ts +12 -0
- package/dist/menus/DropdownMenu.d.ts +20 -0
- package/dist/menus/MenuBar.d.ts +11 -0
- package/dist/menus/NestedMenuItem.d.ts +13 -0
- package/dist/menus/SplitButton.d.ts +15 -0
- package/dist/menus/index.d.ts +11 -0
- package/dist/menus/types.d.ts +24 -0
- package/dist/menus.cjs +1 -0
- package/dist/menus.js +355 -0
- package/dist/navigation/Breadcrumbs.d.ts +18 -0
- package/dist/navigation/DraggableTabs.d.ts +24 -0
- package/dist/navigation/Pagination.d.ts +15 -0
- package/dist/navigation/PersistentTabPanel.d.ts +13 -0
- package/dist/navigation/Stepper.d.ts +19 -0
- package/dist/navigation/TabPanel.d.ts +11 -0
- package/dist/navigation/Tabs.d.ts +26 -0
- package/dist/navigation/TreeView.d.ts +27 -0
- package/dist/navigation/index.d.ts +16 -0
- package/dist/navigation.cjs +1 -0
- package/dist/navigation.js +429 -0
- package/dist/overlays/Dialog.d.ts +18 -0
- package/dist/overlays/Drawer.d.ts +17 -0
- package/dist/overlays/ErrorOverlay.d.ts +21 -0
- package/dist/overlays/Modal.d.ts +14 -0
- package/dist/overlays/NotificationCenter.d.ts +31 -0
- package/dist/overlays/Popover.d.ts +15 -0
- package/dist/overlays/Spotlight.d.ts +24 -0
- package/dist/overlays/ToastProvider.d.ts +32 -0
- package/dist/overlays/Tooltip.d.ts +15 -0
- package/dist/overlays/index.d.ts +20 -0
- package/dist/overlays/useToast.d.ts +21 -0
- package/dist/overlays.cjs +1 -0
- package/dist/overlays.js +865 -0
- package/dist/sidebars/ActivityBar.d.ts +16 -0
- package/dist/sidebars/NavMenu.d.ts +27 -0
- package/dist/sidebars/NavMenu.test.d.ts +1 -0
- package/dist/sidebars/PropertyGrid.d.ts +16 -0
- package/dist/sidebars/SidebarGroup.d.ts +15 -0
- package/dist/sidebars/SidebarPanel.d.ts +19 -0
- package/dist/sidebars/SidebarTreeItem.d.ts +21 -0
- package/dist/sidebars/index.d.ts +13 -0
- package/dist/sidebars/types.d.ts +29 -0
- package/dist/sidebars.cjs +1 -0
- package/dist/sidebars.js +762 -0
- package/dist/table/ColumnFilter.d.ts +10 -0
- package/dist/table/DataTable.d.ts +23 -0
- package/dist/table/IDETable.d.ts +48 -0
- package/dist/table/TableEmptyState.d.ts +12 -0
- package/dist/table/TableSkeleton.d.ts +11 -0
- package/dist/table/TableToolbar.d.ts +15 -0
- package/dist/table/index.d.ts +12 -0
- package/dist/table/types.d.ts +4 -0
- package/dist/table.cjs +1 -0
- package/dist/table.js +580 -0
- package/dist/theme/AppTheme.d.ts +14 -0
- package/dist/theme/customizations/dataDisplay.d.ts +2 -0
- package/dist/theme/customizations/feedback.d.ts +2 -0
- package/dist/theme/customizations/inputs.d.ts +2 -0
- package/dist/theme/customizations/navigation.d.ts +2 -0
- package/dist/theme/index.d.ts +36 -0
- package/dist/theme/primitives.d.ts +234 -0
- package/dist/theme.cjs +1 -0
- package/dist/theme.js +1362 -0
- package/dist/tokens.css +252 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/maps.d.ts +25 -0
- package/dist/types/variants.d.ts +21 -0
- package/dist/types.cjs +1 -0
- package/dist/types.js +96 -0
- package/dist/typography/CodeBlock.d.ts +15 -0
- package/dist/typography/CodeInline.d.ts +10 -0
- package/dist/typography/Heading.d.ts +13 -0
- package/dist/typography/Link.d.ts +18 -0
- package/dist/typography/Text.d.ts +22 -0
- package/dist/typography/index.d.ts +10 -0
- package/dist/typography.cjs +1 -0
- package/dist/typography.js +120 -0
- package/dist/ui.css +1 -0
- package/dist/units-BuBKbqQ7.js +54 -0
- package/dist/units-CDpdlN1W.cjs +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/language.d.ts +4 -0
- package/dist/utils/time.d.ts +5 -0
- package/dist/utils/units.d.ts +7 -0
- package/dist/utils.cjs +1 -0
- package/dist/utils.js +78 -0
- package/package.json +261 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
|
+
import { SemanticColor, Emphasis, ComponentSize, Shape } from '../types';
|
|
4
|
+
export interface ButtonProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
color?: SemanticColor;
|
|
7
|
+
emphasis?: Emphasis;
|
|
8
|
+
size?: ComponentSize;
|
|
9
|
+
shape?: Shape;
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
loadingPosition?: 'start' | 'center' | 'end';
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
startIcon?: React.ReactNode;
|
|
14
|
+
/** Alias for startIcon */
|
|
15
|
+
startAdornment?: React.ReactNode;
|
|
16
|
+
/** Alias for startIcon (single icon shorthand) */
|
|
17
|
+
icon?: React.ReactNode;
|
|
18
|
+
endIcon?: React.ReactNode;
|
|
19
|
+
/** Alias for endIcon */
|
|
20
|
+
endAdornment?: React.ReactNode;
|
|
21
|
+
fullWidth?: boolean;
|
|
22
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
23
|
+
type?: 'button' | 'submit' | 'reset';
|
|
24
|
+
href?: string;
|
|
25
|
+
sx?: SxProps<Theme>;
|
|
26
|
+
}
|
|
27
|
+
declare function Button({ children, color, emphasis, size, shape, loading, loadingPosition, disabled, startIcon, startAdornment, icon, endIcon, endAdornment, fullWidth, onClick, type, href, sx, }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
declare namespace Button {
|
|
29
|
+
var displayName: string;
|
|
30
|
+
}
|
|
31
|
+
export default Button;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
|
+
import { SemanticColor, Emphasis, ComponentSize } from '../types';
|
|
4
|
+
export interface ButtonGroupProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
emphasis?: Emphasis;
|
|
7
|
+
size?: ComponentSize;
|
|
8
|
+
color?: SemanticColor;
|
|
9
|
+
fullWidth?: boolean;
|
|
10
|
+
orientation?: 'horizontal' | 'vertical';
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
sx?: SxProps<Theme>;
|
|
13
|
+
}
|
|
14
|
+
declare function ButtonGroup({ children, emphasis, size, color, fullWidth, orientation, disabled, sx, }: ButtonGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare namespace ButtonGroup {
|
|
16
|
+
var displayName: string;
|
|
17
|
+
}
|
|
18
|
+
export default ButtonGroup;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ButtonProps } from './Button';
|
|
2
|
+
export interface ConfirmButtonProps extends Omit<ButtonProps, 'onClick'> {
|
|
3
|
+
onConfirm: () => void;
|
|
4
|
+
confirmMessage?: string;
|
|
5
|
+
}
|
|
6
|
+
declare function ConfirmButton({ onConfirm, confirmMessage, children, ...buttonProps }: ConfirmButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare namespace ConfirmButton {
|
|
8
|
+
var displayName: string;
|
|
9
|
+
}
|
|
10
|
+
export default ConfirmButton;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ComponentSize } from '../types';
|
|
2
|
+
export interface CopyButtonProps {
|
|
3
|
+
value: string;
|
|
4
|
+
size?: ComponentSize;
|
|
5
|
+
label?: string;
|
|
6
|
+
}
|
|
7
|
+
declare function CopyButton({ value, size, label }: CopyButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare namespace CopyButton {
|
|
9
|
+
var displayName: string;
|
|
10
|
+
}
|
|
11
|
+
export default CopyButton;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
|
+
import { SemanticColor, Emphasis, ComponentSize, Shape } from '../types';
|
|
4
|
+
export interface IconButtonProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
color?: SemanticColor;
|
|
7
|
+
emphasis?: Emphasis;
|
|
8
|
+
size?: ComponentSize;
|
|
9
|
+
shape?: Shape;
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
13
|
+
'aria-label'?: string;
|
|
14
|
+
title?: string;
|
|
15
|
+
sx?: SxProps<Theme>;
|
|
16
|
+
}
|
|
17
|
+
declare function IconButton({ children, color, emphasis, size, shape, loading, disabled, onClick, title, sx, ...rest }: IconButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
declare namespace IconButton {
|
|
19
|
+
var displayName: string;
|
|
20
|
+
}
|
|
21
|
+
export default IconButton;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
2
|
+
import { ComponentSize } from '../types';
|
|
3
|
+
export interface SearchBarProps {
|
|
4
|
+
value: string;
|
|
5
|
+
onChange: (value: string) => void;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
regex?: boolean;
|
|
8
|
+
caseSensitive?: boolean;
|
|
9
|
+
onRegexChange?: (enabled: boolean) => void;
|
|
10
|
+
onCaseSensitiveChange?: (enabled: boolean) => void;
|
|
11
|
+
matchCount?: number;
|
|
12
|
+
currentMatch?: number;
|
|
13
|
+
onNext?: () => void;
|
|
14
|
+
onPrev?: () => void;
|
|
15
|
+
size?: ComponentSize;
|
|
16
|
+
sx?: SxProps<Theme>;
|
|
17
|
+
}
|
|
18
|
+
declare function SearchBar({ value, onChange, placeholder, regex, caseSensitive, onRegexChange, onCaseSensitiveChange, matchCount, currentMatch, onNext, onPrev, size, sx, }: SearchBarProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare namespace SearchBar {
|
|
20
|
+
var displayName: string;
|
|
21
|
+
}
|
|
22
|
+
export default SearchBar;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
|
+
import { SemanticColor, ComponentSize } from '../types';
|
|
4
|
+
export interface ToggleButtonProps {
|
|
5
|
+
selected: boolean;
|
|
6
|
+
onChange: (selected: boolean) => void;
|
|
7
|
+
icon: React.ReactNode;
|
|
8
|
+
label?: string;
|
|
9
|
+
size?: ComponentSize;
|
|
10
|
+
color?: SemanticColor;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
sx?: SxProps<Theme>;
|
|
13
|
+
}
|
|
14
|
+
declare function ToggleButton({ selected, onChange, icon, label, size, color, disabled, sx, }: ToggleButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare namespace ToggleButton {
|
|
16
|
+
var displayName: string;
|
|
17
|
+
}
|
|
18
|
+
export default ToggleButton;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
|
+
import { SemanticColor, ComponentSize } from '../types';
|
|
4
|
+
export interface ToggleOption {
|
|
5
|
+
key: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface ToggleGroupProps {
|
|
11
|
+
value: string | string[];
|
|
12
|
+
onChange: (value: string | string[]) => void;
|
|
13
|
+
options: ToggleOption[];
|
|
14
|
+
exclusive?: boolean;
|
|
15
|
+
size?: ComponentSize;
|
|
16
|
+
color?: SemanticColor;
|
|
17
|
+
sx?: SxProps<Theme>;
|
|
18
|
+
}
|
|
19
|
+
declare function ToggleGroup({ value, onChange, options, exclusive, size, color, sx, }: ToggleGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare namespace ToggleGroup {
|
|
21
|
+
var displayName: string;
|
|
22
|
+
}
|
|
23
|
+
export default ToggleGroup;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
|
+
import { ComponentSize } from '../types';
|
|
4
|
+
export interface ToolbarProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
size?: ComponentSize;
|
|
7
|
+
variant?: 'default' | 'dense';
|
|
8
|
+
dividers?: boolean;
|
|
9
|
+
sx?: SxProps<Theme>;
|
|
10
|
+
}
|
|
11
|
+
declare function Toolbar({ children, variant, dividers, sx, }: ToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare namespace Toolbar {
|
|
13
|
+
var displayName: string;
|
|
14
|
+
}
|
|
15
|
+
export default Toolbar;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
|
+
export interface ToolbarGroupProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
sx?: SxProps<Theme>;
|
|
6
|
+
}
|
|
7
|
+
declare function ToolbarGroup({ children, sx }: ToolbarGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare namespace ToolbarGroup {
|
|
9
|
+
var displayName: string;
|
|
10
|
+
}
|
|
11
|
+
export default ToolbarGroup;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { default as Button } from './Button';
|
|
2
|
+
export type { ButtonProps } from './Button';
|
|
3
|
+
export { default as IconButton } from './IconButton';
|
|
4
|
+
export type { IconButtonProps } from './IconButton';
|
|
5
|
+
export { default as CopyButton } from './CopyButton';
|
|
6
|
+
export type { CopyButtonProps } from './CopyButton';
|
|
7
|
+
export { default as ConfirmButton } from './ConfirmButton';
|
|
8
|
+
export type { ConfirmButtonProps } from './ConfirmButton';
|
|
9
|
+
export { default as ActionMenu } from './ActionMenu';
|
|
10
|
+
export type { ActionMenuProps, ActionMenuItem } from './ActionMenu';
|
|
11
|
+
export { default as ButtonGroup } from './ButtonGroup';
|
|
12
|
+
export type { ButtonGroupProps } from './ButtonGroup';
|
|
13
|
+
export { default as Toolbar } from './Toolbar';
|
|
14
|
+
export type { ToolbarProps } from './Toolbar';
|
|
15
|
+
export { default as ToolbarGroup } from './ToolbarGroup';
|
|
16
|
+
export type { ToolbarGroupProps } from './ToolbarGroup';
|
|
17
|
+
export { default as ToggleButton } from './ToggleButton';
|
|
18
|
+
export type { ToggleButtonProps } from './ToggleButton';
|
|
19
|
+
export { default as ToggleGroup } from './ToggleGroup';
|
|
20
|
+
export type { ToggleGroupProps, ToggleOption } from './ToggleGroup';
|
|
21
|
+
export { default as SearchBar } from './SearchBar';
|
|
22
|
+
export type { SearchBarProps } from './SearchBar';
|
package/dist/buttons.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./Button-Dmu1cikC.cjs"),B=require("./CopyButton-CACe3RCF.cjs"),o=require("react/jsx-runtime"),g=require("react"),O=require("@mui/material/Popover"),m=require("@mui/material/Box"),z=require("@mui/material/Typography"),w=require("@mui/material/Menu"),N=require("@mui/material/MenuItem"),E=require("@mui/material/ListItemIcon"),$=require("@mui/material/ListItemText"),D=require("@mui/material/Divider"),K=require("@mui/icons-material/MoreVert"),W=require("@mui/material/ButtonGroup"),d=require("./types.cjs"),v=require("@mui/material/IconButton"),C=require("@mui/material/Tooltip"),F=require("@mui/material/ToggleButton"),U=require("@mui/material/ToggleButtonGroup"),V=require("@mui/material/InputBase"),P=require("@mui/icons-material/Search"),b=require("react-icons/lu");function q({onConfirm:n,confirmMessage:e="Are you sure?",children:c,...t}){const[s,i]=g.useState(!1),a=g.useRef(null);return o.jsxs(o.Fragment,{children:[o.jsx(m,{component:"span",ref:a,sx:{display:"inline-flex"},children:o.jsx(y.Button,{...t,onClick:()=>i(!0),children:c})}),o.jsxs(O,{open:s,anchorEl:a.current,onClose:()=>i(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},slotProps:{paper:{sx:{p:2,mt:.5,minWidth:200,bgcolor:"var(--ov-bg-surface)",border:"1px solid var(--ov-border-default)"}}},children:[o.jsx(z,{variant:"body2",sx:{color:"var(--ov-fg-default)",mb:1.5},children:e}),o.jsxs(m,{sx:{display:"flex",gap:1,justifyContent:"flex-end"},children:[o.jsx(y.Button,{size:"xs",emphasis:"ghost",color:"neutral",onClick:()=>i(!1),children:"Cancel"}),o.jsx(y.Button,{size:"xs",emphasis:"solid",color:"danger",onClick:()=>{i(!1),n()},children:"Confirm"})]})]})]})}q.displayName="ConfirmButton";function S({items:n,trigger:e,size:c="sm"}){const[t,s]=g.useState(!1),i=g.useRef(null),a=()=>s(!1);return o.jsxs(o.Fragment,{children:[o.jsx("span",{ref:i,children:e?o.jsx("span",{onClick:()=>s(!0),style:{cursor:"pointer"},children:e}):o.jsx(B.IconButton,{size:c,color:"neutral",onClick:()=>s(!0),"aria-label":"Actions",children:o.jsx(K,{fontSize:"inherit"})})}),o.jsx(w,{open:t,anchorEl:i.current,onClose:a,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{minWidth:160,bgcolor:"var(--ov-bg-surface)",border:"1px solid var(--ov-border-default)"}}},children:n.map(r=>[o.jsxs(N,{disabled:r.disabled,onClick:()=>{a(),r.onClick()},sx:{fontSize:"var(--ov-text-sm)",color:r.color==="danger"||r.color==="error"?"var(--ov-danger-default)":"var(--ov-fg-default)"},children:[r.icon&&o.jsx(E,{sx:{color:"inherit",minWidth:28},children:r.icon}),o.jsx($,{children:r.label})]},r.key),r.dividerAfter&&o.jsx(D,{},`${r.key}-divider`)])})]})}S.displayName="ActionMenu";function k({children:n,emphasis:e="outline",size:c="sm",color:t="neutral",fullWidth:s,orientation:i="horizontal",disabled:a,sx:r}){const p=d.toMuiColor(t),u=d.toMuiVariant(e),l=d.toMuiSize(c);return o.jsx(W,{color:p,variant:u,size:l,fullWidth:s,orientation:i,disabled:a,sx:r,children:n})}k.displayName="ButtonGroup";const _={default:36,dense:28};function M({children:n,variant:e="default",dividers:c=!1,sx:t}){const s=_[e];return o.jsx(m,{sx:{display:"flex",alignItems:"center",height:s,gap:c?0:.5,px:.5,bgcolor:"var(--ov-bg-surface)",...c&&{"& > *:not(:last-child)::after":{content:'""',display:"block",width:"1px",height:"60%",bgcolor:"var(--ov-border-muted)",ml:.5,mr:.5,flexShrink:0}},...typeof t=="object"&&!Array.isArray(t)?t:{}},children:n})}M.displayName="Toolbar";function T({children:n,sx:e}){return o.jsx(m,{sx:{display:"flex",alignItems:"center",gap:"2px",...typeof e=="object"&&!Array.isArray(e)?e:{}},children:n})}T.displayName="ToolbarGroup";function A({selected:n,onChange:e,icon:c,label:t,size:s="sm",color:i="primary",disabled:a,sx:r}){const p=d.toMuiSize(s),u=d.toCssColor(i),l=o.jsx(v,{size:p,disabled:a,onClick:()=>e(!n),sx:{borderRadius:"4px",color:n?u:"var(--ov-fg-muted)",bgcolor:n?"var(--ov-state-hover)":"transparent","&:hover":{bgcolor:"var(--ov-state-hover)"},...typeof r=="object"&&!Array.isArray(r)?r:{}},children:c});return t?o.jsx(C,{title:t,children:l}):l}A.displayName="ToggleButton";function I({value:n,onChange:e,options:c,exclusive:t=!0,size:s="sm",color:i="primary",sx:a}){const r=d.toMuiSize(s),p=d.toCssColor(i),u=(l,x)=>{x!==null&&e(x)};return o.jsx(U,{value:n,exclusive:t,onChange:u,size:r,sx:{"& .Mui-selected":{color:`${p} !important`,bgcolor:"var(--ov-state-hover) !important"},...typeof a=="object"&&!Array.isArray(a)?a:{}},children:c.map(l=>o.jsxs(F,{value:l.key,disabled:l.disabled,sx:{fontSize:"var(--ov-text-sm)",textTransform:"none",px:1.5,gap:.5},children:[l.icon,l.label]},l.key))})}I.displayName="ToggleGroup";const H={xs:24,sm:28,md:32,lg:36,xl:40};function G({value:n,onChange:e,placeholder:c="Search...",regex:t,caseSensitive:s,onRegexChange:i,onCaseSensitiveChange:a,matchCount:r,currentMatch:p,onNext:u,onPrev:l,size:x="sm",sx:j}){const R=H[x],h=x==="xs"?12:14,L=g.useCallback(f=>{f.key==="Enter"&&(f.shiftKey?l?.():u?.()),f.key==="Escape"&&f.target.blur()},[u,l]);return o.jsxs(m,{sx:{display:"flex",alignItems:"center",height:R,border:"1px solid var(--ov-border-default)",borderRadius:"4px",bgcolor:"var(--ov-bg-surface)",px:.5,gap:"2px","&:focus-within":{borderColor:"var(--ov-accent)"},...typeof j=="object"&&!Array.isArray(j)?j:{}},children:[o.jsx(P,{sx:{fontSize:h+2,color:"var(--ov-fg-muted)",ml:.25}}),o.jsx(V,{value:n,onChange:f=>e(f.target.value),onKeyDown:L,placeholder:c,sx:{flex:1,fontSize:x==="xs"?"var(--ov-text-xs)":"var(--ov-text-sm)",color:"var(--ov-fg-default)","& input":{py:0,px:.5},"& input::placeholder":{color:"var(--ov-fg-faint)",opacity:1}}}),a&&o.jsx(C,{title:"Match Case",children:o.jsx(v,{size:"small",onClick:()=>a(!s),sx:{borderRadius:"3px",p:"2px",color:s?"var(--ov-accent-fg)":"var(--ov-fg-faint)",bgcolor:s?"var(--ov-accent-subtle)":"transparent"},children:o.jsx(b.LuCaseSensitive,{size:h})})}),i&&o.jsx(C,{title:"Use Regular Expression",children:o.jsx(v,{size:"small",onClick:()=>i(!t),sx:{borderRadius:"3px",p:"2px",color:t?"var(--ov-accent-fg)":"var(--ov-fg-faint)",bgcolor:t?"var(--ov-accent-subtle)":"transparent"},children:o.jsx(b.LuRegex,{size:h})})}),r!==void 0&&o.jsx(z,{sx:{fontSize:"var(--ov-text-xs)",color:"var(--ov-fg-muted)",whiteSpace:"nowrap",px:.5},children:r===0?"No results":`${(p??0)+1}/${r}`}),l&&o.jsx(v,{size:"small",onClick:l,sx:{p:"2px"},children:o.jsx(b.LuChevronUp,{size:h})}),u&&o.jsx(v,{size:"small",onClick:u,sx:{p:"2px"},children:o.jsx(b.LuChevronDown,{size:h})})]})}G.displayName="SearchBar";exports.Button=y.Button;exports.CopyButton=B.CopyButton;exports.IconButton=B.IconButton;exports.ActionMenu=S;exports.ButtonGroup=k;exports.ConfirmButton=q;exports.SearchBar=G;exports.ToggleButton=A;exports.ToggleGroup=I;exports.Toolbar=M;exports.ToolbarGroup=T;
|
package/dist/buttons.js
ADDED
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
import { B as b } from "./Button-lr02bh_m.js";
|
|
2
|
+
import { I } from "./CopyButton-DPBgL0K8.js";
|
|
3
|
+
import { C as jo } from "./CopyButton-DPBgL0K8.js";
|
|
4
|
+
import { jsxs as f, Fragment as z, jsx as o } from "react/jsx-runtime";
|
|
5
|
+
import { useState as k, useRef as B, useCallback as j } from "react";
|
|
6
|
+
import G from "@mui/material/Popover";
|
|
7
|
+
import g from "@mui/material/Box";
|
|
8
|
+
import M from "@mui/material/Typography";
|
|
9
|
+
import R from "@mui/material/Menu";
|
|
10
|
+
import w from "@mui/material/MenuItem";
|
|
11
|
+
import L from "@mui/material/ListItemIcon";
|
|
12
|
+
import N from "@mui/material/ListItemText";
|
|
13
|
+
import O from "@mui/material/Divider";
|
|
14
|
+
import E from "@mui/icons-material/MoreVert";
|
|
15
|
+
import $ from "@mui/material/ButtonGroup";
|
|
16
|
+
import { toMuiColor as D, toMuiVariant as K, toMuiSize as C, toCssColor as S } from "./types.js";
|
|
17
|
+
import v from "@mui/material/IconButton";
|
|
18
|
+
import y from "@mui/material/Tooltip";
|
|
19
|
+
import W from "@mui/material/ToggleButton";
|
|
20
|
+
import U from "@mui/material/ToggleButtonGroup";
|
|
21
|
+
import V from "@mui/material/InputBase";
|
|
22
|
+
import F from "@mui/icons-material/Search";
|
|
23
|
+
import { LuCaseSensitive as _, LuRegex as q, LuChevronUp as H, LuChevronDown as J } from "react-icons/lu";
|
|
24
|
+
function P({
|
|
25
|
+
onConfirm: n,
|
|
26
|
+
confirmMessage: e = "Are you sure?",
|
|
27
|
+
children: c,
|
|
28
|
+
...t
|
|
29
|
+
}) {
|
|
30
|
+
const [i, a] = k(!1), l = B(null);
|
|
31
|
+
return /* @__PURE__ */ f(z, { children: [
|
|
32
|
+
/* @__PURE__ */ o(g, { component: "span", ref: l, sx: { display: "inline-flex" }, children: /* @__PURE__ */ o(b, { ...t, onClick: () => a(!0), children: c }) }),
|
|
33
|
+
/* @__PURE__ */ f(
|
|
34
|
+
G,
|
|
35
|
+
{
|
|
36
|
+
open: i,
|
|
37
|
+
anchorEl: l.current,
|
|
38
|
+
onClose: () => a(!1),
|
|
39
|
+
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
40
|
+
transformOrigin: { vertical: "top", horizontal: "center" },
|
|
41
|
+
slotProps: {
|
|
42
|
+
paper: {
|
|
43
|
+
sx: {
|
|
44
|
+
p: 2,
|
|
45
|
+
mt: 0.5,
|
|
46
|
+
minWidth: 200,
|
|
47
|
+
bgcolor: "var(--ov-bg-surface)",
|
|
48
|
+
border: "1px solid var(--ov-border-default)"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ o(
|
|
54
|
+
M,
|
|
55
|
+
{
|
|
56
|
+
variant: "body2",
|
|
57
|
+
sx: { color: "var(--ov-fg-default)", mb: 1.5 },
|
|
58
|
+
children: e
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
/* @__PURE__ */ f(g, { sx: { display: "flex", gap: 1, justifyContent: "flex-end" }, children: [
|
|
62
|
+
/* @__PURE__ */ o(
|
|
63
|
+
b,
|
|
64
|
+
{
|
|
65
|
+
size: "xs",
|
|
66
|
+
emphasis: "ghost",
|
|
67
|
+
color: "neutral",
|
|
68
|
+
onClick: () => a(!1),
|
|
69
|
+
children: "Cancel"
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
/* @__PURE__ */ o(
|
|
73
|
+
b,
|
|
74
|
+
{
|
|
75
|
+
size: "xs",
|
|
76
|
+
emphasis: "solid",
|
|
77
|
+
color: "danger",
|
|
78
|
+
onClick: () => {
|
|
79
|
+
a(!1), n();
|
|
80
|
+
},
|
|
81
|
+
children: "Confirm"
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
] })
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
] });
|
|
89
|
+
}
|
|
90
|
+
P.displayName = "ConfirmButton";
|
|
91
|
+
function Q({
|
|
92
|
+
items: n,
|
|
93
|
+
trigger: e,
|
|
94
|
+
size: c = "sm"
|
|
95
|
+
}) {
|
|
96
|
+
const [t, i] = k(!1), a = B(null), l = () => i(!1);
|
|
97
|
+
return /* @__PURE__ */ f(z, { children: [
|
|
98
|
+
/* @__PURE__ */ o("span", { ref: a, children: e ? /* @__PURE__ */ o("span", { onClick: () => i(!0), style: { cursor: "pointer" }, children: e }) : /* @__PURE__ */ o(
|
|
99
|
+
I,
|
|
100
|
+
{
|
|
101
|
+
size: c,
|
|
102
|
+
color: "neutral",
|
|
103
|
+
onClick: () => i(!0),
|
|
104
|
+
"aria-label": "Actions",
|
|
105
|
+
children: /* @__PURE__ */ o(E, { fontSize: "inherit" })
|
|
106
|
+
}
|
|
107
|
+
) }),
|
|
108
|
+
/* @__PURE__ */ o(
|
|
109
|
+
R,
|
|
110
|
+
{
|
|
111
|
+
open: t,
|
|
112
|
+
anchorEl: a.current,
|
|
113
|
+
onClose: l,
|
|
114
|
+
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
115
|
+
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
116
|
+
slotProps: {
|
|
117
|
+
paper: {
|
|
118
|
+
sx: {
|
|
119
|
+
minWidth: 160,
|
|
120
|
+
bgcolor: "var(--ov-bg-surface)",
|
|
121
|
+
border: "1px solid var(--ov-border-default)"
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
children: n.map((r) => [
|
|
126
|
+
/* @__PURE__ */ f(
|
|
127
|
+
w,
|
|
128
|
+
{
|
|
129
|
+
disabled: r.disabled,
|
|
130
|
+
onClick: () => {
|
|
131
|
+
l(), r.onClick();
|
|
132
|
+
},
|
|
133
|
+
sx: {
|
|
134
|
+
fontSize: "var(--ov-text-sm)",
|
|
135
|
+
color: r.color === "danger" || r.color === "error" ? "var(--ov-danger-default)" : "var(--ov-fg-default)"
|
|
136
|
+
},
|
|
137
|
+
children: [
|
|
138
|
+
r.icon && /* @__PURE__ */ o(L, { sx: { color: "inherit", minWidth: 28 }, children: r.icon }),
|
|
139
|
+
/* @__PURE__ */ o(N, { children: r.label })
|
|
140
|
+
]
|
|
141
|
+
},
|
|
142
|
+
r.key
|
|
143
|
+
),
|
|
144
|
+
r.dividerAfter && /* @__PURE__ */ o(O, {}, `${r.key}-divider`)
|
|
145
|
+
])
|
|
146
|
+
}
|
|
147
|
+
)
|
|
148
|
+
] });
|
|
149
|
+
}
|
|
150
|
+
Q.displayName = "ActionMenu";
|
|
151
|
+
function X({
|
|
152
|
+
children: n,
|
|
153
|
+
emphasis: e = "outline",
|
|
154
|
+
size: c = "sm",
|
|
155
|
+
color: t = "neutral",
|
|
156
|
+
fullWidth: i,
|
|
157
|
+
orientation: a = "horizontal",
|
|
158
|
+
disabled: l,
|
|
159
|
+
sx: r
|
|
160
|
+
}) {
|
|
161
|
+
const u = D(t), p = K(e), s = C(c);
|
|
162
|
+
return /* @__PURE__ */ o(
|
|
163
|
+
$,
|
|
164
|
+
{
|
|
165
|
+
color: u,
|
|
166
|
+
variant: p,
|
|
167
|
+
size: s,
|
|
168
|
+
fullWidth: i,
|
|
169
|
+
orientation: a,
|
|
170
|
+
disabled: l,
|
|
171
|
+
sx: r,
|
|
172
|
+
children: n
|
|
173
|
+
}
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
X.displayName = "ButtonGroup";
|
|
177
|
+
const Y = {
|
|
178
|
+
default: 36,
|
|
179
|
+
dense: 28
|
|
180
|
+
};
|
|
181
|
+
function Z({
|
|
182
|
+
children: n,
|
|
183
|
+
variant: e = "default",
|
|
184
|
+
dividers: c = !1,
|
|
185
|
+
sx: t
|
|
186
|
+
}) {
|
|
187
|
+
const i = Y[e];
|
|
188
|
+
return /* @__PURE__ */ o(
|
|
189
|
+
g,
|
|
190
|
+
{
|
|
191
|
+
sx: {
|
|
192
|
+
display: "flex",
|
|
193
|
+
alignItems: "center",
|
|
194
|
+
height: i,
|
|
195
|
+
gap: c ? 0 : 0.5,
|
|
196
|
+
px: 0.5,
|
|
197
|
+
bgcolor: "var(--ov-bg-surface)",
|
|
198
|
+
...c && {
|
|
199
|
+
"& > *:not(:last-child)::after": {
|
|
200
|
+
content: '""',
|
|
201
|
+
display: "block",
|
|
202
|
+
width: "1px",
|
|
203
|
+
height: "60%",
|
|
204
|
+
bgcolor: "var(--ov-border-muted)",
|
|
205
|
+
ml: 0.5,
|
|
206
|
+
mr: 0.5,
|
|
207
|
+
flexShrink: 0
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
...typeof t == "object" && !Array.isArray(t) ? t : {}
|
|
211
|
+
},
|
|
212
|
+
children: n
|
|
213
|
+
}
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
Z.displayName = "Toolbar";
|
|
217
|
+
function oo({ children: n, sx: e }) {
|
|
218
|
+
return /* @__PURE__ */ o(
|
|
219
|
+
g,
|
|
220
|
+
{
|
|
221
|
+
sx: {
|
|
222
|
+
display: "flex",
|
|
223
|
+
alignItems: "center",
|
|
224
|
+
gap: "2px",
|
|
225
|
+
...typeof e == "object" && !Array.isArray(e) ? e : {}
|
|
226
|
+
},
|
|
227
|
+
children: n
|
|
228
|
+
}
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
oo.displayName = "ToolbarGroup";
|
|
232
|
+
function ro({
|
|
233
|
+
selected: n,
|
|
234
|
+
onChange: e,
|
|
235
|
+
icon: c,
|
|
236
|
+
label: t,
|
|
237
|
+
size: i = "sm",
|
|
238
|
+
color: a = "primary",
|
|
239
|
+
disabled: l,
|
|
240
|
+
sx: r
|
|
241
|
+
}) {
|
|
242
|
+
const u = C(i), p = S(a), s = /* @__PURE__ */ o(
|
|
243
|
+
v,
|
|
244
|
+
{
|
|
245
|
+
size: u,
|
|
246
|
+
disabled: l,
|
|
247
|
+
onClick: () => e(!n),
|
|
248
|
+
sx: {
|
|
249
|
+
borderRadius: "4px",
|
|
250
|
+
color: n ? p : "var(--ov-fg-muted)",
|
|
251
|
+
bgcolor: n ? "var(--ov-state-hover)" : "transparent",
|
|
252
|
+
"&:hover": {
|
|
253
|
+
bgcolor: "var(--ov-state-hover)"
|
|
254
|
+
},
|
|
255
|
+
...typeof r == "object" && !Array.isArray(r) ? r : {}
|
|
256
|
+
},
|
|
257
|
+
children: c
|
|
258
|
+
}
|
|
259
|
+
);
|
|
260
|
+
return t ? /* @__PURE__ */ o(y, { title: t, children: s }) : s;
|
|
261
|
+
}
|
|
262
|
+
ro.displayName = "ToggleButton";
|
|
263
|
+
function eo({
|
|
264
|
+
value: n,
|
|
265
|
+
onChange: e,
|
|
266
|
+
options: c,
|
|
267
|
+
exclusive: t = !0,
|
|
268
|
+
size: i = "sm",
|
|
269
|
+
color: a = "primary",
|
|
270
|
+
sx: l
|
|
271
|
+
}) {
|
|
272
|
+
const r = C(i), u = S(a);
|
|
273
|
+
return /* @__PURE__ */ o(
|
|
274
|
+
U,
|
|
275
|
+
{
|
|
276
|
+
value: n,
|
|
277
|
+
exclusive: t,
|
|
278
|
+
onChange: (s, d) => {
|
|
279
|
+
d !== null && e(d);
|
|
280
|
+
},
|
|
281
|
+
size: r,
|
|
282
|
+
sx: {
|
|
283
|
+
"& .Mui-selected": {
|
|
284
|
+
color: `${u} !important`,
|
|
285
|
+
bgcolor: "var(--ov-state-hover) !important"
|
|
286
|
+
},
|
|
287
|
+
...typeof l == "object" && !Array.isArray(l) ? l : {}
|
|
288
|
+
},
|
|
289
|
+
children: c.map((s) => /* @__PURE__ */ f(
|
|
290
|
+
W,
|
|
291
|
+
{
|
|
292
|
+
value: s.key,
|
|
293
|
+
disabled: s.disabled,
|
|
294
|
+
sx: {
|
|
295
|
+
fontSize: "var(--ov-text-sm)",
|
|
296
|
+
textTransform: "none",
|
|
297
|
+
px: 1.5,
|
|
298
|
+
gap: 0.5
|
|
299
|
+
},
|
|
300
|
+
children: [
|
|
301
|
+
s.icon,
|
|
302
|
+
s.label
|
|
303
|
+
]
|
|
304
|
+
},
|
|
305
|
+
s.key
|
|
306
|
+
))
|
|
307
|
+
}
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
eo.displayName = "ToggleGroup";
|
|
311
|
+
const to = {
|
|
312
|
+
xs: 24,
|
|
313
|
+
sm: 28,
|
|
314
|
+
md: 32,
|
|
315
|
+
lg: 36,
|
|
316
|
+
xl: 40
|
|
317
|
+
};
|
|
318
|
+
function no({
|
|
319
|
+
value: n,
|
|
320
|
+
onChange: e,
|
|
321
|
+
placeholder: c = "Search...",
|
|
322
|
+
regex: t,
|
|
323
|
+
caseSensitive: i,
|
|
324
|
+
onRegexChange: a,
|
|
325
|
+
onCaseSensitiveChange: l,
|
|
326
|
+
matchCount: r,
|
|
327
|
+
currentMatch: u,
|
|
328
|
+
onNext: p,
|
|
329
|
+
onPrev: s,
|
|
330
|
+
size: d = "sm",
|
|
331
|
+
sx: x
|
|
332
|
+
}) {
|
|
333
|
+
const A = to[d], h = d === "xs" ? 12 : 14, T = j((m) => {
|
|
334
|
+
m.key === "Enter" && (m.shiftKey ? s?.() : p?.()), m.key === "Escape" && m.target.blur();
|
|
335
|
+
}, [p, s]);
|
|
336
|
+
return /* @__PURE__ */ f(
|
|
337
|
+
g,
|
|
338
|
+
{
|
|
339
|
+
sx: {
|
|
340
|
+
display: "flex",
|
|
341
|
+
alignItems: "center",
|
|
342
|
+
height: A,
|
|
343
|
+
border: "1px solid var(--ov-border-default)",
|
|
344
|
+
borderRadius: "4px",
|
|
345
|
+
bgcolor: "var(--ov-bg-surface)",
|
|
346
|
+
px: 0.5,
|
|
347
|
+
gap: "2px",
|
|
348
|
+
"&:focus-within": {
|
|
349
|
+
borderColor: "var(--ov-accent)"
|
|
350
|
+
},
|
|
351
|
+
...typeof x == "object" && !Array.isArray(x) ? x : {}
|
|
352
|
+
},
|
|
353
|
+
children: [
|
|
354
|
+
/* @__PURE__ */ o(F, { sx: { fontSize: h + 2, color: "var(--ov-fg-muted)", ml: 0.25 } }),
|
|
355
|
+
/* @__PURE__ */ o(
|
|
356
|
+
V,
|
|
357
|
+
{
|
|
358
|
+
value: n,
|
|
359
|
+
onChange: (m) => e(m.target.value),
|
|
360
|
+
onKeyDown: T,
|
|
361
|
+
placeholder: c,
|
|
362
|
+
sx: {
|
|
363
|
+
flex: 1,
|
|
364
|
+
fontSize: d === "xs" ? "var(--ov-text-xs)" : "var(--ov-text-sm)",
|
|
365
|
+
color: "var(--ov-fg-default)",
|
|
366
|
+
"& input": { py: 0, px: 0.5 },
|
|
367
|
+
"& input::placeholder": { color: "var(--ov-fg-faint)", opacity: 1 }
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
),
|
|
371
|
+
l && /* @__PURE__ */ o(y, { title: "Match Case", children: /* @__PURE__ */ o(
|
|
372
|
+
v,
|
|
373
|
+
{
|
|
374
|
+
size: "small",
|
|
375
|
+
onClick: () => l(!i),
|
|
376
|
+
sx: {
|
|
377
|
+
borderRadius: "3px",
|
|
378
|
+
p: "2px",
|
|
379
|
+
color: i ? "var(--ov-accent-fg)" : "var(--ov-fg-faint)",
|
|
380
|
+
bgcolor: i ? "var(--ov-accent-subtle)" : "transparent"
|
|
381
|
+
},
|
|
382
|
+
children: /* @__PURE__ */ o(_, { size: h })
|
|
383
|
+
}
|
|
384
|
+
) }),
|
|
385
|
+
a && /* @__PURE__ */ o(y, { title: "Use Regular Expression", children: /* @__PURE__ */ o(
|
|
386
|
+
v,
|
|
387
|
+
{
|
|
388
|
+
size: "small",
|
|
389
|
+
onClick: () => a(!t),
|
|
390
|
+
sx: {
|
|
391
|
+
borderRadius: "3px",
|
|
392
|
+
p: "2px",
|
|
393
|
+
color: t ? "var(--ov-accent-fg)" : "var(--ov-fg-faint)",
|
|
394
|
+
bgcolor: t ? "var(--ov-accent-subtle)" : "transparent"
|
|
395
|
+
},
|
|
396
|
+
children: /* @__PURE__ */ o(q, { size: h })
|
|
397
|
+
}
|
|
398
|
+
) }),
|
|
399
|
+
r !== void 0 && /* @__PURE__ */ o(
|
|
400
|
+
M,
|
|
401
|
+
{
|
|
402
|
+
sx: {
|
|
403
|
+
fontSize: "var(--ov-text-xs)",
|
|
404
|
+
color: "var(--ov-fg-muted)",
|
|
405
|
+
whiteSpace: "nowrap",
|
|
406
|
+
px: 0.5
|
|
407
|
+
},
|
|
408
|
+
children: r === 0 ? "No results" : `${(u ?? 0) + 1}/${r}`
|
|
409
|
+
}
|
|
410
|
+
),
|
|
411
|
+
s && /* @__PURE__ */ o(v, { size: "small", onClick: s, sx: { p: "2px" }, children: /* @__PURE__ */ o(H, { size: h }) }),
|
|
412
|
+
p && /* @__PURE__ */ o(v, { size: "small", onClick: p, sx: { p: "2px" }, children: /* @__PURE__ */ o(J, { size: h }) })
|
|
413
|
+
]
|
|
414
|
+
}
|
|
415
|
+
);
|
|
416
|
+
}
|
|
417
|
+
no.displayName = "SearchBar";
|
|
418
|
+
export {
|
|
419
|
+
Q as ActionMenu,
|
|
420
|
+
b as Button,
|
|
421
|
+
X as ButtonGroup,
|
|
422
|
+
P as ConfirmButton,
|
|
423
|
+
jo as CopyButton,
|
|
424
|
+
I as IconButton,
|
|
425
|
+
no as SearchBar,
|
|
426
|
+
ro as ToggleButton,
|
|
427
|
+
eo as ToggleGroup,
|
|
428
|
+
Z as Toolbar,
|
|
429
|
+
oo as ToolbarGroup
|
|
430
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
type ColorName = 'success' | 'warning' | 'danger' | 'primary' | 'neutral';
|
|
3
|
+
type Props = {
|
|
4
|
+
/** The values to use for calculating the badge colors */
|
|
5
|
+
values: string[];
|
|
6
|
+
/** Specify mapping of values to badges that will change with the input */
|
|
7
|
+
colorMap: Record<string, ColorName>;
|
|
8
|
+
/** The horizontal alignment of the text. Default is 'left' */
|
|
9
|
+
align?: 'left' | 'right' | 'center' | 'justify';
|
|
10
|
+
/** The contents to put in the menu on hover, if any */
|
|
11
|
+
hoverMenu?: (value: string) => React.ReactNode;
|
|
12
|
+
/** The time to wait before showing the hover menu, in ms. Defaults to 200ms */
|
|
13
|
+
hoverMenuDelay?: number;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Render a list of colored badge dots for the generic resource table.
|
|
17
|
+
*/
|
|
18
|
+
export declare const BadgesCell: React.FC<Props>;
|
|
19
|
+
export default BadgesCell;
|