@honeydeck/honeydeck 0.1.2 → 0.3.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.
@@ -1,207 +0,0 @@
1
- # Kit Authoring
2
-
3
- Guide for building reusable Honeydeck kits (themes, layouts, components).
4
-
5
- ## Type Exports
6
-
7
- All types for kit authors come from the `'honeydeck'` package:
8
-
9
- ```ts
10
- import type { LayoutProps, LayoutMap, LayoutDemo } from '@honeydeck/honeydeck'
11
- ```
12
-
13
- | Type | Purpose |
14
- |------|---------|
15
- | `LayoutProps<F>` | Props passed to layout components (generic for frontmatter) |
16
- | `LayoutMap` | `Record<string, ComponentType<LayoutProps<any>>>` |
17
- | `LayoutDemo<F>` | Demo data for the docs reference page |
18
-
19
- ## Layout Map
20
-
21
- The `layouts:` frontmatter resolves to a module that default-exports a `LayoutMap`:
22
-
23
- ```ts
24
- import type { LayoutMap } from '@honeydeck/honeydeck'
25
- import { BlankLayout } from './Blank'
26
- import { DefaultLayout } from './Default'
27
- import { CoverLayout } from './Cover'
28
- import { SectionLayout } from './Section'
29
- import { TwoColLayout } from './TwoCol'
30
- import { ImageLayout } from './Image'
31
- import { ImageLeftLayout } from './ImageLeft'
32
- import { ImageRightLayout } from './ImageRight'
33
-
34
- export default {
35
- Blank: BlankLayout,
36
- Default: DefaultLayout,
37
- Cover: CoverLayout,
38
- Section: SectionLayout,
39
- TwoCol: TwoColLayout,
40
- Image: ImageLayout,
41
- ImageLeft: ImageLeftLayout,
42
- ImageRight: ImageRightLayout,
43
- } satisfies LayoutMap
44
- ```
45
-
46
- ## Layout Props
47
-
48
- `LayoutProps` is generic so layouts can type their accepted frontmatter:
49
-
50
- ```ts
51
- type LayoutProps<F extends Record<string, unknown> = Record<string, unknown>> = {
52
- title: ReactNode | null // extracted first h1 content
53
- children: ReactNode // remaining content (h1 removed)
54
- rawChildren: ReactNode // full unmodified content (h1 included)
55
- frontmatter: F
56
- }
57
- ```
58
-
59
- Example typed layout:
60
-
61
- ```tsx
62
- import type { LayoutProps } from '@honeydeck/honeydeck'
63
-
64
- type CoverFrontmatter = {
65
- author?: string
66
- date?: string
67
- }
68
-
69
- export function CoverLayout({ title, children, frontmatter }: LayoutProps<CoverFrontmatter>) {
70
- const { author, date } = frontmatter
71
- return (/* ... */)
72
- }
73
- ```
74
-
75
- This enables a future language server to extract frontmatter types for autocomplete.
76
-
77
- ## Image Helpers
78
-
79
- Custom layouts can import `ColorModeImage` from `honeydeck` to render optional light/dark image variants with Honeydeck's Tailwind color-mode utilities:
80
-
81
- ```tsx
82
- import { ColorModeImage } from '@honeydeck/honeydeck'
83
-
84
- <ColorModeImage src={image} darkSrc={darkImage} alt={alt} />
85
- ```
86
-
87
- ## Layout Demos
88
-
89
- Layouts optionally export a `demo` constant for the docs reference page:
90
-
91
- ```tsx
92
- import type { LayoutProps, LayoutDemo } from '@honeydeck/honeydeck'
93
-
94
- type CoverFrontmatter = {
95
- /** Speaker or organization shown below the title. */
96
- author?: string
97
- }
98
-
99
- export function CoverLayout({ title, children, frontmatter }: LayoutProps<CoverFrontmatter>) {
100
- const { author } = frontmatter
101
- return (/* ... */)
102
- }
103
-
104
- export const demo: LayoutDemo<CoverFrontmatter> = {
105
- mdx: `---
106
- layout: Cover
107
- author: Hendrik
108
- ---
109
-
110
- # Welcome to My Talk
111
-
112
- Building the future of presentations.`,
113
- }
114
- ```
115
-
116
- `mdx` is the single source for both the live visual preview and the copyable usage snippet. Honeydeck compiles it with the slide MDX pipeline, extracts frontmatter/title/steps, and renders it through the active layout map.
117
-
118
- If no static `demo.mdx` is exported, the layout still appears in `/#/layouts` with a “No demo MDX provided” hint.
119
-
120
- ## Slot Components
121
-
122
- Layouts that need content slots (like `TwoCol`) export slot components alongside the layout:
123
-
124
- ```tsx
125
- // layouts/TwoCol.tsx
126
- import type { LayoutProps } from '@honeydeck/honeydeck'
127
- import type { ReactNode } from 'react'
128
-
129
- export function Left({ children }: { children: ReactNode }) { /* ... */ }
130
- export function Right({ children }: { children: ReactNode }) { /* ... */ }
131
-
132
- export default function TwoColLayout({ title, children }: LayoutProps) {
133
- return (/* ... */)
134
- }
135
- ```
136
-
137
- Users import slots from the layout path:
138
-
139
- ```mdx
140
- import { Left, Right } from '@honeydeck/honeydeck/layouts/TwoCol'
141
- import { Left, Right } from '@company/honeydeck-kit-brand/layouts/TwoCol'
142
- ```
143
-
144
- ## Runtime Reference
145
-
146
- Honeydeck includes built-in runtime reference pages in dev and production builds:
147
-
148
- - **Theme tab (`/#/theme`):** All `--honeydeck-*` CSS tokens with computed values and descriptions.
149
- - **Layouts tab (`/#/layouts`):** All layouts currently available in the active deck layout map, live visual previews rendered from `demo.mdx`, copyable usage snippets from the same MDX source, and prop docs extracted from `LayoutProps<Frontmatter>` field comments.
150
- - **Components tab (`/#/components`):** Public built-in components exported from `@honeydeck/honeydeck/components`, generated documentation from exported component JSDoc comments interpreted as Markdown/MDX, side navigation, and params tables extracted from exported props types.
151
-
152
- Package Markdown guides are published through the Honeydeck docs site rather than rendered as in-deck pages.
153
-
154
- Token descriptions are extracted from CSS comments preceding `--honeydeck-*` declarations at build time.
155
-
156
- ## Dependency Policy
157
-
158
- - `honeydeck` and kits declare `react` and `react-dom` as `peerDependencies`.
159
- - Kits may declare compatible `honeydeck` versions via `peerDependencies`.
160
- - Kits using Tailwind declare compatible Tailwind versions as peer dependencies.
161
- - Generated slide projects install concrete dependency versions.
162
-
163
- ## Design Tokens
164
-
165
- Themes provide CSS custom properties. Colors derive from a primary using `oklch` relative color syntax, with separate values for light and dark modes:
166
-
167
- ```css
168
- [data-honeydeck-color-mode="light"] {
169
- --honeydeck-primary: oklch(50% 0.2 250);
170
- --honeydeck-background: oklch(from var(--honeydeck-primary) 98% 0.01 h);
171
- --honeydeck-foreground: oklch(from var(--honeydeck-primary) 15% 0.02 h);
172
- --honeydeck-surface: oklch(from var(--honeydeck-primary) 94% 0.02 h);
173
- /* ... */
174
- }
175
- ```
176
-
177
- Full token list:
178
-
179
- | Token | Purpose |
180
- |-------|---------|
181
- | `--honeydeck-primary` | Brand color for this mode |
182
- | `--honeydeck-primary-foreground` | Text on primary backgrounds |
183
- | `--honeydeck-background` | Main slide background |
184
- | `--honeydeck-foreground` | Main text color |
185
- | `--honeydeck-surface` | Cards, code blocks, callouts |
186
- | `--honeydeck-surface-foreground` | Text on surfaces |
187
- | `--honeydeck-border` | Border/divider color |
188
- | `--honeydeck-accent` | Accent, computed as complementary by default |
189
- | `--honeydeck-accent-foreground` | Text on accent backgrounds |
190
- | `--honeydeck-link-color` | Link color (default: inherit) |
191
- | `--honeydeck-border-radius` | Default border radius |
192
- | `--honeydeck-font-heading` | Heading font family |
193
- | `--honeydeck-font-body` | Body font family |
194
- | `--honeydeck-font-mono` | Monospace font family |
195
- | `--honeydeck-font-base` | Base font size (default: 16px) |
196
- | `--honeydeck-font-scale` | Heading scale factor (default: 1.25) |
197
- | `--honeydeck-code-line-dim-opacity` | Dim opacity for non-highlighted code lines |
198
-
199
- ## Tailwind Mapping
200
-
201
- All tokens are mapped to Tailwind utilities:
202
-
203
- ```mdx
204
- <div className="bg-surface text-surface-foreground border border-border rounded-honeydeck">
205
- Card content
206
- </div>
207
- ```
package/docs/kits.md DELETED
@@ -1,387 +0,0 @@
1
- # Customization - Kits
2
-
3
- Honeydeck works out of the box with sensible defaults. Customize progressively — override a color, swap a layout, or adopt a full kit from npm.
4
-
5
- ## Zero Config
6
-
7
- A plain deck needs no imports or configuration:
8
-
9
- ```mdx
10
- # Hello world
11
-
12
- This just works with built-in styling.
13
- ```
14
-
15
- Honeydeck automatically loads base CSS with default design tokens and the built-in layout set.
16
-
17
- ## Customizing Colors & Typography
18
-
19
- Import a CSS file to override design tokens. The cascade does the rest:
20
-
21
- ```mdx
22
- import './my-theme.css'
23
-
24
- # Now with my brand colors
25
- ```
26
-
27
- ```css
28
- /* my-theme.css */
29
- :root {
30
- --honeydeck-primary: oklch(55% 0.25 280);
31
- --honeydeck-font-heading: 'Playfair Display', serif;
32
- --honeydeck-border-radius: 1rem;
33
- }
34
- ```
35
-
36
- You only override what you want — everything else keeps its default. Both light and dark modes can be targeted:
37
-
38
- ```css
39
- [data-honeydeck-color-mode="light"] {
40
- --honeydeck-primary: oklch(50% 0.2 250);
41
- }
42
-
43
- [data-honeydeck-color-mode="dark"] {
44
- --honeydeck-primary: oklch(70% 0.2 250);
45
- }
46
- ```
47
-
48
- ### Available Tokens
49
-
50
- | Token | Purpose |
51
- |-------|---------|
52
- | `--honeydeck-primary` | Brand color (per mode) |
53
- | `--honeydeck-background` | Slide background |
54
- | `--honeydeck-foreground` | Main text color |
55
- | `--honeydeck-surface` | Cards, code blocks, callouts |
56
- | `--honeydeck-border` | Border/divider color |
57
- | `--honeydeck-accent` | Accent, computed as complementary by default |
58
- | `--honeydeck-font-heading` | Heading font family |
59
- | `--honeydeck-font-body` | Body font family |
60
- | `--honeydeck-font-mono` | Monospace font family |
61
- | `--honeydeck-font-base` | Base font size (default: 16px) |
62
- | `--honeydeck-font-scale` | Heading scale factor (default: 1.25) |
63
- | `--honeydeck-border-radius` | Default border radius |
64
- | `--honeydeck-code-line-dim-opacity` | Dim for non-highlighted code lines |
65
-
66
- → Full token reference in [Kit Authoring](kit-authoring.md#design-tokens)
67
-
68
- ### Bundled Themes
69
-
70
- Honeydeck defaults to a clean black, white, and grey theme:
71
-
72
- ```css
73
- @import "tailwindcss";
74
- @import "@honeydeck/honeydeck/theme.css";
75
- ```
76
-
77
- `@honeydeck/honeydeck/themes/clean.css` is available as an optional clean theme layer when you want to name that layer directly.
78
-
79
- Honeydeck also includes a Bee theme that can be layered on top of the base theme:
80
-
81
- ```css
82
- @import "tailwindcss";
83
- @import "@honeydeck/honeydeck/theme.css";
84
- @import "@honeydeck/honeydeck/themes/bee.css";
85
- ```
86
-
87
- ### Bundled Layout Sets
88
-
89
- The default layout set is clean and minimal:
90
-
91
- ```yaml
92
- ---
93
- layouts: "@honeydeck/honeydeck/layouts"
94
- ---
95
- ```
96
-
97
- The same clean set is also available through the named clean kit import path `@honeydeck/honeydeck/layouts/clean`.
98
-
99
- Use the Bee layout set with the Bee theme when you want the original playful Bee look:
100
-
101
- ```yaml
102
- ---
103
- layouts: "@honeydeck/honeydeck/layouts/bee"
104
- ---
105
- ```
106
-
107
- For two-column slides, import slots from the matching layout set:
108
-
109
- ```mdx
110
- // Clean default
111
- import { Left, Right } from '@honeydeck/honeydeck/layouts/TwoCol'
112
- ```
113
-
114
- ```mdx
115
- // Bee layout set
116
- import { Left, Right } from '@honeydeck/honeydeck/layouts/bee/TwoCol'
117
- ```
118
-
119
- ### Using Tailwind
120
-
121
- Tokens are mapped to Tailwind utilities, so you can use them inline:
122
-
123
- ```mdx
124
- <div className="bg-surface text-surface-foreground border border-border rounded-honeydeck">
125
- Styled with theme tokens
126
- </div>
127
- ```
128
-
129
- ## Using Layouts
130
-
131
- in your decks frontmatter, configure which layouts to use:
132
-
133
- ```yaml
134
- ---
135
- layouts: "awsome-kit/layouts"
136
- ---
137
- ```
138
-
139
- Select a layout in slide frontmatter:
140
-
141
- ```yaml
142
- ---
143
- layout: Section
144
- ---
145
-
146
- # Big Idea
147
- ```
148
-
149
- If no `layout:` is specified, `Default` is used. Layout names are PascalCase.
150
-
151
- ### Built-in Layouts
152
-
153
- | Layout | Description |
154
- |--------|-------------|
155
- | `Blank` | Empty slide with only children |
156
- | `Default` | Title top-left, body flows below |
157
- | `Section` | Big centered heading for section breaks |
158
- | `Cover` | Opening/closing slide (title, body, author) |
159
- | `TwoCol` | Two equal columns |
160
- | `Image` | Prominent image with optional title and children |
161
- | `ImageLeft` | Prominent left image with title and body on the right |
162
- | `ImageRight` | Prominent right image with title and body on the left |
163
-
164
- ### Passing Props to Layouts
165
-
166
- Layouts receive extra frontmatter fields as props; Cover body copy belongs in the slide content:
167
-
168
- ```mdx
169
- ---
170
- layout: Cover
171
- author: You_Name_Here
172
- ---
173
-
174
- # Honeydeck
175
-
176
- A modern slide framework.
177
- ```
178
-
179
- ### Two-Column Layout
180
-
181
- `TwoCol` uses slot components you import:
182
-
183
- ```mdx
184
- ---
185
- layout: TwoCol
186
- ---
187
-
188
- import { Left, Right } from '@honeydeck/honeydeck/layouts/TwoCol'
189
-
190
- <Left>
191
- ## Benefits
192
- - Fast iteration
193
- - Live reload
194
- </Left>
195
-
196
- <Right>
197
- ## Trade-offs
198
- - Requires Node.js
199
- </Right>
200
- ```
201
-
202
- ### Image Layout
203
-
204
- Displays a specified image large and prominent:
205
-
206
- ```yaml
207
- ---
208
- layout: Image
209
- image: /diagrams/architecture.png
210
- darkImage: /diagrams/architecture-dark.png
211
- ---
212
-
213
- # System Architecture
214
-
215
- Our distributed system.
216
- ```
217
-
218
- ### Side Image Layouts
219
-
220
- `ImageLeft` and `ImageRight` place the image beside the content while using the same `image`, `darkImage`, and `alt` frontmatter as `Image`:
221
-
222
- ```yaml
223
- ---
224
- layout: ImageRight
225
- image: /photos/launch.jpg
226
- darkImage: /photos/launch-dark.jpg
227
- alt: Launch moment
228
- ---
229
-
230
- # Launch Moment
231
-
232
- Supporting context sits beside the image.
233
- ```
234
-
235
- ## Creating Custom Layouts
236
-
237
- Custom layouts are React components you import and wrap content with:
238
-
239
- ```tsx
240
- // components/GradientLayout.tsx
241
- import type { ReactNode } from 'react'
242
-
243
- export function GradientLayout({ children }: { children: ReactNode }) {
244
- return (
245
- <div className="grid place-items-center h-full bg-gradient-to-br from-purple-900 to-indigo-900 text-white p-12">
246
- {children}
247
- </div>
248
- )
249
- }
250
- ```
251
-
252
- Use it in MDX:
253
-
254
- ```mdx
255
- ---
256
-
257
- import { GradientLayout } from './components/GradientLayout'
258
-
259
- <GradientLayout>
260
- # Special Slide
261
-
262
- With a custom gradient background.
263
- </GradientLayout>
264
-
265
- ---
266
- ```
267
-
268
- Built-in placeholder images are available as URL exports for custom image layouts:
269
-
270
- ```ts
271
- import {
272
- imagePlaceholder,
273
- imagePlaceholderDark,
274
- verticalImagePlaceholder,
275
- verticalImagePlaceholderDark,
276
- } from '@honeydeck/honeydeck/layouts/placeholders'
277
- ```
278
-
279
- Use `ColorModeImage` when a custom layout accepts separate light and dark image URLs:
280
-
281
- ```tsx
282
- import { ColorModeImage } from '@honeydeck/honeydeck'
283
-
284
- <ColorModeImage src={image} darkSrc={darkImage} alt={alt} />
285
- ```
286
-
287
- ### Creating a Reusable Layout Set
288
-
289
- For a set of layouts you want to reuse across slides or decks, create a layout map:
290
-
291
- ```ts
292
- // layouts/index.ts
293
- import defaultLayouts from '@honeydeck/honeydeck/layouts'
294
- import HeroLayout from './Hero'
295
-
296
- export default {
297
- ...defaultLayouts,
298
- Hero: HeroLayout,
299
- }
300
- ```
301
-
302
- Layouts can export a colocated demo for `/#/layouts`:
303
-
304
- ```tsx
305
- // layouts/Hero.tsx
306
- import type { LayoutDemo, LayoutProps } from '@honeydeck/honeydeck/types'
307
-
308
- export default function HeroLayout({ title, children }: LayoutProps) {
309
- return (/* ... */)
310
- }
311
-
312
- export const demo: LayoutDemo = {
313
- mdx: `---
314
- layout: Hero
315
- ---
316
-
317
- # Hero Moment
318
-
319
- This snippet and preview come from the same demo.`,
320
- }
321
- ```
322
-
323
- Reference it in deck frontmatter:
324
-
325
- ```yaml
326
- ---
327
- layouts: "./layouts"
328
- ---
329
- ```
330
-
331
- Now you can use `layout: Hero` in any slide. The docs reference lists every layout in the active map, even if no slide currently uses it.
332
-
333
- ## Using Third-Party Kits
334
-
335
- A **kit** is an npm package that bundles theme CSS, layouts, and/or components. You reference each part individually:
336
-
337
- ```yaml
338
- ---
339
- layouts: "@company/honeydeck-kit-brand/layouts"
340
- ---
341
- ```
342
-
343
- ```mdx
344
- import '@company/honeydeck-kit-brand/theme.css'
345
- import { Callout } from '@company/honeydeck-kit-brand/components'
346
-
347
- # Hello
348
-
349
- <Callout>Important!</Callout>
350
- ```
351
-
352
- ### Mix and Match
353
-
354
- Since each concern is an explicit reference, mix freely:
355
-
356
- ```yaml
357
- ---
358
- layouts: "@company/honeydeck-kit-brand/layouts"
359
- ---
360
- ```
361
-
362
- ```mdx
363
- import '@other/honeydeck-kit-minimal/theme.css'
364
- import { Callout } from '@company/honeydeck-kit-brand/components'
365
- ```
366
-
367
- Use layouts from one kit, colors from another, components from a third.
368
-
369
- ### Extending a Kit's Theme
370
-
371
- Layer your overrides on top of a kit's CSS:
372
-
373
- ```css
374
- /* my-overrides.css */
375
- @import '@company/honeydeck-kit-brand/theme.css';
376
-
377
- :root {
378
- --honeydeck-primary: oklch(50% 0.2 300);
379
- --honeydeck-font-heading: 'My Font', sans-serif;
380
- }
381
- ```
382
-
383
- ```mdx
384
- import './my-overrides.css'
385
- ```
386
-
387
- → Building your own kit? See [Kit Authoring](kit-authoring.md)