@gradeui/ui 4.0.1 → 4.1.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/AGENTS.md +25 -0
- package/DESIGN.index.md +88 -0
- package/DESIGN.md +6086 -0
- package/components/ui/section.md +8 -6
- package/components/ui/selection-card.md +43 -0
- package/components/ui/shader-controls.md +32 -0
- package/dist/contracts.js +6 -6
- package/dist/contracts.js.map +1 -1
- package/dist/contracts.mjs +6 -6
- package/dist/contracts.mjs.map +1 -1
- package/dist/index.d.mts +25 -25
- package/dist/index.d.ts +25 -25
- package/dist/index.js +61 -61
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +61 -61
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/foundations/_intro.md +52 -0
- package/foundations/color-scopes.md +52 -0
- package/foundations/expressive.md +57 -0
- package/foundations/spacing-layout.md +51 -0
- package/foundations/themes.md +52 -0
- package/foundations/typography.md +60 -0
- package/llms.txt +32 -0
- package/package.json +15 -3
package/AGENTS.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Using @gradeui/ui (for AI agents)
|
|
2
|
+
|
|
3
|
+
You are generating UI with the Grade Design System. This package is **self-describing** —
|
|
4
|
+
everything you need ships in the installed package. Read the comprehensive spec first:
|
|
5
|
+
|
|
6
|
+
- **`@gradeui/ui/DESIGN.md`** — the whole design system in one file: foundations
|
|
7
|
+
(themes, colour scopes, expressive accents, typography, spacing) + every component
|
|
8
|
+
sidecar (when_to_use, props, examples). **Read this before generating markup.**
|
|
9
|
+
- **`@gradeui/ui/contracts`** — programmatic prop schemas: `import { COMPONENT_CONTRACTS } from "@gradeui/ui/contracts"`.
|
|
10
|
+
- **`@gradeui/ui/styles.css`** — precompiled styles (or wire `@gradeui/ui/styles/globals.css` into Tailwind v4).
|
|
11
|
+
|
|
12
|
+
## The one rule you must not break
|
|
13
|
+
|
|
14
|
+
A page is an ordered stack of `Section` bands, and **every `Section` wraps a `Container`**:
|
|
15
|
+
|
|
16
|
+
```jsx
|
|
17
|
+
<Section scope="inverse" pad="xl">
|
|
18
|
+
<Container maxW="lg">{/* content */}</Container>
|
|
19
|
+
</Section>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Full-bleed = `<Container maxW="full">`, never omitting the Container. This holds for
|
|
23
|
+
app content regions too, not just marketing. **Never** hand-roll
|
|
24
|
+
`<section className="py-20">` or `<div className="max-w-7xl mx-auto px-6">` — that
|
|
25
|
+
div-soup is exactly what `Section` + `Container` replace.
|
package/DESIGN.index.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<!-- GENERATED — pnpm -F @gradeui/ui generate:design -->
|
|
2
|
+
# Grade component index
|
|
3
|
+
|
|
4
|
+
A cheap scan of all 79 components. Read the foundations + this
|
|
5
|
+
index first; then pull only the sidecars you need from `components/ui/<name>.md`
|
|
6
|
+
(or the full `@gradeui/ui/DESIGN.md`). Foundations: themes, color-scopes, expressive, typography, spacing-layout.
|
|
7
|
+
|
|
8
|
+
| component | when to use |
|
|
9
|
+
| --- | --- |
|
|
10
|
+
| `Accordion` | Long-form content that would overwhelm if shown all at once — FAQs, settings groups, "what's included" sections, nested help. |
|
|
11
|
+
| `AIChatComposer` | The reusable "input card" for any chat surface — auto-growing textarea, image attachments via paperclip and clipboard paste, attachment chips with previews, Sen |
|
|
12
|
+
| `AIChat` | A flexible chat block — header + scrollable message list + composer. |
|
|
13
|
+
| `AppShell` | | |
|
|
14
|
+
| `Avatar` | User/entity identity for PEOPLE — profile pictures, author rows, member lists, account headers. |
|
|
15
|
+
| `BackgroundFill` | The background *paint* of a frame — a generative shader, image, video, gradient, repeating texture, or solid token rendered as a layer BEHIND the frame's conten |
|
|
16
|
+
| `Badge` | Compact status chips, counts, tags, pills. |
|
|
17
|
+
| `Banner` | A full-width horizontal strip surfacing system-level state, announcements, or first-run guidance — "you're previewing a draft", "investigating incident", "new f |
|
|
18
|
+
| `Breadcrumb` | Reach for Breadcrumb whenever a screen sits inside a hierarchy and you want the path back to the top to be visible. |
|
|
19
|
+
| `Button` | Any clickable action. |
|
|
20
|
+
| `Calendar` | An inline date grid — date-of-birth pickers in profile forms, scheduling screens with a month view, range selection in reporting filters. |
|
|
21
|
+
| `Callout` | Inline, ambient, non-blocking status/feedback that sits inside the layout flow. |
|
|
22
|
+
| `Card` | Grouped content with a distinct surface — settings panels, dashboard tiles, list-of-cards layouts, marketing hero containers, AI suggestion overlays. |
|
|
23
|
+
| `Carousel` | Anywhere a horizontal stack of slides cycles automatically or on user input — marketing hero rotations, featured rails on a TV / streaming app, onboarding tours |
|
|
24
|
+
| `ChartContainer` | Reporting dashboards, single-purpose analytics cards (revenue, conversions, active users), or anywhere you'd otherwise hand-roll a Recharts setup. |
|
|
25
|
+
| `CheckboxCard` | Multi-select where each option is a whole selectable card (add-ons, feature toggles, opt-ins). |
|
|
26
|
+
| `Checkbox` | Binary on/off tied to a list (select multiple, agree to terms). |
|
|
27
|
+
| `Code` | Read-only code surface for marketing heroes, docs, changelog entries, AI-output displays. |
|
|
28
|
+
| `Collapsible` | A single show/hide reveal — "Show advanced settings" rows, expandable inline help, "More details" sections inside cards. |
|
|
29
|
+
| `ColorPicker` | The token-led single-select colour picker — the focused "pick one colour token" sibling of FillPicker's solid tab. |
|
|
30
|
+
| `Combobox` | Single-pick searchable picker — the single-select sibling of MultiSelect and the Linear "selectable badge" pattern (status / priority / assignee). |
|
|
31
|
+
| `Command` | A searchable list of actions or destinations — global ⌘K palettes, "jump to" inputs, account switchers with filter. |
|
|
32
|
+
| `Composer` | | |
|
|
33
|
+
| `DataView` | One dataset, drawn as a table, a list of cards, or a grid — without re-typing the TanStack boilerplate (sortable headers, flexRender, selection, view switch) on |
|
|
34
|
+
| `DatePicker` | Any date or date-range entry. |
|
|
35
|
+
| `Dialog` | Modal interruptions — confirmations, focused forms, detail views, AI suggestion sheets. |
|
|
36
|
+
| `DropdownMenu` | A small action menu attached to a trigger — overflow "…" buttons on cards, user-avatar menus in headers, "Insert" menus in editors. |
|
|
37
|
+
| `Field` | Pair a bare control with a label and optional description in a row, with id + aria-describedby wired automatically. |
|
|
38
|
+
| `FillPicker` | Grade's paint picker — the control for choosing a frame's background fill, modelled on Figma's fill popover. |
|
|
39
|
+
| `Flex` | The unopinionated flexbox primitive — reach for Flex when Stack, Row, or Grid don't quite fit. |
|
|
40
|
+
| `grade-loader` | |
|
|
41
|
+
| `GradientEditor` | Edit a multi-stop CSS gradient with token-led stops. |
|
|
42
|
+
| `Grid` | 2D layouts where Stack (vertical) and Row (horizontal) don't fit — stat-card grids, feature tiles, pricing columns, photo grids. |
|
|
43
|
+
| `HoverCard` | Rich preview content surfaced on hover — user profile mini-cards on @-mentions, link previews, definition popups, layer-thumbnail peeks. |
|
|
44
|
+
| `Input` | Any single-line text entry. |
|
|
45
|
+
| `Label` | Every Input / Textarea / Checkbox / Switch / RadioGroup. |
|
|
46
|
+
| `Logo` | ALWAYS use <Logo> wherever a screen carries a brand mark — |
|
|
47
|
+
| `Map` | Any layout that needs a real map — listings (real estate, Airbnb-style), fleet/logistics dashboards, store locators, anywhere a user picks a location from a vie |
|
|
48
|
+
| `MediaSurface` | The canonical media slot for ALL non-person imagery — album art, posters, hero images, landscape photos, video and 3D containers. |
|
|
49
|
+
| `Message` | | |
|
|
50
|
+
| `Motion` | A directed sequence of scenes on one persistent stage — the |
|
|
51
|
+
| `MultiSelect` | | |
|
|
52
|
+
| `Popover` | A floating panel anchored to a trigger that contains interactive content — date pickers, color pickers, filter pickers, "more info" panels, inline forms. |
|
|
53
|
+
| `Progress` | Determinate progress — file uploads, multi-step forms, quota meters. |
|
|
54
|
+
| `PropertyList` | Read-only display of the properties of a SINGLE item — detail panels, inspectors, "about this" cards, order/record summaries. |
|
|
55
|
+
| `RadioCard` | Single-select where each option is a whole selectable card (shipping options, plan picker, onboarding choices). |
|
|
56
|
+
| `RadioGroup` | A small set of mutually-exclusive options where the user needs to SEE all of them at once — pricing tiers (3-4 options), shipping speed, payment method radio ca |
|
|
57
|
+
| `Resizable` | A multi-pane layout where the user wants to drag the divider — Slack/Mail-style list+detail, IDE editor+terminal, side-by-side compare view. |
|
|
58
|
+
| `RivePlayer` | Rive runtime wrapped in the shared media surface. |
|
|
59
|
+
| `Row` | Horizontal composition — button groups, inline form rows, logo + nav rows, anything on one line. |
|
|
60
|
+
| `ScreenAnimator` | Wrap ANY screen or section in a directed camera — a "live demo |
|
|
61
|
+
| `ScrollArea` | Bounded content that needs custom scroll chrome — sidebars with long item lists, chat transcripts, table panels inside a dashboard, anywhere the OS scrollbar wo |
|
|
62
|
+
| `SectionBlock` | The top-level container for a marketing page section — hero, feature row, pricing table, testimonial strip, FAQ section. |
|
|
63
|
+
| `Section` | THE page scaffold. |
|
|
64
|
+
| `Select` | Single-choice from 3+ known options. |
|
|
65
|
+
| `SelectionCard` | A selectable option where the WHOLE card is the control — plan pickers, shipping/payment options, onboarding choices, settings toggles. |
|
|
66
|
+
| `Separator` | Light divider between sibling blocks in a Card, list, or header. |
|
|
67
|
+
| `ShaderControls` | Render a `ControlSpec[]` schema into a DS-native control panel — the single renderer behind shader params, the post-processing stack, and any effect layer (they |
|
|
68
|
+
| `ShaderPresetPicker` | Runtime gallery of shader presets — click to select. |
|
|
69
|
+
| `ShaderPresetPreview` | Thumbnail-sized preview card for a shader preset. |
|
|
70
|
+
| `Sheet` | A panel that slides in from a screen edge — mobile nav drawers, side panels for editing a single record without leaving the list, filter trays on small viewport |
|
|
71
|
+
| `Sidebar` | Vertical app navigation. |
|
|
72
|
+
| `Skeleton` | Loading placeholder for content whose shape you know. |
|
|
73
|
+
| `Slider` | A continuous-ish numeric pick — volume, opacity, font size, price-range filters. |
|
|
74
|
+
| `Sortable` | Drag-to-reorder lists, kanban-column reordering, sortable shelves, tab strips the user can rearrange. |
|
|
75
|
+
| `Stack` | Default top-level layout inside the main slot when composing two or more stacked regions (hero + content + footer, auth card + subtext, etc.). |
|
|
76
|
+
| `Swatch` | Showing a colour as a small chip — brand-pop strips, palette / accent pickers, theme previews, token galleries, "pick a colour" rows. |
|
|
77
|
+
| `SwitchCard` | A prominent on/off setting presented as a whole selectable card. |
|
|
78
|
+
| `Switch` | Instant on/off setting ("Enable notifications", "Dark mode"). |
|
|
79
|
+
| `Table` | Structured tabular data — rows × columns with alignment requirements. |
|
|
80
|
+
| `Tabs` | A small set of peer views within one surface (2–5 tabs). |
|
|
81
|
+
| `Textarea` | Multi-line text entry (descriptions, messages, comments). |
|
|
82
|
+
| `ThreeScene` | WebGL primitive for shader backgrounds, generative visuals, and bespoke three.js scenes. |
|
|
83
|
+
| `Toaster` | Transient, non-blocking feedback that confirms or warns about an action — "Saved", "Failed to upload", "Copied to clipboard", "Invitation sent". |
|
|
84
|
+
| `ToggleGroup` | A small set of mutually-exclusive (`type="single"`) or independent (`type="multiple"`) binary options that live side-by-side as a segmented control — viewport s |
|
|
85
|
+
| `Toggle` | A standalone on/off button — Bold/Italic in a toolbar, "Show grid" in a header, single binary toggle that doesn't belong inside a Switch row. |
|
|
86
|
+
| `Toolbar` | | |
|
|
87
|
+
| `Tooltip` | A short, non-essential label that explains a control on hover/focus — icon-only buttons in toolbars, abbreviated column headers, status dots. |
|
|
88
|
+
| `VideoPlayer` | HTML5 video wrapped in the shared media surface. |
|