UNPKG

@gfazioli/mantine-split-pane

Version:

A Mantine 9 React component for resizable split pane layouts with 7 resizer variants, context-based prop inheritance, responsive orientation, and dynamic pane generation.

1 lines 1.67 kB
{"version":3,"file":"Split.context.mjs","sources":["../../src/Split.context.ts"],"sourcesContent":["import { createSafeContext } from '@mantine/core';\nimport { SplitResizerContextProps, SplitResizerVariant } from './Resizer/SplitResizer';\n\n/**\n * Internal context shared between `Split` and its children.\n * Extends `SplitResizerContextProps` so that resizer configuration set on the\n * parent `<Split>` automatically cascades to every `<Split.Resizer>` child.\n * The `variant` field is added here because it flows through the Mantine\n * factory system rather than through `SplitResizerContextProps`.\n */\ninterface SplitContext extends SplitResizerContextProps {\n /** Visual variant applied to all child resizers (e.g. `'filled'`, `'gradient'`) */\n variant?: SplitResizerVariant;\n\n /** Current container dimensions, updated by ResizeObserver on the root `<Split>` element */\n containerSize?: { width: number; height: number };\n}\n\nexport const [SplitContextProvider, useSplitContext] = createSafeContext<SplitContext>(\n 'Split component was not found in tree'\n);\n"],"names":[],"mappings":";;;AACY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAoB,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,CAAC,GAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB,CAAA;AACxE,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACF,CAAA,CAAA;;"}