@principal-ade/panel-layouts 0.1.5 → 0.1.6

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/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { default as default_2 } from 'react';
1
2
  import { EditableConfigurablePanelLayout } from '@principal-ade/panels';
2
3
  import { EditableConfigurablePanelLayoutProps } from '@principal-ade/panels';
3
4
  import { mapThemeToPanelVars } from '@principal-ade/panels';
@@ -40,6 +41,22 @@ export { EditableConfigurablePanelLayout }
40
41
 
41
42
  export { EditableConfigurablePanelLayoutProps }
42
43
 
44
+ /**
45
+ * Visual indicator that highlights the focused panel
46
+ *
47
+ * Renders a subtle border/glow around the focused panel for keyboard navigation feedback
48
+ */
49
+ export declare const FocusIndicator: default_2.FC<FocusIndicatorProps>;
50
+
51
+ export declare interface FocusIndicatorProps {
52
+ /** Whether this panel is currently focused */
53
+ isFocused: boolean;
54
+ /** Custom class name */
55
+ className?: string;
56
+ /** Custom styles */
57
+ style?: default_2.CSSProperties;
58
+ }
59
+
43
60
  /**
44
61
  * Default localStorage-based persistence adapter for web applications
45
62
  */
@@ -92,6 +109,28 @@ export { PanelDefinition }
92
109
 
93
110
  export { PanelDefinitionWithContent }
94
111
 
112
+ /**
113
+ * Actions for managing panel focus
114
+ */
115
+ export declare interface PanelFocusActions {
116
+ /** Set focus to a specific panel */
117
+ setFocus: (panel: PanelSlotId) => void;
118
+ /** Clear focus from all panels */
119
+ clearFocus: () => void;
120
+ /** Focus the next visible panel */
121
+ focusNext: () => void;
122
+ /** Focus the previous visible panel */
123
+ focusPrevious: () => void;
124
+ }
125
+
126
+ /**
127
+ * Focus state for the panel layout
128
+ */
129
+ export declare interface PanelFocusState {
130
+ /** Currently focused panel, or null if no panel is focused */
131
+ focusedPanel: PanelSlotId | null;
132
+ }
133
+
95
134
  export { PanelGroup }
96
135
 
97
136
  export { PanelLayout }
@@ -116,6 +155,14 @@ export declare interface PanelSizes {
116
155
 
117
156
  export { PanelSlot }
118
157
 
158
+ /**
159
+ * Focus management type definitions for keyboard shortcuts
160
+ */
161
+ /**
162
+ * Panel identifier for focus tracking
163
+ */
164
+ export declare type PanelSlotId = 'left' | 'middle' | 'right';
165
+
119
166
  /**
120
167
  * Storage adapter interface for persisting panel state
121
168
  * Implementations can use localStorage, Electron IPC, or remote storage
@@ -229,6 +276,63 @@ export declare interface UpdateWorkspaceOptions {
229
276
  };
230
277
  }
231
278
 
279
+ /**
280
+ * Hook for managing panel focus state with keyboard shortcuts
281
+ */
282
+ export declare function usePanelFocus(options?: UsePanelFocusOptions): UsePanelFocusReturn;
283
+
284
+ export declare interface UsePanelFocusOptions {
285
+ /** Initial focused panel (optional) */
286
+ initialFocus?: PanelSlotId | null;
287
+ /** Collapsed state to determine which panels are visible */
288
+ collapsed?: PanelCollapsed;
289
+ /** Whether this is a two-panel or three-panel layout */
290
+ panelType?: 'two-panel' | 'three-panel';
291
+ /** Callback when focus changes */
292
+ onFocusChange?: (panel: PanelSlotId | null) => void;
293
+ }
294
+
295
+ export declare interface UsePanelFocusReturn extends PanelFocusState, PanelFocusActions {
296
+ /** Check if a specific panel is focused */
297
+ isFocused: (panel: PanelSlotId) => boolean;
298
+ }
299
+
300
+ /**
301
+ * Hook for handling Alt+1/2/3 keyboard shortcuts for panel toggle and focus
302
+ *
303
+ * Behavior:
304
+ * - Alt+1 (Left Panel):
305
+ * 1. If collapsed: expand (no focus change)
306
+ * 2. If expanded but not focused: focus it
307
+ * 3. If focused: collapse and focus middle
308
+ *
309
+ * - Alt+2 (Middle Panel):
310
+ * - Always focus middle (never collapses)
311
+ *
312
+ * - Alt+3 (Right Panel):
313
+ * 1. If collapsed: expand (no focus change)
314
+ * 2. If expanded but not focused: focus it
315
+ * 3. If focused: collapse and focus middle
316
+ */
317
+ export declare function usePanelKeyboardShortcuts(options: UsePanelKeyboardShortcutsOptions): void;
318
+
319
+ export declare interface UsePanelKeyboardShortcutsOptions {
320
+ /** Whether keyboard shortcuts are enabled */
321
+ enabled?: boolean;
322
+ /** Current focused panel */
323
+ focusedPanel: PanelSlotId | null;
324
+ /** Current collapsed state */
325
+ collapsed: PanelCollapsed;
326
+ /** Panel type (two-panel or three-panel) */
327
+ panelType: 'two-panel' | 'three-panel';
328
+ /** Set focus to a specific panel */
329
+ setFocus: (panel: PanelSlotId) => void;
330
+ /** Callback to expand a panel */
331
+ onExpand: (panel: 'left' | 'right') => void | Promise<void>;
332
+ /** Callback to collapse a panel */
333
+ onCollapse: (panel: 'left' | 'right') => void | Promise<void>;
334
+ }
335
+
232
336
  /**
233
337
  * Hook for persisting panel layouts across sessions
234
338
  *