@deadragdoll/reactnu 0.1.9
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 +21 -0
- package/README.md +151 -0
- package/dist/appHost/NuAppHostProvider.d.ts +6 -0
- package/dist/appHost/appHostContext.d.ts +26 -0
- package/dist/components/Button/Button.d.ts +13 -0
- package/dist/components/Button/index.d.ts +1 -0
- package/dist/components/CheckBox/CheckBox.d.ts +14 -0
- package/dist/components/CheckBox/index.d.ts +1 -0
- package/dist/components/ComboBox/ComboBox.d.ts +23 -0
- package/dist/components/ComboBox/index.d.ts +1 -0
- package/dist/components/CommandButton/CommandButton.d.ts +17 -0
- package/dist/components/CommandButton/index.d.ts +1 -0
- package/dist/components/CrtGlitch/CrtGlitch.d.ts +23 -0
- package/dist/components/CrtGlitch/index.d.ts +1 -0
- package/dist/components/Dashboard/Dashboard.d.ts +25 -0
- package/dist/components/Dashboard/index.d.ts +1 -0
- package/dist/components/Desktop/Desktop.d.ts +6 -0
- package/dist/components/Desktop/index.d.ts +1 -0
- package/dist/components/Dropdown/Dropdown.d.ts +19 -0
- package/dist/components/Dropdown/index.d.ts +1 -0
- package/dist/components/Frame/Frame.d.ts +24 -0
- package/dist/components/Frame/index.d.ts +1 -0
- package/dist/components/Glyph/NuGlyph.d.ts +6 -0
- package/dist/components/Glyph/index.d.ts +1 -0
- package/dist/components/Info/Info.d.ts +13 -0
- package/dist/components/Info/index.d.ts +1 -0
- package/dist/components/ListBox/ListBox.d.ts +23 -0
- package/dist/components/ListBox/index.d.ts +1 -0
- package/dist/components/ListBox/internals/ListBoxCategoryView.d.ts +6 -0
- package/dist/components/ListBox/internals/ListBoxCheckControl.d.ts +8 -0
- package/dist/components/ListBox/internals/ListBoxGroupView.d.ts +17 -0
- package/dist/components/ListBox/internals/ListBoxItemView.d.ts +18 -0
- package/dist/components/ListBox/internals/helpers.d.ts +5 -0
- package/dist/components/ListBox/internals/renderLabel.d.ts +2 -0
- package/dist/components/ListBox/internals/types.d.ts +27 -0
- package/dist/components/ListView/ListView.d.ts +27 -0
- package/dist/components/ListView/index.d.ts +1 -0
- package/dist/components/ListView/internals/ListViewCheckControl.d.ts +8 -0
- package/dist/components/ListView/internals/ListViewRow.d.ts +18 -0
- package/dist/components/ListView/internals/helpers.d.ts +5 -0
- package/dist/components/ListView/internals/types.d.ts +17 -0
- package/dist/components/MainMenu/MainMenu.d.ts +8 -0
- package/dist/components/MainMenu/MainMenu.types.d.ts +23 -0
- package/dist/components/MainMenu/index.d.ts +3 -0
- package/dist/components/MainMenu/internals/MainMenuList.d.ts +12 -0
- package/dist/components/MainMenu/menuState.d.ts +40 -0
- package/dist/components/MaskedField/MaskedField.d.ts +13 -0
- package/dist/components/MaskedField/index.d.ts +2 -0
- package/dist/components/MaskedField/textMask.d.ts +8 -0
- package/dist/components/Memo/Memo.d.ts +14 -0
- package/dist/components/Memo/index.d.ts +1 -0
- package/dist/components/PageControl/PageControl.d.ts +20 -0
- package/dist/components/PageControl/index.d.ts +1 -0
- package/dist/components/Panel/Panel.d.ts +11 -0
- package/dist/components/Panel/index.d.ts +1 -0
- package/dist/components/PopupMenu/PopupMenu.d.ts +22 -0
- package/dist/components/PopupMenu/index.d.ts +2 -0
- package/dist/components/PopupMenu/usePopupMenu.d.ts +12 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts +17 -0
- package/dist/components/ProgressBar/index.d.ts +1 -0
- package/dist/components/PropertyGrid/PropertyGrid.d.ts +38 -0
- package/dist/components/PropertyGrid/index.d.ts +1 -0
- package/dist/components/RadioGroup/RadioButton.d.ts +9 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +21 -0
- package/dist/components/RadioGroup/index.d.ts +2 -0
- package/dist/components/ReportCell/ReportCell.d.ts +6 -0
- package/dist/components/ReportCell/index.d.ts +1 -0
- package/dist/components/SearchBox/SearchBox.d.ts +23 -0
- package/dist/components/SearchBox/index.d.ts +1 -0
- package/dist/components/SpinBox/SpinBox.d.ts +16 -0
- package/dist/components/SpinBox/index.d.ts +1 -0
- package/dist/components/Splitter/Splitter.d.ts +15 -0
- package/dist/components/Splitter/index.d.ts +1 -0
- package/dist/components/Stack/Stack.d.ts +13 -0
- package/dist/components/Stack/index.d.ts +1 -0
- package/dist/components/TextField/TextField.d.ts +12 -0
- package/dist/components/TextField/index.d.ts +1 -0
- package/dist/components/TickBar/TickBar.d.ts +22 -0
- package/dist/components/TickBar/index.d.ts +1 -0
- package/dist/components/ToolBar/ToolBar.d.ts +25 -0
- package/dist/components/ToolBar/index.d.ts +1 -0
- package/dist/components/TreeListView/TreeListView.d.ts +33 -0
- package/dist/components/TreeListView/index.d.ts +1 -0
- package/dist/components/TreeListView/internals/TreeListViewRow.d.ts +28 -0
- package/dist/components/TreeListView/internals/helpers.d.ts +14 -0
- package/dist/components/TreeListView/internals/types.d.ts +32 -0
- package/dist/components/TreeView/TreeView.d.ts +26 -0
- package/dist/components/TreeView/index.d.ts +1 -0
- package/dist/components/TreeView/internals/TreeViewItem.d.ts +21 -0
- package/dist/components/TreeView/internals/helpers.d.ts +5 -0
- package/dist/components/TreeView/internals/types.d.ts +10 -0
- package/dist/components/View/NuView.d.ts +10 -0
- package/dist/components/View/index.d.ts +1 -0
- package/dist/components/Window/StatusBarItem.d.ts +7 -0
- package/dist/components/Window/Window.d.ts +41 -0
- package/dist/components/Window/WindowTitleButton.d.ts +17 -0
- package/dist/components/Window/index.d.ts +5 -0
- package/dist/components/Window/internals/WindowStatusBar.d.ts +8 -0
- package/dist/components/Window/internals/WindowTitleBar.d.ts +10 -0
- package/dist/components/Window/useWindowTitleButtons.d.ts +12 -0
- package/dist/components/Window/windowMenuContext.d.ts +3 -0
- package/dist/components/_shared/ControlOpener.d.ts +18 -0
- package/dist/components/_shared/portalPositioning.d.ts +16 -0
- package/dist/components/_shared/slotProps.d.ts +867 -0
- package/dist/components/_shared/themePortal.d.ts +2 -0
- package/dist/components/_shared/treeData.d.ts +19 -0
- package/dist/components/_shared/usePopupPosition.d.ts +40 -0
- package/dist/index.cjs +9848 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.js +9885 -0
- package/dist/styles.css +3644 -0
- package/dist/theme/NuThemeProvider.d.ts +26 -0
- package/dist/theme/themeContext.d.ts +15 -0
- package/dist/theme/themes.d.ts +49 -0
- package/dist/utils/renderMnemonicText.d.ts +10 -0
- package/dist/windowing/AppBarHost.d.ts +6 -0
- package/dist/windowing/AppBarItem.d.ts +587 -0
- package/dist/windowing/NuWindowProvider.d.ts +9 -0
- package/dist/windowing/WindowBar.d.ts +13 -0
- package/dist/windowing/dialogHelpers.d.ts +1793 -0
- package/dist/windowing/internals/MdiWindowPickerDialog.d.ts +10 -0
- package/dist/windowing/mdiMenu.d.ts +3 -0
- package/dist/windowing/windowContext.d.ts +18 -0
- package/dist/windowing/windowing.constants.d.ts +1 -0
- package/dist/windowing/windowing.types.d.ts +54 -0
- package/docs/API_REFERENCE.md +150 -0
- package/docs/ARCHITECTURE.md +170 -0
- package/docs/AppBarHost.md +22 -0
- package/docs/AppBarItem.md +22 -0
- package/docs/Button.md +24 -0
- package/docs/COMPONENT_INDEX.md +64 -0
- package/docs/CONTRIBUTOR_GUIDE.md +393 -0
- package/docs/CheckBox.md +30 -0
- package/docs/ComboBox.md +41 -0
- package/docs/CommandButton.md +45 -0
- package/docs/CrtGlitch.md +49 -0
- package/docs/Dashboard.md +73 -0
- package/docs/Desktop.md +27 -0
- package/docs/DialogHelpers.md +85 -0
- package/docs/Dropdown.md +44 -0
- package/docs/Frame.md +38 -0
- package/docs/GETTING_STARTED.md +110 -0
- package/docs/Glyph.md +29 -0
- package/docs/Info.md +51 -0
- package/docs/ListBox.md +35 -0
- package/docs/ListView.md +62 -0
- package/docs/MainMenu.md +36 -0
- package/docs/MaskedField.md +124 -0
- package/docs/Memo.md +32 -0
- package/docs/NuAppHostProvider.md +28 -0
- package/docs/NuThemeProvider.md +64 -0
- package/docs/NuView.md +58 -0
- package/docs/NuWindowProvider.md +81 -0
- package/docs/PageControl.md +28 -0
- package/docs/Panel.md +23 -0
- package/docs/PopupMenu.md +42 -0
- package/docs/ProgressBar.md +33 -0
- package/docs/PropertyGrid.md +63 -0
- package/docs/RadioGroup.md +36 -0
- package/docs/ReportCell.md +27 -0
- package/docs/SLOT_CUSTOMIZATION.md +85 -0
- package/docs/STORYBOOK.md +96 -0
- package/docs/SearchBox.md +41 -0
- package/docs/SpinBox.md +25 -0
- package/docs/Splitter.md +91 -0
- package/docs/Stack.md +26 -0
- package/docs/StatusBarItem.md +31 -0
- package/docs/TOKEN_CHECKLIST.md +122 -0
- package/docs/TextField.md +27 -0
- package/docs/TickBar.md +57 -0
- package/docs/ToolBar.md +51 -0
- package/docs/TreeListView.md +84 -0
- package/docs/TreeView.md +53 -0
- package/docs/Window.md +53 -0
- package/docs/WindowBar.md +24 -0
- package/package.json +47 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NuManagedWindowInfo } from "../windowing.types";
|
|
2
|
+
type MdiWindowPickerDialogProps = {
|
|
3
|
+
activeWindowId?: string;
|
|
4
|
+
domain?: string;
|
|
5
|
+
onActivateWindow: (id: string) => void;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
windows: NuManagedWindowInfo[];
|
|
8
|
+
};
|
|
9
|
+
export declare function MdiWindowPickerDialog({ activeWindowId, domain, onActivateWindow, onClose, windows }: MdiWindowPickerDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { NuInputBoxOptions, NuManagedWindowDefinition, NuManagedWindowInfo, NuMessageBoxOptions, NuMessageBoxResult } from "./windowing.types";
|
|
2
|
+
export type NuWindowContextValue = {
|
|
3
|
+
activateWindow: (id: string) => void;
|
|
4
|
+
bringToFront: (id: string) => void;
|
|
5
|
+
closeAll: () => void;
|
|
6
|
+
closeWindow: (id: string) => void;
|
|
7
|
+
openDialog: (definition: NuManagedWindowDefinition) => string;
|
|
8
|
+
openWindow: (definition: NuManagedWindowDefinition) => string;
|
|
9
|
+
showInputBox: (options: NuInputBoxOptions) => Promise<string | null>;
|
|
10
|
+
showMessageBox: (options: NuMessageBoxOptions) => Promise<NuMessageBoxResult>;
|
|
11
|
+
toggleWindowMaximized: (id: string) => void;
|
|
12
|
+
toggleWindowMinimized: (id: string) => void;
|
|
13
|
+
updateWindow: (id: string, patch: Partial<NuManagedWindowDefinition>) => void;
|
|
14
|
+
windows: NuManagedWindowInfo[];
|
|
15
|
+
};
|
|
16
|
+
export type NuMdiMenuBridge = Pick<NuWindowContextValue, "activateWindow" | "openDialog" | "windows">;
|
|
17
|
+
export declare const NuWindowContext: import("react").Context<NuWindowContextValue | null>;
|
|
18
|
+
export declare function useNuWindowManager(): NuWindowContextValue;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const NU_APP_BAR_HEIGHT = "2.1rem";
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from "react";
|
|
2
|
+
import { WindowBorder, WindowMode } from "../components/Window";
|
|
3
|
+
import { WindowTitleButtonDefinition } from "../components/Window/WindowTitleButton";
|
|
4
|
+
import { NuInputBoxOptions, NuMessageBoxKind, NuMessageBoxOptions, NuMessageBoxPreset, NuMessageBoxResult } from "./dialogHelpers";
|
|
5
|
+
export type NuManagedWindowSnapshot = {
|
|
6
|
+
height?: number;
|
|
7
|
+
left?: number;
|
|
8
|
+
maximized?: boolean;
|
|
9
|
+
minimized?: boolean;
|
|
10
|
+
top?: number;
|
|
11
|
+
width?: number;
|
|
12
|
+
};
|
|
13
|
+
export type NuManagedWindowDefinition = {
|
|
14
|
+
appModal?: boolean;
|
|
15
|
+
bodyClassName?: string;
|
|
16
|
+
border?: WindowBorder;
|
|
17
|
+
className?: string;
|
|
18
|
+
closeable?: boolean;
|
|
19
|
+
content: ReactNode | ((controls: NuManagedWindowControls) => ReactNode);
|
|
20
|
+
domain?: string;
|
|
21
|
+
maximizable?: boolean;
|
|
22
|
+
modal?: boolean | string;
|
|
23
|
+
minimizable?: boolean;
|
|
24
|
+
mode?: WindowMode;
|
|
25
|
+
onClose?: (snapshot: NuManagedWindowSnapshot) => boolean | void;
|
|
26
|
+
onOpen?: () => NuManagedWindowSnapshot | void;
|
|
27
|
+
resizable?: boolean;
|
|
28
|
+
statusBar?: ReactNode;
|
|
29
|
+
style?: CSSProperties;
|
|
30
|
+
titleButtons?: WindowTitleButtonDefinition[];
|
|
31
|
+
title: string;
|
|
32
|
+
};
|
|
33
|
+
export type NuManagedWindowControls = {
|
|
34
|
+
bringToFront: () => void;
|
|
35
|
+
close: () => void;
|
|
36
|
+
id: string;
|
|
37
|
+
toggleMaximized: () => void;
|
|
38
|
+
toggleMinimized: () => void;
|
|
39
|
+
update: (patch: Partial<NuManagedWindowDefinition>) => void;
|
|
40
|
+
};
|
|
41
|
+
export type NuManagedWindowInfo = Omit<NuManagedWindowDefinition, "content"> & {
|
|
42
|
+
active: boolean;
|
|
43
|
+
id: string;
|
|
44
|
+
maximized: boolean;
|
|
45
|
+
minimized: boolean;
|
|
46
|
+
mode: WindowMode;
|
|
47
|
+
};
|
|
48
|
+
export type NuWindowBounds = {
|
|
49
|
+
height: number;
|
|
50
|
+
left: number;
|
|
51
|
+
top: number;
|
|
52
|
+
width: number;
|
|
53
|
+
};
|
|
54
|
+
export type { NuInputBoxOptions, NuMessageBoxKind, NuMessageBoxOptions, NuMessageBoxPreset, NuMessageBoxResult };
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# API Reference
|
|
2
|
+
|
|
3
|
+
This is the top-level map of the public ReactNU API.
|
|
4
|
+
|
|
5
|
+
For internal implementation and extension rules, also read:
|
|
6
|
+
|
|
7
|
+
- [Contributor Guide](./CONTRIBUTOR_GUIDE.md)
|
|
8
|
+
- [Architecture](./ARCHITECTURE.md)
|
|
9
|
+
- [Storybook](./STORYBOOK.md)
|
|
10
|
+
|
|
11
|
+
## Common Customization Contract
|
|
12
|
+
|
|
13
|
+
Many controls now support internal slot overrides through:
|
|
14
|
+
|
|
15
|
+
- `slotStyles`
|
|
16
|
+
- `slotClassNames`
|
|
17
|
+
|
|
18
|
+
See: [Slot Customization](./SLOT_CUSTOMIZATION.md)
|
|
19
|
+
|
|
20
|
+
## Providers And Shell
|
|
21
|
+
|
|
22
|
+
- `NuThemeProvider`
|
|
23
|
+
docs: [NuThemeProvider](./NuThemeProvider.md)
|
|
24
|
+
- `NuDesktop`
|
|
25
|
+
docs: [Desktop](./Desktop.md)
|
|
26
|
+
- `Dashboard`
|
|
27
|
+
docs: [Dashboard](./Dashboard.md)
|
|
28
|
+
- `NuAppHostProvider`
|
|
29
|
+
docs: [NuAppHostProvider](./NuAppHostProvider.md)
|
|
30
|
+
- `NuWindowProvider`
|
|
31
|
+
docs: [NuWindowProvider](./NuWindowProvider.md)
|
|
32
|
+
|
|
33
|
+
## Hooks
|
|
34
|
+
|
|
35
|
+
- `useNuTheme()`
|
|
36
|
+
reads and changes the active theme, provider typography, and desktop pattern mode
|
|
37
|
+
- `useAppHostMenu()`
|
|
38
|
+
manages the desktop-level main menu tree and item flags
|
|
39
|
+
- `useNuWindowManager()`
|
|
40
|
+
opens, updates, activates, and closes managed windows
|
|
41
|
+
also exposes `showMessageBox(...)` and `showInputBox(...)`
|
|
42
|
+
- `usePopupMenu()`
|
|
43
|
+
anchor/open helper for `PopupMenu`
|
|
44
|
+
- `useWindowMenu()`
|
|
45
|
+
accesses menu state from inside a managed window
|
|
46
|
+
|
|
47
|
+
## Core Controls
|
|
48
|
+
|
|
49
|
+
- `Button`
|
|
50
|
+
docs: [Button](./Button.md)
|
|
51
|
+
- `CheckBox`
|
|
52
|
+
docs: [CheckBox](./CheckBox.md)
|
|
53
|
+
- `Dropdown`
|
|
54
|
+
docs: [Dropdown](./Dropdown.md)
|
|
55
|
+
- `ComboBox`
|
|
56
|
+
docs: [ComboBox](./ComboBox.md)
|
|
57
|
+
- `CommandButton`
|
|
58
|
+
docs: [CommandButton](./CommandButton.md)
|
|
59
|
+
- `Info`
|
|
60
|
+
docs: [Info](./Info.md)
|
|
61
|
+
- `MaskedField`
|
|
62
|
+
docs: [MaskedField](./MaskedField.md)
|
|
63
|
+
- `Memo`
|
|
64
|
+
docs: [Memo](./Memo.md)
|
|
65
|
+
- `Panel`
|
|
66
|
+
docs: [Panel](./Panel.md)
|
|
67
|
+
- `PageControl` / `Tabs`
|
|
68
|
+
docs: [PageControl](./PageControl.md)
|
|
69
|
+
- `ProgressBar`
|
|
70
|
+
docs: [ProgressBar](./ProgressBar.md)
|
|
71
|
+
- `RadioButton`, `RadioGroup`
|
|
72
|
+
docs: [RadioGroup](./RadioGroup.md)
|
|
73
|
+
- `SearchBox`
|
|
74
|
+
docs: [SearchBox](./SearchBox.md)
|
|
75
|
+
- `TextField`
|
|
76
|
+
docs: [TextField](./TextField.md)
|
|
77
|
+
- `SpinBox`
|
|
78
|
+
docs: [SpinBox](./SpinBox.md)
|
|
79
|
+
- `TickBar`
|
|
80
|
+
docs: [TickBar](./TickBar.md)
|
|
81
|
+
|
|
82
|
+
## Data And Navigation Controls
|
|
83
|
+
|
|
84
|
+
- `ListBox`
|
|
85
|
+
docs: [ListBox](./ListBox.md)
|
|
86
|
+
- `ListView`
|
|
87
|
+
docs: [ListView](./ListView.md)
|
|
88
|
+
- `TreeView`
|
|
89
|
+
docs: [TreeView](./TreeView.md)
|
|
90
|
+
- `TreeListView`
|
|
91
|
+
docs: [TreeListView](./TreeListView.md)
|
|
92
|
+
|
|
93
|
+
## Layout And Surfaces
|
|
94
|
+
|
|
95
|
+
- `Frame`
|
|
96
|
+
docs: [Frame](./Frame.md)
|
|
97
|
+
- `NuView`
|
|
98
|
+
docs: [NuView](./NuView.md)
|
|
99
|
+
- `PropertyGrid`
|
|
100
|
+
docs: [PropertyGrid](./PropertyGrid.md)
|
|
101
|
+
- `ReportCell`
|
|
102
|
+
docs: [ReportCell](./ReportCell.md)
|
|
103
|
+
- `Splitter`
|
|
104
|
+
docs: [Splitter](./Splitter.md)
|
|
105
|
+
- `Stack`
|
|
106
|
+
docs: [Stack](./Stack.md)
|
|
107
|
+
- `ToolBar`, `ToolButton`, `ToolSeparator`
|
|
108
|
+
docs: [ToolBar](./ToolBar.md)
|
|
109
|
+
|
|
110
|
+
## Menus
|
|
111
|
+
|
|
112
|
+
- `MainMenu`
|
|
113
|
+
docs: [MainMenu](./MainMenu.md)
|
|
114
|
+
- `PopupMenu`
|
|
115
|
+
docs: [PopupMenu](./PopupMenu.md)
|
|
116
|
+
|
|
117
|
+
## Windowing And Desktop Chrome
|
|
118
|
+
|
|
119
|
+
- `Window`
|
|
120
|
+
docs: [Window](./Window.md)
|
|
121
|
+
- `StatusBarItem`
|
|
122
|
+
docs: [StatusBarItem](./StatusBarItem.md)
|
|
123
|
+
- `AppBarHost`
|
|
124
|
+
docs: [AppBarHost](./AppBarHost.md)
|
|
125
|
+
- `AppBarItem`
|
|
126
|
+
docs: [AppBarItem](./AppBarItem.md)
|
|
127
|
+
- `WindowBar`
|
|
128
|
+
docs: [WindowBar](./WindowBar.md)
|
|
129
|
+
- `MessageBox` / `InputBox` helpers
|
|
130
|
+
docs: [Dialog Helpers](./DialogHelpers.md)
|
|
131
|
+
|
|
132
|
+
## Visual Utilities
|
|
133
|
+
|
|
134
|
+
- `NuGlyph`
|
|
135
|
+
docs: [Glyph](./Glyph.md)
|
|
136
|
+
- `NuCrtGlitch`
|
|
137
|
+
docs: [CrtGlitch](./CrtGlitch.md)
|
|
138
|
+
- `nuThemes`
|
|
139
|
+
- `resolveNuTheme(...)`
|
|
140
|
+
- `isNuThemeName(...)`
|
|
141
|
+
|
|
142
|
+
## Start Here
|
|
143
|
+
|
|
144
|
+
If you are new to the library, read in this order:
|
|
145
|
+
|
|
146
|
+
1. [Getting Started](./GETTING_STARTED.md)
|
|
147
|
+
2. [Architecture](./ARCHITECTURE.md)
|
|
148
|
+
3. [NuThemeProvider](./NuThemeProvider.md)
|
|
149
|
+
4. [Desktop](./Desktop.md)
|
|
150
|
+
5. [NuWindowProvider](./NuWindowProvider.md)
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# Architecture
|
|
2
|
+
|
|
3
|
+
ReactNU is organized around a desktop shell and explicit ownership boundaries.
|
|
4
|
+
|
|
5
|
+
## Main Layers
|
|
6
|
+
|
|
7
|
+
1. Theme tokens
|
|
8
|
+
2. Low-level controls
|
|
9
|
+
3. Desktop shell and window manager
|
|
10
|
+
4. Host application composition
|
|
11
|
+
|
|
12
|
+
## Desktop Ownership
|
|
13
|
+
|
|
14
|
+
Recommended ownership:
|
|
15
|
+
|
|
16
|
+
`NuThemeProvider -> NuDesktop -> workspace + app bar -> managed windows`
|
|
17
|
+
|
|
18
|
+
That means:
|
|
19
|
+
|
|
20
|
+
- `NuDesktop` owns screen geometry.
|
|
21
|
+
- `NuDesktop` composes `NuAppHostProvider` and `NuWindowProvider` for the full desktop shell.
|
|
22
|
+
- `NuWindowProvider` owns managed windows.
|
|
23
|
+
- the host owns main menu content and app bar composition.
|
|
24
|
+
- controls do not know about desktop layout unless they are part of windowing.
|
|
25
|
+
|
|
26
|
+
## Window Ownership
|
|
27
|
+
|
|
28
|
+
Managed windows are opened through `useNuWindowManager()`:
|
|
29
|
+
|
|
30
|
+
- `openWindow(definition)`
|
|
31
|
+
- `openDialog(definition)`
|
|
32
|
+
- `updateWindow(id, patch)`
|
|
33
|
+
- `closeWindow(id)`
|
|
34
|
+
|
|
35
|
+
The host provides:
|
|
36
|
+
|
|
37
|
+
- title
|
|
38
|
+
- content
|
|
39
|
+
- optional persistence callbacks
|
|
40
|
+
- domain metadata
|
|
41
|
+
|
|
42
|
+
The manager provides:
|
|
43
|
+
|
|
44
|
+
- activation
|
|
45
|
+
- z-order
|
|
46
|
+
- modal behavior
|
|
47
|
+
- app-bar visibility state
|
|
48
|
+
|
|
49
|
+
## Popup Ownership
|
|
50
|
+
|
|
51
|
+
Popup-like controls such as:
|
|
52
|
+
|
|
53
|
+
- `Dropdown`
|
|
54
|
+
- `ComboBox`
|
|
55
|
+
- `SearchBox`
|
|
56
|
+
- `PopupMenu`
|
|
57
|
+
|
|
58
|
+
use a shared ownership split:
|
|
59
|
+
|
|
60
|
+
- the control owns anchor measurement
|
|
61
|
+
- the popup layer renders into `document.body`
|
|
62
|
+
- theme variables are mirrored from the nearest `.nu-theme-root`
|
|
63
|
+
|
|
64
|
+
This avoids mixing local portal roots with viewport-based coordinates.
|
|
65
|
+
|
|
66
|
+
If a popup needs the same chrome as another control, prefer a shared internal primitive or shared helper over per-control duplication.
|
|
67
|
+
|
|
68
|
+
## Scroll Ownership
|
|
69
|
+
|
|
70
|
+
ReactNU does not assume that every container should scroll automatically.
|
|
71
|
+
|
|
72
|
+
Recommended ownership:
|
|
73
|
+
|
|
74
|
+
- `Splitter cell -> NuView -> content`
|
|
75
|
+
- `Window body -> scrollable control`
|
|
76
|
+
- `Frame -> one filling child`
|
|
77
|
+
|
|
78
|
+
This keeps scroll behavior explicit and avoids hidden nested viewport bugs.
|
|
79
|
+
|
|
80
|
+
## Slot Customization
|
|
81
|
+
|
|
82
|
+
ReactNU is standardizing internal customization around named slots.
|
|
83
|
+
|
|
84
|
+
Preferred API:
|
|
85
|
+
|
|
86
|
+
- `slotStyles`
|
|
87
|
+
- `slotClassNames`
|
|
88
|
+
|
|
89
|
+
Use this for component internals instead of inventing ad-hoc props like:
|
|
90
|
+
|
|
91
|
+
- `headerStyle`
|
|
92
|
+
- `inputShellClassName`
|
|
93
|
+
- `popupBackground`
|
|
94
|
+
|
|
95
|
+
See: [Slot Customization](./SLOT_CUSTOMIZATION.md)
|
|
96
|
+
|
|
97
|
+
## Shared Internal Primitives
|
|
98
|
+
|
|
99
|
+
Not every repeated visual element should become a public component.
|
|
100
|
+
|
|
101
|
+
Preferred rule:
|
|
102
|
+
|
|
103
|
+
- shared public behavior -> public component
|
|
104
|
+
- shared internal geometry/chrome -> internal primitive
|
|
105
|
+
|
|
106
|
+
Example:
|
|
107
|
+
|
|
108
|
+
- `Dropdown` and `ComboBox` use the internal `ControlOpener` primitive so opener size, glyph metrics, border, and button chrome stay centralized.
|
|
109
|
+
|
|
110
|
+
## Tree Ownership
|
|
111
|
+
|
|
112
|
+
`TreeView` and `TreeListView` own:
|
|
113
|
+
|
|
114
|
+
- hierarchy geometry
|
|
115
|
+
- connector rendering
|
|
116
|
+
- expand/collapse behavior
|
|
117
|
+
- keyboard navigation
|
|
118
|
+
|
|
119
|
+
The host owns:
|
|
120
|
+
|
|
121
|
+
- data
|
|
122
|
+
- selection/check state when controlled
|
|
123
|
+
- report-column rendering for `TreeListView`
|
|
124
|
+
|
|
125
|
+
## Window Persistence
|
|
126
|
+
|
|
127
|
+
Managed windows can persist geometry with:
|
|
128
|
+
|
|
129
|
+
- `onOpen?: () => NuManagedWindowSnapshot | void`
|
|
130
|
+
- `onClose?: (snapshot) => boolean | void`
|
|
131
|
+
|
|
132
|
+
Use this when the host wants to restore:
|
|
133
|
+
|
|
134
|
+
- last position
|
|
135
|
+
- last size
|
|
136
|
+
- maximized state
|
|
137
|
+
- minimized state
|
|
138
|
+
|
|
139
|
+
## Recommended Host Split
|
|
140
|
+
|
|
141
|
+
Keep host code separated by responsibility:
|
|
142
|
+
|
|
143
|
+
- desktop shell
|
|
144
|
+
- menu state
|
|
145
|
+
- app bar composition
|
|
146
|
+
- window launchers
|
|
147
|
+
- individual window content components
|
|
148
|
+
|
|
149
|
+
That keeps the component library reusable and avoids demo-only patterns leaking into product code.
|
|
150
|
+
|
|
151
|
+
## Storybook Host Strategy
|
|
152
|
+
|
|
153
|
+
Storybook should distinguish between:
|
|
154
|
+
|
|
155
|
+
- full desktop-shell stories
|
|
156
|
+
- bounded window-manager stories
|
|
157
|
+
|
|
158
|
+
Use a full `NuDesktop` story when validating:
|
|
159
|
+
|
|
160
|
+
- desktop background
|
|
161
|
+
- menu/app-bar composition
|
|
162
|
+
- shell-level layering
|
|
163
|
+
|
|
164
|
+
Use a bounded `NuWindowProvider` story when validating:
|
|
165
|
+
|
|
166
|
+
- helper dialogs
|
|
167
|
+
- modal behavior
|
|
168
|
+
- managed window chrome inside a fixed preview area
|
|
169
|
+
|
|
170
|
+
This avoids accidental fullscreen/fixed-position behavior inside Storybook preview containers.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# AppBarHost
|
|
2
|
+
|
|
3
|
+
`AppBarHost` is the bottom chrome container for desktop bar content.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
<AppBarHost inline>
|
|
9
|
+
<WindowBar items={windowManager.windows} onActivateWindow={handleActivate} />
|
|
10
|
+
<CalendarAppBarItem />
|
|
11
|
+
</AppBarHost>
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Key Props
|
|
15
|
+
|
|
16
|
+
- `children`
|
|
17
|
+
- `inline?: boolean`
|
|
18
|
+
|
|
19
|
+
## Notes
|
|
20
|
+
|
|
21
|
+
- `inline` is intended for `NuDesktop` layout usage.
|
|
22
|
+
- The host is intentionally dumb; the application decides which app-bar items to place inside it.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# AppBarItem
|
|
2
|
+
|
|
3
|
+
`AppBarItem` is the generic item primitive for desktop bar content such as clocks, indicators, or task entries.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
<AppBarItem alignment="end">12:30</AppBarItem>
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Key Props
|
|
12
|
+
|
|
13
|
+
- `alignment?: "start" | "end"`
|
|
14
|
+
- `active?: boolean`
|
|
15
|
+
- `grow?: boolean`
|
|
16
|
+
- `interactive?: boolean`
|
|
17
|
+
- standard static or button-like props depending on usage
|
|
18
|
+
|
|
19
|
+
## Notes
|
|
20
|
+
|
|
21
|
+
- `AppBarItem` can render as static chrome or as an interactive item.
|
|
22
|
+
- `WindowBar` is built on top of this primitive rather than embedding its own task-button styling.
|
package/docs/Button.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Button
|
|
2
|
+
|
|
3
|
+
`Button` is the basic action control for the library.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
<Button variant="primary">Commit</Button>
|
|
9
|
+
<Button variant="secondary">Preview</Button>
|
|
10
|
+
<Button variant="danger">Reset</Button>
|
|
11
|
+
<Button variant="success">Apply</Button>
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Key Props
|
|
15
|
+
|
|
16
|
+
- `variant?: "primary" | "secondary" | "danger" | "success"`
|
|
17
|
+
- `focused?: boolean`
|
|
18
|
+
- `defaultFocused?: boolean`
|
|
19
|
+
- standard `button` props such as `disabled`, `onClick`, `type`
|
|
20
|
+
|
|
21
|
+
## Notes
|
|
22
|
+
|
|
23
|
+
- Visual focus is rendered with DOS-style side markers instead of a browser outline.
|
|
24
|
+
- Press state is purely visual and does not change layout around neighboring controls.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Component Index
|
|
2
|
+
|
|
3
|
+
## Guides
|
|
4
|
+
|
|
5
|
+
- [Getting Started](./GETTING_STARTED.md)
|
|
6
|
+
- [Architecture](./ARCHITECTURE.md)
|
|
7
|
+
- [API Reference](./API_REFERENCE.md)
|
|
8
|
+
- [Contributor Guide](./CONTRIBUTOR_GUIDE.md)
|
|
9
|
+
- [Slot Customization](./SLOT_CUSTOMIZATION.md)
|
|
10
|
+
- [Storybook](./STORYBOOK.md)
|
|
11
|
+
|
|
12
|
+
## Core Components
|
|
13
|
+
|
|
14
|
+
- [Button](./Button.md)
|
|
15
|
+
- [CheckBox](./CheckBox.md)
|
|
16
|
+
- [Dashboard](./Dashboard.md)
|
|
17
|
+
- [Desktop](./Desktop.md)
|
|
18
|
+
- [Dropdown](./Dropdown.md)
|
|
19
|
+
- [Frame](./Frame.md)
|
|
20
|
+
- [Glyph](./Glyph.md)
|
|
21
|
+
- [Info](./Info.md)
|
|
22
|
+
- [ListBox](./ListBox.md)
|
|
23
|
+
- [ListView](./ListView.md)
|
|
24
|
+
- [MainMenu](./MainMenu.md)
|
|
25
|
+
- [MaskedField](./MaskedField.md)
|
|
26
|
+
- [Memo](./Memo.md)
|
|
27
|
+
- [PageControl](./PageControl.md)
|
|
28
|
+
- [Panel](./Panel.md)
|
|
29
|
+
- [PopupMenu](./PopupMenu.md)
|
|
30
|
+
- [PropertyGrid](./PropertyGrid.md)
|
|
31
|
+
- [ProgressBar](./ProgressBar.md)
|
|
32
|
+
- [RadioGroup](./RadioGroup.md)
|
|
33
|
+
- [ReportCell](./ReportCell.md)
|
|
34
|
+
- [SearchBox](./SearchBox.md)
|
|
35
|
+
- [SpinBox](./SpinBox.md)
|
|
36
|
+
- [Stack](./Stack.md)
|
|
37
|
+
- [Splitter](./Splitter.md)
|
|
38
|
+
- [TextField](./TextField.md)
|
|
39
|
+
- [TickBar](./TickBar.md)
|
|
40
|
+
- [ToolBar](./ToolBar.md)
|
|
41
|
+
- [TreeListView](./TreeListView.md)
|
|
42
|
+
- [TreeView](./TreeView.md)
|
|
43
|
+
- [NuView](./NuView.md)
|
|
44
|
+
- [Window](./Window.md)
|
|
45
|
+
- [StatusBarItem](./StatusBarItem.md)
|
|
46
|
+
- [ComboBox](./ComboBox.md)
|
|
47
|
+
- [CommandButton](./CommandButton.md)
|
|
48
|
+
- [CrtGlitch](./CrtGlitch.md)
|
|
49
|
+
|
|
50
|
+
## App Bar And Windowing
|
|
51
|
+
|
|
52
|
+
- [AppBarHost](./AppBarHost.md)
|
|
53
|
+
- [AppBarItem](./AppBarItem.md)
|
|
54
|
+
- [WindowBar](./WindowBar.md)
|
|
55
|
+
- [NuWindowProvider](./NuWindowProvider.md)
|
|
56
|
+
|
|
57
|
+
## Providers
|
|
58
|
+
|
|
59
|
+
- [NuThemeProvider](./NuThemeProvider.md)
|
|
60
|
+
- [NuAppHostProvider](./NuAppHostProvider.md)
|
|
61
|
+
|
|
62
|
+
## Design System
|
|
63
|
+
|
|
64
|
+
- [Token Checklist](./TOKEN_CHECKLIST.md)
|