@exegia/corpora-ui 0.18.0 → 0.19.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.
@@ -2,6 +2,9 @@
2
2
  export declare const SCAFFOLD_SIDEBAR_WIDTH = 64;
3
3
  /** Inspector drawer width in px. */
4
4
  export declare const SCAFFOLD_INSPECTOR_WIDTH = 272;
5
+ /** Most panels the canvas holds at once — omit Actions' `onAdd` when the
6
+ * count reaches it so the Add segment hides. */
7
+ export declare const SCAFFOLD_PANEL_CAPACITY = 3;
5
8
  /** Gap in px between the drawer/actions and the viewport edges. */
6
9
  export declare const SCAFFOLD_EDGE_GUTTER = 10;
7
10
  /** Vertical room in px reserved above the canvas for the actions cluster. */
@@ -7,12 +7,13 @@ import { ScaffoldMain } from './scaffold-main';
7
7
  import { ScaffoldPanel } from './scaffold-panel';
8
8
  import { ScaffoldRoot } from './scaffold-root';
9
9
  import { ScaffoldSidebar } from './scaffold-sidebar';
10
+ import { ScaffoldTab } from './scaffold-tab';
10
11
  import { ScaffoldSubPanel } from './scaffold-sub-panel.tsx';
11
12
  export { useScaffoldContext } from './scaffold-context';
12
13
  export { useScaffold } from './use-scaffold';
13
14
  export type * from './type';
14
15
  export * from './constants';
15
- export { PanelCloseButton, PanelMenuButton, ScaffoldActions, ScaffoldCanvas, ScaffoldInspector, ScaffoldMain, ScaffoldPanel, ScaffoldRoot, ScaffoldSidebar, };
16
+ export { PanelCloseButton, PanelMenuButton, ScaffoldActions, ScaffoldCanvas, ScaffoldInspector, ScaffoldMain, ScaffoldPanel, ScaffoldRoot, ScaffoldSidebar, ScaffoldTab, };
16
17
  export declare const Scaffold: {
17
18
  Root: typeof ScaffoldRoot;
18
19
  Sidebar: typeof ScaffoldSidebar;
@@ -20,6 +21,7 @@ export declare const Scaffold: {
20
21
  Actions: typeof ScaffoldActions;
21
22
  Canvas: typeof ScaffoldCanvas;
22
23
  Panel: typeof ScaffoldPanel;
24
+ Tab: typeof ScaffoldTab;
23
25
  Inspector: typeof ScaffoldInspector;
24
26
  SubPanel: typeof ScaffoldSubPanel;
25
27
  };
@@ -1,7 +1,8 @@
1
1
  import { PanelMenuButtonProps } from './type';
2
2
  import * as React from "react";
3
3
  /**
4
- * Floating swap affordance centered on the seam between a panel's primary
5
- * surface and its secondary strip.
4
+ * Floating menu affordance centered on the seam between a panel's primary
5
+ * surface and its secondary strip: a compact ⋯ toggle that morphs into the
6
+ * Expand | Swap (| Close) actions.
6
7
  */
7
- export declare function PanelMenuButton({ onClick, onExpand, secondaryExpanded, label, sound, className, }: PanelMenuButtonProps): React.ReactElement;
8
+ export declare function PanelMenuButton({ onClick, onExpand, onCloseSecondary, secondaryExpanded, swapped, label, sound, className, }: PanelMenuButtonProps): React.ReactElement;
@@ -2,8 +2,9 @@ import { ScaffoldActionsProps } from './type';
2
2
  import * as React from "react";
3
3
  /**
4
4
  * The floating pill cluster in the main region's top-right corner — the
5
- * design's "Panel Context Menu": an Add segment plus an overflow segment
6
- * whose badge counts the non-visible panels. Slides left in step with the
7
- * inspector opening.
5
+ * design's "Panel Context Menu": one tab per open panel (`Scaffold.Tab`
6
+ * children) plus an Add segment. Add renders only while `onAdd` is
7
+ * present — omit it once the canvas holds `SCAFFOLD_PANEL_CAPACITY`
8
+ * panels. Slides left in step with the inspector opening.
8
9
  */
9
- export declare function ScaffoldActions({ onAdd, addLabel, addIcon, overflowCount, onBrowse, browseLabel, sound, className, children, ...rest }: ScaffoldActionsProps): React.ReactElement;
10
+ export declare function ScaffoldActions({ onAdd, addLabel, addIcon, sound, className, children, ...rest }: ScaffoldActionsProps): React.ReactElement;
@@ -7,4 +7,4 @@ import * as React from "react";
7
7
  * the two cards with a layout morph — the strip glides up and grows into the
8
8
  * primary slot while the primary card shrinks down into the strip.
9
9
  */
10
- export declare function ScaffoldPanel({ children, SecondaryPanel, onClose, onSwap, name, closeLabel, swapLabel, sound, className, }: ScaffoldPanelProps): React.ReactElement;
10
+ export declare function ScaffoldPanel({ children, SecondaryPanel, onSwap, onCloseSecondary, name, swapLabel, sound, className, }: ScaffoldPanelProps): React.ReactElement;
@@ -0,0 +1,9 @@
1
+ import { ScaffoldTabProps } from './type';
2
+ import * as React from "react";
3
+ /**
4
+ * A panel's tab inside the action cluster: its label plus a close
5
+ * affordance. Render one per open panel as Actions children, keyed —
6
+ * closes animate out of the pill. Omit `onClose` on the last remaining
7
+ * panel's tab; the canvas keeps at least one panel open.
8
+ */
9
+ export declare function ScaffoldTab({ children, onClose, closeLabel, sound, className, ...rest }: ScaffoldTabProps): React.ReactElement;
@@ -25,23 +25,16 @@ export type ScaffoldCanvasProps = ComponentProps<"div">;
25
25
  * on `motion.*` elements — strip them from pass-through HTML props. */
26
26
  type MotionSafe<T> = Omit<T, "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd" | "onAnimationIteration">;
27
27
  export interface ScaffoldActionsProps extends MotionSafe<Omit<ComponentProps<"div">, "children">> {
28
- /** Called when the Add segment is pressed. */
28
+ /** Called when the Add segment is pressed. The segment renders only
29
+ * while this is present — omit it to hide Add, e.g. once the canvas
30
+ * holds `SCAFFOLD_PANEL_CAPACITY` panels. */
29
31
  onAdd?: () => void;
30
32
  /** Label of the Add segment. */
31
33
  addLabel?: ReactNode;
32
34
  /** Replaces the default add icon. */
33
35
  addIcon?: ReactNode;
34
- /** Number of non-visible panels tucked into the overflow dropdown —
35
- * the badge on the browse segment. The segment renders when this or
36
- * `onBrowse` is present; the badge only when > 0. Per the design
37
- * comments the dropdown menu itself is a later iteration; for now the
38
- * segment just keeps the count. */
39
- overflowCount?: number;
40
- /** Called when the overflow (stacked-panels) segment is pressed. */
41
- onBrowse?: () => void;
42
- /** Accessible name of the overflow segment. */
43
- browseLabel?: string;
44
- /** Extra segments appended after the built-in ones. */
36
+ /** The panel tabs (`Scaffold.Tab`, one per open panel) and any extra
37
+ * segments, rendered before Add. Key each tab — closes animate out. */
45
38
  children?: ReactNode;
46
39
  /** Emit interaction-sound attributes (inert until an app binds cuelume). */
47
40
  sound?: boolean;
@@ -52,31 +45,34 @@ export interface ScaffoldPanelProps {
52
45
  children: ReactNode;
53
46
  /** The panel's content, rendered in a card with a drop shadow. */
54
47
  SecondaryPanel?: TScaffoldPanelChild;
55
- /** Renders the floating close button in the panel's top-right corner. */
56
- onClose?: () => void;
57
- /** Renders the floating swap button over the primary/secondary gap.
58
- * Only shown when `secondary` is present. Clicking it trades the two
59
- * cards with a layout morph — flip the slot content here so each card
60
- * carries its subject to its new home. */
48
+ /** Reveals the Swap action in the seam menu (needs `SecondaryPanel`).
49
+ * Swapping trades the two cards with a layout morph — flip the slot
50
+ * content here so each card carries its subject to its new home. */
61
51
  onSwap?: () => void;
62
- /** Controlled swap state — while true the strip's card sits in the
63
- * primary slot. Omit letting the panel toggle it on swap clicks. */
64
- swapped?: boolean;
65
- /** Initial swap state when uncontrolled. */
66
- defaultSwapped?: boolean;
67
- /** Fixed width in px; omitted, the panel flexes to share the canvas. */
68
- width?: number;
52
+ /** Reveals the Close action in the seam menu — remove `SecondaryPanel`
53
+ * here; the strip and the menu leave together. */
54
+ onCloseSecondary?: () => void;
69
55
  /** Accessible name of the panel region. */
70
56
  name?: string;
71
57
  /** Emit interaction-sound attributes on the floating buttons. */
72
58
  sound?: boolean;
73
- /** Accessible name of the close button. */
74
- closeLabel?: string;
75
- /** Accessible name of the swap button. */
59
+ /** Accessible name of the seam-menu toggle. */
76
60
  swapLabel?: string;
77
61
  /** Extra class names for the panel's root element. */
78
62
  className?: string;
79
63
  }
64
+ export interface ScaffoldTabProps extends MotionSafe<Omit<ComponentProps<"div">, "children">> {
65
+ /** The tab's label. */
66
+ children?: ReactNode;
67
+ /** Renders the tab's close button. The button renders only while this
68
+ * is present — omit it to pin the tab, e.g. on the last remaining
69
+ * panel (the canvas keeps at least one open). */
70
+ onClose?: () => void;
71
+ /** Accessible name of the close button. */
72
+ closeLabel?: string;
73
+ /** Emit interaction-sound attributes on the close button. */
74
+ sound?: boolean;
75
+ }
80
76
  export type TSubPanelPosition = "bottom" | "top";
81
77
  export type TSubPanelVariant = "card" | "subtle" | "inset";
82
78
  export interface ScaffoldSubPanelProps extends MotionSafe<Omit<ComponentProps<"div">, "children">> {
@@ -113,9 +109,15 @@ export interface PanelMenuButtonProps extends PanelFloatingButtonProps {
113
109
  /** Called when the Expand action is pressed — the panel trades which
114
110
  * sub-panel holds the flexible slot. */
115
111
  onExpand?: () => void;
112
+ /** Renders the Close action; called when it is pressed — the consumer
113
+ * removes the secondary strip. */
114
+ onCloseSecondary?: () => void;
116
115
  /** Whether the secondary strip currently holds the flexible slot —
117
116
  * flips the Expand chevron between down and up. */
118
117
  secondaryExpanded?: boolean;
118
+ /** Whether the panel is swapped (column-reverse). Mirrors the Expand
119
+ * chevron so it keeps pointing at the sub-panel that grows next. */
120
+ swapped?: boolean;
119
121
  }
120
122
  export interface UseScaffoldOptions {
121
123
  /** Initial inspector state. Closed by default. */
@@ -1,3 +1,4 @@
1
+ import { Variants } from 'motion/react';
1
2
  import { ClassNameValue } from 'tailwind-merge';
2
3
  import { TSubPanelVariant } from './type.ts';
3
4
  /** Desktop backdrop the whole scaffold sits on — a soft warm-gray wash. */
@@ -11,5 +12,10 @@ export declare const floatingButtonClass: ClassNameValue;
11
12
  export declare const revealOnPanelHoverClass: ClassNameValue;
12
13
  /** Pill segment inside the actions cluster (Add, browse). */
13
14
  export declare const actionSegmentClass: ClassNameValue;
15
+ /** Pill segments (seam-menu actions, tabs, Add) blur/fade in place while
16
+ * the track morphs around them. The exit is a fast tween, not the layout
17
+ * spring — the track stays overflow-visible, so popped-out segments must be
18
+ * gone before the shrinking pill leaves them behind as a ghost. */
19
+ export declare const segmentVariants: Variants;
14
20
  /** Map of sub-panel variants to their corresponding side. */
15
21
  export declare const subPanelVariant: Record<TSubPanelVariant, ClassNameValue>;