@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.
Files changed (257) hide show
  1. package/LICENSE +661 -0
  2. package/dist/Button-Dmu1cikC.cjs +1 -0
  3. package/dist/Button-lr02bh_m.js +51 -0
  4. package/dist/CodeBlock-B1iQO7zU.js +73 -0
  5. package/dist/CodeBlock-CIyG0DbW.cjs +2 -0
  6. package/dist/CopyButton-CACe3RCF.cjs +1 -0
  7. package/dist/CopyButton-DPBgL0K8.js +77 -0
  8. package/dist/ErrorState-CexYrMpy.js +188 -0
  9. package/dist/ErrorState-CnIR-1xa.cjs +1 -0
  10. package/dist/HotkeyHint-6SOi-MaU.js +37 -0
  11. package/dist/HotkeyHint-DrTOTrIM.cjs +1 -0
  12. package/dist/Icon-CKdIOrjZ.cjs +1 -0
  13. package/dist/Icon-CuO9W7cA.js +27 -0
  14. package/dist/SearchInput-CFBBNdI2.cjs +1 -0
  15. package/dist/SearchInput-D3AsCI5H.js +41 -0
  16. package/dist/Select-CnRBSc5w.cjs +1 -0
  17. package/dist/Select-DTUF31OP.js +206 -0
  18. package/dist/Skeleton-BUYyXUiC.js +32 -0
  19. package/dist/Skeleton-CfdQWLQM.cjs +1 -0
  20. package/dist/StatusDot-CYyJxjJK.cjs +1 -0
  21. package/dist/StatusDot-CncykBAY.js +68 -0
  22. package/dist/StatusPill-C1NaiCzd.js +29 -0
  23. package/dist/StatusPill-C7yn7dSA.cjs +1 -0
  24. package/dist/TabPanel-CkUSl6Bt.cjs +1 -0
  25. package/dist/TabPanel-DLHbgKpl.js +124 -0
  26. package/dist/Text-By4P3in5.js +71 -0
  27. package/dist/Text-Mk6Uyg1w.cjs +1 -0
  28. package/dist/Tooltip-44-P5KfQ.cjs +1 -0
  29. package/dist/Tooltip-BEVuYuZ3.js +41 -0
  30. package/dist/_commonjsHelpers-CvWRHxnb.js +26 -0
  31. package/dist/_commonjsHelpers-D3HyQheV.cjs +1 -0
  32. package/dist/buttons/ActionMenu.d.ts +21 -0
  33. package/dist/buttons/Button.d.ts +31 -0
  34. package/dist/buttons/ButtonGroup.d.ts +18 -0
  35. package/dist/buttons/ConfirmButton.d.ts +10 -0
  36. package/dist/buttons/CopyButton.d.ts +11 -0
  37. package/dist/buttons/IconButton.d.ts +21 -0
  38. package/dist/buttons/SearchBar.d.ts +22 -0
  39. package/dist/buttons/ToggleButton.d.ts +18 -0
  40. package/dist/buttons/ToggleGroup.d.ts +23 -0
  41. package/dist/buttons/Toolbar.d.ts +15 -0
  42. package/dist/buttons/ToolbarGroup.d.ts +11 -0
  43. package/dist/buttons/index.d.ts +22 -0
  44. package/dist/buttons.cjs +1 -0
  45. package/dist/buttons.js +430 -0
  46. package/dist/cells/BadgesCell.d.ts +19 -0
  47. package/dist/cells/ChipCell.d.ts +16 -0
  48. package/dist/cells/SelectBoxHeader.d.ts +11 -0
  49. package/dist/cells/SelectBoxRow.d.ts +11 -0
  50. package/dist/cells/TextCell.d.ts +25 -0
  51. package/dist/cells/index.d.ts +5 -0
  52. package/dist/cells.cjs +1 -0
  53. package/dist/cells.js +284 -0
  54. package/dist/charts/BarChart.d.ts +15 -0
  55. package/dist/charts/ChartContainer.d.ts +12 -0
  56. package/dist/charts/ChartLegend.d.ts +11 -0
  57. package/dist/charts/GaugeCard.d.ts +18 -0
  58. package/dist/charts/MetricsPanel.d.ts +61 -0
  59. package/dist/charts/PieChart.d.ts +13 -0
  60. package/dist/charts/ScatterChart.d.ts +25 -0
  61. package/dist/charts/Sparkline.d.ts +16 -0
  62. package/dist/charts/StackedAreaChart.d.ts +18 -0
  63. package/dist/charts/TimeSeriesChart.d.ts +43 -0
  64. package/dist/charts/formatters.d.ts +17 -0
  65. package/dist/charts/index.d.ts +21 -0
  66. package/dist/charts/palette.d.ts +7 -0
  67. package/dist/charts/types.d.ts +67 -0
  68. package/dist/charts/useChartTheme.d.ts +13 -0
  69. package/dist/charts.cjs +1 -0
  70. package/dist/charts.js +967 -0
  71. package/dist/components/ActionCard.d.ts +22 -0
  72. package/dist/components/AspectRatio.d.ts +13 -0
  73. package/dist/components/Avatar.d.ts +19 -0
  74. package/dist/components/Badge.d.ts +22 -0
  75. package/dist/components/Card.d.ts +24 -0
  76. package/dist/components/Chip.d.ts +32 -0
  77. package/dist/components/ClipboardText.d.ts +14 -0
  78. package/dist/components/DetailsCard.d.ts +25 -0
  79. package/dist/components/EmptySearch.d.ts +12 -0
  80. package/dist/components/ExpandableSections.d.ts +51 -0
  81. package/dist/components/FileIcon.d.ts +12 -0
  82. package/dist/components/HotkeyHint.d.ts +8 -0
  83. package/dist/components/Icon.d.ts +7 -0
  84. package/dist/components/InlineEdit.d.ts +14 -0
  85. package/dist/components/KVCard.d.ts +12 -0
  86. package/dist/components/Kbd.d.ts +8 -0
  87. package/dist/components/List.d.ts +29 -0
  88. package/dist/components/ListCard.d.ts +30 -0
  89. package/dist/components/ListItem.d.ts +27 -0
  90. package/dist/components/LoadingOverlay.d.ts +14 -0
  91. package/dist/components/MediaCard.d.ts +24 -0
  92. package/dist/components/MetricsSection.d.ts +37 -0
  93. package/dist/components/OverflowText.d.ts +12 -0
  94. package/dist/components/StatCard.d.ts +26 -0
  95. package/dist/components/StatusCard.d.ts +29 -0
  96. package/dist/components/TruncatedList.d.ts +13 -0
  97. package/dist/domain/DescriptionList.d.ts +12 -0
  98. package/dist/domain/EventsList.d.ts +11 -0
  99. package/dist/domain/FilterBar.d.ts +23 -0
  100. package/dist/domain/LogsViewer.d.ts +15 -0
  101. package/dist/domain/MetricCard.d.ts +14 -0
  102. package/dist/domain/ObjectInspector.d.ts +19 -0
  103. package/dist/domain/ResourceBreadcrumb.d.ts +19 -0
  104. package/dist/domain/ResourceRef.d.ts +15 -0
  105. package/dist/domain/ResourceStatus.d.ts +17 -0
  106. package/dist/domain/SecretValueMask.d.ts +11 -0
  107. package/dist/domain/Timeline.d.ts +21 -0
  108. package/dist/domain/index.d.ts +23 -0
  109. package/dist/domain/types.d.ts +25 -0
  110. package/dist/domain.cjs +1 -0
  111. package/dist/domain.js +871 -0
  112. package/dist/editors/CodeEditor.d.ts +19 -0
  113. package/dist/editors/CommandPalette.d.ts +22 -0
  114. package/dist/editors/DiffViewer.d.ts +14 -0
  115. package/dist/editors/MarkdownPreview.d.ts +9 -0
  116. package/dist/editors/Terminal.d.ts +18 -0
  117. package/dist/editors/index.d.ts +11 -0
  118. package/dist/editors/themes.d.ts +4 -0
  119. package/dist/editors.cjs +42 -0
  120. package/dist/editors.js +38396 -0
  121. package/dist/feedback/Alert.d.ts +21 -0
  122. package/dist/feedback/ConnectionIndicator.d.ts +15 -0
  123. package/dist/feedback/EmptyState.d.ts +17 -0
  124. package/dist/feedback/ErrorState.d.ts +12 -0
  125. package/dist/feedback/IDEStatusFooter.d.ts +104 -0
  126. package/dist/feedback/NotificationStack.d.ts +32 -0
  127. package/dist/feedback/ProgressBar.d.ts +16 -0
  128. package/dist/feedback/ProgressRing.d.ts +26 -0
  129. package/dist/feedback/RunButton.d.ts +17 -0
  130. package/dist/feedback/Skeleton.d.ts +13 -0
  131. package/dist/feedback/StatusBar.d.ts +12 -0
  132. package/dist/feedback/StatusBarItem.d.ts +18 -0
  133. package/dist/feedback/StatusDot.d.ts +14 -0
  134. package/dist/feedback/StatusPill.d.ts +13 -0
  135. package/dist/feedback/index.d.ts +29 -0
  136. package/dist/feedback.cjs +1 -0
  137. package/dist/feedback.js +1011 -0
  138. package/dist/index.cjs +1 -0
  139. package/dist/index.d.ts +54 -0
  140. package/dist/index.js +1632 -0
  141. package/dist/inputs/Autocomplete.d.ts +30 -0
  142. package/dist/inputs/Checkbox.d.ts +17 -0
  143. package/dist/inputs/ColorPicker.d.ts +13 -0
  144. package/dist/inputs/DebouncedInput.d.ts +10 -0
  145. package/dist/inputs/FormField.d.ts +15 -0
  146. package/dist/inputs/FormSection.d.ts +14 -0
  147. package/dist/inputs/KeyValueEditor.d.ts +17 -0
  148. package/dist/inputs/RadioGroup.d.ts +23 -0
  149. package/dist/inputs/SearchInput.d.ts +14 -0
  150. package/dist/inputs/Select.d.ts +32 -0
  151. package/dist/inputs/Slider.d.ts +24 -0
  152. package/dist/inputs/Switch.d.ts +17 -0
  153. package/dist/inputs/TagInput.d.ts +18 -0
  154. package/dist/inputs/TextArea.d.ts +26 -0
  155. package/dist/inputs/TextField.d.ts +39 -0
  156. package/dist/inputs/TimeRangePicker.d.ts +21 -0
  157. package/dist/inputs/index.d.ts +31 -0
  158. package/dist/inputs.cjs +21 -0
  159. package/dist/inputs.js +15834 -0
  160. package/dist/layout/AppShell.d.ts +18 -0
  161. package/dist/layout/DockLayout.d.ts +23 -0
  162. package/dist/layout/Inline.d.ts +15 -0
  163. package/dist/layout/Panel.d.ts +17 -0
  164. package/dist/layout/ResizableSplitPane.d.ts +18 -0
  165. package/dist/layout/Spacer.d.ts +9 -0
  166. package/dist/layout/Stack.d.ts +19 -0
  167. package/dist/layout/index.d.ts +16 -0
  168. package/dist/layout/useResizablePanel.d.ts +18 -0
  169. package/dist/layout.cjs +5 -0
  170. package/dist/layout.js +378 -0
  171. package/dist/menus/ContextMenu.d.ts +12 -0
  172. package/dist/menus/DropdownMenu.d.ts +20 -0
  173. package/dist/menus/MenuBar.d.ts +11 -0
  174. package/dist/menus/NestedMenuItem.d.ts +13 -0
  175. package/dist/menus/SplitButton.d.ts +15 -0
  176. package/dist/menus/index.d.ts +11 -0
  177. package/dist/menus/types.d.ts +24 -0
  178. package/dist/menus.cjs +1 -0
  179. package/dist/menus.js +355 -0
  180. package/dist/navigation/Breadcrumbs.d.ts +18 -0
  181. package/dist/navigation/DraggableTabs.d.ts +24 -0
  182. package/dist/navigation/Pagination.d.ts +15 -0
  183. package/dist/navigation/PersistentTabPanel.d.ts +13 -0
  184. package/dist/navigation/Stepper.d.ts +19 -0
  185. package/dist/navigation/TabPanel.d.ts +11 -0
  186. package/dist/navigation/Tabs.d.ts +26 -0
  187. package/dist/navigation/TreeView.d.ts +27 -0
  188. package/dist/navigation/index.d.ts +16 -0
  189. package/dist/navigation.cjs +1 -0
  190. package/dist/navigation.js +429 -0
  191. package/dist/overlays/Dialog.d.ts +18 -0
  192. package/dist/overlays/Drawer.d.ts +17 -0
  193. package/dist/overlays/ErrorOverlay.d.ts +21 -0
  194. package/dist/overlays/Modal.d.ts +14 -0
  195. package/dist/overlays/NotificationCenter.d.ts +31 -0
  196. package/dist/overlays/Popover.d.ts +15 -0
  197. package/dist/overlays/Spotlight.d.ts +24 -0
  198. package/dist/overlays/ToastProvider.d.ts +32 -0
  199. package/dist/overlays/Tooltip.d.ts +15 -0
  200. package/dist/overlays/index.d.ts +20 -0
  201. package/dist/overlays/useToast.d.ts +21 -0
  202. package/dist/overlays.cjs +1 -0
  203. package/dist/overlays.js +865 -0
  204. package/dist/sidebars/ActivityBar.d.ts +16 -0
  205. package/dist/sidebars/NavMenu.d.ts +27 -0
  206. package/dist/sidebars/NavMenu.test.d.ts +1 -0
  207. package/dist/sidebars/PropertyGrid.d.ts +16 -0
  208. package/dist/sidebars/SidebarGroup.d.ts +15 -0
  209. package/dist/sidebars/SidebarPanel.d.ts +19 -0
  210. package/dist/sidebars/SidebarTreeItem.d.ts +21 -0
  211. package/dist/sidebars/index.d.ts +13 -0
  212. package/dist/sidebars/types.d.ts +29 -0
  213. package/dist/sidebars.cjs +1 -0
  214. package/dist/sidebars.js +762 -0
  215. package/dist/table/ColumnFilter.d.ts +10 -0
  216. package/dist/table/DataTable.d.ts +23 -0
  217. package/dist/table/IDETable.d.ts +48 -0
  218. package/dist/table/TableEmptyState.d.ts +12 -0
  219. package/dist/table/TableSkeleton.d.ts +11 -0
  220. package/dist/table/TableToolbar.d.ts +15 -0
  221. package/dist/table/index.d.ts +12 -0
  222. package/dist/table/types.d.ts +4 -0
  223. package/dist/table.cjs +1 -0
  224. package/dist/table.js +580 -0
  225. package/dist/theme/AppTheme.d.ts +14 -0
  226. package/dist/theme/customizations/dataDisplay.d.ts +2 -0
  227. package/dist/theme/customizations/feedback.d.ts +2 -0
  228. package/dist/theme/customizations/inputs.d.ts +2 -0
  229. package/dist/theme/customizations/navigation.d.ts +2 -0
  230. package/dist/theme/index.d.ts +36 -0
  231. package/dist/theme/primitives.d.ts +234 -0
  232. package/dist/theme.cjs +1 -0
  233. package/dist/theme.js +1362 -0
  234. package/dist/tokens.css +252 -0
  235. package/dist/types/index.d.ts +7 -0
  236. package/dist/types/maps.d.ts +25 -0
  237. package/dist/types/variants.d.ts +21 -0
  238. package/dist/types.cjs +1 -0
  239. package/dist/types.js +96 -0
  240. package/dist/typography/CodeBlock.d.ts +15 -0
  241. package/dist/typography/CodeInline.d.ts +10 -0
  242. package/dist/typography/Heading.d.ts +13 -0
  243. package/dist/typography/Link.d.ts +18 -0
  244. package/dist/typography/Text.d.ts +22 -0
  245. package/dist/typography/index.d.ts +10 -0
  246. package/dist/typography.cjs +1 -0
  247. package/dist/typography.js +120 -0
  248. package/dist/ui.css +1 -0
  249. package/dist/units-BuBKbqQ7.js +54 -0
  250. package/dist/units-CDpdlN1W.cjs +1 -0
  251. package/dist/utils/index.d.ts +4 -0
  252. package/dist/utils/language.d.ts +4 -0
  253. package/dist/utils/time.d.ts +5 -0
  254. package/dist/utils/units.d.ts +7 -0
  255. package/dist/utils.cjs +1 -0
  256. package/dist/utils.js +78 -0
  257. package/package.json +261 -0
@@ -0,0 +1,18 @@
1
+ import { ReactNode } from 'react';
2
+ import { SxProps, Theme } from '@mui/material/styles';
3
+ export interface AppShellProps {
4
+ header?: ReactNode;
5
+ sidebar?: ReactNode;
6
+ footer?: ReactNode;
7
+ children: ReactNode;
8
+ sidebarWidth?: number | string;
9
+ sidebarCollapsed?: boolean;
10
+ headerHeight?: number | string;
11
+ footerHeight?: number | string;
12
+ sx?: SxProps<Theme>;
13
+ }
14
+ declare function AppShell({ header, sidebar, footer, children, sidebarWidth, sidebarCollapsed, headerHeight, footerHeight, sx, }: AppShellProps): import("react/jsx-runtime").JSX.Element;
15
+ declare namespace AppShell {
16
+ var displayName: string;
17
+ }
18
+ export default AppShell;
@@ -0,0 +1,23 @@
1
+ import { default as React } from 'react';
2
+ import { SxProps, Theme } from '@mui/material/styles';
3
+ export interface DockLeaf {
4
+ type: 'leaf';
5
+ id: string;
6
+ minSize?: number;
7
+ }
8
+ export interface DockSplit {
9
+ type: 'horizontal' | 'vertical';
10
+ children: DockNode[];
11
+ sizes?: number[];
12
+ }
13
+ export type DockNode = DockLeaf | DockSplit;
14
+ export interface DockLayoutProps {
15
+ layout: DockNode;
16
+ renderPanel: (id: string) => React.ReactNode;
17
+ sx?: SxProps<Theme>;
18
+ }
19
+ declare function DockLayout({ layout, renderPanel, sx, }: DockLayoutProps): import("react/jsx-runtime").JSX.Element;
20
+ declare namespace DockLayout {
21
+ var displayName: string;
22
+ }
23
+ export default DockLayout;
@@ -0,0 +1,15 @@
1
+ import { ReactNode } from 'react';
2
+ import { SxProps, Theme } from '@mui/material/styles';
3
+ export interface InlineProps {
4
+ gap?: number;
5
+ align?: string;
6
+ justify?: string;
7
+ divider?: boolean;
8
+ children: ReactNode;
9
+ sx?: SxProps<Theme>;
10
+ }
11
+ declare function Inline({ gap, align, justify, divider, children, sx, }: InlineProps): import("react/jsx-runtime").JSX.Element;
12
+ declare namespace Inline {
13
+ var displayName: string;
14
+ }
15
+ export default Inline;
@@ -0,0 +1,17 @@
1
+ import { ReactNode } from 'react';
2
+ import { SxProps, Theme } from '@mui/material/styles';
3
+ export interface PanelProps {
4
+ title?: string;
5
+ icon?: ReactNode;
6
+ toolbar?: ReactNode;
7
+ children: ReactNode;
8
+ collapsible?: boolean;
9
+ onClose?: () => void;
10
+ elevation?: 'flat' | 'raised' | 'overlay';
11
+ sx?: SxProps<Theme>;
12
+ }
13
+ declare function Panel({ title, icon, toolbar, children, collapsible, onClose, elevation, sx, }: PanelProps): import("react/jsx-runtime").JSX.Element;
14
+ declare namespace Panel {
15
+ var displayName: string;
16
+ }
17
+ export default Panel;
@@ -0,0 +1,18 @@
1
+ import { ReactNode } from 'react';
2
+ import { SxProps, Theme } from '@mui/material/styles';
3
+ export interface ResizableSplitPaneProps {
4
+ direction?: 'horizontal' | 'vertical';
5
+ defaultSize?: number;
6
+ minSize?: number;
7
+ maxSize?: number;
8
+ onResize?: (size: number) => void;
9
+ children: [ReactNode, ReactNode];
10
+ handleSize?: number;
11
+ id?: string;
12
+ sx?: SxProps<Theme>;
13
+ }
14
+ declare function ResizableSplitPane({ direction, defaultSize, minSize, maxSize, onResize, children, handleSize, id, sx, }: ResizableSplitPaneProps): import("react/jsx-runtime").JSX.Element;
15
+ declare namespace ResizableSplitPane {
16
+ var displayName: string;
17
+ }
18
+ export default ResizableSplitPane;
@@ -0,0 +1,9 @@
1
+ import { SxProps, Theme } from '@mui/material/styles';
2
+ export interface SpacerProps {
3
+ sx?: SxProps<Theme>;
4
+ }
5
+ declare function Spacer({ sx }: SpacerProps): import("react/jsx-runtime").JSX.Element;
6
+ declare namespace Spacer {
7
+ var displayName: string;
8
+ }
9
+ export default Spacer;
@@ -0,0 +1,19 @@
1
+ import { ReactNode } from 'react';
2
+ import { StackProps as MuiStackProps } from '@mui/material/Stack';
3
+ export interface StackProps extends Omit<MuiStackProps, 'divider'> {
4
+ /** Alias for spacing */
5
+ gap?: number;
6
+ /** Alias for alignItems */
7
+ align?: string;
8
+ /** Alias for justifyContent */
9
+ justify?: string;
10
+ /** When true, renders dividers between children. Can also pass a ReactNode. */
11
+ divider?: boolean | ReactNode;
12
+ /** Shorthand: when true, flex-wrap is 'wrap' */
13
+ wrap?: boolean;
14
+ }
15
+ declare function Stack({ direction, gap, spacing, align, alignItems, justify, justifyContent, wrap, flexWrap, divider, children, sx, ...rest }: StackProps): import("react/jsx-runtime").JSX.Element;
16
+ declare namespace Stack {
17
+ var displayName: string;
18
+ }
19
+ export default Stack;
@@ -0,0 +1,16 @@
1
+ export { default as useResizablePanel } from './useResizablePanel';
2
+ export type { UseResizablePanelOptions, UseResizablePanelReturn } from './useResizablePanel';
3
+ export { default as ResizableSplitPane } from './ResizableSplitPane';
4
+ export type { ResizableSplitPaneProps } from './ResizableSplitPane';
5
+ export { default as AppShell } from './AppShell';
6
+ export type { AppShellProps } from './AppShell';
7
+ export { default as Panel } from './Panel';
8
+ export type { PanelProps } from './Panel';
9
+ export { default as Stack } from './Stack';
10
+ export type { StackProps } from './Stack';
11
+ export { default as Inline } from './Inline';
12
+ export type { InlineProps } from './Inline';
13
+ export { default as Spacer } from './Spacer';
14
+ export type { SpacerProps } from './Spacer';
15
+ export { default as DockLayout } from './DockLayout';
16
+ export type { DockLayoutProps, DockNode, DockLeaf, DockSplit } from './DockLayout';
@@ -0,0 +1,18 @@
1
+ export interface UseResizablePanelOptions {
2
+ direction: 'horizontal' | 'vertical';
3
+ defaultSize: number;
4
+ minSize?: number;
5
+ maxSize?: number;
6
+ onResize?: (size: number) => void;
7
+ storageKey?: string;
8
+ }
9
+ export interface UseResizablePanelReturn {
10
+ size: number;
11
+ isDragging: boolean;
12
+ handleProps: {
13
+ onMouseDown: React.MouseEventHandler;
14
+ onDoubleClick: React.MouseEventHandler;
15
+ };
16
+ reset: () => void;
17
+ }
18
+ export default function useResizablePanel({ direction, defaultSize, minSize, maxSize, onResize, storageKey, }: UseResizablePanelOptions): UseResizablePanelReturn;
@@ -0,0 +1,5 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react"),r=require("react/jsx-runtime"),u=require("@mui/material/Box"),R=require("@mui/material/Typography"),C=require("@mui/material/IconButton"),W=require("@mui/material/Collapse"),w=require("react-icons/lu"),E=require("@mui/material/Stack"),P=require("@mui/material/Divider");function T(e,t){try{const n=localStorage.getItem(e);return n?Number(n):t}catch{return t}}function S(e,t){try{localStorage.setItem(e,String(t))}catch{}}function I({direction:e,defaultSize:t,minSize:n=0,maxSize:s=1/0,onResize:l,storageKey:o}){const[i,p]=v.useState(()=>o?T(o,t):t),[d,c]=v.useState(!1),a=v.useRef({pos:0,size:0}),h=v.useCallback(f=>Math.max(n,Math.min(s,f)),[n,s]),m=v.useCallback(f=>{f.preventDefault();const x=e==="horizontal"?f.clientX:f.clientY;a.current={pos:x,size:i},c(!0)},[e,i]);v.useEffect(()=>{if(!d)return;const f=b=>{const H=(e==="horizontal"?b.clientX:b.clientY)-a.current.pos,D=h(a.current.size+H);p(D),l?.(D)},x=()=>{c(!1),o&&S(o,i)};return document.addEventListener("mousemove",f),document.addEventListener("mouseup",x),()=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",x)}},[d,e,h,l,o,i]);const y=v.useCallback(()=>{const x=h(i===n?t:n);p(x),l?.(x),o&&S(o,x)},[i,n,t,h,l,o]),j=v.useCallback(()=>{p(t),l?.(t),o&&S(o,t)},[t,l,o]);return{size:i,isDragging:d,handleProps:{onMouseDown:m,onDoubleClick:y},reset:j}}function k({direction:e="horizontal",defaultSize:t=300,minSize:n=100,maxSize:s,onResize:l,children:o,handleSize:i=4,id:p,sx:d}){const{size:c,isDragging:a,handleProps:h}=I({direction:e,defaultSize:t,minSize:n,maxSize:s,onResize:l,storageKey:p?`ov-split-${p}`:void 0}),m=e==="horizontal";return r.jsxs(u,{sx:{display:"flex",flexDirection:m?"row":"column",height:"100%",width:"100%",overflow:"hidden",userSelect:a?"none":void 0,...d},children:[r.jsx(u,{sx:{[m?"width":"height"]:c,flexShrink:0,overflow:"auto"},children:o[0]}),r.jsx(u,{...h,sx:{[m?"width":"height"]:i,flexShrink:0,cursor:m?"col-resize":"row-resize",bgcolor:a?"var(--ov-accent)":"transparent",transition:a?"none":"background-color 0.15s","&:hover":{bgcolor:"var(--ov-border-default)"}}}),r.jsx(u,{sx:{flex:1,overflow:"auto",minWidth:0,minHeight:0},children:o[1]})]})}k.displayName="ResizableSplitPane";function A({header:e,sidebar:t,footer:n,children:s,sidebarWidth:l=240,sidebarCollapsed:o=!1,headerHeight:i=48,footerHeight:p=32,sx:d}){const c=o?0:l,a=e?i:0,h=n?p:0;return r.jsxs(u,{sx:{display:"grid",gridTemplateAreas:`
2
+ "header header"
3
+ "sidebar main"
4
+ "footer footer"
5
+ `,gridTemplateColumns:t?`${typeof c=="number"?`${c}px`:c} 1fr`:"1fr",gridTemplateRows:`${typeof a=="number"?`${a}px`:a} 1fr ${typeof h=="number"?`${h}px`:h}`,height:"100vh",width:"100vw",overflow:"hidden","--ov-shell-sidebar-width":typeof c=="number"?`${c}px`:c,"--ov-shell-header-height":typeof a=="number"?`${a}px`:a,"--ov-shell-footer-height":typeof h=="number"?`${h}px`:h,...d},children:[e&&r.jsx(u,{sx:{gridArea:"header",overflow:"hidden"},children:e}),t&&r.jsx(u,{sx:{gridArea:"sidebar",overflow:"auto",transition:"width 0.2s ease"},children:t}),r.jsx(u,{sx:{gridArea:"main",overflow:"auto"},children:s}),n&&r.jsx(u,{sx:{gridArea:"footer",overflow:"hidden"},children:n})]})}A.displayName="AppShell";const B={flat:"none",raised:"0 1px 3px rgba(0,0,0,0.12)",overlay:"0 4px 12px rgba(0,0,0,0.2)"};function L({title:e,icon:t,toolbar:n,children:s,collapsible:l=!1,onClose:o,elevation:i="flat",sx:p}){const[d,c]=v.useState(!1);return r.jsxs(u,{sx:{display:"flex",flexDirection:"column",border:"1px solid var(--ov-border-default)",borderRadius:"6px",bgcolor:"var(--ov-bg-surface)",boxShadow:B[i],overflow:"hidden",...p},children:[(e||n||o)&&r.jsxs(u,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:.75,borderBottom:d?"none":"1px solid var(--ov-border-muted)",bgcolor:"var(--ov-bg-subtle)",minHeight:36},children:[l&&r.jsx(C,{size:"small",onClick:()=>c(a=>!a),sx:{p:.25},children:d?r.jsx(w.LuChevronRight,{size:14}):r.jsx(w.LuChevronDown,{size:14})}),t&&r.jsx(u,{sx:{display:"flex",color:"var(--ov-fg-muted)"},children:t}),e&&r.jsx(R,{variant:"body2",sx:{fontWeight:600,fontSize:"0.8125rem",color:"var(--ov-fg-base)",flex:1},children:e}),n&&r.jsx(u,{sx:{display:"flex",alignItems:"center",gap:.5},children:n}),o&&r.jsx(C,{size:"small",onClick:o,sx:{p:.25,ml:"auto"},children:r.jsx(w.LuX,{size:14})})]}),r.jsx(W,{in:!d,children:r.jsx(u,{sx:{flex:1,overflow:"auto"},children:s})})]})}L.displayName="Panel";function z({direction:e="column",gap:t,spacing:n,align:s,alignItems:l,justify:o,justifyContent:i,wrap:p,flexWrap:d,divider:c=!1,children:a,sx:h,...m}){const y=n??t??1,j=l??s,f=i??o,x=d??(p?"wrap":void 0),b=typeof c=="boolean"?c?r.jsx(P,{orientation:e==="row"?"vertical":"horizontal",flexItem:!0}):void 0:c;return r.jsx(E,{direction:e,spacing:y,alignItems:j,justifyContent:f,flexWrap:x,divider:b,sx:h,...m,children:a})}z.displayName="Stack";function $({gap:e=1,align:t="center",justify:n,divider:s=!1,children:l,sx:o}){return r.jsx(z,{direction:"row",gap:e,align:t,justify:n,wrap:!0,divider:s,sx:o,children:l})}$.displayName="Inline";function q({sx:e}){return r.jsx(u,{sx:{flex:1,...e}})}q.displayName="Spacer";function g(e,t){if(e.type==="leaf")return r.jsx(u,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto"},children:t(e.id)});const n=e.type==="horizontal"?"horizontal":"vertical",s=e.children;return s.length===0?null:s.length===1?g(s[0],t):N(s,n,e.sizes,t)}function N(e,t,n,s){if(e.length===1)return g(e[0],s);const l=n?.[0]??50,o=e[0],i=e.slice(1),p=n?.slice(1),d=o.type==="leaf"?o.minSize??100:100;return r.jsxs(k,{direction:t,defaultSize:l,minSize:d,children:[g(o,s),i.length===1?g(i[0],s):N(i,t,p,s)]})}function M({layout:e,renderPanel:t,sx:n}){return r.jsx(u,{sx:{display:"flex",flex:1,minWidth:0,minHeight:0,overflow:"hidden",...typeof n=="object"&&!Array.isArray(n)?n:{}},children:g(e,t)})}M.displayName="DockLayout";exports.AppShell=A;exports.DockLayout=M;exports.Inline=$;exports.Panel=L;exports.ResizableSplitPane=k;exports.Spacer=q;exports.Stack=z;exports.useResizablePanel=I;
package/dist/layout.js ADDED
@@ -0,0 +1,378 @@
1
+ import { useState as S, useRef as N, useCallback as b, useEffect as W } from "react";
2
+ import { jsxs as g, jsx as n } from "react/jsx-runtime";
3
+ import d from "@mui/material/Box";
4
+ import E from "@mui/material/Typography";
5
+ import A from "@mui/material/IconButton";
6
+ import H from "@mui/material/Collapse";
7
+ import { LuChevronRight as M, LuChevronDown as T, LuX as j } from "react-icons/lu";
8
+ import B from "@mui/material/Stack";
9
+ import R from "@mui/material/Divider";
10
+ function X(e, o) {
11
+ try {
12
+ const r = localStorage.getItem(e);
13
+ return r ? Number(r) : o;
14
+ } catch {
15
+ return o;
16
+ }
17
+ }
18
+ function w(e, o) {
19
+ try {
20
+ localStorage.setItem(e, String(o));
21
+ } catch {
22
+ }
23
+ }
24
+ function J({
25
+ direction: e,
26
+ defaultSize: o,
27
+ minSize: r = 0,
28
+ maxSize: i = 1 / 0,
29
+ onResize: s,
30
+ storageKey: t
31
+ }) {
32
+ const [l, u] = S(
33
+ () => t ? X(t, o) : o
34
+ ), [p, c] = S(!1), a = N({ pos: 0, size: 0 }), f = b(
35
+ (h) => Math.max(r, Math.min(i, h)),
36
+ [r, i]
37
+ ), v = b(
38
+ (h) => {
39
+ h.preventDefault();
40
+ const m = e === "horizontal" ? h.clientX : h.clientY;
41
+ a.current = { pos: m, size: l }, c(!0);
42
+ },
43
+ [e, l]
44
+ );
45
+ W(() => {
46
+ if (!p) return;
47
+ const h = (y) => {
48
+ const L = (e === "horizontal" ? y.clientX : y.clientY) - a.current.pos, k = f(a.current.size + L);
49
+ u(k), s?.(k);
50
+ }, m = () => {
51
+ c(!1), t && w(t, l);
52
+ };
53
+ return document.addEventListener("mousemove", h), document.addEventListener("mouseup", m), () => {
54
+ document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", m);
55
+ };
56
+ }, [p, e, f, s, t, l]);
57
+ const D = b(() => {
58
+ const m = f(l === r ? o : r);
59
+ u(m), s?.(m), t && w(t, m);
60
+ }, [l, r, o, f, s, t]), z = b(() => {
61
+ u(o), s?.(o), t && w(t, o);
62
+ }, [o, s, t]);
63
+ return {
64
+ size: l,
65
+ isDragging: p,
66
+ handleProps: {
67
+ onMouseDown: v,
68
+ onDoubleClick: D
69
+ },
70
+ reset: z
71
+ };
72
+ }
73
+ function I({
74
+ direction: e = "horizontal",
75
+ defaultSize: o = 300,
76
+ minSize: r = 100,
77
+ maxSize: i,
78
+ onResize: s,
79
+ children: t,
80
+ handleSize: l = 4,
81
+ id: u,
82
+ sx: p
83
+ }) {
84
+ const { size: c, isDragging: a, handleProps: f } = J({
85
+ direction: e,
86
+ defaultSize: o,
87
+ minSize: r,
88
+ maxSize: i,
89
+ onResize: s,
90
+ storageKey: u ? `ov-split-${u}` : void 0
91
+ }), v = e === "horizontal";
92
+ return /* @__PURE__ */ g(
93
+ d,
94
+ {
95
+ sx: {
96
+ display: "flex",
97
+ flexDirection: v ? "row" : "column",
98
+ height: "100%",
99
+ width: "100%",
100
+ overflow: "hidden",
101
+ userSelect: a ? "none" : void 0,
102
+ ...p
103
+ },
104
+ children: [
105
+ /* @__PURE__ */ n(
106
+ d,
107
+ {
108
+ sx: {
109
+ [v ? "width" : "height"]: c,
110
+ flexShrink: 0,
111
+ overflow: "auto"
112
+ },
113
+ children: t[0]
114
+ }
115
+ ),
116
+ /* @__PURE__ */ n(
117
+ d,
118
+ {
119
+ ...f,
120
+ sx: {
121
+ [v ? "width" : "height"]: l,
122
+ flexShrink: 0,
123
+ cursor: v ? "col-resize" : "row-resize",
124
+ bgcolor: a ? "var(--ov-accent)" : "transparent",
125
+ transition: a ? "none" : "background-color 0.15s",
126
+ "&:hover": {
127
+ bgcolor: "var(--ov-border-default)"
128
+ }
129
+ }
130
+ }
131
+ ),
132
+ /* @__PURE__ */ n(d, { sx: { flex: 1, overflow: "auto", minWidth: 0, minHeight: 0 }, children: t[1] })
133
+ ]
134
+ }
135
+ );
136
+ }
137
+ I.displayName = "ResizableSplitPane";
138
+ function P({
139
+ header: e,
140
+ sidebar: o,
141
+ footer: r,
142
+ children: i,
143
+ sidebarWidth: s = 240,
144
+ sidebarCollapsed: t = !1,
145
+ headerHeight: l = 48,
146
+ footerHeight: u = 32,
147
+ sx: p
148
+ }) {
149
+ const c = t ? 0 : s, a = e ? l : 0, f = r ? u : 0;
150
+ return /* @__PURE__ */ g(
151
+ d,
152
+ {
153
+ sx: {
154
+ display: "grid",
155
+ gridTemplateAreas: `
156
+ "header header"
157
+ "sidebar main"
158
+ "footer footer"
159
+ `,
160
+ gridTemplateColumns: o ? `${typeof c == "number" ? `${c}px` : c} 1fr` : "1fr",
161
+ gridTemplateRows: `${typeof a == "number" ? `${a}px` : a} 1fr ${typeof f == "number" ? `${f}px` : f}`,
162
+ height: "100vh",
163
+ width: "100vw",
164
+ overflow: "hidden",
165
+ "--ov-shell-sidebar-width": typeof c == "number" ? `${c}px` : c,
166
+ "--ov-shell-header-height": typeof a == "number" ? `${a}px` : a,
167
+ "--ov-shell-footer-height": typeof f == "number" ? `${f}px` : f,
168
+ ...p
169
+ },
170
+ children: [
171
+ e && /* @__PURE__ */ n(d, { sx: { gridArea: "header", overflow: "hidden" }, children: e }),
172
+ o && /* @__PURE__ */ n(
173
+ d,
174
+ {
175
+ sx: {
176
+ gridArea: "sidebar",
177
+ overflow: "auto",
178
+ transition: "width 0.2s ease"
179
+ },
180
+ children: o
181
+ }
182
+ ),
183
+ /* @__PURE__ */ n(d, { sx: { gridArea: "main", overflow: "auto" }, children: i }),
184
+ r && /* @__PURE__ */ n(d, { sx: { gridArea: "footer", overflow: "hidden" }, children: r })
185
+ ]
186
+ }
187
+ );
188
+ }
189
+ P.displayName = "AppShell";
190
+ const Y = {
191
+ flat: "none",
192
+ raised: "0 1px 3px rgba(0,0,0,0.12)",
193
+ overlay: "0 4px 12px rgba(0,0,0,0.2)"
194
+ };
195
+ function U({
196
+ title: e,
197
+ icon: o,
198
+ toolbar: r,
199
+ children: i,
200
+ collapsible: s = !1,
201
+ onClose: t,
202
+ elevation: l = "flat",
203
+ sx: u
204
+ }) {
205
+ const [p, c] = S(!1);
206
+ return /* @__PURE__ */ g(
207
+ d,
208
+ {
209
+ sx: {
210
+ display: "flex",
211
+ flexDirection: "column",
212
+ border: "1px solid var(--ov-border-default)",
213
+ borderRadius: "6px",
214
+ bgcolor: "var(--ov-bg-surface)",
215
+ boxShadow: Y[l],
216
+ overflow: "hidden",
217
+ ...u
218
+ },
219
+ children: [
220
+ (e || r || t) && /* @__PURE__ */ g(
221
+ d,
222
+ {
223
+ sx: {
224
+ display: "flex",
225
+ alignItems: "center",
226
+ gap: 1,
227
+ px: 1.5,
228
+ py: 0.75,
229
+ borderBottom: p ? "none" : "1px solid var(--ov-border-muted)",
230
+ bgcolor: "var(--ov-bg-subtle)",
231
+ minHeight: 36
232
+ },
233
+ children: [
234
+ s && /* @__PURE__ */ n(
235
+ A,
236
+ {
237
+ size: "small",
238
+ onClick: () => c((a) => !a),
239
+ sx: { p: 0.25 },
240
+ children: p ? /* @__PURE__ */ n(M, { size: 14 }) : /* @__PURE__ */ n(T, { size: 14 })
241
+ }
242
+ ),
243
+ o && /* @__PURE__ */ n(d, { sx: { display: "flex", color: "var(--ov-fg-muted)" }, children: o }),
244
+ e && /* @__PURE__ */ n(
245
+ E,
246
+ {
247
+ variant: "body2",
248
+ sx: {
249
+ fontWeight: 600,
250
+ fontSize: "0.8125rem",
251
+ color: "var(--ov-fg-base)",
252
+ flex: 1
253
+ },
254
+ children: e
255
+ }
256
+ ),
257
+ r && /* @__PURE__ */ n(d, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: r }),
258
+ t && /* @__PURE__ */ n(A, { size: "small", onClick: t, sx: { p: 0.25, ml: "auto" }, children: /* @__PURE__ */ n(j, { size: 14 }) })
259
+ ]
260
+ }
261
+ ),
262
+ /* @__PURE__ */ n(H, { in: !p, children: /* @__PURE__ */ n(d, { sx: { flex: 1, overflow: "auto" }, children: i }) })
263
+ ]
264
+ }
265
+ );
266
+ }
267
+ U.displayName = "Panel";
268
+ function $({
269
+ direction: e = "column",
270
+ gap: o,
271
+ spacing: r,
272
+ align: i,
273
+ alignItems: s,
274
+ justify: t,
275
+ justifyContent: l,
276
+ wrap: u,
277
+ flexWrap: p,
278
+ divider: c = !1,
279
+ children: a,
280
+ sx: f,
281
+ ...v
282
+ }) {
283
+ return /* @__PURE__ */ n(
284
+ B,
285
+ {
286
+ direction: e,
287
+ spacing: r ?? o ?? 1,
288
+ alignItems: s ?? i,
289
+ justifyContent: l ?? t,
290
+ flexWrap: p ?? (u ? "wrap" : void 0),
291
+ divider: typeof c == "boolean" ? c ? /* @__PURE__ */ n(R, { orientation: e === "row" ? "vertical" : "horizontal", flexItem: !0 }) : void 0 : c,
292
+ sx: f,
293
+ ...v,
294
+ children: a
295
+ }
296
+ );
297
+ }
298
+ $.displayName = "Stack";
299
+ function q({
300
+ gap: e = 1,
301
+ align: o = "center",
302
+ justify: r,
303
+ divider: i = !1,
304
+ children: s,
305
+ sx: t
306
+ }) {
307
+ return /* @__PURE__ */ n(
308
+ $,
309
+ {
310
+ direction: "row",
311
+ gap: e,
312
+ align: o,
313
+ justify: r,
314
+ wrap: !0,
315
+ divider: i,
316
+ sx: t,
317
+ children: s
318
+ }
319
+ );
320
+ }
321
+ q.displayName = "Inline";
322
+ function F({ sx: e }) {
323
+ return /* @__PURE__ */ n(d, { sx: { flex: 1, ...e } });
324
+ }
325
+ F.displayName = "Spacer";
326
+ function x(e, o) {
327
+ if (e.type === "leaf")
328
+ return /* @__PURE__ */ n(d, { sx: { flex: 1, minWidth: 0, minHeight: 0, overflow: "auto" }, children: o(e.id) });
329
+ const r = e.type === "horizontal" ? "horizontal" : "vertical", i = e.children;
330
+ return i.length === 0 ? null : i.length === 1 ? x(i[0], o) : C(i, r, e.sizes, o);
331
+ }
332
+ function C(e, o, r, i) {
333
+ if (e.length === 1) return x(e[0], i);
334
+ const s = r?.[0] ?? 50, t = e[0], l = e.slice(1), u = r?.slice(1), p = t.type === "leaf" ? t.minSize ?? 100 : 100;
335
+ return /* @__PURE__ */ g(
336
+ I,
337
+ {
338
+ direction: o,
339
+ defaultSize: s,
340
+ minSize: p,
341
+ children: [
342
+ x(t, i),
343
+ l.length === 1 ? x(l[0], i) : C(l, o, u, i)
344
+ ]
345
+ }
346
+ );
347
+ }
348
+ function G({
349
+ layout: e,
350
+ renderPanel: o,
351
+ sx: r
352
+ }) {
353
+ return /* @__PURE__ */ n(
354
+ d,
355
+ {
356
+ sx: {
357
+ display: "flex",
358
+ flex: 1,
359
+ minWidth: 0,
360
+ minHeight: 0,
361
+ overflow: "hidden",
362
+ ...typeof r == "object" && !Array.isArray(r) ? r : {}
363
+ },
364
+ children: x(e, o)
365
+ }
366
+ );
367
+ }
368
+ G.displayName = "DockLayout";
369
+ export {
370
+ P as AppShell,
371
+ G as DockLayout,
372
+ q as Inline,
373
+ U as Panel,
374
+ I as ResizableSplitPane,
375
+ F as Spacer,
376
+ $ as Stack,
377
+ J as useResizablePanel
378
+ };
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+ import { ContextMenuItem } from './types';
3
+ export interface ContextMenuProps {
4
+ items: ContextMenuItem[];
5
+ children: React.ReactNode;
6
+ onOpenChange?: (open: boolean) => void;
7
+ }
8
+ declare function ContextMenu({ items, children, onOpenChange, }: ContextMenuProps): import("react/jsx-runtime").JSX.Element;
9
+ declare namespace ContextMenu {
10
+ var displayName: string;
11
+ }
12
+ export default ContextMenu;
@@ -0,0 +1,20 @@
1
+ import { default as React } from 'react';
2
+ import { SxProps, Theme } from '@mui/material/styles';
3
+ import { ComponentSize } from '../types';
4
+ import { ContextMenuItem } from './types';
5
+ import { SubmenuDirection } from './NestedMenuItem';
6
+ export interface DropdownMenuProps {
7
+ items: ContextMenuItem[];
8
+ trigger: React.ReactNode;
9
+ placement?: 'bottom-start' | 'bottom-end' | 'top-start' | 'top-end';
10
+ /** Which side nested submenus expand toward. Inferred from placement if not set. */
11
+ submenuDirection?: SubmenuDirection;
12
+ size?: ComponentSize;
13
+ width?: number | string;
14
+ sx?: SxProps<Theme>;
15
+ }
16
+ declare function DropdownMenu({ items, trigger, placement, submenuDirection, width, }: DropdownMenuProps): import("react/jsx-runtime").JSX.Element;
17
+ declare namespace DropdownMenu {
18
+ var displayName: string;
19
+ }
20
+ export default DropdownMenu;
@@ -0,0 +1,11 @@
1
+ import { SxProps, Theme } from '@mui/material/styles';
2
+ import { MenuBarItem } from './types';
3
+ export interface MenuBarProps {
4
+ menus: MenuBarItem[];
5
+ sx?: SxProps<Theme>;
6
+ }
7
+ declare function MenuBar({ menus, sx }: MenuBarProps): import("react/jsx-runtime").JSX.Element;
8
+ declare namespace MenuBar {
9
+ var displayName: string;
10
+ }
11
+ export default MenuBar;
@@ -0,0 +1,13 @@
1
+ import { ContextMenuItem } from './types';
2
+ export type SubmenuDirection = 'left' | 'right';
3
+ export interface NestedMenuItemProps {
4
+ item: ContextMenuItem;
5
+ onClose: () => void;
6
+ /** Which side submenus expand toward. Defaults to 'right'. */
7
+ submenuDirection?: SubmenuDirection;
8
+ }
9
+ declare function NestedMenuItem({ item, onClose, submenuDirection }: NestedMenuItemProps): import("react/jsx-runtime").JSX.Element;
10
+ declare namespace NestedMenuItem {
11
+ var displayName: string;
12
+ }
13
+ export default NestedMenuItem;
@@ -0,0 +1,15 @@
1
+ import { SemanticColor, Emphasis, ComponentSize } from '../types';
2
+ import { SplitButtonOption } from './types';
3
+ export interface SplitButtonProps {
4
+ options: SplitButtonOption[];
5
+ onSelect: (option: SplitButtonOption) => void;
6
+ defaultIndex?: number;
7
+ color?: SemanticColor;
8
+ emphasis?: Emphasis;
9
+ size?: ComponentSize;
10
+ }
11
+ declare function SplitButton({ options, onSelect, defaultIndex, color, emphasis, size, }: SplitButtonProps): import("react/jsx-runtime").JSX.Element;
12
+ declare namespace SplitButton {
13
+ var displayName: string;
14
+ }
15
+ export default SplitButton;
@@ -0,0 +1,11 @@
1
+ export type { ContextMenuItem, MenuBarItem, SplitButtonOption } from './types';
2
+ export { default as ContextMenu } from './ContextMenu';
3
+ export type { ContextMenuProps } from './ContextMenu';
4
+ export { default as DropdownMenu } from './DropdownMenu';
5
+ export type { DropdownMenuProps } from './DropdownMenu';
6
+ export { default as NestedMenuItem } from './NestedMenuItem';
7
+ export type { NestedMenuItemProps, SubmenuDirection } from './NestedMenuItem';
8
+ export { default as MenuBar } from './MenuBar';
9
+ export type { MenuBarProps } from './MenuBar';
10
+ export { default as SplitButton } from './SplitButton';
11
+ export type { SplitButtonProps } from './SplitButton';
@@ -0,0 +1,24 @@
1
+ import { ReactNode } from 'react';
2
+ import { SemanticColor } from '../types';
3
+ export interface ContextMenuItem {
4
+ key: string;
5
+ label: string;
6
+ icon?: ReactNode;
7
+ shortcut?: string[];
8
+ color?: SemanticColor;
9
+ disabled?: boolean;
10
+ dividerAfter?: boolean;
11
+ children?: ContextMenuItem[];
12
+ onClick?: () => void;
13
+ }
14
+ export interface MenuBarItem {
15
+ key: string;
16
+ label: string;
17
+ items: ContextMenuItem[];
18
+ }
19
+ export interface SplitButtonOption {
20
+ key: string;
21
+ label: string;
22
+ icon?: ReactNode;
23
+ disabled?: boolean;
24
+ }