import { DemoStory } from '../demo/demo-types'; import { SliderFrame, SliderFrameHookProps } from './slider-frame'; import { SliderHelper, SliderHelperCloseProps } from './slider-helper'; import { HeaderWithBackFrame } from '../components/mobile-components/mobile-header-with-back'; import { Button, ButtonSize } from '../components/button'; // A dummy component to load inside the slider const DummyInnerPage = ({ hook }: { hook: SliderFrameHookProps }) => { return ( hook.close!(e)}>

This is the inner page content!

You can put any scrollable content here. Click the back arrow in the header to close.

); }; export const sliderFrameDemo: DemoStory = { id: 'slider-frame-demo', text: 'Slider Frame Demo', args: { direction: 'right', }, argTypes: { direction: { control: 'select', options: ['right', 'bottom'], description: 'Direction the slider enters from', }, }, render: (args) => { const sliderHook: SliderFrameHookProps = {}; return (

This demo shows how to use SliderFrame to slide in a new full-cover page over the current view.

), }); }} /> {/* The SliderFrame is placed here but initially hidden */} ); }, code: `import { SliderFrame, SliderFrameHookProps } from 'lupine.components/frames/slider-frame'; import { HeaderWithBackFrame } from 'lupine.components/components/mobile-components/mobile-header-with-back'; import { Button, ButtonSize } from 'lupine.components/components/button'; // 1. Define your inner page component const InnerPage = ({ hook }: { hook: SliderFrameHookProps }) => { return ( hook.close!(e)} >
Content goes here
); }; // 2. Setup the hook and frame in your main page const MyPage = () => { const sliderHook: SliderFrameHookProps = {}; return (
); }; `, };