promptslide 0.2.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.
- package/dist/index.d.ts +377 -0
- package/dist/index.js +963 -0
- package/dist/index.js.map +1 -0
- package/package.json +65 -0
- package/src/commands/build.mjs +73 -0
- package/src/commands/create.mjs +197 -0
- package/src/commands/preview.mjs +22 -0
- package/src/commands/studio.mjs +27 -0
- package/src/core/animated.tsx +153 -0
- package/src/core/animation-config.ts +98 -0
- package/src/core/animation-context.tsx +54 -0
- package/src/core/index.ts +73 -0
- package/src/core/layouts/shared-footer.tsx +43 -0
- package/src/core/morph.tsx +153 -0
- package/src/core/slide-deck.tsx +430 -0
- package/src/core/slide-error-boundary.tsx +50 -0
- package/src/core/theme-context.tsx +48 -0
- package/src/core/transitions.ts +200 -0
- package/src/core/types.ts +136 -0
- package/src/core/use-slide-navigation.ts +142 -0
- package/src/core/utils.ts +8 -0
- package/src/index.mjs +70 -0
- package/src/utils/ansi.mjs +5 -0
- package/src/utils/colors.mjs +44 -0
- package/src/utils/prompts.mjs +50 -0
- package/src/utils/tsconfig.mjs +35 -0
- package/src/vite/config.mjs +40 -0
- package/src/vite/plugin.mjs +66 -0
- package/templates/default/AGENTS.md +453 -0
- package/templates/default/README.md +35 -0
- package/templates/default/package.json +26 -0
- package/templates/default/public/logo.svg +7 -0
- package/templates/default/src/App.tsx +11 -0
- package/templates/default/src/deck-config.ts +8 -0
- package/templates/default/src/globals.css +157 -0
- package/templates/default/src/layouts/slide-layout-centered.tsx +59 -0
- package/templates/default/src/slides/slide-example.tsx +53 -0
- package/templates/default/src/slides/slide-title.tsx +27 -0
- package/templates/default/src/theme.ts +8 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
@import "tw-animate-css";
|
|
3
|
+
@source "../node_modules/promptslide/src/core";
|
|
4
|
+
|
|
5
|
+
@custom-variant dark (&:is(.dark *));
|
|
6
|
+
|
|
7
|
+
@theme inline {
|
|
8
|
+
--font-sans: "Inter", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
|
9
|
+
--font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
|
|
10
|
+
|
|
11
|
+
--color-border: var(--border);
|
|
12
|
+
--color-input: var(--input);
|
|
13
|
+
--color-ring: var(--ring);
|
|
14
|
+
--color-background: var(--background);
|
|
15
|
+
--color-foreground: var(--foreground);
|
|
16
|
+
|
|
17
|
+
--color-primary: var(--primary);
|
|
18
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
19
|
+
|
|
20
|
+
--color-secondary: var(--secondary);
|
|
21
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
22
|
+
|
|
23
|
+
--color-destructive: var(--destructive);
|
|
24
|
+
--color-destructive-foreground: var(--destructive-foreground);
|
|
25
|
+
|
|
26
|
+
--color-muted: var(--muted);
|
|
27
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
28
|
+
|
|
29
|
+
--color-accent: var(--accent);
|
|
30
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
31
|
+
|
|
32
|
+
--color-popover: var(--popover);
|
|
33
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
34
|
+
|
|
35
|
+
--color-card: var(--card);
|
|
36
|
+
--color-card-foreground: var(--card-foreground);
|
|
37
|
+
|
|
38
|
+
--color-chart-5: var(--chart-5);
|
|
39
|
+
--color-chart-4: var(--chart-4);
|
|
40
|
+
--color-chart-3: var(--chart-3);
|
|
41
|
+
--color-chart-2: var(--chart-2);
|
|
42
|
+
--color-chart-1: var(--chart-1);
|
|
43
|
+
|
|
44
|
+
--radius-lg: var(--radius);
|
|
45
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
46
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
47
|
+
--radius-xl: calc(var(--radius) + 4px);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/*
|
|
51
|
+
---
|
|
52
|
+
Color Theme
|
|
53
|
+
---
|
|
54
|
+
Customize your slide deck colors by editing the OKLCH values below.
|
|
55
|
+
OKLCH format: oklch(lightness chroma hue)
|
|
56
|
+
- Lightness: 0 (black) to 1 (white)
|
|
57
|
+
- Chroma: 0 (gray) to ~0.4 (vivid)
|
|
58
|
+
- Hue: 0-360 (color wheel angle)
|
|
59
|
+
|
|
60
|
+
Change --primary to set your brand color.
|
|
61
|
+
---
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
:root {
|
|
65
|
+
--background: oklch(1 0 0);
|
|
66
|
+
--foreground: oklch(0.145 0 0);
|
|
67
|
+
|
|
68
|
+
--card: oklch(1 0 0);
|
|
69
|
+
--card-foreground: oklch(0.145 0 0);
|
|
70
|
+
|
|
71
|
+
--popover: oklch(1 0 0);
|
|
72
|
+
--popover-foreground: oklch(0.145 0 0);
|
|
73
|
+
|
|
74
|
+
/* Primary brand color — change this to match your brand */
|
|
75
|
+
--primary: {{PRIMARY_COLOR}};
|
|
76
|
+
--primary-foreground: oklch(0.985 0 0);
|
|
77
|
+
|
|
78
|
+
--secondary: oklch(0.97 0 0);
|
|
79
|
+
--secondary-foreground: oklch(0.205 0 0);
|
|
80
|
+
|
|
81
|
+
--muted: oklch(0.97 0 0);
|
|
82
|
+
--muted-foreground: oklch(0.556 0 0);
|
|
83
|
+
|
|
84
|
+
--accent: oklch(0.97 0 0);
|
|
85
|
+
--accent-foreground: oklch(0.205 0 0);
|
|
86
|
+
|
|
87
|
+
--destructive: oklch(0.577 0.245 27.325);
|
|
88
|
+
--destructive-foreground: oklch(0.985 0 0);
|
|
89
|
+
|
|
90
|
+
--border: oklch(0.922 0 0);
|
|
91
|
+
--input: oklch(0.922 0 0);
|
|
92
|
+
--ring: oklch(0.708 0 0);
|
|
93
|
+
|
|
94
|
+
--radius: 0.625rem;
|
|
95
|
+
|
|
96
|
+
--chart-1: {{PRIMARY_COLOR}};
|
|
97
|
+
--chart-2: oklch(0.6 0.118 184.704);
|
|
98
|
+
--chart-3: oklch(0.398 0.07 227.392);
|
|
99
|
+
--chart-4: oklch(0.828 0.189 84.429);
|
|
100
|
+
--chart-5: oklch(0.769 0.188 70.08);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.dark {
|
|
104
|
+
--background: oklch(0.159 0 0);
|
|
105
|
+
--foreground: oklch(0.985 0 0);
|
|
106
|
+
|
|
107
|
+
--card: oklch(0.205 0 0);
|
|
108
|
+
--card-foreground: oklch(0.985 0 0);
|
|
109
|
+
|
|
110
|
+
--popover: oklch(0.205 0 0);
|
|
111
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
112
|
+
|
|
113
|
+
/* Primary brand color (dark mode) */
|
|
114
|
+
--primary: {{PRIMARY_COLOR_DARK}};
|
|
115
|
+
--primary-foreground: oklch(0.985 0 0);
|
|
116
|
+
|
|
117
|
+
--secondary: oklch(0.985 0 0);
|
|
118
|
+
--secondary-foreground: oklch(0.141 0 0);
|
|
119
|
+
|
|
120
|
+
--muted: oklch(0.305 0 0);
|
|
121
|
+
--muted-foreground: oklch(0.712 0 0);
|
|
122
|
+
|
|
123
|
+
--accent: oklch(0.305 0 0);
|
|
124
|
+
--accent-foreground: oklch(0.925 0 0);
|
|
125
|
+
|
|
126
|
+
--destructive: oklch(0.704 0.191 22.216);
|
|
127
|
+
--destructive-foreground: oklch(0.985 0 0);
|
|
128
|
+
|
|
129
|
+
--border: oklch(0.269 0 0);
|
|
130
|
+
--input: oklch(1 0 0 / 15%);
|
|
131
|
+
--ring: oklch(0.556 0 0);
|
|
132
|
+
|
|
133
|
+
--chart-1: oklch(0.488 0.243 264.376);
|
|
134
|
+
--chart-2: oklch(0.696 0.17 162.48);
|
|
135
|
+
--chart-3: oklch(0.769 0.188 70.08);
|
|
136
|
+
--chart-4: oklch(0.627 0.265 303.9);
|
|
137
|
+
--chart-5: oklch(0.645 0.246 16.439);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
@layer base {
|
|
141
|
+
*,
|
|
142
|
+
::after,
|
|
143
|
+
::before,
|
|
144
|
+
::backdrop,
|
|
145
|
+
::file-selector-button {
|
|
146
|
+
border-color: var(--color-gray-200, currentcolor);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
@layer base {
|
|
151
|
+
* {
|
|
152
|
+
@apply border-border outline-ring/50;
|
|
153
|
+
}
|
|
154
|
+
body {
|
|
155
|
+
@apply bg-background text-foreground;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { useTheme, SlideFooter } from "promptslide";
|
|
2
|
+
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// SLIDE LAYOUT — CENTERED
|
|
5
|
+
// =============================================================================
|
|
6
|
+
|
|
7
|
+
interface SlideLayoutCenteredProps {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
slideNumber: number;
|
|
10
|
+
totalSlides: number;
|
|
11
|
+
title?: string;
|
|
12
|
+
subtitle?: string;
|
|
13
|
+
eyebrow?: string;
|
|
14
|
+
hideFooter?: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function SlideLayoutCentered({
|
|
18
|
+
children,
|
|
19
|
+
slideNumber,
|
|
20
|
+
totalSlides,
|
|
21
|
+
title,
|
|
22
|
+
subtitle,
|
|
23
|
+
eyebrow,
|
|
24
|
+
hideFooter = false,
|
|
25
|
+
}: SlideLayoutCenteredProps) {
|
|
26
|
+
const theme = useTheme();
|
|
27
|
+
const headingFont = theme?.fonts?.heading
|
|
28
|
+
? { fontFamily: theme.fonts.heading }
|
|
29
|
+
: undefined;
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<div className="bg-background text-foreground relative flex h-full w-full flex-col overflow-hidden px-12 pt-10 pb-6">
|
|
33
|
+
{/* Header */}
|
|
34
|
+
{(title || eyebrow) && (
|
|
35
|
+
<div className="mb-6 shrink-0">
|
|
36
|
+
{eyebrow && (
|
|
37
|
+
<div className="text-primary mb-2 text-xs font-bold tracking-[0.2em] uppercase">
|
|
38
|
+
{eyebrow}
|
|
39
|
+
</div>
|
|
40
|
+
)}
|
|
41
|
+
{title && (
|
|
42
|
+
<h2 className="text-foreground text-4xl font-bold tracking-tight" style={headingFont}>
|
|
43
|
+
{title}
|
|
44
|
+
</h2>
|
|
45
|
+
)}
|
|
46
|
+
{subtitle && <p className="text-muted-foreground mt-2 max-w-4xl text-lg">{subtitle}</p>}
|
|
47
|
+
</div>
|
|
48
|
+
)}
|
|
49
|
+
|
|
50
|
+
{/* Content Area */}
|
|
51
|
+
<div className="min-h-0 w-full flex-1 overflow-hidden pt-2">{children}</div>
|
|
52
|
+
|
|
53
|
+
{/* Footer */}
|
|
54
|
+
{!hideFooter && (
|
|
55
|
+
<SlideFooter slideNumber={slideNumber} totalSlides={totalSlides} />
|
|
56
|
+
)}
|
|
57
|
+
</div>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Lightbulb, Rocket, Zap } from "lucide-react";
|
|
2
|
+
|
|
3
|
+
import { Animated, AnimatedGroup } from "promptslide";
|
|
4
|
+
import type { SlideProps } from "promptslide";
|
|
5
|
+
import { SlideLayoutCentered } from "@/layouts/slide-layout-centered";
|
|
6
|
+
|
|
7
|
+
export function SlideExample({ slideNumber, totalSlides }: SlideProps) {
|
|
8
|
+
return (
|
|
9
|
+
<SlideLayoutCentered
|
|
10
|
+
slideNumber={slideNumber}
|
|
11
|
+
totalSlides={totalSlides}
|
|
12
|
+
eyebrow="EXAMPLE"
|
|
13
|
+
title="Click to Reveal Content"
|
|
14
|
+
subtitle="This slide demonstrates step animations. Click or press Space to advance."
|
|
15
|
+
>
|
|
16
|
+
<div className="flex h-full flex-col justify-center">
|
|
17
|
+
<Animated step={1} animation="fade">
|
|
18
|
+
<p className="text-muted-foreground mb-8 text-lg">
|
|
19
|
+
Each element appears on click. Edit this slide or create new ones in{" "}
|
|
20
|
+
<code className="text-primary font-mono text-sm">src/slides/</code>
|
|
21
|
+
</p>
|
|
22
|
+
</Animated>
|
|
23
|
+
|
|
24
|
+
<AnimatedGroup
|
|
25
|
+
startStep={2}
|
|
26
|
+
animation="slide-up"
|
|
27
|
+
staggerDelay={0.1}
|
|
28
|
+
className="grid grid-cols-3 gap-6"
|
|
29
|
+
>
|
|
30
|
+
<div className="rounded-xl border border-border bg-card p-6">
|
|
31
|
+
<Lightbulb className="text-primary mb-3 h-8 w-8" />
|
|
32
|
+
<h3 className="text-foreground mb-1 font-semibold">Idea</h3>
|
|
33
|
+
<p className="text-muted-foreground text-sm">
|
|
34
|
+
Describe your slides in natural language
|
|
35
|
+
</p>
|
|
36
|
+
</div>
|
|
37
|
+
<div className="rounded-xl border border-border bg-card p-6">
|
|
38
|
+
<Zap className="text-primary mb-3 h-8 w-8" />
|
|
39
|
+
<h3 className="text-foreground mb-1 font-semibold">Build</h3>
|
|
40
|
+
<p className="text-muted-foreground text-sm">
|
|
41
|
+
Your coding agent creates the components
|
|
42
|
+
</p>
|
|
43
|
+
</div>
|
|
44
|
+
<div className="rounded-xl border border-border bg-card p-6">
|
|
45
|
+
<Rocket className="text-primary mb-3 h-8 w-8" />
|
|
46
|
+
<h3 className="text-foreground mb-1 font-semibold">Present</h3>
|
|
47
|
+
<p className="text-muted-foreground text-sm">Press F to go fullscreen and present</p>
|
|
48
|
+
</div>
|
|
49
|
+
</AnimatedGroup>
|
|
50
|
+
</div>
|
|
51
|
+
</SlideLayoutCentered>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Presentation } from "lucide-react";
|
|
2
|
+
|
|
3
|
+
import type { SlideProps } from "promptslide";
|
|
4
|
+
import { SlideLayoutCentered } from "@/layouts/slide-layout-centered";
|
|
5
|
+
|
|
6
|
+
export function SlideTitle({ slideNumber, totalSlides }: SlideProps) {
|
|
7
|
+
return (
|
|
8
|
+
<SlideLayoutCentered slideNumber={slideNumber} totalSlides={totalSlides} hideFooter>
|
|
9
|
+
<div className="relative flex h-full w-full flex-col items-center justify-center text-center">
|
|
10
|
+
<Presentation className="text-primary mb-6 h-16 w-16" />
|
|
11
|
+
|
|
12
|
+
<h1 className="text-foreground max-w-5xl text-5xl font-bold tracking-tight md:text-7xl lg:text-8xl">
|
|
13
|
+
{"{{PROJECT_NAME}}"}
|
|
14
|
+
</h1>
|
|
15
|
+
|
|
16
|
+
<p className="text-muted-foreground mt-6 max-w-3xl text-xl font-light md:text-2xl">
|
|
17
|
+
A presentation built with PromptSlide
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<div className="text-muted-foreground mt-16 text-sm">
|
|
21
|
+
Press <kbd className="rounded bg-card px-2 py-0.5 font-mono text-xs">Space</kbd> or{" "}
|
|
22
|
+
<kbd className="rounded bg-card px-2 py-0.5 font-mono text-xs">→</kbd> to navigate
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</SlideLayoutCentered>
|
|
26
|
+
);
|
|
27
|
+
}
|