react-panel-layout 0.3.0 → 0.4.2

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 (56) hide show
  1. package/README.md +291 -0
  2. package/dist/FloatingPanelFrame-SOrLGjZd.js +67 -0
  3. package/dist/FloatingPanelFrame-SOrLGjZd.js.map +1 -0
  4. package/dist/FloatingPanelFrame-XtBcHANI.cjs +2 -0
  5. package/dist/FloatingPanelFrame-XtBcHANI.cjs.map +1 -0
  6. package/dist/GridLayout-CLvW8jID.js +1352 -0
  7. package/dist/GridLayout-CLvW8jID.js.map +1 -0
  8. package/dist/GridLayout-qufTyOQM.cjs +2 -0
  9. package/dist/GridLayout-qufTyOQM.cjs.map +1 -0
  10. package/dist/components/pivot/PivotLayer.d.ts +14 -0
  11. package/dist/config/PanelContentDeclaration.d.ts +20 -0
  12. package/dist/config/panelRouter.d.ts +3 -1
  13. package/dist/config.cjs +1 -1
  14. package/dist/config.cjs.map +1 -1
  15. package/dist/config.js +125 -76
  16. package/dist/config.js.map +1 -1
  17. package/dist/constants/styles.d.ts +13 -0
  18. package/dist/floating.cjs +1 -1
  19. package/dist/floating.js +1 -1
  20. package/dist/hooks/useTransitionState.d.ts +21 -0
  21. package/dist/index.cjs +2 -2
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.d.ts +2 -0
  24. package/dist/index.js +573 -498
  25. package/dist/index.js.map +1 -1
  26. package/dist/modules/panels/rendering/ContentRegistry.d.ts +50 -0
  27. package/dist/modules/panels/rendering/RenderContext.d.ts +1 -0
  28. package/dist/modules/panels/state/types.d.ts +2 -2
  29. package/dist/modules/pivot/PivotContent.d.ts +29 -0
  30. package/dist/modules/pivot/index.d.ts +5 -0
  31. package/dist/modules/pivot/types.d.ts +62 -0
  32. package/dist/modules/pivot/usePivot.d.ts +28 -0
  33. package/dist/modules/window/useDrawerState.d.ts +3 -2
  34. package/dist/pivot/index.d.ts +8 -0
  35. package/dist/pivot.cjs +2 -0
  36. package/dist/pivot.cjs.map +1 -0
  37. package/dist/pivot.js +5 -0
  38. package/dist/pivot.js.map +1 -0
  39. package/dist/styles-DcG3aIFx.cjs +2 -0
  40. package/dist/styles-DcG3aIFx.cjs.map +1 -0
  41. package/dist/styles-w0ZixggV.js +51 -0
  42. package/dist/styles-w0ZixggV.js.map +1 -0
  43. package/dist/types.d.ts +37 -0
  44. package/dist/usePivot-C8q0pMgW.cjs +2 -0
  45. package/dist/usePivot-C8q0pMgW.cjs.map +1 -0
  46. package/dist/usePivot-z9gumDf-.js +97 -0
  47. package/dist/usePivot-z9gumDf-.js.map +1 -0
  48. package/package.json +7 -1
  49. package/dist/FloatingPanelFrame-0MnRbFkV.cjs +0 -2
  50. package/dist/FloatingPanelFrame-0MnRbFkV.cjs.map +0 -1
  51. package/dist/FloatingPanelFrame-BkjBp0S5.js +0 -96
  52. package/dist/FloatingPanelFrame-BkjBp0S5.js.map +0 -1
  53. package/dist/GridLayout-B0W3Tdan.cjs +0 -2
  54. package/dist/GridLayout-B0W3Tdan.cjs.map +0 -1
  55. package/dist/GridLayout-C0uqEj9E.js +0 -1296
  56. package/dist/GridLayout-C0uqEj9E.js.map +0 -1
package/README.md CHANGED
@@ -119,3 +119,294 @@ All available CSS variables are documented in [docs/design-tokens.md](./docs/des
119
119
  - Larger UI: Increase `--rpl-size-tab-font` and spacing variables
120
120
  - Light theme: Override color variables for light backgrounds
121
121
  - VS Code style: See examples in the design tokens documentation
122
+
123
+ ---
124
+
125
+ ## Grid Layout – Flexible Grid-Based Layouts
126
+
127
+ `GridLayout` provides a declarative way to create complex grid-based layouts with resizable tracks and floating overlays.
128
+
129
+ ### Quick Start
130
+
131
+ ```tsx
132
+ import { GridLayout } from "react-panel-layout";
133
+ import type { PanelLayoutConfig, LayerDefinition } from "react-panel-layout";
134
+
135
+ const config: PanelLayoutConfig = {
136
+ areas: [
137
+ ["cell1", "cell2"],
138
+ ["cell3", "cell4"],
139
+ ],
140
+ rows: [{ size: "1fr" }, { size: "1fr" }],
141
+ columns: [{ size: "1fr" }, { size: "1fr" }],
142
+ gap: "1rem",
143
+ };
144
+
145
+ const layers: LayerDefinition[] = [
146
+ { id: "cell1", component: <Cell1 />, gridArea: "cell1" },
147
+ { id: "cell2", component: <Cell2 />, gridArea: "cell2" },
148
+ { id: "cell3", component: <Cell3 />, gridArea: "cell3" },
149
+ { id: "cell4", component: <Cell4 />, gridArea: "cell4" },
150
+ ];
151
+
152
+ <GridLayout config={config} layers={layers} />;
153
+ ```
154
+
155
+ ### PanelLayoutConfig
156
+
157
+ Define your grid structure with the following properties:
158
+
159
+ | Property | Type | Description |
160
+ |-----------|----------------|-----------------------------------------------|
161
+ | `areas` | `string[][]` | Grid template areas (CSS grid-template-areas) |
162
+ | `rows` | `GridTrack[]` | Row track definitions |
163
+ | `columns` | `GridTrack[]` | Column track definitions |
164
+ | `gap` | `string` | Gap between grid cells (optional) |
165
+
166
+ ### GridTrack
167
+
168
+ Each track (row or column) can be configured with:
169
+
170
+ ```tsx
171
+ type GridTrack = {
172
+ size: string; // CSS size value: "1fr", "200px", "auto", etc.
173
+ resizable?: boolean; // Enable drag-to-resize
174
+ minSize?: number; // Minimum size in pixels (when resizable)
175
+ maxSize?: number; // Maximum size in pixels (when resizable)
176
+ };
177
+ ```
178
+
179
+ ### Resizable Tracks
180
+
181
+ Enable resizable sidebar columns or rows:
182
+
183
+ ```tsx
184
+ const config: PanelLayoutConfig = {
185
+ areas: [
186
+ ["sidebar", "main", "inspector"],
187
+ ],
188
+ rows: [{ size: "1fr" }],
189
+ columns: [
190
+ { size: "250px", resizable: true, minSize: 200, maxSize: 400 },
191
+ { size: "1fr" },
192
+ { size: "300px", resizable: true, minSize: 250, maxSize: 500 },
193
+ ],
194
+ gap: "4px",
195
+ };
196
+ ```
197
+
198
+ ### LayerDefinition
199
+
200
+ Each layer defines content to place in the grid or as a floating overlay:
201
+
202
+ ```tsx
203
+ type LayerDefinition = {
204
+ id: string; // Unique identifier
205
+ component: React.ReactNode; // Content to render
206
+ visible?: boolean; // Show/hide the layer
207
+
208
+ // Grid positioning
209
+ gridArea?: string; // Grid area name from config.areas
210
+ gridRow?: string; // Explicit grid-row value
211
+ gridColumn?: string; // Explicit grid-column value
212
+
213
+ // Floating positioning (for overlays)
214
+ position?: { top?, right?, bottom?, left? };
215
+ width?: string | number;
216
+ height?: string | number;
217
+ zIndex?: number;
218
+
219
+ // Floating behavior
220
+ floating?: {
221
+ draggable?: boolean;
222
+ resizable?: boolean;
223
+ constraints?: { minWidth?, maxWidth?, minHeight?, maxHeight? };
224
+ };
225
+
226
+ // Drawer behavior (slide-in panels)
227
+ drawer?: DrawerBehavior;
228
+ };
229
+ ```
230
+
231
+ ### Floating Overlays
232
+
233
+ Add draggable floating panels on top of the grid:
234
+
235
+ ```tsx
236
+ const layers: LayerDefinition[] = [
237
+ // Grid-based layer
238
+ {
239
+ id: "canvas",
240
+ component: <Canvas />,
241
+ gridArea: "canvas",
242
+ zIndex: 0,
243
+ },
244
+ // Floating panel
245
+ {
246
+ id: "tools",
247
+ component: <ToolsPanel />,
248
+ position: { left: 20, top: 20 },
249
+ width: 200,
250
+ height: 250,
251
+ zIndex: 10,
252
+ floating: {
253
+ draggable: true,
254
+ },
255
+ },
256
+ ];
257
+ ```
258
+
259
+ ### IDE-Style Layout Example
260
+
261
+ A complete IDE-style layout with toolbar, sidebar, main canvas, and floating panels:
262
+
263
+ ```tsx
264
+ const config: PanelLayoutConfig = {
265
+ areas: [
266
+ ["toolbar", "toolbar", "toolbar"],
267
+ ["sidebar", "canvas", "inspector"],
268
+ ["statusbar", "statusbar", "statusbar"],
269
+ ],
270
+ rows: [
271
+ { size: "60px" },
272
+ { size: "1fr" },
273
+ { size: "30px" },
274
+ ],
275
+ columns: [
276
+ { size: "250px", resizable: true, minSize: 200, maxSize: 400 },
277
+ { size: "1fr" },
278
+ { size: "300px", resizable: true, minSize: 250, maxSize: 500 },
279
+ ],
280
+ gap: "4px",
281
+ };
282
+
283
+ const layers: LayerDefinition[] = [
284
+ { id: "toolbar", component: <Toolbar />, gridArea: "toolbar", zIndex: 10 },
285
+ { id: "sidebar", component: <Sidebar />, gridArea: "sidebar" },
286
+ { id: "canvas", component: <Canvas />, gridArea: "canvas" },
287
+ { id: "inspector", component: <Inspector />, gridArea: "inspector" },
288
+ { id: "statusbar", component: <StatusBar />, gridArea: "statusbar", zIndex: 10 },
289
+ // Floating panel
290
+ {
291
+ id: "preview",
292
+ component: <Preview />,
293
+ position: { right: 20, top: 80 },
294
+ width: 300,
295
+ height: 400,
296
+ zIndex: 20,
297
+ floating: { draggable: true },
298
+ },
299
+ ];
300
+
301
+ <GridLayout config={config} layers={layers} />;
302
+ ```
303
+
304
+ ---
305
+
306
+ ## Pivot – Headless Content Switching
307
+
308
+ `usePivot` is a headless hook for building tabbed interfaces, content switchers, and navigation patterns. It handles state management and provides an `Outlet` component for rendering content with CSS transitions.
309
+
310
+ ### Quick Start
311
+
312
+ ```tsx
313
+ import { usePivot } from "react-panel-layout/pivot";
314
+
315
+ const items = [
316
+ { id: "home", label: "Home", content: <HomePage /> },
317
+ { id: "settings", label: "Settings", content: <SettingsPage /> },
318
+ ];
319
+
320
+ function MyTabs() {
321
+ const { activeId, getItemProps, Outlet } = usePivot({
322
+ items,
323
+ defaultActiveId: "home",
324
+ });
325
+
326
+ return (
327
+ <div>
328
+ <nav>
329
+ {items.map((item) => (
330
+ <button key={item.id} {...getItemProps(item.id)}>
331
+ {item.label}
332
+ </button>
333
+ ))}
334
+ </nav>
335
+ <Outlet />
336
+ </div>
337
+ );
338
+ }
339
+ ```
340
+
341
+ ### Transition Modes
342
+
343
+ ```tsx
344
+ const { Outlet } = usePivot({
345
+ items,
346
+ transitionMode: "css", // "css" (default) | "none"
347
+ });
348
+ ```
349
+
350
+ - `"css"` – Smooth opacity transitions via CSS design tokens (default)
351
+ - `"none"` – Instant switch, uses React.Activity for memory optimization
352
+
353
+ ### Design Tokens
354
+
355
+ Customize animations via CSS custom properties:
356
+
357
+ ```css
358
+ /* Define enter/leave keyframes */
359
+ @keyframes pivotEnter {
360
+ from { opacity: 0; }
361
+ to { opacity: 1; }
362
+ }
363
+
364
+ @keyframes pivotLeave {
365
+ from { opacity: 1; }
366
+ to { opacity: 0; }
367
+ }
368
+
369
+ /* Reference via design tokens */
370
+ :root {
371
+ --rpl-pivot-animation-enter: pivotEnter 150ms ease-out forwards;
372
+ --rpl-pivot-animation-leave: pivotLeave 150ms ease-out forwards;
373
+ }
374
+ ```
375
+
376
+ Example: Slide-up animation:
377
+ ```css
378
+ @keyframes pivotSlideIn {
379
+ from { opacity: 0; transform: translateY(8px); }
380
+ to { opacity: 1; transform: translateY(0); }
381
+ }
382
+
383
+ @keyframes pivotSlideOut {
384
+ from { opacity: 1; transform: translateY(0); }
385
+ to { opacity: 0; transform: translateY(-8px); }
386
+ }
387
+
388
+ :root {
389
+ --rpl-pivot-animation-enter: pivotSlideIn 150ms ease-out forwards;
390
+ --rpl-pivot-animation-leave: pivotSlideOut 150ms ease-out forwards;
391
+ }
392
+ ```
393
+
394
+ ### UsePivotOptions
395
+
396
+ | Property | Type | Description |
397
+ |----------|------|-------------|
398
+ | `items` | `PivotItem[]` | Array of content items |
399
+ | `activeId` | `string` | Controlled active item ID |
400
+ | `defaultActiveId` | `string` | Default active item (uncontrolled) |
401
+ | `onActiveChange` | `(id) => void` | Callback when active item changes |
402
+ | `transitionMode` | `"css" \| "none"` | Enable/disable CSS transitions |
403
+
404
+ ### UsePivotResult
405
+
406
+ | Property | Type | Description |
407
+ |----------|------|-------------|
408
+ | `activeId` | `string` | Current active item ID |
409
+ | `setActiveId` | `(id) => void` | Change active item |
410
+ | `isActive` | `(id) => boolean` | Check if item is active |
411
+ | `getItemProps` | `(id) => props` | Get props for navigation elements |
412
+ | `Outlet` | `React.FC` | Component that renders active content |
@@ -0,0 +1,67 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import * as n from "react";
3
+ import { F as r, a as d, b as i, c as _, d as c, e as N, f as A, g as F, h as m, i as P, j as L, k as y } from "./styles-w0ZixggV.js";
4
+ const O = {
5
+ display: "flex",
6
+ flexDirection: "column",
7
+ borderRadius: _,
8
+ border: `1px solid ${i}`,
9
+ background: d,
10
+ overflow: "hidden",
11
+ boxShadow: r
12
+ }, g = {
13
+ display: "flex",
14
+ alignItems: "center",
15
+ gap: F,
16
+ padding: `${N} ${A}`,
17
+ borderBottom: `1px solid ${i}`,
18
+ background: c
19
+ }, E = {
20
+ fontWeight: 600
21
+ }, f = {
22
+ marginLeft: "auto",
23
+ color: P,
24
+ fontSize: m
25
+ }, u = {
26
+ display: "flex",
27
+ alignItems: "center",
28
+ gap: L
29
+ }, T = {
30
+ padding: y,
31
+ overflow: "auto"
32
+ }, I = n.forwardRef(function({ style: t, ...a }, s) {
33
+ const l = n.useMemo(() => ({ ...O, ...t }), [t]);
34
+ return /* @__PURE__ */ o("div", { ref: s, style: l, ...a });
35
+ }), G = ({ style: e, ...t }) => {
36
+ const a = n.useMemo(() => ({ ...g, ...e }), [e]);
37
+ return /* @__PURE__ */ o("div", { style: a, ...t });
38
+ }, R = ({ style: e, ...t }) => {
39
+ const a = n.useMemo(() => ({ ...E, ...e }), [e]);
40
+ return /* @__PURE__ */ o("span", { style: a, ...t });
41
+ }, b = ({ style: e, ...t }) => {
42
+ const a = n.useMemo(() => ({ ...f, ...e }), [e]);
43
+ return /* @__PURE__ */ o("span", { style: a, ...t });
44
+ }, D = ({ style: e, ...t }) => {
45
+ const a = n.useMemo(() => ({ ...u, ...e }), [e]);
46
+ return /* @__PURE__ */ o("div", { style: a, ...t });
47
+ }, S = n.forwardRef(
48
+ function({ style: t, ...a }, s) {
49
+ const l = n.useMemo(() => ({ ...T, ...t }), [t]);
50
+ return /* @__PURE__ */ o("div", { ref: s, style: l, ...a });
51
+ }
52
+ );
53
+ I.displayName = "FloatingPanelFrame";
54
+ G.displayName = "FloatingPanelHeader";
55
+ R.displayName = "FloatingPanelTitle";
56
+ b.displayName = "FloatingPanelMeta";
57
+ D.displayName = "FloatingPanelControls";
58
+ S.displayName = "FloatingPanelContent";
59
+ export {
60
+ I as F,
61
+ G as a,
62
+ R as b,
63
+ b as c,
64
+ D as d,
65
+ S as e
66
+ };
67
+ //# sourceMappingURL=FloatingPanelFrame-SOrLGjZd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FloatingPanelFrame-SOrLGjZd.js","sources":["../src/components/paneling/FloatingPanelFrame.tsx"],"sourcesContent":["/**\n * @file Shared floating panel frame components for reusable overlay styling\n */\nimport * as React from \"react\";\nimport {\n FLOATING_PANEL_BORDER_RADIUS,\n FLOATING_PANEL_GAP,\n FLOATING_PANEL_HEADER_PADDING_Y,\n FLOATING_PANEL_HEADER_PADDING_X,\n FLOATING_PANEL_CONTENT_PADDING,\n FLOATING_PANEL_META_FONT_SIZE,\n FLOATING_PANEL_CONTROLS_GAP,\n FLOATING_PANEL_SURFACE_COLOR,\n FLOATING_PANEL_SURFACE_2_COLOR,\n FLOATING_PANEL_BORDER_COLOR,\n FLOATING_PANEL_MUTED_FG_COLOR,\n FLOATING_PANEL_SHADOW,\n} from \"../../constants/styles\";\n\nconst frameStyle: React.CSSProperties = {\n display: \"flex\",\n flexDirection: \"column\",\n borderRadius: FLOATING_PANEL_BORDER_RADIUS,\n border: `1px solid ${FLOATING_PANEL_BORDER_COLOR}`,\n background: FLOATING_PANEL_SURFACE_COLOR,\n overflow: \"hidden\",\n boxShadow: FLOATING_PANEL_SHADOW,\n};\n\nconst headerStyle: React.CSSProperties = {\n display: \"flex\",\n alignItems: \"center\",\n gap: FLOATING_PANEL_GAP,\n padding: `${FLOATING_PANEL_HEADER_PADDING_Y} ${FLOATING_PANEL_HEADER_PADDING_X}`,\n borderBottom: `1px solid ${FLOATING_PANEL_BORDER_COLOR}`,\n background: FLOATING_PANEL_SURFACE_2_COLOR,\n};\n\nconst titleStyle: React.CSSProperties = {\n fontWeight: 600,\n};\n\nconst metaStyle: React.CSSProperties = {\n marginLeft: \"auto\",\n color: FLOATING_PANEL_MUTED_FG_COLOR,\n fontSize: FLOATING_PANEL_META_FONT_SIZE,\n};\n\nconst controlsStyle: React.CSSProperties = {\n display: \"flex\",\n alignItems: \"center\",\n gap: FLOATING_PANEL_CONTROLS_GAP,\n};\n\nconst contentStyle: React.CSSProperties = {\n padding: FLOATING_PANEL_CONTENT_PADDING,\n overflow: \"auto\",\n};\n\nexport type FloatingPanelFrameProps = Omit<React.HTMLAttributes<HTMLDivElement>, \"className\" | \"style\"> & {\n style?: React.CSSProperties;\n};\n\nexport const FloatingPanelFrame = React.forwardRef<HTMLDivElement, FloatingPanelFrameProps>(function FloatingPanelFrame(\n { style: propStyle, ...props },\n ref,\n) {\n const combinedStyle = React.useMemo(() => ({ ...frameStyle, ...propStyle }), [propStyle]);\n return <div ref={ref} style={combinedStyle} {...props} />;\n});\n\nexport type FloatingPanelHeaderProps = Omit<React.HTMLAttributes<HTMLDivElement>, \"className\" | \"style\"> & {\n style?: React.CSSProperties;\n};\n\nexport const FloatingPanelHeader: React.FC<FloatingPanelHeaderProps> = ({ style: propStyle, ...props }) => {\n const combinedStyle = React.useMemo(() => ({ ...headerStyle, ...propStyle }), [propStyle]);\n return <div style={combinedStyle} {...props} />;\n};\n\nexport type FloatingPanelTitleProps = Omit<React.HTMLAttributes<HTMLSpanElement>, \"className\" | \"style\"> & {\n style?: React.CSSProperties;\n};\n\nexport const FloatingPanelTitle: React.FC<FloatingPanelTitleProps> = ({ style: propStyle, ...props }) => {\n const combinedStyle = React.useMemo(() => ({ ...titleStyle, ...propStyle }), [propStyle]);\n return <span style={combinedStyle} {...props} />;\n};\n\nexport type FloatingPanelMetaProps = Omit<React.HTMLAttributes<HTMLSpanElement>, \"className\" | \"style\"> & {\n style?: React.CSSProperties;\n};\n\nexport const FloatingPanelMeta: React.FC<FloatingPanelMetaProps> = ({ style: propStyle, ...props }) => {\n const combinedStyle = React.useMemo(() => ({ ...metaStyle, ...propStyle }), [propStyle]);\n return <span style={combinedStyle} {...props} />;\n};\n\nexport type FloatingPanelControlsProps = Omit<React.HTMLAttributes<HTMLDivElement>, \"className\" | \"style\"> & {\n style?: React.CSSProperties;\n};\n\nexport const FloatingPanelControls: React.FC<FloatingPanelControlsProps> = ({ style: propStyle, ...props }) => {\n const combinedStyle = React.useMemo(() => ({ ...controlsStyle, ...propStyle }), [propStyle]);\n return <div style={combinedStyle} {...props} />;\n};\n\nexport type FloatingPanelContentProps = Omit<React.HTMLAttributes<HTMLDivElement>, \"className\" | \"style\"> & {\n style?: React.CSSProperties;\n};\n\nexport const FloatingPanelContent = React.forwardRef<HTMLDivElement, FloatingPanelContentProps>(\n function FloatingPanelContent({ style: propStyle, ...props }, ref) {\n const combinedStyle = React.useMemo(() => ({ ...contentStyle, ...propStyle }), [propStyle]);\n return <div ref={ref} style={combinedStyle} {...props} />;\n },\n);\n\nFloatingPanelFrame.displayName = \"FloatingPanelFrame\";\nFloatingPanelHeader.displayName = \"FloatingPanelHeader\";\nFloatingPanelTitle.displayName = \"FloatingPanelTitle\";\nFloatingPanelMeta.displayName = \"FloatingPanelMeta\";\nFloatingPanelControls.displayName = \"FloatingPanelControls\";\nFloatingPanelContent.displayName = \"FloatingPanelContent\";\n\n"],"names":["frameStyle","FLOATING_PANEL_BORDER_RADIUS","FLOATING_PANEL_BORDER_COLOR","FLOATING_PANEL_SURFACE_COLOR","FLOATING_PANEL_SHADOW","headerStyle","FLOATING_PANEL_GAP","FLOATING_PANEL_HEADER_PADDING_Y","FLOATING_PANEL_HEADER_PADDING_X","FLOATING_PANEL_SURFACE_2_COLOR","titleStyle","metaStyle","FLOATING_PANEL_MUTED_FG_COLOR","FLOATING_PANEL_META_FONT_SIZE","controlsStyle","FLOATING_PANEL_CONTROLS_GAP","contentStyle","FLOATING_PANEL_CONTENT_PADDING","FloatingPanelFrame","React","propStyle","props","ref","combinedStyle","FloatingPanelHeader","jsx","FloatingPanelTitle","FloatingPanelMeta","FloatingPanelControls","FloatingPanelContent"],"mappings":";;;AAmBA,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C,QAAA,EAAK,OAAOF,GAAgB,GAAGF,GAAO;AAChD,GAMaM,IAAsD,CAAC,EAAE,OAAOP,GAAW,GAAGC,QAAY;AACrG,QAAME,IAAgBJ,EAAM,QAAQ,OAAO,EAAE,GAAGR,GAAW,GAAGS,EAAA,IAAc,CAACA,CAAS,CAAC;AACvF,SAAO,gBAAAK,EAAC,QAAA,EAAK,OAAOF,GAAgB,GAAGF,GAAO;AAChD,GAMaO,IAA8D,CAAC,EAAE,OAAOR,GAAW,GAAGC,QAAY;AAC7G,QAAME,IAAgBJ,EAAM,QAAQ,OAAO,EAAE,GAAGL,GAAe,GAAGM,EAAA,IAAc,CAACA,CAAS,CAAC;AAC3F,SAAO,gBAAAK,EAAC,OAAA,EAAI,OAAOF,GAAgB,GAAGF,GAAO;AAC/C,GAMaQ,IAAuBV,EAAM;AAAA,EACxC,SAA8B,EAAE,OAAOC,GAAW,GAAGC,EAAA,GAASC,GAAK;AACjE,UAAMC,IAAgBJ,EAAM,QAAQ,OAAO,EAAE,GAAGH,GAAc,GAAGI,EAAA,IAAc,CAACA,CAAS,CAAC;AAC1F,6BAAQ,OAAA,EAAI,KAAAE,GAAU,OAAOC,GAAgB,GAAGF,GAAO;AAAA,EACzD;AACF;AAEAH,EAAmB,cAAc;AACjCM,EAAoB,cAAc;AAClCE,EAAmB,cAAc;AACjCC,EAAkB,cAAc;AAChCC,EAAsB,cAAc;AACpCC,EAAqB,cAAc;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const s=require("react/jsx-runtime"),P=require("react"),o=require("./styles-DcG3aIFx.cjs");function A(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const l=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,l.get?l:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const a=A(P),O={display:"flex",flexDirection:"column",borderRadius:o.FLOATING_PANEL_BORDER_RADIUS,border:`1px solid ${o.FLOATING_PANEL_BORDER_COLOR}`,background:o.FLOATING_PANEL_SURFACE_COLOR,overflow:"hidden",boxShadow:o.FLOATING_PANEL_SHADOW},g={display:"flex",alignItems:"center",gap:o.FLOATING_PANEL_GAP,padding:`${o.FLOATING_PANEL_HEADER_PADDING_Y} ${o.FLOATING_PANEL_HEADER_PADDING_X}`,borderBottom:`1px solid ${o.FLOATING_PANEL_BORDER_COLOR}`,background:o.FLOATING_PANEL_SURFACE_2_COLOR},u={fontWeight:600},m={marginLeft:"auto",color:o.FLOATING_PANEL_MUTED_FG_COLOR,fontSize:o.FLOATING_PANEL_META_FONT_SIZE},L={display:"flex",alignItems:"center",gap:o.FLOATING_PANEL_CONTROLS_GAP},y={padding:o.FLOATING_PANEL_CONTENT_PADDING,overflow:"auto"},r=a.forwardRef(function({style:t,...n},l){const i=a.useMemo(()=>({...O,...t}),[t]);return s.jsx("div",{ref:l,style:i,...n})}),c=({style:e,...t})=>{const n=a.useMemo(()=>({...g,...e}),[e]);return s.jsx("div",{style:n,...t})},d=({style:e,...t})=>{const n=a.useMemo(()=>({...u,...e}),[e]);return s.jsx("span",{style:n,...t})},_=({style:e,...t})=>{const n=a.useMemo(()=>({...m,...e}),[e]);return s.jsx("span",{style:n,...t})},F=({style:e,...t})=>{const n=a.useMemo(()=>({...L,...e}),[e]);return s.jsx("div",{style:n,...t})},N=a.forwardRef(function({style:t,...n},l){const i=a.useMemo(()=>({...y,...t}),[t]);return s.jsx("div",{ref:l,style:i,...n})});r.displayName="FloatingPanelFrame";c.displayName="FloatingPanelHeader";d.displayName="FloatingPanelTitle";_.displayName="FloatingPanelMeta";F.displayName="FloatingPanelControls";N.displayName="FloatingPanelContent";exports.FloatingPanelContent=N;exports.FloatingPanelControls=F;exports.FloatingPanelFrame=r;exports.FloatingPanelHeader=c;exports.FloatingPanelMeta=_;exports.FloatingPanelTitle=d;
2
+ //# sourceMappingURL=FloatingPanelFrame-XtBcHANI.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FloatingPanelFrame-XtBcHANI.cjs","sources":["../src/components/paneling/FloatingPanelFrame.tsx"],"sourcesContent":["/**\n * @file Shared floating panel frame components for reusable overlay styling\n */\nimport * as React from \"react\";\nimport {\n FLOATING_PANEL_BORDER_RADIUS,\n FLOATING_PANEL_GAP,\n FLOATING_PANEL_HEADER_PADDING_Y,\n FLOATING_PANEL_HEADER_PADDING_X,\n FLOATING_PANEL_CONTENT_PADDING,\n FLOATING_PANEL_META_FONT_SIZE,\n FLOATING_PANEL_CONTROLS_GAP,\n FLOATING_PANEL_SURFACE_COLOR,\n FLOATING_PANEL_SURFACE_2_COLOR,\n FLOATING_PANEL_BORDER_COLOR,\n FLOATING_PANEL_MUTED_FG_COLOR,\n FLOATING_PANEL_SHADOW,\n} from \"../../constants/styles\";\n\nconst frameStyle: React.CSSProperties = {\n display: \"flex\",\n flexDirection: \"column\",\n borderRadius: FLOATING_PANEL_BORDER_RADIUS,\n border: `1px solid ${FLOATING_PANEL_BORDER_COLOR}`,\n background: FLOATING_PANEL_SURFACE_COLOR,\n overflow: \"hidden\",\n boxShadow: FLOATING_PANEL_SHADOW,\n};\n\nconst headerStyle: React.CSSProperties = {\n display: \"flex\",\n alignItems: \"center\",\n gap: FLOATING_PANEL_GAP,\n padding: `${FLOATING_PANEL_HEADER_PADDING_Y} ${FLOATING_PANEL_HEADER_PADDING_X}`,\n borderBottom: `1px solid ${FLOATING_PANEL_BORDER_COLOR}`,\n background: FLOATING_PANEL_SURFACE_2_COLOR,\n};\n\nconst titleStyle: React.CSSProperties = {\n fontWeight: 600,\n};\n\nconst metaStyle: React.CSSProperties = {\n marginLeft: \"auto\",\n color: FLOATING_PANEL_MUTED_FG_COLOR,\n fontSize: FLOATING_PANEL_META_FONT_SIZE,\n};\n\nconst controlsStyle: React.CSSProperties = {\n display: \"flex\",\n alignItems: \"center\",\n gap: FLOATING_PANEL_CONTROLS_GAP,\n};\n\nconst contentStyle: React.CSSProperties = {\n padding: FLOATING_PANEL_CONTENT_PADDING,\n overflow: \"auto\",\n};\n\nexport type FloatingPanelFrameProps = Omit<React.HTMLAttributes<HTMLDivElement>, \"className\" | \"style\"> & {\n style?: React.CSSProperties;\n};\n\nexport const FloatingPanelFrame = React.forwardRef<HTMLDivElement, FloatingPanelFrameProps>(function FloatingPanelFrame(\n { style: propStyle, ...props },\n ref,\n) {\n const combinedStyle = React.useMemo(() => ({ ...frameStyle, ...propStyle }), [propStyle]);\n return <div ref={ref} style={combinedStyle} {...props} />;\n});\n\nexport type FloatingPanelHeaderProps = Omit<React.HTMLAttributes<HTMLDivElement>, \"className\" | \"style\"> & {\n style?: React.CSSProperties;\n};\n\nexport const FloatingPanelHeader: React.FC<FloatingPanelHeaderProps> = ({ style: propStyle, ...props }) => {\n const combinedStyle = React.useMemo(() => ({ ...headerStyle, ...propStyle }), [propStyle]);\n return <div style={combinedStyle} {...props} />;\n};\n\nexport type FloatingPanelTitleProps = Omit<React.HTMLAttributes<HTMLSpanElement>, \"className\" | \"style\"> & {\n style?: React.CSSProperties;\n};\n\nexport const FloatingPanelTitle: React.FC<FloatingPanelTitleProps> = ({ style: propStyle, ...props }) => {\n const combinedStyle = React.useMemo(() => ({ ...titleStyle, ...propStyle }), [propStyle]);\n return <span style={combinedStyle} {...props} />;\n};\n\nexport type FloatingPanelMetaProps = Omit<React.HTMLAttributes<HTMLSpanElement>, \"className\" | \"style\"> & {\n style?: React.CSSProperties;\n};\n\nexport const FloatingPanelMeta: React.FC<FloatingPanelMetaProps> = ({ style: propStyle, ...props }) => {\n const combinedStyle = React.useMemo(() => ({ ...metaStyle, ...propStyle }), [propStyle]);\n return <span style={combinedStyle} {...props} />;\n};\n\nexport type FloatingPanelControlsProps = Omit<React.HTMLAttributes<HTMLDivElement>, \"className\" | \"style\"> & {\n style?: React.CSSProperties;\n};\n\nexport const FloatingPanelControls: React.FC<FloatingPanelControlsProps> = ({ style: propStyle, ...props }) => {\n const combinedStyle = React.useMemo(() => ({ ...controlsStyle, ...propStyle }), [propStyle]);\n return <div style={combinedStyle} {...props} />;\n};\n\nexport type FloatingPanelContentProps = Omit<React.HTMLAttributes<HTMLDivElement>, \"className\" | \"style\"> & {\n style?: React.CSSProperties;\n};\n\nexport const FloatingPanelContent = React.forwardRef<HTMLDivElement, FloatingPanelContentProps>(\n function FloatingPanelContent({ style: propStyle, ...props }, ref) {\n const combinedStyle = React.useMemo(() => ({ ...contentStyle, ...propStyle }), [propStyle]);\n return <div ref={ref} style={combinedStyle} {...props} />;\n },\n);\n\nFloatingPanelFrame.displayName = \"FloatingPanelFrame\";\nFloatingPanelHeader.displayName = \"FloatingPanelHeader\";\nFloatingPanelTitle.displayName = \"FloatingPanelTitle\";\nFloatingPanelMeta.displayName = \"FloatingPanelMeta\";\nFloatingPanelControls.displayName = \"FloatingPanelControls\";\nFloatingPanelContent.displayName = \"FloatingPanelContent\";\n\n"],"names":["frameStyle","FLOATING_PANEL_BORDER_RADIUS","FLOATING_PANEL_BORDER_COLOR","FLOATING_PANEL_SURFACE_COLOR","FLOATING_PANEL_SHADOW","headerStyle","FLOATING_PANEL_GAP","FLOATING_PANEL_HEADER_PADDING_Y","FLOATING_PANEL_HEADER_PADDING_X","FLOATING_PANEL_SURFACE_2_COLOR","titleStyle","metaStyle","FLOATING_PANEL_MUTED_FG_COLOR","FLOATING_PANEL_META_FONT_SIZE","controlsStyle","FLOATING_PANEL_CONTROLS_GAP","contentStyle","FLOATING_PANEL_CONTENT_PADDING","FloatingPanelFrame","React","propStyle","props","ref","combinedStyle","FloatingPanelHeader","jsx","FloatingPanelTitle","FloatingPanelMeta","FloatingPanelControls","FloatingPanelContent"],"mappings":"kYAmBMA,EAAkC,CACtC,QAAS,OACT,cAAe,SACf,aAAcC,EAAAA,6BACd,OAAQ,aAAaC,EAAAA,2BAA2B,GAChD,WAAYC,EAAAA,6BACZ,SAAU,SACV,UAAWC,EAAAA,qBACb,EAEMC,EAAmC,CACvC,QAAS,OACT,WAAY,SACZ,IAAKC,EAAAA,mBACL,QAAS,GA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