Skip to content

Commit b9032ca

Browse files
cjpillsburyclaudedecepulis
authored
docs: initial component examples (#123)
Co-authored-by: Claude <[email protected]> Co-authored-by: Darius Cepulis <[email protected]>
1 parent 77182f1 commit b9032ca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1891
-54
lines changed

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

website/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,22 +94,22 @@ See [content.config.ts](src/content.config.ts) for the blog collection definitio
9494
The most sophisticated part of the website is the documentation system, which adapts content based on:
9595

9696
- **Framework** (HTML, React)
97-
- **Styling approach** (CSS, Tailwind)
97+
- **Styling approach** (CSS, more coming soon)
9898

9999
##### URL Structure
100100

101101
```text
102102
/docs/framework/{framework}/style/{style}/{slug}/
103103
```
104104

105-
Example: `/docs/framework/react/style/tailwind/concepts/state-management/`
105+
Example: `/docs/framework/react/style/css/concepts/state-management/`
106106

107107
##### Framework/Style Matrix
108108

109109
| Framework | Available Styles |
110110
| --------- | ---------------- |
111-
| HTML | css, tailwind |
112-
| React | css, tailwind |
111+
| HTML | css |
112+
| React | css |
113113

114114
##### Content Filtering
115115

website/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"@base-ui-components/react": "1.0.0-beta.4",
2222
"@nanostores/react": "^1.0.0",
2323
"@tailwindcss/vite": "^4.1.14",
24+
"@videojs/html": "workspace:*",
2425
"@videojs/react": "workspace:*",
2526
"astro": "^5.14.4",
2627
"clsx": "^2.1.1",
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
import type { ComponentProps } from 'astro/types';
3+
import { Code } from 'astro:components';
4+
import Pre from './typography/Pre.astro';
5+
import { twMerge } from 'tailwind-merge';
6+
7+
interface Props extends Omit<ComponentProps<typeof Code>, 'class'> {
8+
maxWidth?: ComponentProps<typeof Pre>['maxWidth'];
9+
wrapperClass?: ComponentProps<typeof Pre>['class'];
10+
codeClass?: ComponentProps<typeof Code>['class'];
11+
}
12+
13+
const { code, lang, maxWidth = true, themes, wrapperClass, codeClass, style, ...codeProps } = Astro.props;
14+
---
15+
16+
<Pre as="div" maxWidth={maxWidth} class={wrapperClass}>
17+
<Code
18+
code={code}
19+
lang={lang}
20+
themes={themes ?? {
21+
light: 'gruvbox-light-hard',
22+
dark: 'gruvbox-dark-medium',
23+
}}
24+
class={twMerge('font-mono text-code', codeClass)}
25+
style={style ? `${style};` : '' + 'overflow-x:visible!important;background:none!important'}
26+
{...codeProps}
27+
/>
28+
</Pre>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
// Simple container component for constraining content width in documentation
3+
---
4+
5+
<div class="w-full max-w-3xl mx-auto">
6+
<slot />
7+
</div>
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
// video.js 8
22
export const PLAYBACK_ID = 'UZMwOY6MgmhFNXLbSFXAuPKlRPss5XNA';
33
export const THUMB_TIME = 0;
4-
// player.style
5-
// export const PLAYBACK_ID = 'fXNzVtmtWuyz00xnSrJg4OJH6PyNo6D02UzmgeKGkP5YQ';

website/src/components/typography/Pre.astro

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ const { as: Tag = 'pre', maxWidth = true, class: className, style: _style, ...pr
1414
<div class={twMerge(clsx('relative my-6 group', maxWidth && 'max-w-3xl mx-auto'))}>
1515
<Tag
1616
class={twMerge(
17-
'rounded-lg p-6 overflow-x-auto overflow-y-scroll max-h-96 border border-light-40 dark:border-dark-80 bg-light-100 dark:bg-dark-110',
17+
'rounded-lg p-6 overflow-scroll max-h-96 border border-light-40 dark:border-dark-80 bg-light-100 dark:bg-dark-110',
1818
className,
1919
)}
20-
{...props}
20+
{/* weird formatting to prevent leading whitespace */}
21+
{...props}><slot /></Tag
2122
>
22-
<slot />
23-
</Tag>
2423
</div>

website/src/config/docs/sidebar.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,17 @@ import type { Sidebar } from '@/types/docs';
22

33
export const sidebar: Sidebar = [
44
{ sidebarLabel: 'Writing guides', slug: 'how-to/write-guides', devOnly: true },
5-
{ slug: 'concepts/coming-soon' },
5+
{ sidebarLabel: 'Getting started', contents: [{ slug: 'concepts/under-construction' }] },
6+
{
7+
sidebarLabel: 'Components',
8+
contents: [
9+
{ slug: 'resources/play-button' },
10+
{ slug: 'resources/mute-button' },
11+
{ slug: 'resources/fullscreen-button' },
12+
{ slug: 'resources/time-slider' },
13+
{ slug: 'resources/volume-slider' },
14+
],
15+
},
616
// {
717
// sidebarLabel: 'Getting started',
818
// contents: [

website/src/content.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { file } from 'astro/loaders';
22
import { defineCollection, reference, z } from 'astro:content';
3+
import { SUPPORTED_FRAMEWORKS } from './types/docs';
34
import { defaultGitService } from './utils/gitService';
45
import { globWithParser } from './utils/globWithParser';
56

@@ -80,6 +81,7 @@ const docs = defineCollection({
8081
title: z.string(),
8182
description: z.string(),
8283
updatedDate: z.coerce.date().optional(),
84+
frameworkTitle: z.record(z.enum(SUPPORTED_FRAMEWORKS as [string, ...string[]]), z.string()).optional(),
8385
}),
8486
});
8587

website/src/content/docs/concepts/coming-soon.mdx

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)