@olwiba/ui 0.0.28
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.
- package/LICENSE +21 -0
- package/README.md +98 -0
- package/dist/index.d.ts +762 -0
- package/dist/index.js +2102 -0
- package/dist/index.js.map +1 -0
- package/package.json +88 -0
- package/src/app/AppShell.tsx +365 -0
- package/src/app/AuthSection.tsx +141 -0
- package/src/app/EmptyState.tsx +34 -0
- package/src/app/ErrorPage.tsx +78 -0
- package/src/app/UpgradePrompt.tsx +203 -0
- package/src/blog/PostCard.tsx +66 -0
- package/src/blog/PostList.tsx +27 -0
- package/src/components/ConfirmDialog.tsx +43 -0
- package/src/components/ContextMenu.tsx +86 -0
- package/src/components/DevBanner.tsx +22 -0
- package/src/components/Dock.tsx +94 -0
- package/src/components/FeatureCard.tsx +45 -0
- package/src/components/GlassCard.tsx +30 -0
- package/src/components/ImageCard.tsx +60 -0
- package/src/components/PageHeader.tsx +101 -0
- package/src/components/PricingCard.tsx +90 -0
- package/src/components/RegisterHotkeys.tsx +43 -0
- package/src/components/RootErrorFallback.tsx +29 -0
- package/src/components/Spinner.tsx +14 -0
- package/src/components/Spotlight.tsx +104 -0
- package/src/components/StatCard.tsx +44 -0
- package/src/components/Suspensed.tsx +17 -0
- package/src/components/TestimonialCard.tsx +64 -0
- package/src/components/ThemeColorUpdater.tsx +23 -0
- package/src/components/ThemeSwitchMinimal.tsx +28 -0
- package/src/components/VersionBanner.tsx +38 -0
- package/src/context/OlwibaUIContext.tsx +58 -0
- package/src/hooks/use-confirm.ts +64 -0
- package/src/hooks/use-controlled-open.ts +33 -0
- package/src/hooks/use-copy-to-clipboard.ts +20 -0
- package/src/hooks/use-debounce.ts +14 -0
- package/src/hooks/use-intersection-observer.ts +25 -0
- package/src/hooks/use-local-storage.ts +31 -0
- package/src/hooks/use-media-query.ts +21 -0
- package/src/hooks/use-mounted.ts +11 -0
- package/src/hooks/use-pagination.ts +31 -0
- package/src/hooks/use-scrolled-past.ts +27 -0
- package/src/index.ts +113 -0
- package/src/lib/utils.ts +6 -0
- package/src/marketing/ContactSection.tsx +110 -0
- package/src/marketing/CtaSection.tsx +74 -0
- package/src/marketing/FaqSection.tsx +44 -0
- package/src/marketing/FeaturesSection.tsx +42 -0
- package/src/marketing/Footer.tsx +87 -0
- package/src/marketing/HeroSection.tsx +112 -0
- package/src/marketing/LogoStrip.tsx +94 -0
- package/src/marketing/Navbar.tsx +142 -0
- package/src/marketing/NewsletterSection.tsx +64 -0
- package/src/marketing/PricingSection.tsx +120 -0
- package/src/marketing/SectionTitle.tsx +30 -0
- package/src/marketing/StatsSection.tsx +63 -0
- package/src/marketing/TeamSection.tsx +110 -0
- package/src/marketing/TestimonialsSection.tsx +56 -0
- package/src/motion/CountUp.tsx +64 -0
- package/src/motion/FadeIn.tsx +69 -0
- package/src/motion/PageTransition.tsx +49 -0
- package/src/motion/StaggerChildren.tsx +74 -0
- package/src/overlays/Overlay.tsx +88 -0
- package/src/overlays/Underlay.tsx +114 -0
- package/src/primitives/Badge.tsx +11 -0
- package/src/primitives/Button.tsx +16 -0
- package/src/primitives/Card.tsx +22 -0
- package/src/primitives/Checkbox.tsx +17 -0
- package/src/primitives/Input.tsx +16 -0
- package/src/primitives/Switch.tsx +16 -0
- package/src/primitives/Textarea.tsx +16 -0
- package/src/primitives/index.ts +7 -0
- package/src/types/external-packages.d.ts +79 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { cn } from '@olwiba/cn';
|
|
5
|
+
import { Loader2 } from 'lucide-react';
|
|
6
|
+
|
|
7
|
+
// ─── Dim ──────────────────────────────────────────────────────────────────────
|
|
8
|
+
|
|
9
|
+
interface DimOverlayProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
10
|
+
opacity?: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function DimOverlay({ opacity = 0.5, className, style, ...props }: DimOverlayProps) {
|
|
14
|
+
return (
|
|
15
|
+
<div
|
|
16
|
+
aria-hidden="true"
|
|
17
|
+
className={cn('absolute inset-0 bg-background', className)}
|
|
18
|
+
style={{ opacity, ...style }}
|
|
19
|
+
{...props}
|
|
20
|
+
/>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// ─── Scrim ────────────────────────────────────────────────────────────────────
|
|
25
|
+
|
|
26
|
+
type ScrimDirection = 'top' | 'bottom' | 'left' | 'right';
|
|
27
|
+
|
|
28
|
+
interface ScrimOverlayProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
29
|
+
direction?: ScrimDirection;
|
|
30
|
+
color?: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const scrimGradients: Record<ScrimDirection, string> = {
|
|
34
|
+
bottom: 'to bottom',
|
|
35
|
+
top: 'to top',
|
|
36
|
+
left: 'to left',
|
|
37
|
+
right: 'to right',
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
function ScrimOverlay({ direction = 'bottom', color = 'var(--background)', className, style, ...props }: ScrimOverlayProps) {
|
|
41
|
+
return (
|
|
42
|
+
<div
|
|
43
|
+
aria-hidden="true"
|
|
44
|
+
className={cn('pointer-events-none absolute inset-x-0 bottom-0 h-1/2', className)}
|
|
45
|
+
style={{
|
|
46
|
+
background: `linear-gradient(${scrimGradients[direction]}, transparent, ${color})`,
|
|
47
|
+
...style,
|
|
48
|
+
}}
|
|
49
|
+
{...props}
|
|
50
|
+
/>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// ─── Loading ──────────────────────────────────────────────────────────────────
|
|
55
|
+
|
|
56
|
+
interface LoadingOverlayProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
57
|
+
label?: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function LoadingOverlay({ label, className, ...props }: LoadingOverlayProps) {
|
|
61
|
+
return (
|
|
62
|
+
<div
|
|
63
|
+
role="status"
|
|
64
|
+
className={cn('absolute inset-0 flex flex-col items-center justify-center gap-2 bg-background/80 backdrop-blur-sm', className)}
|
|
65
|
+
{...props}
|
|
66
|
+
>
|
|
67
|
+
<Loader2 className="size-5 animate-spin text-muted-foreground" />
|
|
68
|
+
{label && <p className="text-xs text-muted-foreground">{label}</p>}
|
|
69
|
+
</div>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// ─── Public API ───────────────────────────────────────────────────────────────
|
|
74
|
+
|
|
75
|
+
type OverlayVariant = 'dim' | 'scrim' | 'loading';
|
|
76
|
+
|
|
77
|
+
type OverlayProps =
|
|
78
|
+
| ({ variant: 'dim' } & DimOverlayProps)
|
|
79
|
+
| ({ variant: 'scrim' } & ScrimOverlayProps)
|
|
80
|
+
| ({ variant: 'loading' } & LoadingOverlayProps);
|
|
81
|
+
|
|
82
|
+
export function Overlay(props: OverlayProps) {
|
|
83
|
+
if (props.variant === 'dim') return <DimOverlay {...(props as DimOverlayProps)} />;
|
|
84
|
+
if (props.variant === 'scrim') return <ScrimOverlay {...(props as ScrimOverlayProps)} />;
|
|
85
|
+
return <LoadingOverlay {...(props as LoadingOverlayProps)} />;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export type { OverlayProps, OverlayVariant };
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { cn } from '@olwiba/cn';
|
|
5
|
+
|
|
6
|
+
// ─── Grid ─────────────────────────────────────────────────────────────────────
|
|
7
|
+
|
|
8
|
+
interface GridUnderlayProps extends React.SVGAttributes<SVGElement> {
|
|
9
|
+
variant: 'dots' | 'lines' | 'cross';
|
|
10
|
+
size?: number;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function GridUnderlay({ variant, size = 24, className, ...props }: GridUnderlayProps) {
|
|
15
|
+
const id = React.useId();
|
|
16
|
+
|
|
17
|
+
const pattern =
|
|
18
|
+
variant === 'dots' ? (
|
|
19
|
+
<circle cx={size / 2} cy={size / 2} r={1} fill="currentColor" />
|
|
20
|
+
) : variant === 'lines' ? (
|
|
21
|
+
<path d={`M ${size} 0 L 0 0 0 ${size}`} fill="none" stroke="currentColor" strokeWidth={0.5} />
|
|
22
|
+
) : (
|
|
23
|
+
<>
|
|
24
|
+
<line x1={size / 2} y1={0} x2={size / 2} y2={size} stroke="currentColor" strokeWidth={0.5} />
|
|
25
|
+
<line x1={0} y1={size / 2} x2={size} y2={size / 2} stroke="currentColor" strokeWidth={0.5} />
|
|
26
|
+
</>
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<svg
|
|
31
|
+
aria-hidden="true"
|
|
32
|
+
className={cn('pointer-events-none absolute inset-0 h-full w-full text-foreground/15', className)}
|
|
33
|
+
{...props}
|
|
34
|
+
>
|
|
35
|
+
<defs>
|
|
36
|
+
<pattern id={id} width={size} height={size} patternUnits="userSpaceOnUse">
|
|
37
|
+
{pattern}
|
|
38
|
+
</pattern>
|
|
39
|
+
</defs>
|
|
40
|
+
<rect width="100%" height="100%" fill={`url(#${id})`} />
|
|
41
|
+
</svg>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// ─── Glow ─────────────────────────────────────────────────────────────────────
|
|
46
|
+
|
|
47
|
+
const blurClass = { sm: 'blur-xl', md: 'blur-2xl', lg: 'blur-3xl', xl: 'blur-[80px]' } as const;
|
|
48
|
+
|
|
49
|
+
interface GlowUnderlayProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
50
|
+
size?: number;
|
|
51
|
+
color?: string;
|
|
52
|
+
followCursor?: boolean;
|
|
53
|
+
blur?: keyof typeof blurClass;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function GlowUnderlay({
|
|
57
|
+
size = 400,
|
|
58
|
+
color = 'color-mix(in oklch, var(--primary) 45%, transparent)',
|
|
59
|
+
followCursor = false,
|
|
60
|
+
blur = 'lg',
|
|
61
|
+
className,
|
|
62
|
+
style,
|
|
63
|
+
...props
|
|
64
|
+
}: GlowUnderlayProps) {
|
|
65
|
+
const [pos, setPos] = React.useState({ x: '50%', y: '50%' });
|
|
66
|
+
const containerRef = React.useRef<HTMLDivElement>(null);
|
|
67
|
+
|
|
68
|
+
React.useEffect(() => {
|
|
69
|
+
if (!followCursor) return;
|
|
70
|
+
const handleMouseMove = (e: MouseEvent) => {
|
|
71
|
+
const el = containerRef.current;
|
|
72
|
+
if (!el) return;
|
|
73
|
+
const rect = el.getBoundingClientRect();
|
|
74
|
+
setPos({ x: `${e.clientX - rect.left}px`, y: `${e.clientY - rect.top}px` });
|
|
75
|
+
};
|
|
76
|
+
window.addEventListener('mousemove', handleMouseMove);
|
|
77
|
+
return () => window.removeEventListener('mousemove', handleMouseMove);
|
|
78
|
+
}, [followCursor]);
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
<div ref={containerRef} className={cn('pointer-events-none absolute inset-0 overflow-hidden', className)} {...props}>
|
|
82
|
+
<div
|
|
83
|
+
aria-hidden="true"
|
|
84
|
+
className={cn('absolute rounded-full', blurClass[blur])}
|
|
85
|
+
style={{
|
|
86
|
+
width: size,
|
|
87
|
+
height: size,
|
|
88
|
+
background: color,
|
|
89
|
+
left: pos.x,
|
|
90
|
+
top: pos.y,
|
|
91
|
+
transform: 'translate(-50%, -50%)',
|
|
92
|
+
...style,
|
|
93
|
+
}}
|
|
94
|
+
/>
|
|
95
|
+
</div>
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// ─── Public API ───────────────────────────────────────────────────────────────
|
|
100
|
+
|
|
101
|
+
type UnderlayVariant = 'dots' | 'lines' | 'cross' | 'glow';
|
|
102
|
+
|
|
103
|
+
type UnderlayProps =
|
|
104
|
+
| ({ variant: 'dots' | 'lines' | 'cross' } & Omit<GridUnderlayProps, 'variant'>)
|
|
105
|
+
| ({ variant: 'glow' } & Omit<GlowUnderlayProps, 'variant'>);
|
|
106
|
+
|
|
107
|
+
export function Underlay(props: UnderlayProps) {
|
|
108
|
+
if (props.variant === 'glow') {
|
|
109
|
+
return <GlowUnderlay {...(props as GlowUnderlayProps)} />;
|
|
110
|
+
}
|
|
111
|
+
return <GridUnderlay {...(props as GridUnderlayProps)} />;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export type { UnderlayProps, UnderlayVariant };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Badge as CNBadge, type BadgeProps as CNBadgeProps } from '@olwiba/cn';
|
|
5
|
+
|
|
6
|
+
// Badge no longer supports mode — variant/size/disabled only.
|
|
7
|
+
export type BadgeProps = CNBadgeProps;
|
|
8
|
+
|
|
9
|
+
export function Badge(props: BadgeProps) {
|
|
10
|
+
return <CNBadge {...props} />;
|
|
11
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Button as CNButton, type ButtonProps as CNButtonProps } from '@olwiba/cn';
|
|
5
|
+
import { useUIMode } from '../context/OlwibaUIContext';
|
|
6
|
+
|
|
7
|
+
export type ButtonProps = CNButtonProps;
|
|
8
|
+
|
|
9
|
+
export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
10
|
+
({ mode, ...props }, ref) => {
|
|
11
|
+
const ctxMode = useUIMode();
|
|
12
|
+
const resolvedMode = mode ?? (ctxMode !== 'default' ? (ctxMode as "playful" | "smooth") : undefined);
|
|
13
|
+
return <CNButton mode={resolvedMode} {...props} ref={ref} />;
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
Button.displayName = 'Button';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import {
|
|
5
|
+
Card as CNCard, type CardProps as CNCardProps,
|
|
6
|
+
CardHeader, CardTitle, CardDescription, CardContent, CardFooter,
|
|
7
|
+
} from '@olwiba/cn';
|
|
8
|
+
import { useUIMode } from '../context/OlwibaUIContext';
|
|
9
|
+
|
|
10
|
+
export type CardProps = CNCardProps;
|
|
11
|
+
|
|
12
|
+
export const Card = React.forwardRef<HTMLDivElement, CardProps>(
|
|
13
|
+
({ mode, ...props }, ref) => {
|
|
14
|
+
const ctxMode = useUIMode();
|
|
15
|
+
const resolvedMode = mode ?? (ctxMode !== 'default' ? (ctxMode as "playful" | "smooth") : undefined);
|
|
16
|
+
return <CNCard mode={resolvedMode} {...props} ref={ref} />;
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
Card.displayName = 'Card';
|
|
20
|
+
|
|
21
|
+
// Sub-components are pass-throughs — no mode logic needed.
|
|
22
|
+
export { CardHeader, CardTitle, CardDescription, CardContent, CardFooter };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Checkbox as CNCheckbox, type CheckboxProps as CNCheckboxProps } from '@olwiba/cn';
|
|
5
|
+
import { useUIMode } from '../context/OlwibaUIContext';
|
|
6
|
+
|
|
7
|
+
export type CheckboxProps = CNCheckboxProps;
|
|
8
|
+
|
|
9
|
+
export const Checkbox = React.forwardRef<
|
|
10
|
+
React.ElementRef<typeof CNCheckbox>,
|
|
11
|
+
CheckboxProps
|
|
12
|
+
>(({ mode, ...props }, ref) => {
|
|
13
|
+
const ctxMode = useUIMode();
|
|
14
|
+
const resolvedMode = mode ?? (ctxMode !== 'default' ? (ctxMode as "playful" | "smooth") : undefined);
|
|
15
|
+
return <CNCheckbox mode={resolvedMode} {...props} ref={ref} />;
|
|
16
|
+
});
|
|
17
|
+
Checkbox.displayName = 'Checkbox';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Input as CNInput, type InputProps as CNInputProps } from '@olwiba/cn';
|
|
5
|
+
import { useUIMode } from '../context/OlwibaUIContext';
|
|
6
|
+
|
|
7
|
+
export type InputProps = CNInputProps;
|
|
8
|
+
|
|
9
|
+
export const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|
10
|
+
({ mode, ...props }, ref) => {
|
|
11
|
+
const ctxMode = useUIMode();
|
|
12
|
+
const resolvedMode = mode ?? (ctxMode !== 'default' ? (ctxMode as "playful" | "smooth") : undefined);
|
|
13
|
+
return <CNInput mode={resolvedMode} {...props} ref={ref} />;
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
Input.displayName = 'Input';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Switch as CNSwitch, type SwitchProps as CNSwitchProps } from '@olwiba/cn';
|
|
5
|
+
|
|
6
|
+
export type SwitchProps = CNSwitchProps & {
|
|
7
|
+
mode?: 'default' | 'playful' | 'smooth';
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const Switch = React.forwardRef<
|
|
11
|
+
React.ElementRef<typeof CNSwitch>,
|
|
12
|
+
SwitchProps
|
|
13
|
+
>(({ mode: _mode, ...props }, ref) => {
|
|
14
|
+
return <CNSwitch {...props} ref={ref} />;
|
|
15
|
+
});
|
|
16
|
+
Switch.displayName = 'Switch';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Textarea as CNTextarea, type TextareaProps as CNTextareaProps } from '@olwiba/cn';
|
|
5
|
+
import { useUIMode } from '../context/OlwibaUIContext';
|
|
6
|
+
|
|
7
|
+
export type TextareaProps = CNTextareaProps;
|
|
8
|
+
|
|
9
|
+
export const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
10
|
+
({ mode, ...props }, ref) => {
|
|
11
|
+
const ctxMode = useUIMode();
|
|
12
|
+
const resolvedMode = mode ?? (ctxMode !== 'default' ? (ctxMode as "playful" | "smooth") : undefined);
|
|
13
|
+
return <CNTextarea mode={resolvedMode} {...props} ref={ref} />;
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
Textarea.displayName = 'Textarea';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { Button, type ButtonProps } from './Button';
|
|
2
|
+
export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, type CardProps } from './Card';
|
|
3
|
+
export { Badge, type BadgeProps } from './Badge';
|
|
4
|
+
export { Input, type InputProps } from './Input';
|
|
5
|
+
export { Textarea, type TextareaProps } from './Textarea';
|
|
6
|
+
export { Checkbox, type CheckboxProps } from './Checkbox';
|
|
7
|
+
export { Switch, type SwitchProps } from './Switch';
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
declare module '@olwiba/docs' {
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
export const Theme: {
|
|
5
|
+
Purple: string;
|
|
6
|
+
[key: string]: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export function createDocsRoot(config: Record<string, unknown>): unknown;
|
|
10
|
+
export const DocsHeader: React.ComponentType<any>;
|
|
11
|
+
export const DocsFooter: React.ComponentType<any>;
|
|
12
|
+
export const DocsLayout: React.ComponentType<any>;
|
|
13
|
+
export const DocsCopyPage: React.ComponentType<any>;
|
|
14
|
+
export const DocsMobileNav: React.ComponentType<any>;
|
|
15
|
+
export const DocsToc: React.ComponentType<any>;
|
|
16
|
+
export const CopyCommandButton: React.ComponentType<any>;
|
|
17
|
+
export const CopyButton: React.ComponentType<any>;
|
|
18
|
+
export const mdxComponents: Record<string, React.ComponentType<any>>;
|
|
19
|
+
export function extractTextFromReactNode(node: React.ReactNode): string;
|
|
20
|
+
export function cn(...inputs: any[]): string;
|
|
21
|
+
export const Sandbox: React.ComponentType<any>;
|
|
22
|
+
export const CodeFence: React.ComponentType<any>;
|
|
23
|
+
|
|
24
|
+
export interface SandboxDefinition {
|
|
25
|
+
id: string;
|
|
26
|
+
defaultViewport?: 'desktop' | 'tablet' | 'mobile' | 'custom';
|
|
27
|
+
files: Array<{ path: string; language: string; code: string }>;
|
|
28
|
+
preview: React.LazyExoticComponent<React.FC>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type SandboxRegistryInput =
|
|
32
|
+
| SandboxDefinition[]
|
|
33
|
+
| Record<string, SandboxDefinition>;
|
|
34
|
+
|
|
35
|
+
export function registerSandboxes(input: SandboxRegistryInput): void;
|
|
36
|
+
export function getSandboxDefinition(id: string): SandboxDefinition | undefined;
|
|
37
|
+
|
|
38
|
+
export interface UIModeOption {
|
|
39
|
+
value: string;
|
|
40
|
+
label: string;
|
|
41
|
+
}
|
|
42
|
+
export interface UIModeDropdownProps {
|
|
43
|
+
modes: UIModeOption[];
|
|
44
|
+
}
|
|
45
|
+
export const UIModeDropdown: React.ComponentType<UIModeDropdownProps>;
|
|
46
|
+
export function getUIMode(): string;
|
|
47
|
+
export function setUIMode(mode: string): void;
|
|
48
|
+
export function subscribeUIMode(fn: (mode: string) => void): () => void;
|
|
49
|
+
|
|
50
|
+
export interface SidebarSection {
|
|
51
|
+
name: string;
|
|
52
|
+
href: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface TocItem {
|
|
56
|
+
title: string;
|
|
57
|
+
url: string;
|
|
58
|
+
depth: number;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface PageLoaderData {
|
|
62
|
+
path: string;
|
|
63
|
+
url: string;
|
|
64
|
+
pageTree: unknown;
|
|
65
|
+
frontmatter: { title?: string; description?: string };
|
|
66
|
+
toc: TocItem[];
|
|
67
|
+
rawContent: string;
|
|
68
|
+
neighbours: {
|
|
69
|
+
previous: { url: string; name: string } | null;
|
|
70
|
+
next: { url: string; name: string } | null;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
declare module '@olwiba/docs/server' {
|
|
76
|
+
export function createServer(): unknown;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
|