@exegia/corpora-ui 0.24.0 → 0.26.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.
@@ -1,2 +1,2 @@
1
1
  import { AnimatedSidebarProviderProps } from './type';
2
- export declare function AnimatedPanelProvider({ children, shellId, defaultPanelWidth, open, defaultOpen, onOpenChange, openMobile, defaultOpenMobile, onOpenMobileChange, onNarrowChange, className, style, ...props }: AnimatedSidebarProviderProps): import("react").JSX.Element;
2
+ export declare function AnimatedPanelProvider({ children, shellId, defaultPanelWidth, open, defaultOpen, onOpenChange, openMobile, defaultOpenMobile, onOpenMobileChange, onNarrowChange, panelComponents: _panelComponents, className, style, ...props }: AnimatedSidebarProviderProps): import("react").JSX.Element;
@@ -1,3 +1,3 @@
1
1
  import { ShellLayoutProps } from './type';
2
2
  import * as React from "react";
3
- export declare function ShellLayout({ children, variant, panels, className, header, defaultOpen, ...panelControlProps }: ShellLayoutProps): React.ReactElement;
3
+ export declare function ShellLayout({ children, variant, panels, className, header, trailing, defaultOpen, panelComponents, ...panelControlProps }: ShellLayoutProps): React.ReactElement;
@@ -97,11 +97,15 @@ export type TPanelSide = IPanel["side"];
97
97
  * key. Where an entry's own `side` field disagrees with its key, the key
98
98
  * wins. */
99
99
  export type TPanelMap<Side extends TPanelSide = TPanelSide> = Partial<Record<Side, IPanel>>;
100
+ /** Dynamic panel content keyed by side — filled by
101
+ * `useShellPanels().openPanel(side, component)` and read by ShellLayout,
102
+ * where a side's entry wins over the static `panels` map's `component`. */
103
+ export type SidebarComponentMap = Partial<Record<SidebarSide, ReactNode>>;
100
104
  /** The open/close surface of the shell's panels, lifted straight from
101
105
  * AnimatedPanelProvider — every prop is keyed by side, there are no
102
106
  * explicit per-side props. `useShellPanels` produces the controlled subset
103
107
  * of these as `providerProps`. */
104
- export type ShellPanelControlProps = Pick<AnimatedSidebarProviderProps, "open" | "defaultOpen" | "onOpenChange" | "openMobile" | "defaultOpenMobile" | "onOpenMobileChange" | "shellId" | "defaultPanelWidth">;
108
+ export type ShellPanelControlProps = Pick<AnimatedSidebarProviderProps, "open" | "defaultOpen" | "onOpenChange" | "openMobile" | "defaultOpenMobile" | "onOpenMobileChange" | "shellId" | "defaultPanelWidth" | "panelComponents">;
105
109
  export interface UseShellPanelsOptions {
106
110
  /** The id the shell's fit state is filed under. Name it to read the same
107
111
  * shell from elsewhere (`useShellFitState("app-shell")`) and to keep a
@@ -149,6 +153,13 @@ export interface ShellPanelControls {
149
153
  * mobile state themselves when the viewport is narrow. Carries the same
150
154
  * `isNarrow` refusal as `setOpen`. */
151
155
  toggle: (side: SidebarSide) => void;
156
+ /** Open a side's panel and, when given, swap in the content it shows.
157
+ * The component travels through `providerProps.panelComponents` into
158
+ * ShellLayout, where it wins over the static `panels` entry for that
159
+ * side, and sticks until the next `openPanel(side, component)` replaces
160
+ * it — closing the panel leaves it in place for the exit animation and
161
+ * the next open. Carries the same `isNarrow` refusal as `setOpen`. */
162
+ openPanel: (side: SidebarSide, component?: ReactNode) => void;
152
163
  /** Spread onto ShellLayout (or AnimatedPanelProvider directly). */
153
164
  providerProps: ShellPanelControlProps;
154
165
  }
@@ -158,6 +169,10 @@ export interface ShellLayoutProps extends ShellPanelControlProps {
158
169
  * the `left` rail and the `right` drawer; other sides are reserved. */
159
170
  panels?: TPanelMap;
160
171
  header?: ReactNode;
172
+ /** Actions pinned to the header's right edge, rendered just before the
173
+ * right panel's trigger. The cluster hugs the trailing edge no matter
174
+ * which of `header` / the left rail / the right panel are present. */
175
+ trailing?: ReactNode;
161
176
  className?: string;
162
177
  variant?: "web" | "desktop";
163
178
  }
@@ -205,6 +220,11 @@ export interface AnimatedSidebarProviderProps extends HTMLAttributes<HTMLDivElem
205
220
  /** Initial mobile overlay state — every side starts closed. */
206
221
  defaultOpenMobile?: SidebarOpenState;
207
222
  onOpenMobileChange?: (open: boolean, side: SidebarSide) => void;
223
+ /** Content pushed into a side's panel by `useShellPanels().openPanel`. It
224
+ * rides along in `providerProps` so the record can be spread on either
225
+ * surface: ShellLayout renders it in that side's panel; the bare provider
226
+ * renders no panels, so it only swallows the prop to keep it off the DOM. */
227
+ panelComponents?: SidebarComponentMap;
208
228
  /** Fires when the shell crosses the width a secondary panel needs (rail +
209
229
  * body + panel at their floors). An imperative escape hatch for a consumer
210
230
  * that mounts the provider on its own; anything under `ExegiaProvider` can
@@ -1,6 +1,6 @@
1
1
  import { useRender } from '@base-ui/react/use-render';
2
2
  import { VariantProps } from 'class-variance-authority';
3
- import { HTMLMotionProps } from 'framer-motion';
3
+ import { HTMLMotionProps } from 'motion/react';
4
4
  import { Separator } from './separator';
5
5
  declare const buttonGroupVariants: (props?: ({
6
6
  orientation?: "horizontal" | "vertical" | null | undefined;