phosphor-ui 0.3.39-dev.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/LICENSE +21 -0
- package/README.md +267 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/styles/components.css +10743 -0
- package/dist/esm/ascii.d.ts +3 -0
- package/dist/esm/components/admin/AdminShell/AdminShell.d.ts +36 -0
- package/dist/esm/components/admin/AdminShell/index.d.ts +2 -0
- package/dist/esm/components/admin/ContentEditor/ContentEditor.d.ts +63 -0
- package/dist/esm/components/admin/ContentEditor/EditorShell.d.ts +15 -0
- package/dist/esm/components/admin/ContentEditor/PairListField.d.ts +11 -0
- package/dist/esm/components/admin/ContentEditor/RepeaterField.d.ts +16 -0
- package/dist/esm/components/admin/ContentEditor/StatusSelect.d.ts +7 -0
- package/dist/esm/components/admin/ContentEditor/TagInput.d.ts +11 -0
- package/dist/esm/components/admin/ContentEditor/index.d.ts +12 -0
- package/dist/esm/components/admin/CourseEditor/CourseEditor.d.ts +28 -0
- package/dist/esm/components/admin/CourseEditor/index.d.ts +2 -0
- package/dist/esm/components/admin/LessonEditor/LessonEditor.d.ts +27 -0
- package/dist/esm/components/admin/LessonEditor/index.d.ts +2 -0
- package/dist/esm/components/admin/NoteEditor/NoteEditor.d.ts +18 -0
- package/dist/esm/components/admin/NoteEditor/index.d.ts +2 -0
- package/dist/esm/components/admin/ProjectEditor/ProjectEditor.d.ts +26 -0
- package/dist/esm/components/admin/ProjectEditor/index.d.ts +2 -0
- package/dist/esm/components/admin/index.d.ts +6 -0
- package/dist/esm/components/atoms/Avatar/Avatar.d.ts +9 -0
- package/dist/esm/components/atoms/Avatar/index.d.ts +2 -0
- package/dist/esm/components/atoms/Badge/Badge.d.ts +9 -0
- package/dist/esm/components/atoms/Badge/index.d.ts +2 -0
- package/dist/esm/components/atoms/Button/Button.d.ts +23 -0
- package/dist/esm/components/atoms/Button/index.d.ts +2 -0
- package/dist/esm/components/atoms/Checkbox/Checkbox.d.ts +14 -0
- package/dist/esm/components/atoms/Checkbox/index.d.ts +2 -0
- package/dist/esm/components/atoms/DropdownMenu/DropdownMenu.d.ts +25 -0
- package/dist/esm/components/atoms/DropdownMenu/index.d.ts +2 -0
- package/dist/esm/components/atoms/Glyph/Glyph.d.ts +14 -0
- package/dist/esm/components/atoms/Glyph/index.d.ts +2 -0
- package/dist/esm/components/atoms/Headings/Headings.d.ts +17 -0
- package/dist/esm/components/atoms/Headings/index.d.ts +2 -0
- package/dist/esm/components/atoms/Hr/Hr.d.ts +2 -0
- package/dist/esm/components/atoms/Hr/index.d.ts +1 -0
- package/dist/esm/components/atoms/Input/Input.d.ts +41 -0
- package/dist/esm/components/atoms/Input/index.d.ts +2 -0
- package/dist/esm/components/atoms/Kbd/Kbd.d.ts +6 -0
- package/dist/esm/components/atoms/Kbd/index.d.ts +1 -0
- package/dist/esm/components/atoms/Link/Link.d.ts +7 -0
- package/dist/esm/components/atoms/Link/index.d.ts +2 -0
- package/dist/esm/components/atoms/ProgressBar/ProgressBar.d.ts +13 -0
- package/dist/esm/components/atoms/ProgressBar/index.d.ts +2 -0
- package/dist/esm/components/atoms/ReadingRail/ReadingRail.d.ts +5 -0
- package/dist/esm/components/atoms/ReadingRail/index.d.ts +1 -0
- package/dist/esm/components/atoms/StatPill/StatPill.d.ts +9 -0
- package/dist/esm/components/atoms/StatPill/index.d.ts +2 -0
- package/dist/esm/components/atoms/Tag/Tag.d.ts +18 -0
- package/dist/esm/components/atoms/Tag/index.d.ts +2 -0
- package/dist/esm/components/atoms/Text/Text.d.ts +18 -0
- package/dist/esm/components/atoms/Text/index.d.ts +2 -0
- package/dist/esm/components/atoms/index.d.ts +17 -0
- package/dist/esm/components/atoms/primitive.d.ts +7 -0
- package/dist/esm/components/content/ArticleList/ArticleList.d.ts +14 -0
- package/dist/esm/components/content/ArticleList/index.d.ts +1 -0
- package/dist/esm/components/content/CodeBlock/CodeBlock.d.ts +21 -0
- package/dist/esm/components/content/CodeBlock/index.d.ts +3 -0
- package/dist/esm/components/content/CodeBlock/phosphorTheme.d.ts +2 -0
- package/dist/esm/components/content/MdxComponents/MdxComponents.d.ts +16 -0
- package/dist/esm/components/content/MdxComponents/index.d.ts +2 -0
- package/dist/esm/components/content/PostFrontmatter/PostFrontmatter.d.ts +10 -0
- package/dist/esm/components/content/PostFrontmatter/index.d.ts +2 -0
- package/dist/esm/components/content/Prose/Prose.d.ts +7 -0
- package/dist/esm/components/content/Prose/index.d.ts +2 -0
- package/dist/esm/components/content/index.d.ts +6 -0
- package/dist/esm/components/index.d.ts +145 -0
- package/dist/esm/components/molecules/AuthorCard/AuthorCard.d.ts +13 -0
- package/dist/esm/components/molecules/AuthorCard/index.d.ts +2 -0
- package/dist/esm/components/molecules/Breadcrumbs/Breadcrumbs.d.ts +13 -0
- package/dist/esm/components/molecules/Breadcrumbs/index.d.ts +2 -0
- package/dist/esm/components/molecules/Callout/Callout.d.ts +13 -0
- package/dist/esm/components/molecules/Callout/index.d.ts +2 -0
- package/dist/esm/components/molecules/CheckboxField/index.d.ts +2 -0
- package/dist/esm/components/molecules/CourseCard/index.d.ts +2 -0
- package/dist/esm/components/molecules/EmptyState/EmptyState.d.ts +16 -0
- package/dist/esm/components/molecules/EmptyState/index.d.ts +2 -0
- package/dist/esm/components/molecules/FeatureList/FeatureList.d.ts +16 -0
- package/dist/esm/components/molecules/FeatureList/index.d.ts +2 -0
- package/dist/esm/components/molecules/Field/Field.d.ts +25 -0
- package/dist/esm/components/molecules/Field/index.d.ts +2 -0
- package/dist/esm/components/molecules/FormField/Form.d.ts +38 -0
- package/dist/esm/components/molecules/FormField/FormField.d.ts +17 -0
- package/dist/esm/components/molecules/FormField/index.d.ts +4 -0
- package/dist/esm/components/molecules/HeaderNav/HeaderNav.d.ts +14 -0
- package/dist/esm/components/molecules/HeaderNav/index.d.ts +2 -0
- package/dist/esm/components/molecules/InputField/index.d.ts +2 -0
- package/dist/esm/components/molecules/LessonRow/LessonRow.d.ts +18 -0
- package/dist/esm/components/molecules/LessonRow/index.d.ts +2 -0
- package/dist/esm/components/molecules/List/List.d.ts +22 -0
- package/dist/esm/components/molecules/List/index.d.ts +2 -0
- package/dist/esm/components/molecules/LocaleSwitch/LocaleSwitch.d.ts +17 -0
- package/dist/esm/components/molecules/LocaleSwitch/index.d.ts +2 -0
- package/dist/esm/components/molecules/Modal/Modal.d.ts +25 -0
- package/dist/esm/components/molecules/Modal/index.d.ts +2 -0
- package/dist/esm/components/molecules/Pagination/Pagination.d.ts +17 -0
- package/dist/esm/components/molecules/Pagination/index.d.ts +2 -0
- package/dist/esm/components/molecules/PostFrontmatter/index.d.ts +2 -0
- package/dist/esm/components/molecules/PostMeta/PostMeta.d.ts +14 -0
- package/dist/esm/components/molecules/PostMeta/index.d.ts +2 -0
- package/dist/esm/components/molecules/PrereqList/PrereqList.d.ts +14 -0
- package/dist/esm/components/molecules/PrereqList/index.d.ts +2 -0
- package/dist/esm/components/molecules/SearchResult/SearchResult.d.ts +23 -0
- package/dist/esm/components/molecules/SearchResult/index.d.ts +2 -0
- package/dist/esm/components/molecules/Select/Select.d.ts +23 -0
- package/dist/esm/components/molecules/Select/index.d.ts +2 -0
- package/dist/esm/components/molecules/SelectField/index.d.ts +2 -0
- package/dist/esm/components/molecules/ShareBar/ShareBar.d.ts +12 -0
- package/dist/esm/components/molecules/ShareBar/index.d.ts +2 -0
- package/dist/esm/components/molecules/Stepper/Stepper.d.ts +26 -0
- package/dist/esm/components/molecules/Stepper/index.d.ts +2 -0
- package/dist/esm/components/molecules/TableOfContents/TableOfContents.d.ts +23 -0
- package/dist/esm/components/molecules/TableOfContents/index.d.ts +2 -0
- package/dist/esm/components/molecules/Tabs/Tabs.d.ts +21 -0
- package/dist/esm/components/molecules/Tabs/index.d.ts +2 -0
- package/dist/esm/components/molecules/TextareaField/index.d.ts +2 -0
- package/dist/esm/components/molecules/Timeline/Timeline.d.ts +14 -0
- package/dist/esm/components/molecules/Timeline/index.d.ts +2 -0
- package/dist/esm/components/molecules/Toast/Toast.d.ts +18 -0
- package/dist/esm/components/molecules/Toast/index.d.ts +2 -0
- package/dist/esm/components/molecules/Tooltip/Tooltip.d.ts +10 -0
- package/dist/esm/components/molecules/Tooltip/index.d.ts +2 -0
- package/dist/esm/components/molecules/index.d.ts +27 -0
- package/dist/esm/components/organisms/AsciiBanner/AsciiBanner.d.ts +21 -0
- package/dist/esm/components/organisms/AsciiBanner/index.d.ts +2 -0
- package/dist/esm/components/organisms/CourseCard/CourseCard.d.ts +24 -0
- package/dist/esm/components/organisms/CourseCard/index.d.ts +2 -0
- package/dist/esm/components/organisms/CrtShell/CrtShell.d.ts +10 -0
- package/dist/esm/components/organisms/CrtShell/index.d.ts +2 -0
- package/dist/esm/components/organisms/Exercise/Exercise.d.ts +15 -0
- package/dist/esm/components/organisms/Exercise/index.d.ts +2 -0
- package/dist/esm/components/organisms/Footer/Footer.d.ts +19 -0
- package/dist/esm/components/organisms/Footer/index.d.ts +2 -0
- package/dist/esm/components/organisms/Glyphs/Glyphs.d.ts +11 -0
- package/dist/esm/components/organisms/Glyphs/index.d.ts +4 -0
- package/dist/esm/components/organisms/Header/Header.d.ts +35 -0
- package/dist/esm/components/organisms/Header/index.d.ts +2 -0
- package/dist/esm/components/organisms/HeaderNav/index.d.ts +2 -0
- package/dist/esm/components/organisms/HeroFrame/HeroFrame.d.ts +42 -0
- package/dist/esm/components/organisms/HeroFrame/index.d.ts +2 -0
- package/dist/esm/components/organisms/LoginForm/LoginForm.d.ts +16 -0
- package/dist/esm/components/organisms/LoginForm/index.d.ts +2 -0
- package/dist/esm/components/organisms/ModuleAccordion/ModuleAccordion.d.ts +24 -0
- package/dist/esm/components/organisms/ModuleAccordion/index.d.ts +2 -0
- package/dist/esm/components/organisms/NerdTree/NerdTree.d.ts +29 -0
- package/dist/esm/components/organisms/NerdTree/index.d.ts +2 -0
- package/dist/esm/components/organisms/PdaWindow/PdaWindow.d.ts +8 -0
- package/dist/esm/components/organisms/PdaWindow/index.d.ts +2 -0
- package/dist/esm/components/organisms/PostHeader/PostHeader.d.ts +19 -0
- package/dist/esm/components/organisms/PostHeader/index.d.ts +2 -0
- package/dist/esm/components/organisms/PostListing/PostListing.d.ts +30 -0
- package/dist/esm/components/organisms/PostListing/index.d.ts +2 -0
- package/dist/esm/components/organisms/RelatedPosts/RelatedPosts.d.ts +15 -0
- package/dist/esm/components/organisms/RelatedPosts/index.d.ts +2 -0
- package/dist/esm/components/organisms/Search/Search.d.ts +17 -0
- package/dist/esm/components/organisms/Search/index.d.ts +2 -0
- package/dist/esm/components/organisms/SeriesNav/SeriesNav.d.ts +14 -0
- package/dist/esm/components/organisms/SeriesNav/index.d.ts +2 -0
- package/dist/esm/components/organisms/VideoPlayer/VideoPlayer.d.ts +24 -0
- package/dist/esm/components/organisms/VideoPlayer/index.d.ts +2 -0
- package/dist/esm/components/organisms/index.d.ts +19 -0
- package/dist/esm/components/pages/Post/index.d.ts +2 -0
- package/dist/esm/components/pages/index.d.ts +1 -0
- package/dist/esm/components/presets/SiteShell/index.d.ts +2 -0
- package/dist/esm/components/presets/index.d.ts +1 -0
- package/dist/esm/components/templates/Layout/Layout.d.ts +1786 -0
- package/dist/esm/components/templates/Layout/index.d.ts +2 -0
- package/dist/esm/components/templates/MainframeLayout/MainframeLayout.d.ts +39 -0
- package/dist/esm/components/templates/MainframeLayout/index.d.ts +2 -0
- package/dist/esm/components/templates/PostTemplate/Post.d.ts +30 -0
- package/dist/esm/components/templates/PostTemplate/index.d.ts +2 -0
- package/dist/esm/components/templates/SiteShell/SiteShell.d.ts +26 -0
- package/dist/esm/components/templates/SiteShell/index.d.ts +2 -0
- package/dist/esm/components/templates/index.d.ts +4 -0
- package/dist/esm/foundations/animation/index.d.ts +16 -0
- package/dist/esm/foundations/effects/index.d.ts +9 -0
- package/dist/esm/foundations/glyphs/catalog.d.ts +103 -0
- package/dist/esm/foundations/glyphs/index.d.ts +2 -0
- package/dist/esm/foundations/index.d.ts +8 -0
- package/dist/esm/foundations/mdx/index.d.ts +3 -0
- package/dist/esm/foundations/syntax/index.d.ts +1 -0
- package/dist/esm/foundations/tokens/index.d.ts +32 -0
- package/dist/esm/foundations/typography/index.d.ts +8 -0
- package/dist/esm/foundations/typography/variants.d.ts +3 -0
- package/dist/esm/foundations/utils/index.d.ts +1 -0
- package/dist/esm/foundations/utils/slug.d.ts +1 -0
- package/dist/esm/hooks/index.d.ts +3 -0
- package/dist/esm/hooks/useHashRoute.d.ts +6 -0
- package/dist/esm/hooks/useReadingProgress.d.ts +4 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/styles/components.css +10743 -0
- package/dist/esm/utils/browser.d.ts +5 -0
- package/dist/esm/utils/classNames.d.ts +2 -0
- package/dist/styles/components.css +10743 -0
- package/dist/styles/fonts/bender/Bender-Black.woff +0 -0
- package/dist/styles/fonts/bender/Bender-BlackItalic.woff +0 -0
- package/dist/styles/fonts/bender/Bender-Bold.woff +0 -0
- package/dist/styles/fonts/bender/Bender-BoldItalic.woff +0 -0
- package/dist/styles/fonts/bender/Bender-Italic.woff +0 -0
- package/dist/styles/fonts/bender/Bender-Light.woff +0 -0
- package/dist/styles/fonts/bender/Bender-LightItalic.woff +0 -0
- package/dist/styles/fonts/bender/Bender.woff +0 -0
- package/dist/styles/fonts/vcr_osd_mono/VCR_OSD_MONO_1.001.ttf +0 -0
- package/dist/styles/fonts.css +73 -0
- package/dist/styles/global.css +486 -0
- package/dist/styles/phosphor.css +5 -0
- package/dist/styles/tokens.css +382 -0
- package/dist/styles/typography.css +193 -0
- package/package.json +145 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 sektant1
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<h1>phosphor-ui</h1>
|
|
3
|
+
|
|
4
|
+
<p>Single-channel green-phosphor React UI for personal wikis, blogs, digital gardens, project logs, and second brains.</p>
|
|
5
|
+
|
|
6
|
+
[](https://www.npmjs.com/package/phosphor-ui)
|
|
7
|
+
[](https://www.npmjs.com/package/phosphor-ui)
|
|
8
|
+
[](./LICENSE)
|
|
9
|
+
[](https://sektant1.github.io/phosphor)
|
|
10
|
+
[](https://www.typescriptlang.org)
|
|
11
|
+
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
<div align="center">
|
|
18
|
+
<img src="./assets/output.gif" alt="Hero frame and post listing" width="100%" />
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
## Install
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install phosphor-ui
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Peer deps: `react ^17 || ^18 || ^19`, `react-dom ^17 || ^18 || ^19`.
|
|
28
|
+
`@mdx-js/react ^2 || ^3` is optional for MDX applications, but the package root does not load it at module initialization.
|
|
29
|
+
|
|
30
|
+
## Setup
|
|
31
|
+
|
|
32
|
+
Import the full stylesheet once at your app root:
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
import "phosphor-ui/phosphor.css";
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
If you need finer control, import `tokens.css`, `global.css`, and `components.css` separately.
|
|
39
|
+
|
|
40
|
+
## Tokens
|
|
41
|
+
|
|
42
|
+
Use the `--pho-*` tokens for app-level customization. The older raw tokens
|
|
43
|
+
(`--phosphor`, `--bg`, `--magenta`, etc.) still work, but the semantic names are
|
|
44
|
+
the stable consumer API.
|
|
45
|
+
|
|
46
|
+
```css
|
|
47
|
+
:root {
|
|
48
|
+
--pho-color-background: #04140a;
|
|
49
|
+
--pho-color-primary: #2cff7a;
|
|
50
|
+
--pho-color-accent: #62ff9a;
|
|
51
|
+
--pho-size-prose: 72ch;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.noteShell {
|
|
55
|
+
max-width: var(--pho-size-prose);
|
|
56
|
+
color: var(--pho-color-text);
|
|
57
|
+
border: var(--pho-border-line);
|
|
58
|
+
box-shadow: var(--pho-glow-primary-soft);
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
For TypeScript tooling, token names are exported from the package:
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
import { PHOSPHOR_TOKEN_GROUPS, phosphorVar } from "phosphor-ui";
|
|
66
|
+
|
|
67
|
+
const linkColor = phosphorVar("--pho-color-link");
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Quick start
|
|
71
|
+
|
|
72
|
+
```tsx
|
|
73
|
+
import { SiteShell, Post, Callout } from "phosphor-ui";
|
|
74
|
+
import "phosphor-ui/phosphor.css";
|
|
75
|
+
|
|
76
|
+
export default function App() {
|
|
77
|
+
return (
|
|
78
|
+
<SiteShell
|
|
79
|
+
title="field notes"
|
|
80
|
+
tagline="personal wiki / project log"
|
|
81
|
+
nav={[
|
|
82
|
+
{ label: "notes", href: "/notes", active: true },
|
|
83
|
+
{ label: "projects", href: "/projects" },
|
|
84
|
+
]}
|
|
85
|
+
footerLinks={[{ label: "rss", href: "/rss.xml" }]}
|
|
86
|
+
>
|
|
87
|
+
<Post
|
|
88
|
+
title="Boot sequence"
|
|
89
|
+
headerProps={{
|
|
90
|
+
eyebrow: "log / systems",
|
|
91
|
+
meta: { date: "2026-05-09", readTime: "3 min", tags: ["wiki"] },
|
|
92
|
+
}}
|
|
93
|
+
>
|
|
94
|
+
<p>Use normal React or MDX content inside the post body.</p>
|
|
95
|
+
<Callout title="signal">
|
|
96
|
+
The shell includes a CRT frame, accessible skip link, header, content
|
|
97
|
+
region, and footer.
|
|
98
|
+
</Callout>
|
|
99
|
+
</Post>
|
|
100
|
+
</SiteShell>
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Import Model
|
|
106
|
+
|
|
107
|
+
Use the root package for application code:
|
|
108
|
+
|
|
109
|
+
```tsx
|
|
110
|
+
import { SiteShell, Post, Button, Callout, TableOfContents } from "phosphor-ui";
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
The physical folders are organized for maintainers. Consumers should prefer the stable root exports so components can move internally without breaking your site.
|
|
114
|
+
|
|
115
|
+
## Components
|
|
116
|
+
|
|
117
|
+
| Group | Components |
|
|
118
|
+
|---|---|
|
|
119
|
+
| **Presets** | `SiteShell` |
|
|
120
|
+
| **Layout** | `CrtShell` `Header` `Footer` `HeroFrame` `NerdTree` `PdaWindow` `Post` |
|
|
121
|
+
| **Content** | `Prose` `PostBody` `Callout` `CodeBlock` `Hr` `Tag` `Text` `AsciiBanner` `TerminalPrompt` |
|
|
122
|
+
| **Lists** | `PostListing` `PostRow` `CourseCard` `LessonRow` `ModuleAccordion` `PrereqList` `Exercise` |
|
|
123
|
+
| **Nav** | `Breadcrumbs` `Pagination` `SeriesNav` `Stepper` `TableOfContents` `Link` |
|
|
124
|
+
| **Form** | `Button` `Input` `Textarea` `Checkbox` `Select` `DropdownMenu` `Badge` |
|
|
125
|
+
| **Feedback** | `ProgressBar` `ReadingRail` `StatPill` `Toast` `Tooltip` `VideoPlayer` |
|
|
126
|
+
|
|
127
|
+
## Recipes
|
|
128
|
+
|
|
129
|
+
### Course cards
|
|
130
|
+
|
|
131
|
+
```tsx
|
|
132
|
+
<CourseCard
|
|
133
|
+
stamp="COURSE-01"
|
|
134
|
+
thumbSrc="/images/course-frame.png"
|
|
135
|
+
coverMeta="6 modules"
|
|
136
|
+
tag="entry"
|
|
137
|
+
title="Cold-boot operations"
|
|
138
|
+
progress={{ value: 4, total: 6 }}
|
|
139
|
+
cta={{ label: "resume", href: "/courses/cold-boot" }}
|
|
140
|
+
/>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
For a compact text-only card, remove the cover column:
|
|
144
|
+
|
|
145
|
+
```tsx
|
|
146
|
+
<CourseCard showCover={false} title="Reference index" cta={{ label: "open", href: "/ref" }} />
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Admin editors
|
|
150
|
+
|
|
151
|
+
```tsx
|
|
152
|
+
<ContentEditor
|
|
153
|
+
kindLabel="POST"
|
|
154
|
+
autoSlug={{ from: "title", to: "slug" }}
|
|
155
|
+
fields={[
|
|
156
|
+
{ kind: "text", key: "title", label: "TITLE" },
|
|
157
|
+
{ kind: "textarea", key: "body", label: "BODY", rows: 12 },
|
|
158
|
+
{ kind: "tags", key: "tags", label: "TAGS" },
|
|
159
|
+
]}
|
|
160
|
+
/>
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## Personal Site Pattern
|
|
164
|
+
|
|
165
|
+
For blogs, digital gardens, and second brains, start with `SiteShell` and add pages with `Post`:
|
|
166
|
+
|
|
167
|
+
```tsx
|
|
168
|
+
<SiteShell title="notes" nav={navItems}>
|
|
169
|
+
<Post title="Now page" sidebar={<TableOfContents items={toc} />}>
|
|
170
|
+
<NowPageMdx />
|
|
171
|
+
</Post>
|
|
172
|
+
</SiteShell>
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Reach for lower-level components when you need custom app structure:
|
|
176
|
+
|
|
177
|
+
```tsx
|
|
178
|
+
<CrtShell>
|
|
179
|
+
<Header title="lab" />
|
|
180
|
+
<main>
|
|
181
|
+
<NerdTree nodes={nodes} />
|
|
182
|
+
<Prose>{children}</Prose>
|
|
183
|
+
</main>
|
|
184
|
+
<Footer brand="lab" />
|
|
185
|
+
</CrtShell>
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## MDX posts
|
|
189
|
+
|
|
190
|
+
```tsx
|
|
191
|
+
import { PostBody } from "phosphor-ui";
|
|
192
|
+
import PostMdx from "./posts/boot.mdx";
|
|
193
|
+
|
|
194
|
+
<PostBody>
|
|
195
|
+
<PostMdx />
|
|
196
|
+
</PostBody>
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
`PostBody` wraps content in `<Prose>`. Use `mdxComponents` with your MDX provider/compiler to map native MDX tags (`h1-h6`, `pre`, `blockquote`, `img`, `hr`, `a`) to phosphor components. Fenced code blocks render via `<CodeBlock>` with Shiki syntax highlighting.
|
|
200
|
+
|
|
201
|
+
## Hooks
|
|
202
|
+
|
|
203
|
+
```ts
|
|
204
|
+
import { useReadingProgress, useHashRoute } from "phosphor-ui";
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
- **`useReadingProgress<T>()`** → `{ ref, pct }` — tracks element scroll percentage, pair with `<ReadingRail value={pct} />`
|
|
208
|
+
- **`useHashRoute({ routes, fallback })`** → `[route, go]` — hash-based router with regex/predicate matchers
|
|
209
|
+
|
|
210
|
+
## Animation utilities
|
|
211
|
+
|
|
212
|
+
Included in `global.css`:
|
|
213
|
+
|
|
214
|
+
| Class | Effect |
|
|
215
|
+
|---|---|
|
|
216
|
+
| `.pho-page-enter` | CRT blur + brightness fade-in |
|
|
217
|
+
| `.pho-fade-up` | translate + opacity fade |
|
|
218
|
+
| `.pho-stagger > *` | auto-staggered children (40–520ms) |
|
|
219
|
+
| `.pho-flicker-in` | multi-step CRT flicker |
|
|
220
|
+
| `.pho-blink::after` | phosphor block cursor |
|
|
221
|
+
|
|
222
|
+
All respect `prefers-reduced-motion`.
|
|
223
|
+
|
|
224
|
+
## Develop
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
npm install
|
|
228
|
+
npm run storybook # http://localhost:6006
|
|
229
|
+
npm run typecheck
|
|
230
|
+
npm run build # rollup → dist/
|
|
231
|
+
npm run build-storybook # static → storybook-static/
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
## Release checks
|
|
235
|
+
|
|
236
|
+
Before publishing a stable release, run the package validation flow:
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
npm run validate:package
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
This runs TypeScript checks, public API export checks, story source audits, Jest,
|
|
243
|
+
the library build, and a package smoke test against the generated `dist/`
|
|
244
|
+
artifacts. For public API changes, refresh the checked-in declaration snapshot:
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
npm run build:types:snapshot
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
The supported consumer API is the root import plus the documented CSS subpaths.
|
|
251
|
+
Deep component imports are internal implementation details.
|
|
252
|
+
|
|
253
|
+
## CI/CD
|
|
254
|
+
|
|
255
|
+
The GitHub Actions setup uses `dev` and `prod` as long-lived branches:
|
|
256
|
+
|
|
257
|
+
- `dev` validates the package and publishes prereleases to npm with the `next`
|
|
258
|
+
dist-tag.
|
|
259
|
+
- `prod` validates the package, publishes the stable npm package with the
|
|
260
|
+
`latest` dist-tag, and deploys Storybook to GitHub Pages.
|
|
261
|
+
|
|
262
|
+
See [docs/branching-and-deploy.md](./docs/branching-and-deploy.md) for branch
|
|
263
|
+
setup, required secrets, environments, and release behavior.
|
|
264
|
+
|
|
265
|
+
## License
|
|
266
|
+
|
|
267
|
+
MIT © [sektant1](https://github.com/sektant1)
|