@nanisoft/prism-llms 0.4.0 → 0.5.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/README.md +88 -0
- package/THIRD-PARTY-NOTICES.md +48 -0
- package/dist/data.json +3996 -387
- package/dist/demo-graph.d.ts +21 -12
- package/dist/demo-graph.js +37 -21
- package/dist/extractor.d.ts +24 -17
- package/dist/extractor.js +269 -153
- package/dist/index.d.ts +12 -7
- package/dist/index.js +9 -7
- package/dist/llms-full.txt +7968 -2013
- package/dist/llms.txt +97 -93
- package/dist/markdown.d.ts +69 -23
- package/dist/markdown.js +131 -72
- package/dist/md/blocks/app-shell-01.md +135 -0
- package/dist/md/blocks/auth-form-01.md +135 -0
- package/dist/md/blocks/cta-01.md +88 -0
- package/dist/md/blocks/data-table-01.md +196 -0
- package/dist/md/blocks/feature-grid-01.md +92 -0
- package/dist/md/blocks/hero-01.md +90 -0
- package/dist/md/blocks/instrument-panel-01.md +109 -0
- package/dist/md/blocks/logo-strip-01.md +97 -0
- package/dist/md/blocks/note-grid-01.md +102 -0
- package/dist/md/blocks/page-header-01.md +97 -0
- package/dist/md/blocks/pricing-01.md +91 -0
- package/dist/md/blocks/process-rail-01.md +106 -0
- package/dist/md/blocks/product-grid-01.md +113 -0
- package/dist/md/blocks/settings-panel-01.md +148 -0
- package/dist/md/blocks/site-footer.md +103 -11
- package/dist/md/blocks/site-header.md +111 -11
- package/dist/md/blocks/stack-grid-01.md +108 -0
- package/dist/md/blocks/stats-01.md +89 -0
- package/dist/md/blocks/status-ledger-01.md +121 -0
- package/dist/md/changelogs/prism-llms.md +206 -0
- package/dist/md/changelogs/prism-mcp-server.md +88 -0
- package/dist/md/changelogs/prism-tokens.md +126 -0
- package/dist/md/changelogs/prism-ui.md +429 -0
- package/dist/md/components/accordion.md +108 -0
- package/dist/md/components/alert.md +90 -7
- package/dist/md/components/avatar.md +89 -7
- package/dist/md/components/badge.md +74 -7
- package/dist/md/components/breadcrumb.md +84 -7
- package/dist/md/components/button.md +90 -7
- package/dist/md/components/card.md +90 -7
- package/dist/md/components/checkbox.md +101 -7
- package/dist/md/components/cta-link.md +98 -0
- package/dist/md/components/diagram.md +124 -0
- package/dist/md/components/dialog.md +128 -0
- package/dist/md/components/dropdown-menu.md +125 -0
- package/dist/md/components/fact-list.md +85 -0
- package/dist/md/components/field.md +116 -0
- package/dist/md/components/input.md +86 -7
- package/dist/md/components/kbd.md +77 -0
- package/dist/md/components/pagination.md +95 -7
- package/dist/md/components/popover.md +95 -7
- package/dist/md/components/product-mark.md +123 -0
- package/dist/md/components/product-switcher.md +88 -0
- package/dist/md/components/progress.md +88 -7
- package/dist/md/components/prose.md +91 -0
- package/dist/md/components/radio-group.md +111 -0
- package/dist/md/components/section.md +91 -0
- package/dist/md/components/select.md +143 -7
- package/dist/md/components/separator.md +77 -0
- package/dist/md/components/skeleton.md +71 -7
- package/dist/md/components/slider.md +90 -7
- package/dist/md/components/switch.md +104 -7
- package/dist/md/components/table.md +104 -7
- package/dist/md/components/tabs.md +105 -7
- package/dist/md/components/textarea.md +101 -0
- package/dist/md/components/tooltip.md +95 -7
- package/dist/md/components/typography.md +82 -7
- package/dist/md/content/about-content.md +36 -0
- package/dist/md/content/audience.md +43 -0
- package/dist/md/content/glossary.md +69 -0
- package/dist/md/content/product-vocabulary.md +53 -0
- package/dist/md/content/voice.md +52 -0
- package/dist/md/content/writing-mechanics.md +58 -0
- package/dist/md/foundation/colors.md +10 -0
- package/dist/md/foundation/iconography.md +14 -0
- package/dist/md/foundation/motion.md +10 -0
- package/dist/md/foundation/radii.md +9 -0
- package/dist/md/foundation/shadows.md +9 -0
- package/dist/md/foundation/spacings.md +8 -0
- package/dist/md/foundation/typography.md +9 -0
- package/dist/md/foundation/variables.md +9 -0
- package/dist/md/overview/architecture.md +76 -0
- package/dist/md/overview/brand.md +41 -0
- package/dist/md/overview/composition.md +77 -0
- package/dist/md/overview/quickstart.md +97 -0
- package/dist/md/overview/theming.md +89 -0
- package/dist/md/overview/using-llms.md +83 -0
- package/dist/md/pages/auth-page.md +149 -0
- package/dist/md/pages/blog-post-page.md +136 -0
- package/dist/md/pages/dashboard-page.md +241 -0
- package/dist/md/pages/marketing-page.md +199 -0
- package/dist/md/pages/not-found-page.md +105 -0
- package/dist/md/pages/settings-page.md +206 -0
- package/dist/prism-skill.md +50 -0
- package/dist/store.d.ts +203 -0
- package/dist/store.js +317 -0
- package/package.json +29 -26
- package/dist/demo-graph.d.ts.map +0 -1
- package/dist/demo-graph.js.map +0 -1
- package/dist/extractor.d.ts.map +0 -1
- package/dist/extractor.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/markdown.d.ts.map +0 -1
- package/dist/markdown.js.map +0 -1
- package/dist/md/blocks/component-demo.md +0 -19
- package/dist/md/blocks/page-header.md +0 -19
- package/dist/md/components/affix.md +0 -14
- package/dist/md/components/anchor.md +0 -14
- package/dist/md/components/auto-complete.md +0 -14
- package/dist/md/components/back-top.md +0 -14
- package/dist/md/components/border-beam.md +0 -14
- package/dist/md/components/calendar.md +0 -14
- package/dist/md/components/carousel.md +0 -14
- package/dist/md/components/cascader.md +0 -14
- package/dist/md/components/col.md +0 -14
- package/dist/md/components/collapse.md +0 -14
- package/dist/md/components/color-picker.md +0 -14
- package/dist/md/components/date-picker.md +0 -14
- package/dist/md/components/descriptions.md +0 -14
- package/dist/md/components/display-title.md +0 -20
- package/dist/md/components/divider.md +0 -14
- package/dist/md/components/drawer.md +0 -14
- package/dist/md/components/dropdown.md +0 -14
- package/dist/md/components/empty.md +0 -14
- package/dist/md/components/flex.md +0 -14
- package/dist/md/components/float-button.md +0 -14
- package/dist/md/components/form.md +0 -14
- package/dist/md/components/grid.md +0 -14
- package/dist/md/components/image.md +0 -14
- package/dist/md/components/input-number.md +0 -14
- package/dist/md/components/layout.md +0 -14
- package/dist/md/components/list.md +0 -14
- package/dist/md/components/listy.md +0 -14
- package/dist/md/components/masonry.md +0 -14
- package/dist/md/components/mentions.md +0 -14
- package/dist/md/components/menu.md +0 -14
- package/dist/md/components/modal.md +0 -14
- package/dist/md/components/popconfirm.md +0 -14
- package/dist/md/components/qrcode.md +0 -14
- package/dist/md/components/radio.md +0 -14
- package/dist/md/components/rate.md +0 -14
- package/dist/md/components/result.md +0 -14
- package/dist/md/components/row.md +0 -14
- package/dist/md/components/segmented.md +0 -14
- package/dist/md/components/space.md +0 -14
- package/dist/md/components/spin.md +0 -14
- package/dist/md/components/splitter.md +0 -14
- package/dist/md/components/statistic.md +0 -14
- package/dist/md/components/steps.md +0 -14
- package/dist/md/components/tag.md +0 -14
- package/dist/md/components/time-picker.md +0 -14
- package/dist/md/components/timeline.md +0 -14
- package/dist/md/components/tour.md +0 -14
- package/dist/md/components/transfer.md +0 -14
- package/dist/md/components/tree-select.md +0 -14
- package/dist/md/components/tree.md +0 -14
- package/dist/md/components/upload.md +0 -14
- package/dist/md/components/watermark.md +0 -14
- package/dist/md/docs/brand.md +0 -41
- package/dist/md/pages/blog-layout.md +0 -19
- package/dist/md/pages/docs-shell.md +0 -23
- package/dist/md/theme/blue-dark.md +0 -127
- package/dist/md/theme/blue-light.md +0 -129
- package/dist/md/theme/green-dark.md +0 -127
- package/dist/md/theme/green-light.md +0 -129
- package/dist/md/theme/lavender-dark.md +0 -127
- package/dist/md/theme/lavender-light.md +0 -129
- package/dist/md/theme/peach-dark.md +0 -127
- package/dist/md/theme/peach-light.md +0 -129
- package/dist/md/theme/rose-dark.md +0 -127
- package/dist/md/theme/rose-light.md +0 -129
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Shadows
|
|
2
|
+
|
|
3
|
+
Exactly three authored elevation steps, all mode-independent.
|
|
4
|
+
|
|
5
|
+
Elevation is authored, not borrowed. There are three shadow steps, all black
|
|
6
|
+
alpha with a real vertical offset and a soft blur. `xs` sits under a filled
|
|
7
|
+
control, `sm` under a card, and `md` under the one element that means lifted.
|
|
8
|
+
|
|
9
|
+
<TokenTable group="shadow" />
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Spacings
|
|
2
|
+
|
|
3
|
+
The authored spacing scale both layout and section rhythm use.
|
|
4
|
+
|
|
5
|
+
Spacing is authored once and reaches CSS as `--spacing` and its steps. `Section`
|
|
6
|
+
owns the page rhythm, and a gutter is a spacing token rather than a literal.
|
|
7
|
+
|
|
8
|
+
<TokenTable group="spacing" />
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Typography
|
|
2
|
+
|
|
3
|
+
Inter for the interface, the platform monospace stack for machine values.
|
|
4
|
+
|
|
5
|
+
Inter is the one interface face. The platform monospace stack annotates
|
|
6
|
+
machine-readable values. Sizes are authored as size and line-height pairs, and
|
|
7
|
+
leading, tracking and weight are authored tokens too.
|
|
8
|
+
|
|
9
|
+
<TokenTable group="typography" />
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Variables
|
|
2
|
+
|
|
3
|
+
The full token browser: every semantic custom property and every foundation group.
|
|
4
|
+
|
|
5
|
+
This is the token inventory. It reads the emitted JSON rather than a hardcoded
|
|
6
|
+
table, so it is the same data the stylesheet is compiled from. Colours are shown
|
|
7
|
+
as light and dark pairs; the mode-independent groups are shown once.
|
|
8
|
+
|
|
9
|
+
<TokenBrowser />
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Architecture
|
|
2
|
+
|
|
3
|
+
How Prism keeps tokens, the component library, the docs site and the agent surface on one source of truth.
|
|
4
|
+
|
|
5
|
+
Prism is owned source. It uses Base UI for accessible interaction behavior
|
|
6
|
+
internally, then applies its own props, anatomy, tokens and composition
|
|
7
|
+
patterns. None of the internal dependency is public API.
|
|
8
|
+
|
|
9
|
+
## The package boundary
|
|
10
|
+
|
|
11
|
+
`@nanisoft/prism-ui` is the only UI package an application imports. It ships
|
|
12
|
+
compiled JavaScript and declarations, and its `exports` map is the public
|
|
13
|
+
surface. The token package, `@nanisoft/prism-tokens`, is a pure data package;
|
|
14
|
+
you normally do not import it directly because the compiled CSS reaches you
|
|
15
|
+
through the one stylesheet.
|
|
16
|
+
|
|
17
|
+
That boundary gives a consuming project three guarantees:
|
|
18
|
+
|
|
19
|
+
1. No direct dependency on a second component library.
|
|
20
|
+
2. No upstream visual defaults leaking into your product.
|
|
21
|
+
3. One version line for behavior, design, documentation and machine-readable
|
|
22
|
+
source.
|
|
23
|
+
|
|
24
|
+
## Three composition layers
|
|
25
|
+
|
|
26
|
+
- **Component**: a focused, accessible, product-agnostic export with one job.
|
|
27
|
+
Compound parts, such as the pieces of a card, stay inside the parent module.
|
|
28
|
+
- **Block**: a pre-composed, product-agnostic section assembled from Components.
|
|
29
|
+
It takes its content as props and fetches nothing.
|
|
30
|
+
- **Page**: a complete structural composition of Blocks and Components that
|
|
31
|
+
models a whole screen and receives application-owned data.
|
|
32
|
+
|
|
33
|
+
The dependency direction is one-way. Sibling layers do not import each other,
|
|
34
|
+
and shared UI moves downward.
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
Pages -> Blocks -> Components -> semantic tokens
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## The catalogue
|
|
41
|
+
|
|
42
|
+
The catalogue is one checked module, `packages/ui/src/catalog.ts`, exposed as
|
|
43
|
+
`@nanisoft/prism-ui/catalog`. It is the only list. Navigation, the generated
|
|
44
|
+
item documentation, the corpus and the agent surface all consume it, and none
|
|
45
|
+
keeps a second list. An entry carries the item's name, slug, kind, category,
|
|
46
|
+
description, source, public exports and status.
|
|
47
|
+
|
|
48
|
+
The internal shadcn registry is derived from, or validated against, the
|
|
49
|
+
catalogue. It is an integrity artifact and is never a public install lane.
|
|
50
|
+
|
|
51
|
+
## The styling contract
|
|
52
|
+
|
|
53
|
+
Prism ships one precompiled stylesheet and semantic custom properties. A
|
|
54
|
+
component consumes semantic utilities only (`bg-background`,
|
|
55
|
+
`text-muted-foreground`), never a ramp step and never a raw value. Because the
|
|
56
|
+
semantic names are shadcn's variable contract, an unmodified shadcn block or
|
|
57
|
+
theme works against the packs with no rename.
|
|
58
|
+
|
|
59
|
+
There is no override path. A consumer composes, passes content and data, and
|
|
60
|
+
chooses a pack and a mode. When Prism lacks something, it is requested upstream
|
|
61
|
+
rather than patched locally.
|
|
62
|
+
|
|
63
|
+
## Source to corpus
|
|
64
|
+
|
|
65
|
+
The corpus is a deterministic projection of the same inputs the site renders:
|
|
66
|
+
|
|
67
|
+
```text
|
|
68
|
+
catalogue + emitted declarations + authored MDX + demo sources
|
|
69
|
+
|
|
|
70
|
+
v
|
|
71
|
+
llms.txt, the Markdown mirror, and the MCP store
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
The agent surface and the documentation site therefore cannot disagree about
|
|
75
|
+
what an item is: both read the catalogue, the types and the same demo files.
|
|
76
|
+
The detailed pipeline is in [Using LLMs](/overview/using-llms).
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Brand policy
|
|
2
|
+
|
|
3
|
+
What the MIT licence covers, what it does not, and how the Prism and NaniSoft names may be used.
|
|
4
|
+
|
|
5
|
+
The Prism packages are MIT-licensed, copyright NaniSoft, 2026. The code is yours
|
|
6
|
+
to use, study, modify and redistribute, including commercially. Attribution and
|
|
7
|
+
third-party notices live in the repository's `THIRD-PARTY-NOTICES.md`.
|
|
8
|
+
|
|
9
|
+
A code licence grants rights in the code. It does not grant rights in the brand,
|
|
10
|
+
and this page, not the licence, is where the brand rules live.
|
|
11
|
+
|
|
12
|
+
## What is ours
|
|
13
|
+
|
|
14
|
+
The names **Prism** and **NaniSoft**, the Prism wordmark, and the six pack names
|
|
15
|
+
(`default`, `blush`, `mint`, `lavender`, `sky` and `peach`) identify Prism as
|
|
16
|
+
built by NaniSoft.
|
|
17
|
+
|
|
18
|
+
## What you may do
|
|
19
|
+
|
|
20
|
+
- Say, accurately, that your product is *built with* Prism, and link here.
|
|
21
|
+
- Fork, modify and redistribute the code under MIT, including shipping your own
|
|
22
|
+
packs, as long as you do not present the result as Prism or as originating
|
|
23
|
+
from or endorsed by NaniSoft.
|
|
24
|
+
- Reference Prism in prose, talks and comparisons to identify the project, the
|
|
25
|
+
way any trademark is used to name the thing it names.
|
|
26
|
+
|
|
27
|
+
## What you may not do
|
|
28
|
+
|
|
29
|
+
- Distribute a modified or repackaged version under the Prism or NaniSoft names,
|
|
30
|
+
or with the Prism wordmark.
|
|
31
|
+
- Use the names or the wordmark as your product, domain or package name, or in a
|
|
32
|
+
way that implies NaniSoft endorsement or certification.
|
|
33
|
+
|
|
34
|
+
## Status
|
|
35
|
+
|
|
36
|
+
These marks are not registered, and they are protected by the licence's honesty
|
|
37
|
+
and by common-law rights. If you are unsure whether a use is fine, ask before
|
|
38
|
+
you ship, and if you spot a use of the brand that looks off, tell us.
|
|
39
|
+
|
|
40
|
+
A pack of your own is welcome and encouraged. It needs its own name: the six
|
|
41
|
+
pack names identify Prism, so a fork's palette takes a new one.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Composition
|
|
2
|
+
|
|
3
|
+
Choose the smallest Prism layer that owns the job, and promote repetition upward only when it earns it.
|
|
4
|
+
|
|
5
|
+
Prism's three layers answer three different questions. The skill is starting at
|
|
6
|
+
the bottom and moving up only when the product asks for it.
|
|
7
|
+
|
|
8
|
+
## Start with a Component
|
|
9
|
+
|
|
10
|
+
Reach for a Component when the product needs one accessible control or one
|
|
11
|
+
visual responsibility.
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { Button } from '@nanisoft/prism-ui/components/button'
|
|
15
|
+
|
|
16
|
+
<Button onClick={save}>Save changes</Button>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Do not build a local button variant when the action differs only by consequence.
|
|
20
|
+
The `variant` prop already encodes the action hierarchy, and a local variant is
|
|
21
|
+
the start of a second design system.
|
|
22
|
+
|
|
23
|
+
## Promote repetition into a Block
|
|
24
|
+
|
|
25
|
+
A Block earns its place when the same section appears across routes or products.
|
|
26
|
+
It is pre-composed and product-agnostic, so the copy and the data stay at your
|
|
27
|
+
call site.
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
import { Stats01 } from '@nanisoft/prism-ui/blocks/stats-01'
|
|
31
|
+
|
|
32
|
+
<Stats01
|
|
33
|
+
title="This month"
|
|
34
|
+
stats={[
|
|
35
|
+
{ label: 'Active projects', value: '1,284', delta: 12, hint: 'vs last month' },
|
|
36
|
+
{ label: 'On track', value: '47.2%', delta: -3, hint: 'vs last month' },
|
|
37
|
+
]}
|
|
38
|
+
/>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Good Block candidates are sections that repeat: a hero, a metric row, a pricing
|
|
42
|
+
comparison, a closing call to action. A section that appears once is a local
|
|
43
|
+
composition, not a Block.
|
|
44
|
+
|
|
45
|
+
## Compose a Page last
|
|
46
|
+
|
|
47
|
+
A Page coordinates regions and a whole screen. It does not recreate component
|
|
48
|
+
behavior; it arranges what the lower layers already own.
|
|
49
|
+
|
|
50
|
+
```tsx
|
|
51
|
+
import { Pricing01 } from '@nanisoft/prism-ui/blocks/pricing-01'
|
|
52
|
+
|
|
53
|
+
export function Plans() {
|
|
54
|
+
return (
|
|
55
|
+
<Pricing01
|
|
56
|
+
title="Pick a plan"
|
|
57
|
+
plans={plans}
|
|
58
|
+
/>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## The composition rules
|
|
64
|
+
|
|
65
|
+
- Dependencies point downward: Pages, then Blocks, then Components.
|
|
66
|
+
- Keep behavior in the lowest layer that owns it.
|
|
67
|
+
- Keep brand colour in tokens, not in page CSS.
|
|
68
|
+
- Keep application data and routing in the application.
|
|
69
|
+
- Prefer a documented prop over a chain of local class overrides.
|
|
70
|
+
- Pass the heading level explicitly when a Block is the page's top-level
|
|
71
|
+
heading, and leave it at its default when a Block is composed under one.
|
|
72
|
+
|
|
73
|
+
## Where to go next
|
|
74
|
+
|
|
75
|
+
- Browse the [Components](/components) for the controls.
|
|
76
|
+
- Browse the [Blocks](/blocks) for the sections.
|
|
77
|
+
- Read [Theming](/overview/theming) before restyling anything.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Quickstart
|
|
2
|
+
|
|
3
|
+
Install Prism, load one stylesheet, choose a pack, and render your first Component and Block.
|
|
4
|
+
|
|
5
|
+
Prism is one npm boundary for tokens, components, blocks and pages. This guide
|
|
6
|
+
takes you from an empty project to a rendered block, and it names the one
|
|
7
|
+
stylesheet and the two attributes that do the theming.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm install @nanisoft/prism-ui
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
React stays your application's dependency. Prism's Base UI runtime and Tailwind
|
|
16
|
+
are internal dependencies of the package; you install neither, and you import
|
|
17
|
+
neither.
|
|
18
|
+
|
|
19
|
+
## Load the one stylesheet
|
|
20
|
+
|
|
21
|
+
Import Prism's stylesheet once, beside your own global CSS. It carries the token
|
|
22
|
+
custom properties, all six packs, both modes, and every utility the components
|
|
23
|
+
use.
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import '@nanisoft/prism-ui/styles.css'
|
|
27
|
+
import './globals.css'
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
If your project uses Tailwind, Prism's stylesheet is still a separate import.
|
|
31
|
+
Prism is not a Tailwind plugin, and it is not merged into your Tailwind build.
|
|
32
|
+
|
|
33
|
+
## Choose a pack and a mode
|
|
34
|
+
|
|
35
|
+
Theming is two markup attributes, and it works without JavaScript. `data-pack`
|
|
36
|
+
selects the palette, and the `dark` class selects the mode. The neutral base
|
|
37
|
+
pack is the absence of `data-pack`.
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
// app/layout.tsx
|
|
41
|
+
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
42
|
+
return (
|
|
43
|
+
<html lang="en" data-pack="lavender">
|
|
44
|
+
<body>{children}</body>
|
|
45
|
+
</html>
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
To persist a choice and switch at runtime, mount `PrismProvider` and use
|
|
51
|
+
`usePrismTheme`. The provider is optional; the declarative attributes above need
|
|
52
|
+
no client runtime. See [Theming](/overview/theming) for the full model.
|
|
53
|
+
|
|
54
|
+
## Render the first Component
|
|
55
|
+
|
|
56
|
+
```tsx
|
|
57
|
+
import { Button } from '@nanisoft/prism-ui/components/button'
|
|
58
|
+
|
|
59
|
+
export function SaveAction() {
|
|
60
|
+
return <Button onClick={save}>Save changes</Button>
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
A component is imported from its own subpath. The curated root barrel
|
|
65
|
+
(`@nanisoft/prism-ui`) is convenient for an app that uses most of the set, but a
|
|
66
|
+
single import is the smaller pull. The [Button page](/components/button) shows
|
|
67
|
+
its live demo and generated props table.
|
|
68
|
+
|
|
69
|
+
## Compose the first Block
|
|
70
|
+
|
|
71
|
+
A Block is a pre-composed section that takes its content as props. It ships no
|
|
72
|
+
copy of its own, so the heading, the actions and the numbers all come from you.
|
|
73
|
+
|
|
74
|
+
```tsx
|
|
75
|
+
import { Cta01 } from '@nanisoft/prism-ui/blocks/cta-01'
|
|
76
|
+
|
|
77
|
+
export function Closing() {
|
|
78
|
+
return (
|
|
79
|
+
<Cta01
|
|
80
|
+
title="Start with one block"
|
|
81
|
+
description="Keep the tokens and reshape the rest."
|
|
82
|
+
action={{ label: 'Read the guides', href: '/guides' }}
|
|
83
|
+
/>
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The block's own page lists the props it accepts and renders the same component
|
|
89
|
+
live. A Page composes blocks and components into a whole screen; see
|
|
90
|
+
[Composition](/overview/composition) for when to reach for each layer.
|
|
91
|
+
|
|
92
|
+
## What is next
|
|
93
|
+
|
|
94
|
+
- [Architecture](/overview/architecture) explains the package boundary and the
|
|
95
|
+
catalogue.
|
|
96
|
+
- [Theming](/overview/theming) covers packs, modes and flash-free switching.
|
|
97
|
+
- [Using LLMs](/overview/using-llms) wires an agent to the same source.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Theming
|
|
2
|
+
|
|
3
|
+
Packs and modes are two independent axes, delivered as markup attributes with no override path.
|
|
4
|
+
|
|
5
|
+
Prism themes are complete atmospheres, not a primary-colour swap. A pack changes
|
|
6
|
+
the page ground, the surfaces, the hairlines, the text bases and the focus
|
|
7
|
+
treatment together.
|
|
8
|
+
|
|
9
|
+
## Two axes
|
|
10
|
+
|
|
11
|
+
Theming is two independent axes:
|
|
12
|
+
|
|
13
|
+
- **Pack** selects the palette: `default`, `blush`, `mint`, `lavender`, `sky`
|
|
14
|
+
or `peach`.
|
|
15
|
+
- **Mode** selects the appearance: `light` or `dark`.
|
|
16
|
+
|
|
17
|
+
A **theme** is one pack in one mode, such as Blush dark. It is a fully resolved
|
|
18
|
+
token set, not an object and not an API. There is no theme factory.
|
|
19
|
+
|
|
20
|
+
| Pack | Character |
|
|
21
|
+
| --- | --- |
|
|
22
|
+
| `default` | The neutral base. `primary` reads as ink, not colour. |
|
|
23
|
+
| `blush` | Soft rose, with the softest radius of the set. |
|
|
24
|
+
| `mint` | Soft green, calm and low-energy. |
|
|
25
|
+
| `lavender` | Soft violet, the most saturated brand ramp. |
|
|
26
|
+
| `sky` | Soft blue, the crispest hue and the smallest radius. |
|
|
27
|
+
| `peach` | Soft orange, the warmest hue and the roundest corners. |
|
|
28
|
+
|
|
29
|
+
## Declarative selection
|
|
30
|
+
|
|
31
|
+
Put `data-pack` on any element to make it, and its subtree, a theme boundary.
|
|
32
|
+
Add the `dark` class for dark mode. The neutral base pack is the absence of
|
|
33
|
+
`data-pack`, so it is expressed by omitting the attribute.
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
<!-- the default pack, light -->
|
|
37
|
+
<html lang="en">
|
|
38
|
+
|
|
39
|
+
<!-- Lavender, dark -->
|
|
40
|
+
<html lang="en" data-pack="lavender" class="dark">
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
This form is server-rendered and needs no JavaScript. It is also the cheapest
|
|
44
|
+
way to show several packs at once: any subtree can carry its own `data-pack`.
|
|
45
|
+
See the [themes page](/foundation/themes) for all packs side by side.
|
|
46
|
+
|
|
47
|
+
## Programmatic selection
|
|
48
|
+
|
|
49
|
+
When a user needs to switch and persist a choice, mount the optional provider
|
|
50
|
+
and read the hook.
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
import { PrismProvider, usePrismTheme } from '@nanisoft/prism-ui/provider'
|
|
54
|
+
|
|
55
|
+
function PackPicker() {
|
|
56
|
+
const { pack, setPack, mode, toggleMode } = usePrismTheme()
|
|
57
|
+
return (
|
|
58
|
+
<button onClick={() => setPack('peach')}>
|
|
59
|
+
{pack} / {mode}
|
|
60
|
+
</button>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function App({ children }: { children: React.ReactNode }) {
|
|
65
|
+
return <PrismProvider>{children}</PrismProvider>
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
The provider's only outputs are the two document-element attributes and the
|
|
70
|
+
context. It has no override parameter, no token object and no merge.
|
|
71
|
+
|
|
72
|
+
## Flash-free first paint
|
|
73
|
+
|
|
74
|
+
Under a static export there is no server and no middleware, so a blocking inline
|
|
75
|
+
script in `<head>` is what honours a stored choice before first paint. The
|
|
76
|
+
provider's package includes `PrismThemeScript` for exactly this, and the root
|
|
77
|
+
element carries `suppressHydrationWarning` because the script may set the
|
|
78
|
+
attributes before React hydrates.
|
|
79
|
+
|
|
80
|
+
## There is no consumer theming
|
|
81
|
+
|
|
82
|
+
Prism does not expose `createPrismTheme`, a per-key merge or semantic overrides.
|
|
83
|
+
The supported path is to select a pack and a mode. A product that needs a
|
|
84
|
+
different palette, a new semantic token or a changed component should request it
|
|
85
|
+
upstream, so every consumer benefits from the change and no project carries a
|
|
86
|
+
private fork.
|
|
87
|
+
|
|
88
|
+
`className` is for layout composition only. Changing a Prism-owned visual
|
|
89
|
+
property through a class is not supported.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Using LLMs
|
|
2
|
+
|
|
3
|
+
Using LLMs against Prism: the corpus, the Markdown mirror and the read-only MCP endpoint, so an agent reads the same source the human documentation does.
|
|
4
|
+
|
|
5
|
+
Prism treats agents as first-class consumers. The site, the package declarations,
|
|
6
|
+
the demo sources, the Markdown mirror and the MCP endpoint all project the same
|
|
7
|
+
source, so an agent and a human cannot be told different things.
|
|
8
|
+
|
|
9
|
+
## Fast path
|
|
10
|
+
|
|
11
|
+
1. Read `llms.txt` for the catalogue and the page index.
|
|
12
|
+
2. Use `search_docs` when the item name is unknown.
|
|
13
|
+
3. Use `get_item_doc` for the assembled item documentation and its rules.
|
|
14
|
+
4. Use `get_item_props` for the public TypeScript surface.
|
|
15
|
+
5. Use `get_item_source` for the verbatim demo and the public import line.
|
|
16
|
+
6. Use `get_theme_doc` before choosing a pack or reading a token scale.
|
|
17
|
+
7. Use `get_changelog` before upgrading a dependency on Prism.
|
|
18
|
+
|
|
19
|
+
## The MCP endpoint
|
|
20
|
+
|
|
21
|
+
The endpoint is public and read-only. It returns Markdown and never writes to a
|
|
22
|
+
consumer project.
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
{
|
|
26
|
+
"mcpServers": {
|
|
27
|
+
"prism": {
|
|
28
|
+
"type": "http",
|
|
29
|
+
"url": "https://prism.nanisoft.com/mcp"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## The nine tools
|
|
36
|
+
|
|
37
|
+
| Tool | Use |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| `list_items` | Browse the catalogue, filtered by `kind` and `category` |
|
|
40
|
+
| `get_item_doc` | Read the assembled item documentation |
|
|
41
|
+
| `get_item_props` | Read the `## Props` subset of an item |
|
|
42
|
+
| `get_item_source` | Copy the verbatim demo plus the import line |
|
|
43
|
+
| `get_theme_doc` | Read the token contract and the bound scales |
|
|
44
|
+
| `list_pages` | Browse the non-item pages: Overview, Foundation, Content, Changelogs |
|
|
45
|
+
| `get_page` | Read one non-item page as Markdown |
|
|
46
|
+
| `search_docs` | Search the complete corpus and return references |
|
|
47
|
+
| `get_changelog` | Read a published package's changelog, optionally one version |
|
|
48
|
+
|
|
49
|
+
`list_items` is the one tool that exists because a kind exists; the other seven
|
|
50
|
+
exist because a retrieval pattern exists, and `get_changelog` exists because a
|
|
51
|
+
published breaking change has to be findable by an agent. Search returns
|
|
52
|
+
references, not page bodies, so an agent follows a hit with `get_item_doc` or
|
|
53
|
+
`get_page`.
|
|
54
|
+
|
|
55
|
+
`get_changelog` takes a package and an optional version, and returns that
|
|
56
|
+
package's own `CHANGELOG.md` as it shipped rather than a summary of it. The
|
|
57
|
+
Changelogs section of this site renders the same bytes, so an agent and a reader
|
|
58
|
+
cannot be told different things about what changed.
|
|
59
|
+
|
|
60
|
+
## Import contract for generated code
|
|
61
|
+
|
|
62
|
+
Generated applications import from `@nanisoft/prism-ui`. The internal Base UI
|
|
63
|
+
dependency is not a consumer dependency and must not appear in application
|
|
64
|
+
source.
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
import { Button } from '@nanisoft/prism-ui/components/button'
|
|
68
|
+
import { Hero01 } from '@nanisoft/prism-ui/blocks/hero-01'
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
The internal shadcn registry never appears in generated code. It is an integrity
|
|
72
|
+
artifact inside the package, not an install lane.
|
|
73
|
+
|
|
74
|
+
## Truth rules
|
|
75
|
+
|
|
76
|
+
- The corpus is versioned with `prism-ui`. Compare the version echoed by
|
|
77
|
+
`list_items` with the installed package when behaviour looks inconsistent.
|
|
78
|
+
- Demos are single-source files: the same text is rendered live, copied by the
|
|
79
|
+
site, and returned by `get_item_source`.
|
|
80
|
+
- A generated item has exactly one demo. When an item has no demo, the tool says
|
|
81
|
+
so rather than fabricating one.
|
|
82
|
+
- Product claims belong to the product team. The corpus documents implementation
|
|
83
|
+
and usage, never invented customer evidence.
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# AuthPage
|
|
2
|
+
|
|
3
|
+
A full authentication screen composing a sign-in form with an optional supporting card.
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { AuthPage } from '@nanisoft/prism-ui/pages/auth-page'
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
AuthPage is a complete authentication screen. It composes a sign-in form with an
|
|
12
|
+
optional supporting card, and it owns the centering, the breakpoint and the
|
|
13
|
+
fallback column only. The form carries the credentials, the error slot and the
|
|
14
|
+
submit; the card carries product context beside it.
|
|
15
|
+
|
|
16
|
+
The page composes these parts:
|
|
17
|
+
|
|
18
|
+
| Region | Piece | Role |
|
|
19
|
+
| --- | --- | --- |
|
|
20
|
+
| Form | AuthForm01 | the title, the credential fields, the remember row and the submit |
|
|
21
|
+
| Support | Card | an optional surface beside the form for context or reassurance |
|
|
22
|
+
| Footer | footer | a line under the form, such as a legal note or a link |
|
|
23
|
+
|
|
24
|
+
Every field, label, handler, error and supporting string is a prop. The page
|
|
25
|
+
fetches nothing and imports no router, so the consumer owns the request and the
|
|
26
|
+
links. When no `aside` is passed the layout is one centered column; with one it
|
|
27
|
+
is a two-column split from the large breakpoint up, and the card falls below the
|
|
28
|
+
form on a narrow screen.
|
|
29
|
+
|
|
30
|
+
## Guidelines
|
|
31
|
+
|
|
32
|
+
### When to use
|
|
33
|
+
|
|
34
|
+
Use AuthPage for a sign-in screen whose only task is to collect one email and one
|
|
35
|
+
secret. It works when the screen is the first thing a returning reader sees and
|
|
36
|
+
the supporting card answers a question they are likely to have at that moment.
|
|
37
|
+
|
|
38
|
+
### When not to use
|
|
39
|
+
|
|
40
|
+
Do not use it for registration, password reset or profile editing. Those have
|
|
41
|
+
different field sets, and a sign-in card with the wrong fields is a dead end;
|
|
42
|
+
compose a form from the same parts instead.
|
|
43
|
+
|
|
44
|
+
Do not use it when the screen must carry more than a few words of supporting
|
|
45
|
+
content. The card is context beside a form, not a second page; a longer story
|
|
46
|
+
belongs on a marketing route the reader saw before signing in.
|
|
47
|
+
|
|
48
|
+
### Best practices
|
|
49
|
+
|
|
50
|
+
- Set `type`, `autoComplete` and `required` on every field. Browsers use them to
|
|
51
|
+
fill and validate, so the typing is the whole reason the field is typed.
|
|
52
|
+
- Keep the error to one sentence and mark the failed fields. AuthForm01 sets
|
|
53
|
+
`aria-invalid` when an error is present, so the form and the message agree.
|
|
54
|
+
- Disable the submit control while a request is in flight and pass `pendingLabel`,
|
|
55
|
+
so the reader sees that work is happening.
|
|
56
|
+
- Omit `aside` when there is nothing true to say. An empty card is worse than a
|
|
57
|
+
single centered form.
|
|
58
|
+
- Keep the footer to one line, such as a legal note or a route to create an
|
|
59
|
+
account, and pass the link in as a node so the consumer owns it.
|
|
60
|
+
|
|
61
|
+
### Content guidelines
|
|
62
|
+
|
|
63
|
+
- The title is a short verb phrase in sentence case: "Sign in", "Continue".
|
|
64
|
+
- The description states the outcome, not a policy.
|
|
65
|
+
- An error says what to do next: "Enter your email and password to continue."
|
|
66
|
+
|
|
67
|
+
**The auth page, with a controlled form and a supporting card.**
|
|
68
|
+
|
|
69
|
+
```tsx
|
|
70
|
+
'use client'
|
|
71
|
+
|
|
72
|
+
import { useState } from 'react'
|
|
73
|
+
|
|
74
|
+
import { AuthPage } from '@nanisoft/prism-ui/pages/auth-page'
|
|
75
|
+
|
|
76
|
+
/** The auth page, with a controlled form and a supporting card. */
|
|
77
|
+
export default function AuthPageDemo() {
|
|
78
|
+
const [email, setEmail] = useState('')
|
|
79
|
+
const [password, setPassword] = useState('')
|
|
80
|
+
const [error, setError] = useState<string>()
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<AuthPage
|
|
84
|
+
form={{
|
|
85
|
+
title: 'Sign in',
|
|
86
|
+
description: 'Welcome back. Enter your details to continue.',
|
|
87
|
+
error,
|
|
88
|
+
submitLabel: 'Sign in',
|
|
89
|
+
fields: [
|
|
90
|
+
{
|
|
91
|
+
id: 'auth-page-email',
|
|
92
|
+
label: 'Email',
|
|
93
|
+
type: 'email',
|
|
94
|
+
autoComplete: 'email',
|
|
95
|
+
placeholder: 'you@example.com',
|
|
96
|
+
value: email,
|
|
97
|
+
onChange: setEmail,
|
|
98
|
+
required: true,
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
id: 'auth-page-password',
|
|
102
|
+
label: 'Password',
|
|
103
|
+
type: 'password',
|
|
104
|
+
autoComplete: 'current-password',
|
|
105
|
+
value: password,
|
|
106
|
+
onChange: setPassword,
|
|
107
|
+
required: true,
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
remember: { id: 'auth-page-remember', label: 'Remember me for 30 days' },
|
|
111
|
+
onSubmit: (event) => {
|
|
112
|
+
event.preventDefault()
|
|
113
|
+
setError(
|
|
114
|
+
email && password ? undefined : 'Enter your email and password to continue.',
|
|
115
|
+
)
|
|
116
|
+
},
|
|
117
|
+
}}
|
|
118
|
+
aside={{
|
|
119
|
+
title: 'Everything in one workspace',
|
|
120
|
+
description: 'Projects, deployments and usage, without a second tool.',
|
|
121
|
+
children: (
|
|
122
|
+
<ul className="text-muted-foreground flex flex-col gap-2 text-sm">
|
|
123
|
+
<li>One place for every team</li>
|
|
124
|
+
<li>Usage that updates as you deploy</li>
|
|
125
|
+
<li>Roles from viewer to admin</li>
|
|
126
|
+
</ul>
|
|
127
|
+
),
|
|
128
|
+
}}
|
|
129
|
+
footer={<p>No account yet? Create one.</p>}
|
|
130
|
+
/>
|
|
131
|
+
)
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Props
|
|
136
|
+
|
|
137
|
+
**`form`** `ComponentProps<typeof AuthForm01>` · required · default: — — The credential form.
|
|
138
|
+
**`aside`** `AuthPageAside` · optional · default: — — A supporting card beside the form. Omit it for a single centered column.
|
|
139
|
+
**`footer`** `ReactNode` · optional · default: — — A node under the form, such as a legal line or a link to another screen.
|
|
140
|
+
|
|
141
|
+
## Composition
|
|
142
|
+
|
|
143
|
+
**`exports`** `AuthPage` — the public runtime names this Page promises
|
|
144
|
+
**`source`** `packages/ui/src/pages/auth-page/index.tsx` — the file this Page is defined in
|
|
145
|
+
**`dependencies`** `AuthForm01, Card` — the public Prism exports this item composes
|
|
146
|
+
|
|
147
|
+
## Blocks
|
|
148
|
+
|
|
149
|
+
- [AuthForm01](https://prism.nanisoft.com/blocks/auth-form-01.md)
|