meowtail 0.1.0 → 0.2.0-alpha.1
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/AGENT-COMPONENTS.md +117 -0
- package/ASSISTANT.md +39 -19
- package/JSON.md +12 -5
- package/README.md +462 -349
- package/THIRD_PARTY_NOTICES.md +8 -0
- package/dist/src/chat/assistant-composer.js +3 -5
- package/dist/src/chat/assistant-content.d.ts +2 -0
- package/dist/src/chat/assistant-content.js +51 -3
- package/dist/src/chat/assistant-types.d.ts +39 -1
- package/dist/src/chat/assistant.d.ts +1 -1
- package/dist/src/chat/assistant.js +6 -3
- package/dist/src/chat/attachments.js +9 -5
- package/dist/src/chat/composer-panel.d.ts +17 -0
- package/dist/src/chat/composer-panel.js +12 -0
- package/dist/src/chat/composer.d.ts +2 -0
- package/dist/src/chat/composer.js +5 -2
- package/dist/src/chat/conversation.d.ts +4 -1
- package/dist/src/chat/conversation.js +7 -4
- package/dist/src/chat/index.d.ts +5 -2
- package/dist/src/chat/index.js +2 -0
- package/dist/src/chat/message-list.js +1 -1
- package/dist/src/chat/message.js +3 -3
- package/dist/src/chat/question.js +1 -1
- package/dist/src/chat/sources.js +1 -1
- package/dist/src/chat/task.d.ts +29 -0
- package/dist/src/chat/task.js +53 -0
- package/dist/src/chat/tool-call.d.ts +33 -8
- package/dist/src/chat/tool-call.js +70 -26
- package/dist/src/components/action-rail.d.ts +19 -0
- package/dist/src/components/action-rail.js +13 -0
- package/dist/src/components/add-button.js +1 -1
- package/dist/src/components/alert.d.ts +2 -0
- package/dist/src/components/alert.js +2 -1
- package/dist/src/components/app-bar.d.ts +17 -0
- package/dist/src/components/app-bar.js +10 -0
- package/dist/src/components/breadcrumb.js +1 -1
- package/dist/src/components/choice-select.js +1 -1
- package/dist/src/components/code-block.js +6 -6
- package/dist/src/components/credential-source.js +12 -12
- package/dist/src/components/diff-block.js +1 -1
- package/dist/src/components/grid.js +1 -0
- package/dist/src/components/hover-card.js +2 -2
- package/dist/src/components/image-lightbox.js +3 -3
- package/dist/src/components/image-preview.js +1 -1
- package/dist/src/components/index.d.ts +4 -0
- package/dist/src/components/index.js +4 -0
- package/dist/src/components/inline.js +1 -0
- package/dist/src/components/json-block.js +2 -2
- package/dist/src/components/json-tree.js +3 -3
- package/dist/src/components/layout-item.js +2 -1
- package/dist/src/components/layout-types.d.ts +1 -1
- package/dist/src/components/list-group.d.ts +1 -1
- package/dist/src/components/menu.js +5 -5
- package/dist/src/components/meta-row.d.ts +33 -0
- package/dist/src/components/meta-row.js +45 -0
- package/dist/src/components/output-block.d.ts +5 -3
- package/dist/src/components/output-block.js +35 -25
- package/dist/src/components/page-frame.d.ts +6 -2
- package/dist/src/components/page-frame.js +2 -2
- package/dist/src/components/path-picker.js +4 -4
- package/dist/src/components/process-group.d.ts +2 -2
- package/dist/src/components/rail-item.d.ts +2 -2
- package/dist/src/components/rail-section.d.ts +1 -1
- package/dist/src/components/read-block.js +2 -2
- package/dist/src/components/resource-card.d.ts +1 -1
- package/dist/src/components/resource-link.d.ts +1 -1
- package/dist/src/components/search-block.js +2 -3
- package/dist/src/components/stack.js +1 -0
- package/dist/src/components/status.d.ts +16 -0
- package/dist/src/components/status.js +8 -0
- package/dist/src/components/terminal-block.js +6 -6
- package/dist/src/components/web-block.js +3 -3
- package/dist/src/components/work-card.d.ts +2 -2
- package/dist/src/components/work-card.js +1 -1
- package/dist/src/icons/README.md +13 -2
- package/dist/src/icons/icon-frame.d.ts +11 -0
- package/dist/src/icons/icon-frame.js +4 -0
- package/dist/src/icons/icon-source.d.ts +17 -0
- package/dist/src/icons/icon-source.js +6 -0
- package/dist/src/icons/icon.d.ts +44 -37
- package/dist/src/icons/icon.js +55 -128
- package/dist/src/icons/index.d.ts +1 -0
- package/dist/src/icons/index.js +1 -0
- package/dist/src/icons/lucide.d.ts +1 -0
- package/dist/src/icons/lucide.js +4 -0
- package/dist/src/json/catalog.d.ts +88 -2
- package/dist/src/json/catalog.js +33 -1
- package/dist/src/registry/index.d.ts +54 -4
- package/dist/src/registry/index.js +16 -2
- package/dist/src/shared/execution-state.d.ts +7 -0
- package/dist/src/shared/execution-state.js +36 -0
- package/dist/src/theme/base.styles.js +15 -0
- package/dist/src/theme/chat/assistant.styles.js +21 -9
- package/dist/src/theme/chat/composer-panel.styles.d.ts +1 -0
- package/dist/src/theme/chat/composer-panel.styles.js +44 -0
- package/dist/src/theme/chat/composer.styles.js +39 -7
- package/dist/src/theme/chat/conversation.styles.js +15 -7
- package/dist/src/theme/chat/records.styles.js +79 -7
- package/dist/src/theme/chat/task.styles.d.ts +1 -0
- package/dist/src/theme/chat/task.styles.js +87 -0
- package/dist/src/theme/components/action-rail.styles.d.ts +1 -0
- package/dist/src/theme/components/action-rail.styles.js +47 -0
- package/dist/src/theme/components/alert.styles.js +42 -1
- package/dist/src/theme/components/app-bar.styles.d.ts +1 -0
- package/dist/src/theme/components/app-bar.styles.js +48 -0
- package/dist/src/theme/components/card.styles.js +9 -3
- package/dist/src/theme/components/code-block.styles.js +7 -0
- package/dist/src/theme/components/dialog.styles.js +7 -0
- package/dist/src/theme/components/field.styles.js +4 -0
- package/dist/src/theme/components/list-group.styles.js +10 -11
- package/dist/src/theme/components/meta-row.styles.d.ts +1 -0
- package/dist/src/theme/components/meta-row.styles.js +66 -0
- package/dist/src/theme/components/output-block.styles.js +17 -0
- package/dist/src/theme/components/page-frame.styles.js +7 -1
- package/dist/src/theme/components/page-header.styles.js +7 -0
- package/dist/src/theme/components/resource-card.styles.js +15 -3
- package/dist/src/theme/components/status.styles.d.ts +1 -0
- package/dist/src/theme/components/status.styles.js +25 -0
- package/dist/src/theme/components/tag.styles.js +3 -3
- package/dist/src/theme/components/toolbar.styles.js +7 -0
- package/dist/src/theme/index.d.ts +148 -0
- package/dist/src/theme/index.js +173 -159
- package/dist/src/theme/palette.d.ts +1 -1
- package/dist/src/theme/palette.js +1 -1
- package/dist/src/theme/shared/code-highlight.styles.js +1 -1
- package/dist/src/theme/shared/code-highlight.tokens.d.ts +6 -6
- package/dist/src/theme/shared/code-highlight.tokens.js +6 -6
- package/dist/src/theme/tokens.d.ts +7 -7
- package/dist/src/theme/tokens.js +14 -8
- package/package.json +17 -6
package/README.md
CHANGED
|
@@ -1,332 +1,446 @@
|
|
|
1
1
|
# Meowtail
|
|
2
2
|
|
|
3
|
-
`meowtail`
|
|
3
|
+
`meowtail` provides cross-application components, semantic layout, the standard theme, and the complete Assistant composition. Networking, execution, permissions, and persistence are adapted by the host; the library carries no Rossovia business state or backend.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Presentation package
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The presentation player, Reveal, media lifecycle, presentation content layouts, and themes have moved into the separate [MeowSlides](../meowslides/README.md). Meowtail does not depend on the presentation package in reverse, and the old `meowtail/presentation` and root presentation exports are removed; shared UI and layout are still provided by this package.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
This package's npm name is `meowtail`; existing APIs such as `createMeowUI`, `installMeowUI`, and `createMeowUICatalog`, along with runtime style identity, stay unchanged. Use the new package import path; do not derive new function names, `data-*` markers, or CSS variables from the package name.
|
|
10
|
+
|
|
11
|
+
See [Assistant](ASSISTANT.md) for the usage contract of the complete composition and [JSON catalog](JSON.md) for the finite JSON entry point. Implementation and independent acceptance of both are still in progress; the API descriptions and early artifact verification on this page do not equal a same-source acceptance pass for all current source code.
|
|
12
|
+
|
|
13
|
+
## Minimal browser integration
|
|
14
|
+
|
|
15
|
+
In a browser entry point containing `<main id="app"></main>`, first complete component registration on the same runtime, full CSS loading, and theme root binding, then render content.
|
|
16
|
+
Importing components only, installing the registry only, or using `Theme` only cannot replace these three steps; if any one is missing, the page may still show native controls without the standard theme's sizes and states.
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
import { createRuntime, h } from "meowjsx";
|
|
20
|
+
import { createWebRenderer } from "meowjsx/web";
|
|
21
|
+
import { Button, Inline, Stack, createMeowUI } from "meowtail";
|
|
22
|
+
import { standardTheme, standardOptions } from "meowtail/theme";
|
|
23
|
+
import { applyTheme, mountStyles } from "meowcss/web";
|
|
24
|
+
|
|
25
|
+
const root = document.querySelector<HTMLElement>("#app");
|
|
26
|
+
if (!root) throw new Error("Missing app root");
|
|
27
|
+
const runtime = createRuntime();
|
|
28
|
+
const uninstall = runtime.use(createMeowUI());
|
|
29
|
+
const removeStyles = mountStyles(root.ownerDocument, standardTheme.cssText);
|
|
30
|
+
const removeTheme = applyTheme(root, standardTheme, standardOptions.select({ scheme: "light" }));
|
|
31
|
+
const mounted = createWebRenderer(runtime).render(
|
|
32
|
+
<Stack align="start">
|
|
33
|
+
<strong>Connection settings</strong>
|
|
34
|
+
<Inline gap="compact">
|
|
35
|
+
<Button>Save</Button>
|
|
36
|
+
<Button variant="quiet">Cancel</Button>
|
|
37
|
+
</Inline>
|
|
38
|
+
</Stack>,
|
|
39
|
+
root,
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
// Dispose with the host that owns this mount.
|
|
43
|
+
const dispose = () => {
|
|
44
|
+
mounted.unmount();
|
|
45
|
+
removeTheme();
|
|
46
|
+
removeStyles();
|
|
47
|
+
uninstall();
|
|
48
|
+
};
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The theme root provides an inheritable body font, font size, line height, and text color; local theme configuration inherits the outer typography, while components still own their own control and heading scales.
|
|
52
|
+
This does not include a global `html/body` margin reset, page background, or page whitespace, and does not automatically reset arbitrary `h1/h2/p`.
|
|
53
|
+
Use `PageFrame` / `Container` for page space, `Stack` for related content, and `Inline` for a group of actions; the complete Assistant can use `AssistantView` directly, without rebuilding a page from bare Cards.
|
|
54
|
+
`CardHeader/Title/Content/Footer` express relationships inside a card, while native content follows document semantics; do not wrap every layer of content in its own surface.
|
|
55
|
+
Compare Meowbook's `buttons`, `card-composition`, and `workspace-composition`; they show action relationships, card structure, and a scrolling workspace respectively. A stress state does not mean the product must display all states at once.
|
|
56
|
+
See [Component installation and style delivery](#component-installation-and-style-delivery) for static CSS delivery and local configuration; the Increment in `examples/browser` is only a package-integration smoke test, not a page design template.
|
|
57
|
+
|
|
58
|
+
## Directory structure
|
|
10
59
|
|
|
11
60
|
```text
|
|
12
61
|
src/
|
|
13
|
-
components/ # Button
|
|
14
|
-
chat/ # ChatFrame
|
|
15
|
-
icons/ #
|
|
16
|
-
registry/ #
|
|
17
|
-
shared/ #
|
|
18
|
-
theme/ #
|
|
62
|
+
components/ # Base components such as Button, Card, Input, and Dialog; one component per file
|
|
63
|
+
chat/ # Conversation components such as ChatFrame, ChatMessage, and ChatComposer
|
|
64
|
+
icons/ # Brand marks and small icons; one icon per file
|
|
65
|
+
registry/ # Contract aggregation, meowjsx type declarations, and the installation entry point
|
|
66
|
+
shared/ # Small utilities shared inside components
|
|
67
|
+
theme/ # Standard theme token definitions and TS styles organized by part
|
|
19
68
|
tests/
|
|
20
|
-
unit/ # Bun
|
|
21
|
-
types/ #
|
|
22
|
-
browser/ # Playwright
|
|
69
|
+
unit/ # Bun, grouped by components/chat/icons/shared/theme
|
|
70
|
+
types/ # Public type contracts using *.types.ts / *.types.tsx, verified by tsc
|
|
71
|
+
browser/ # Playwright, grouped by components/chat/theme/catalog
|
|
23
72
|
```
|
|
24
73
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
className
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
##
|
|
32
|
-
|
|
33
|
-
`PageFrame`
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
`
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
`
|
|
42
|
-
`
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
`
|
|
58
|
-
|
|
59
|
-
`TerminalBlock
|
|
60
|
-
|
|
61
|
-
`ImagePreview`
|
|
62
|
-
`ShortcutKeys
|
|
63
|
-
|
|
64
|
-
`Pill`
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
`StatusDot`
|
|
68
|
-
warning
|
|
69
|
-
|
|
70
|
-
`
|
|
71
|
-
|
|
72
|
-
`
|
|
73
|
-
|
|
74
|
-
`
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
`
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
`
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
`
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
`
|
|
141
|
-
`
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
`
|
|
147
|
-
|
|
74
|
+
Product facts, navigation adaptation, and application-specific styles stay in the host; this package provides shared activity panels, the complete Assistant composition, shared page shells, and region layouts, so consumers do not need to rebuild whole pages.
|
|
75
|
+
Shared components keep visual extension points for host applications through
|
|
76
|
+
className, and the standard theme provides default styles from `meowtail/theme`
|
|
77
|
+
in the same package based on the registry's component/part identity. The MeowUI registry is a runtime contract
|
|
78
|
+
and installation entry point, not a shadcn-style source distribution directory.
|
|
79
|
+
|
|
80
|
+
## Current components
|
|
81
|
+
|
|
82
|
+
`PageFrame` accepts header, toolbar, notice, footer, and children, allocates available height between the page header and body, and provides the shared page outer edge.
|
|
83
|
+
The optional `notice` sits between the header and the scrolling body; the optional `footer` stays after the body, so a composer or action bar does not need to float over content.
|
|
84
|
+
Business content and iframes go into the body and no longer each subtract the header height from the viewport.
|
|
85
|
+
The default `variant="page"` provides a bounded width and the page outer edge; `variant="workspace"` is for full-width toolbars and continuous reading/input workspaces, where the shell does not add another page inset and content components keep owning reading width and a safe bottom edge.
|
|
86
|
+
Both shells constrain the body height; the header takes its natural height, actions can wrap, and content expanded in place can overlay the main region.
|
|
87
|
+
`AppBar` is the compact application chrome used in `PageFrame`'s header slot: one title, one optional status line (usually `ChatStatus`), and the actions for the whole screen. It is distinct from `PageHeader` (page title block) and the keyboard `Toolbar`; use it for continuous small-screen workspaces, not as a second page header on desktop pages.
|
|
88
|
+
|
|
89
|
+
`scrollOwner="content"` is the default, where the body hands scrolling to an existing inner container; `scrollOwner="layout"` has the body itself carry natural flow and scrolling. Titles, close buttons, and other header actions do not go inside the body scroll region.
|
|
90
|
+
Only `content` mode allocates stretch space to direct content roots; `layout` mode keeps controls' own default sizes.
|
|
91
|
+
`RegionLayoutDescription` declares page regions with a named matrix; the browser host calls
|
|
92
|
+
`mountRegionLayout(host, layout, options)` and gets `regions` content roots, `showGroup`, `back`, and `dispose`.
|
|
93
|
+
Authors put content into these roots; rectangular regions, finite sizes, local arrangement, and scroll ownership share the same validation and renderer.
|
|
94
|
+
`content` rows claim space by natural content, and `fill` rows claim the remainder; when space is short, content regions keep actions reachable according to their scroll owner. Components should limit their own long content rather than relying on the shell's default clipping to preserve reading space.
|
|
95
|
+
Multiple columns project to one column in narrow windows; a region's `compactRow="content" | "fill"` can specify natural height or remaining height in that projection, and when omitted it is derived from the original matrix row. It does not change grouping, desktop geometry, content mounting, or scroll owner.
|
|
96
|
+
See unified Extension region layout (historical reference in the original product repository) for
|
|
97
|
+
cross-module contracts and shared use between built-ins and extensions.
|
|
98
|
+
The original product's wiring and UI acceptance are historical evidence and cannot replace independent verification after this library's migration.
|
|
99
|
+
|
|
100
|
+
`CodeBlock` accepts raw `code` and an optional `language`, loads Shiki highlighting on demand for known syntaxes, and provides independent copy and soft-wrap toggles.
|
|
101
|
+
Wrapping changes only the display; copying preserves the original whitespace. When the browser clipboard fails, it shows feedback. The host can bind `onCopy` to another
|
|
102
|
+
clipboard implementation, and the component does not execute code. With no language it shows "Code", and `defaultWrap` sets the initial wrap state.
|
|
103
|
+
Unknown languages or failed highlight loads keep a plain-text display.
|
|
104
|
+
|
|
105
|
+
`Checkbox`, `Switch`, and `SegmentedControl` provide native form selection; `Tabs` handles switching panels that stay mounted.
|
|
106
|
+
`Menu`, `HoverCard`, `Toast`, and `RiskConfirmation` provide menus, previews, and feedback, while business actions and display lifetimes are the host's responsibility.
|
|
107
|
+
Menu's Tab / Shift+Tab closes the whole menu chain and leaves along the native order without activating menu items; Escape closes one layer at a time and returns to that layer's entry point.
|
|
108
|
+
`TerminalBlock`, `ReadBlock`, `DiffBlock`, `SearchBlock`, `WebBlock`, and `JsonBlock/JsonTree`
|
|
109
|
+
display host-provided output; components do not execute tools or read files. `ReadBlock` accepts `lang`, loads highlighting when it first enters the viewport, and keeps unknown languages as plain text.
|
|
110
|
+
`ImagePreview` unifies image loading, failure, and the preview frame; `ImageLightbox` provides single-image viewing;
|
|
111
|
+
`ShortcutKeys`, `PathLabel`, `StateDot`, and `TextShimmer` provide supporting presentation.
|
|
112
|
+
|
|
113
|
+
`Pill` is for compact capsule labels or actions, with selected state provided by the host; static labels use `Badge`, which supports outline, solid, and quiet presentation.
|
|
114
|
+
|
|
115
|
+
Shared components added by the UI revision (system design draft (historical reference in the original product repository)):
|
|
116
|
+
`StatusDot` expresses state as processing (accent pulse), success, returned (hollow green; an execution return does not mean the goal is complete),
|
|
117
|
+
warning, danger, unknown (hollow gray; do not pretend to know), and idle; the dot itself carries no text.
|
|
118
|
+
`Status` accepts `state` and a required `label`, treating the decorative dot and visible state text as one content unit; the standard theme fixes the dot at 7px
|
|
119
|
+
and exposes no `size` or `halo`. `label` keeps `Child` composition and excludes direct empty values and booleans; callers must ensure
|
|
120
|
+
strings, arrays, and dynamic content are actually non-empty and visible, and use content suitable for inline presentation. `ListRow.status` and
|
|
121
|
+
`ResourceCard.status` still accept `Child` and can take `Status`; `WorkCard`, `Timeline`, and similar components keep their internal markers
|
|
122
|
+
and are not mechanically replaced with imperative rewrites, per-signal dots, or decorative dot matrices without per-dot text. The caller still reviews the non-empty semantics of status text.
|
|
123
|
+
`Tag` is a static fact next to content
|
|
124
|
+
(neutral, emphasized, orange count, monospace path), while selection and filtering still use `Pill`; `ProcessGroup` and `ProcessStep` are collapsible step records;
|
|
125
|
+
`WorkCard` is a single control in a conversation that points to one piece of work; `IconRail`, `RailItem`, and `RailSection` form a 56px icon rail that expands on hover or keyboard
|
|
126
|
+
focus into a 256px drawer over the content, and a collapsed group folds into one icon that shows the current position of its items with an orange dot.
|
|
127
|
+
`Button`'s `outline` is the secondary level, plus `accent` (a soft background related to current activity) and `stop` (to interrupt running work).
|
|
128
|
+
Details and page structures added in the second stage: `DetailSection` (a block with a hairline; its title is a small label rather than a page title), `Timeline` and
|
|
129
|
+
`TimelineItem` (events threaded on one line, with markers following `StatusDot` semantics), `ResourceLink` (a whole-row reference to an openable object:
|
|
130
|
+
a link when href is present, otherwise a button); `PageHeader` (page name, one-sentence purpose, and page-level actions), `ListGroup` and `ListRow` (sibling entries share one
|
|
131
|
+
outline, an editing area can expand below a row, and a standalone row with `tone="accent"` is a summary row), `ResourceCard` (a capability on an overview page, with a dashed
|
|
132
|
+
low-contrast disabled state); `Drawer` is a narrow-screen native modal panel that slides in from the start edge, with backdrop clicks and Escape handed to the host to update `open`. `SegmentedControl`
|
|
133
|
+
tightens its track and selected state to match the design draft. The narrow-screen `ChatComposer` stacked layout puts "add, input, send" on one row and keeps model selection below.
|
|
134
|
+
The palette and layers live only in `theme/palette.ts`: `accentTokens`, `statusTokens`, `radiusTokens` (8/10/14/22), `lineTokens`
|
|
135
|
+
(0.5px hairlines), and `layerTokens`; accent expresses only "happening now" and "where you are", while primary stays black and white.
|
|
136
|
+
|
|
137
|
+
`ChatToolCall` uses `label` for the action and `summary` for the short target still visible when collapsed; input/output are reactive lazy text,
|
|
138
|
+
and overlong results collapse through the shared `OutputBlock` and copy in full. queued/running/waiting/success/error/cancelled/unknown
|
|
139
|
+
each represent host facts, and complete stays for compatibility. onRetry/onCancel only notify the host; the component does not execute tools or update business state automatically.
|
|
140
|
+
`ChatTask` provides a title, state, public execution summary, separate executionText/replyText, optional native progress, and children/footer;
|
|
141
|
+
execution success without a received public reply is still presented accurately. It defaults to unknown; unknown progress is omitted rather than faking percentages.
|
|
142
|
+
`ChatProcess` aggregates records with native details, and tasks and tools continue to reuse Stack/Inline/Grid, sources, attachments, artifacts, and code components.
|
|
143
|
+
For existing/added/host boundaries across the full lifecycle and the coherent composition rules, see [Agent components](AGENT-COMPONENTS.md);
|
|
144
|
+
for real default compositions, see agent-workflow, agent-workflow-narrow, and agent-workflow-assistant in Meowbook.
|
|
145
|
+
The existing AssistantView JSON catalog also gains finite tool/task parts and onToolAction while reusing the same components;
|
|
146
|
+
it adds no separate ChatTask/ChatToolCall JSON entry, recursive task tree, or arbitrary object interpretation. See the [JSON contract](JSON.md) for the supported set.
|
|
147
|
+
|
|
148
|
+
`ChatMessageList` row spacing is declared by the column and read by the rows: the column sets `--chat-row-pitch` on every non-first row, and rows use it for their
|
|
149
|
+
top margin, with the first row's top margin coming from the list's own inset. When the host mounts messages one by one, it can insert a layout-free container
|
|
150
|
+
(`display: contents`) between the column and the rows, and row spacing matches that of direct children. Tool calls, process groups, and sources share one set of row metrics
|
|
151
|
+
(leading box, gaps, and row box) and scale with the `--chat-font-body` delta relative to 14px: changing the conversation font size
|
|
152
|
+
moves the glyph box, glyphs, row box, and expanded-body indentation together. Content owned by a row (expanded body, rows inside a group) hangs on the row label's
|
|
153
|
+
axis and is hierarchically distinct from the label itself; entries beside the row stay on the same axis.
|
|
154
|
+
|
|
155
|
+
Consecutive replies pass the same avatar with `continuation`, and the theme keeps the avatar column while hiding repeated avatars; the body axis does not depend on adjacent DOM structure. Groups without an avatar keep the avatar-free layout.
|
|
156
|
+
|
|
157
|
+
See [Component development conventions](AGENTS.md) for the default scale and component development order. Calibrate new components on the same screen as existing controls in Meowbook
|
|
158
|
+
first, then integrate them into applications; the theme's font sizes, control heights, and three-level spacing form one set of relationships, and each component does not get its own new sizes.
|
|
159
|
+
Default buttons are 36px high, compact buttons 28px, and input controls 32px. Information blocks are tight inside; page edges, standalone blocks, and reading areas should have generous whitespace.
|
|
160
|
+
Local spacing tokens are not the ceiling for page whitespace, and not every level is uniformly compressed.
|
|
161
|
+
|
|
162
|
+
Use `uiTokens.fontBody` for interface body text, `uiTokens.fontCaption` for supporting descriptions, `uiTokens.fontReading` for long-form and conversation body text,
|
|
163
|
+
`uiTokens.fontTitle` for local titles, and `uiTokens.fontPageTitle` for complete page titles; do not use the page-title scale for field labels. The horizontal padding of ordinary controls comes from
|
|
164
|
+
`uiTokens.controlPaddingInline`; group, section, and panel express whitespace within a group, between areas, and at container edges respectively.
|
|
165
|
+
Relative indentation in reading paragraphs, media sizes, graph coordinates, and touch targets still follow real usage and do not adopt control scales.
|
|
166
|
+
|
|
167
|
+
`PageFrame`'s page edge uses `pageInsetBlock` / `pageInsetInline`, and narrow windows use the corresponding
|
|
168
|
+
`pageInsetCompactBlock` / `pageInsetCompactInline`; page whitespace is not compressed into local panel padding.
|
|
169
|
+
`ResourceCard` uses unified local titles, body text, supporting text, and card radius; padding and vertical rhythm for compact overview objects are defined only in component theme tokens,
|
|
170
|
+
without arbitrary pixel or density parameters. Identities that need checking use the supporting text color and a monospace font, and the disabled state does not erase
|
|
171
|
+
the name or the reason the action is unavailable.
|
|
172
|
+
Meowbook's `page-structure-long-content` adds compositions with long names, precise identifiers, adjacent states, and disabled actions;
|
|
173
|
+
`EmptyState` passes through the caller's native attributes, and state urgency and loading facts still come from the host.
|
|
174
|
+
|
|
175
|
+
Run `bun test packages/meowtail/tests/unit` from the repository root to run the Bun tests in `tests/unit`; typechecking and the component behavior regressions in `tests/browser` run separately. File ownership and naming follow the test file organization specification (historical reference in the original product repository).
|
|
176
|
+
Browser tests start only this package's Meowbook scenes and do not need the Dashboard. Component interaction, layout, conversation components, and theme
|
|
177
|
+
regressions all live in `tests/browser`; the catalog there verifies the actual integration of this package's showcase configuration as a Meowbook consumer.
|
|
178
|
+
Meowbook's own tool and standalone fixture tests are still handled by `test:meowbook`.
|
|
179
|
+
A complete UI regression also requires running the Meowbook tests and the browser scenes in this package's `playwright.config.ts`.
|
|
180
|
+
|
|
181
|
+
`ChoiceGroup` directly displays a small number of single-choice options and reuses native radio keyboard, form, and required validation.
|
|
182
|
+
It supports option descriptions, disabled options, controlled values, and form reset; it does not handle submission.
|
|
183
|
+
`ChatQuestion` lays out the question, supporting description, answer content, feedback, and actions; the meaning of answer modes, asynchronous submission, and cancellation
|
|
184
|
+
is the host's responsibility. The standard theme follows the compact work scale and keeps related actions grouped rather than stretching them to the container edges by default.
|
|
185
|
+
|
|
186
|
+
### Layout and content composition
|
|
187
|
+
|
|
188
|
+
`Stack` arranges vertically; `Inline` arranges horizontally and allows wrapping by default. Both provide `gap` (none/compact/normal/relaxed),
|
|
189
|
+
`align`, and `justify`; `Inline wrap={false}` explicitly keeps a single line. Components keep direction and arrangement structure, and the theme decides semantic spacing.
|
|
190
|
+
`Grid` arranges automatically by container width by default, with `minColumnWidth` set to compact/normal/wide; `columns={1|2|3|4}` can also be specified.
|
|
191
|
+
A fixed column count does not silently become a responsive count. `Container width` is narrow/content/wide/page/full, and the theme controls the maximum content width.
|
|
192
|
+
Stack stretches by default so forms and content regions fill the width; when mixing labels and buttons, use `align="start"` to keep natural sizes,
|
|
193
|
+
or put the actions in an Inline. Fields, actions, and long text clearly choose stretch, start, or baseline alignment according to their content relationship.
|
|
194
|
+
|
|
195
|
+
Local layout can freely nest these JSX components: first choose the horizontal, vertical, or parallel relationship, then use `LayoutItem` when space needs allocating,
|
|
196
|
+
while content and native semantics are still carried by real components. The page shell and named region matrix allocate page space and do not limit component composition inside a region;
|
|
197
|
+
no new serializable recursive layout template or second layout engine was added.
|
|
198
|
+
|
|
199
|
+
Use this set of layout primitives and do not reimplement direction, alignment, and spacing in applications. Stack/Inline/Grid `rowGap` and
|
|
200
|
+
`columnGap` default to auto (following gap) and can use the same semantic spacing independently. Layouts can use `as="header"` or
|
|
201
|
+
`as="footer"` to keep region semantics; components do not choose business breakpoints, text truncation, or wrapping strategies for the host.
|
|
202
|
+
|
|
203
|
+
`ActionRail` is one action row with named `leading`, `trailing`, and `submit` slots. The rail owns start/end anchoring and the rule that the submit action stays visible while flexible leading and trailing actions wrap; callers pass actions rather than layout classes. `MetaRow` is one page-level fact row: `items` carry an optional icon and a short label, separators are generated between facts, `progress` appends one optional progress fact (finite values clamp to 0–100; non-finite values are omitted), and `align`/`progressTone` select the two finite presentations. Neither component owns business state or actions.
|
|
204
|
+
|
|
205
|
+
`Toolbar` is horizontal by default and allows wrapping; `orientation="vertical"` arranges it vertically. It provides one Tab stop for its own buttons and for the action set of native input-like buttons and links with href; arrow keys, Home / End move within the current set, and horizontal orientation respects RTL. Native Input, Textarea, Select, and composite controls that manage their own keyboard keep independent Tab stops and editing keys; nested Toolbars do not consume them twice. Entries that are hidden, disabled, inert, or explicitly set to `tabIndex=-1` by the author are excluded from the action set, and dynamic membership changes do not steal focus. Enter / Space still activate along native control behavior, and complex inputs are not automatically folded into an overflow menu; unmounting restores the tabindex values this component managed and preserves the caller's subsequent valid attributes.
|
|
206
|
+
|
|
207
|
+
`LayoutItem` controls space allocation for direct children: `grow` defaults to false, `shrink` to true,
|
|
208
|
+
`basis` to auto, and `alignSelf` to auto. Its root with Stack/Inline/Grid keeps min-width:0 and min-height:0
|
|
209
|
+
so nested children can accept the finite space the parent allocates; whether long identifiers
|
|
210
|
+
break or body text truncates is decided by the content. Use it only when child space needs controlling, not as a wrapper around every element.
|
|
211
|
+
|
|
212
|
+
For a vertical workspace, first have the host or PageFrame provide a finite height, then allocate the body remainder with `LayoutItem grow`.
|
|
213
|
+
Content that actually scrolls explicitly uses `overflow: auto`; layout components do not clip content by default and do not choose a scroll owner automatically.
|
|
214
|
+
When continuing with layout components such as Stack in between, keep using shrinkable roots; when inserting host wrappers such as native divs, the wrapper still has to handle its own
|
|
215
|
+
height and minimum size. A Stack without a height constraint keeps natural flow, and actions with `shrink={false}` keep their natural size.
|
|
148
216
|
|
|
149
217
|
```tsx
|
|
150
|
-
//
|
|
218
|
+
// Label and value belong to one group; mixed font sizes align along the text baseline.
|
|
151
219
|
<Inline gap="compact" align="baseline">
|
|
152
|
-
<small
|
|
220
|
+
<small>Default connection</small>
|
|
153
221
|
<strong>Codex</strong>
|
|
154
222
|
<small>gpt-6-luna</small>
|
|
155
223
|
</Inline>
|
|
156
224
|
|
|
157
|
-
//
|
|
225
|
+
// The body uses the remaining width; the action keeps its natural size.
|
|
158
226
|
<Inline wrap={false}>
|
|
159
227
|
<LayoutItem grow><Stack gap="compact">{title}{description}</Stack></LayoutItem>
|
|
160
|
-
<LayoutItem shrink={false}><Button
|
|
228
|
+
<LayoutItem shrink={false}><Button>Edit connection</Button></LayoutItem>
|
|
161
229
|
</Inline>
|
|
162
230
|
|
|
163
|
-
//
|
|
231
|
+
// Actions sit close together, with clearer line spacing when they wrap.
|
|
164
232
|
<Inline as="footer" gap="compact" rowGap="normal">{actions}</Inline>
|
|
165
233
|
```
|
|
166
234
|
|
|
167
|
-
Meowbook
|
|
235
|
+
Meowbook's "Layout composition · Text baseline and fixed actions" covers these compositions and long model identifiers together.
|
|
168
236
|
|
|
169
|
-
`DescriptionList` / `DescriptionItem term={...}`
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
237
|
+
`DescriptionList` / `DescriptionItem term={...}` organize related labels and values with native `dl` / `dt` / `dd`.
|
|
238
|
+
Labels in the same group take their natural width up to a cap, and values share a column start; when the local container is too narrow, each item stacks label above value
|
|
239
|
+
based on the local width, not the whole window. By default it keeps semantic font sizes and wrappable long text, and provides no surface, padding, or independent scrolling.
|
|
240
|
+
It needs the parent container to allocate available width and does not promise a layout that tightens width to content; the current Web theme uses CSS subgrid and container queries.
|
|
241
|
+
Labels and arbitrary values accept `Child`; values continue to compose existing layouts and controls, and no metadata schema or extra action slot is provided.
|
|
242
|
+
Code fonts, truncation, and fixed-size child content are decided by the consumer; ordinary text and long identifiers can wrap by default.
|
|
243
|
+
The public parts are `description-list/root` and `description-item/root/term/value`, and native attributes pass through to each component root.
|
|
176
244
|
|
|
177
245
|
```tsx
|
|
178
246
|
<DescriptionList>
|
|
179
|
-
<DescriptionItem term="
|
|
247
|
+
<DescriptionItem term="Working directory">
|
|
180
248
|
<Inline wrap={false} gap="compact" align="start">
|
|
181
249
|
<LayoutItem grow>
|
|
182
250
|
<code>{workspacePath}</code>
|
|
183
251
|
</LayoutItem>
|
|
184
252
|
<LayoutItem shrink={false}>
|
|
185
|
-
<Button size="small"
|
|
253
|
+
<Button size="small">Copy directory</Button>
|
|
186
254
|
</LayoutItem>
|
|
187
255
|
</Inline>
|
|
188
256
|
</DescriptionItem>
|
|
189
|
-
<DescriptionItem term="
|
|
257
|
+
<DescriptionItem term="Access mode">Read-only</DescriptionItem>
|
|
190
258
|
</DescriptionList>
|
|
191
259
|
```
|
|
192
260
|
|
|
193
|
-
Meowbook
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
`Card`
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
Title
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
`FieldGroup`
|
|
204
|
-
`AspectRatio ratio={16/9}`
|
|
205
|
-
`Separator`
|
|
206
|
-
|
|
207
|
-
`Tabs`
|
|
208
|
-
|
|
209
|
-
`Breadcrumb items`
|
|
210
|
-
`Tooltip`
|
|
211
|
-
Escape
|
|
212
|
-
`Alert tone`
|
|
213
|
-
`
|
|
214
|
-
|
|
215
|
-
`
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
`
|
|
228
|
-
|
|
229
|
-
`
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
`
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
`
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
`
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
`
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
`
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
`
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
`
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
`
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
`
|
|
302
|
-
`
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
`
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
261
|
+
Meowbook's `description-list-composition` shows wide and narrow local containers, long labels and identifiers,
|
|
262
|
+
actions and inputs inside values in one viewport, for checking shared columns, natural reflow, native semantics, and draft continuity; it does not mean a business page has been accepted.
|
|
263
|
+
|
|
264
|
+
`Card` supports CardHeader, CardTitle, CardDescription, CardAction, CardContent, and CardFooter.
|
|
265
|
+
The default `variant="auto"` takes depth from the render tree Context: the standard theme presents the top level as an independent surface and blends descendants into the parent; an explicit variant takes precedence.
|
|
266
|
+
Depth follows the logical component tree, so an overlay does not automatically become a new root just because it visually leaves the parent card; overlay content that needs an independent surface uses surface explicitly.
|
|
267
|
+
Title can specify h2–h6; heading levels are still decided by document structure and are not guessed automatically from card nesting.
|
|
268
|
+
Ordinary internal groups use the shared surface, standalone items can explicitly use `variant="surface"`, and `variant="embedded"` explicitly blends into the parent surface.
|
|
269
|
+
Nesting does not mean borders and shadows must be repeated. Complex content still uses Stack/Inline/Grid layout; do not turn Card into a universal layout component.
|
|
270
|
+
|
|
271
|
+
`FieldGroup` organizes fields with native fieldset/legend and supports disabling the whole group; Field continues to handle association for a single field.
|
|
272
|
+
`AspectRatio ratio={16/9}` controls layout ratio; the caller chooses media object-fit and clipping.
|
|
273
|
+
`Separator` keeps horizontal/vertical separator semantics.
|
|
274
|
+
|
|
275
|
+
`Tabs` uses the required id, label, and items (value/label/content/disabled) to create associated tabs/tabpanels;
|
|
276
|
+
it supports arrow keys, Home/End, a controlled value Signal, and defaultValue. Panels stay mounted when switching, so drafts are not lost.
|
|
277
|
+
`Breadcrumb items` is an array of label/href, and the last item marks the current location.
|
|
278
|
+
`Tooltip` uses `trigger(bindings)` to add text descriptions to named focusable controls; it appears after a mouse delay, appears immediately on keyboard focus,
|
|
279
|
+
and closes on Escape; do not put necessary information or interactive content only in a Tooltip—use Popover for the latter.
|
|
280
|
+
`Alert tone` expresses visual state, and `role` explicitly chooses status/alert; urgency is not inferred from color.
|
|
281
|
+
`Alert layout="bar"` is the compact page-notice form: one line with a status dot, body text and a trailing action; the default `layout="block"` keeps title/body/actions for outcomes that need reading. Use `bar` in `PageFrame`'s notice slot; it is a semantic notice shape, not a device variant.
|
|
282
|
+
|
|
283
|
+
`Skeleton` is an aria-hidden placeholder; the caller provides the content region's aria-busy and loading copy.
|
|
284
|
+
`SkeletonBoundary active={loading} label="Updating details"` applies skeleton presentation to already mounted content;
|
|
285
|
+
`active` accepts a boolean or Signal, and toggling does not unmount children, preserving input drafts and component state.
|
|
286
|
+
While loading, the region is marked aria-busy and its content is inert, and screen readers get the caller-provided loading copy from a status outside the region.
|
|
287
|
+
Focus inside the content is released when loading starts and is not automatically reclaimed when it finishes. Callers should put available actions such as cancel and retry outside the boundary.
|
|
288
|
+
Underneath it uses MeowJSX Web's shared skeleton controller, which uniformly removes detail from text, images, icons, and inputs; this is loading presentation only and does not
|
|
289
|
+
start requests, time anything, or decide completion. When there is no content geometry on first load, the caller still uses `Skeleton` to provide placeholder structure.
|
|
290
|
+
When the host explicitly wires an `observation` hub into the Web renderer, the boundary gets its source from the render tree Context and subscribes to its own
|
|
291
|
+
component subtree; nested boundaries are located by contract and node ownership, not by function name. An ordinary unobserved renderer still uses the local DOM
|
|
292
|
+
approach and does not force the component index on. Both approaches keep supplementary listeners for external DOM and theme changes.
|
|
293
|
+
`Spinner label` provides a readable loading state and does not claim real progress.
|
|
294
|
+
|
|
295
|
+
The native select control `Select` reuses browser option, keyboard, and form semantics and provides a `root` part; the theme decides visuals. It is used both for the Meowbook tool appearance and for scene theme selection. The control keeps native `size` (row count) semantics and does not reuse it as a visual size.
|
|
296
|
+
|
|
297
|
+
`Popover` is a non-modal general overlay; it does not set a menu role or trap focus by default. It requires `id` and
|
|
298
|
+
`trigger(bindings)`; the trigger button exposes the bindings, and content goes in children. It supports `open` Signal / `defaultOpen`,
|
|
299
|
+
`onOpenChange`, `align`, `matchTriggerWidth`, `role`, and `labelledBy`. `triggerId` can associate with an external Field.
|
|
300
|
+
It uses the browser Popover API's top-layer hosting and depends on browsers that support that API; positioning uses `@floating-ui/dom`'s
|
|
301
|
+
offset/flip/shift/size and autoUpdate while open, cleaned up on close or unmount. An outside click closes the topmost layer,
|
|
302
|
+
and Escape returns to the current layer's entry point; focus moved outside is not reclaimed. Content is reached in ordinary Tab order, and menu keyboard rules are provided by the consumer.
|
|
303
|
+
Local DOM controls handle Escape first; a child's `preventDefault()` means consumed, and when unconsumed only the original topmost calls the existing `onKeyDown` once and tries to close, re-checking the original layer after the callback so the same key cannot close the parent. `stopPropagation()` alone blocks custom dispatch and does not promise to prevent native Dialog default cancellation. Normal focus return still requires a successful close and an available trigger; a controlled refusal to close, an external deliberate focus move, and unmount are not forcibly overridden, and caller exceptions are not swallowed.
|
|
304
|
+
After positioning and height limiting, only the topmost overlay scrolls its currently focused internal item into view, without moving focus or scrolling outer layers.
|
|
305
|
+
The parts are `root/panel`; surface, spacing, and motion belong to the theme.
|
|
306
|
+
|
|
307
|
+
`ChoiceSelect` implements custom single selection on Popover; native `Select` continues to serve system pickers and multiple selection.
|
|
308
|
+
`options` is `{ value, label, disabled?, group? }[]`; it supports `defaultValue` or a controlled `value` Signal,
|
|
309
|
+
and `onValueChange` receives selections. Arrow keys, Home/End, character search, Enter/Space, Escape, and Tab work.
|
|
310
|
+
`id` is used for Field association; `name/required/disabled/form` connect to a native form control, and a required failure blocks submission and focuses the
|
|
311
|
+
trigger. Error messages use the browser's native validation copy. Reset restores the uncontrolled default value, and a controlled value still belongs to the caller.
|
|
312
|
+
The theme visually hides the native form carrier; a hidden input is not used to fake required validation. It provides no custom multiple selection or asynchronous search.
|
|
313
|
+
The parts are `root/trigger/value/indicator/list/group/option/native/validation`.
|
|
314
|
+
|
|
315
|
+
- Basics: Button, AddButton, IconButton, Card, Badge, Input, Textarea, Select, Field,
|
|
316
|
+
SearchInput, Disclosure, Separator, NavItem, EmptyState.
|
|
317
|
+
- Dialogs: Dialog, DialogPanel, DialogHeader, DialogActions.
|
|
318
|
+
- Chat: ChatFrame, ChatHeader, ChatStatus, ChatConversation, ChatMessageList, ChatMessage, ChatBubble,
|
|
319
|
+
ChatMessageActions, ChatComposer, ChatToolCall, ChatAttachments, ChatProcess, ChatSources.
|
|
320
|
+
- Icons: the finite semantic set `Icon` and `iconNames` sourced from the pinned Lucide dependency, caller-supplied `IconSource` and `IconNode`, and the `meowtail/icons/lucide` pass-through for application icons, plus MeowlandMark, DoodleCat, NotesIcon, TasksIcon, SearchIcon, PlusIcon, GithubIcon, ExternalArrowIcon.
|
|
321
|
+
|
|
322
|
+
Icons outside the semantic set go through `IconSource` with structural `IconNode` data from a trusted source. The pinned pass-through at `meowtail/icons/lucide` re-exports the installed Lucide version, so an application can use any Lucide icon without adding its own icon dependency; JSON surfaces keep only the finite `iconNames` set:
|
|
323
|
+
|
|
324
|
+
```tsx
|
|
325
|
+
import { IconSource } from "meowtail/icons";
|
|
326
|
+
import { Bell } from "meowtail/icons/lucide";
|
|
327
|
+
|
|
328
|
+
<IconSource source={Bell} size={16} label="Notifications" />;
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
Before adding a component, confirm it can be reused in more than two applications or scenes; page components used once by an application should not be moved
|
|
332
|
+
here just to "extract" them.
|
|
333
|
+
|
|
334
|
+
When `Field` has a single control child and can resolve association from `htmlFor`, `descriptionId`, or `errorId`, it
|
|
335
|
+
connects the description and error node ids to the control's `aria-describedby` and sets
|
|
336
|
+
`aria-invalid` when there is an error. Multiple control children or custom compositions still require the caller to pass association attributes explicitly.
|
|
337
|
+
|
|
338
|
+
`Dialog` handles only the native `<dialog>` structure, label association, and panel/header/actions partitioning; opening, closing,
|
|
339
|
+
Escape, focus return, and submission results are still controlled by the application. It has no Radix-like context, portal, or focus trap;
|
|
340
|
+
do not assume the component already provides those behaviors.
|
|
341
|
+
`DialogPanel header={...}` and `Drawer header={...}` explicitly compose the shared `PageFrame`, with the title and close
|
|
342
|
+
sharing a fixed header and the body as the only main scroll region. `DialogPanel as="form"` keeps native form ownership and submission;
|
|
343
|
+
short content takes its natural height, and long content inherits the host dialog's maximum height. It does not scan children to guess a title or compute the header height twice.
|
|
344
|
+
Consumers put `DialogHeader` into the header prop and put the body and existing trailing actions into children; the native window,
|
|
345
|
+
cancellation, drafts, and opening method still belong to the host. The body scroll reference is obtained through the public `page-frame/body` part.
|
|
346
|
+
DialogPanel distributes standard whitespace inside its direct header and body, ensuring that focus outlines of the first and last body controls stay within its scroll viewport; an arbitrary Child header separates with the same `spaceSection`, and without a header the body takes panel whitespace on all four sides. The existing DialogHeader composition keeps its original content geometry, and a stable total height is not promised for arbitrary custom headers; no new gap prop was added. The fixed title, exit, and single body scroll remain separate, and it is not promised that any extremely small height is enough to read. Native Dialog opening, cancellation, and caller focus premises are unchanged; the theme whitespace fix does not mean all pointer/system focus paths have been verified.
|
|
347
|
+
|
|
348
|
+
`EmptyState size="compact"` is for a local empty list or an unselected content region, keeping the title, description, and actions while removing decorative artwork.
|
|
349
|
+
The default `size="default"` keeps the full-page empty state; loading and failure still use their existing feedback and do not become empty states.
|
|
350
|
+
|
|
351
|
+
`ChatAttachments` accepts `items: readonly ChatAttachmentItem[]`, where each item has
|
|
352
|
+
`id`, `name`, `url`, `mediaType`, and an optional `sizeBytes`; `label` defaults to "Message attachments".
|
|
353
|
+
The caller provides URLs, and the component does not fetch data. Images are shown by default as accessible new-window links with lazy-loaded previews and become preview buttons when `onPreview` is provided;
|
|
354
|
+
file links download with the original file name and show B / KB / MB when a valid size is available.
|
|
355
|
+
The theme uses the `root/entry/image/preview/file/icon/details/name/size/previewButton/remove` parts of `chat-attachments`
|
|
356
|
+
through `partSelector(chatAttachmentsContract, part)`.
|
|
357
|
+
Each item can provide `onRemove`, passed only when a draft needs a remove action; upload, file deletion, and URL lifecycles still belong to the host.
|
|
358
|
+
|
|
359
|
+
`ComposerPanel` is the composition directly above `ChatComposer`: it owns the writing surface and an optional page-level meta row, while draft, actions and submission stay in `ChatComposer`. It renders `ChatComposer` with `surface="none"`, so the panel never stacks a second chrome. Narrow composition stays with `ChatComposer`'s own layout and the page/footer edge; the panel has no device variant. The meta slot usually holds a `MetaRow`.
|
|
360
|
+
|
|
361
|
+
`ChatFrame` provides reading margins only for a direct `ChatComposer`; if a footer, Card, or other wrapper container owns that region's space,
|
|
362
|
+
the Composer inside uses its natural width within that container and is no longer narrowed or margined by an ancestor Frame.
|
|
363
|
+
|
|
364
|
+
`ChatComposer`'s `hintId` associates the hint node with the input through `aria-describedby`;
|
|
365
|
+
`onInput` is bound on the textarea and `onSubmit` on the outer form. `value` supports Signals, and
|
|
366
|
+
`submitDisabled` only prevents submission, which suits continued editing while waiting for a result; `disabled` prevents both editing and submission.
|
|
367
|
+
Request state, submitted snapshots, and the latest draft are managed by the caller. `attachments` holds materials to send, and `inputLabel` provides the input name.
|
|
368
|
+
The standard theme organizes attachments, input, supporting actions, and submission on one writing surface.
|
|
369
|
+
`surface="none"` removes ChatComposer's own surface chrome and padding so a parent such as `ComposerPanel` can own the writing surface; the default keeps the standard surface.
|
|
370
|
+
`layout="inline"` puts short drafts and actions on the same row, and long drafts keep growing; hints appear on focus, and the default `stacked` keeps a separate tool row.
|
|
371
|
+
`layout="hero"` uses the input height of the desktop master blank conversation. `trailing` composes selection entry points such as provider and model to the left of the send button;
|
|
372
|
+
a controlled `ChoiceSelect` can be passed, expanding grouped options upward with `placement="top"`, `align="end"`, and `matchTriggerWidth={false}`.
|
|
373
|
+
Option sources, current values, and the actual switching of runtime configuration are still the host's responsibility.
|
|
374
|
+
|
|
375
|
+
`ChatMessage` handles identity, arrangement, and state, wrapping `ChatBubble` around content by default and keeping the original call style.
|
|
376
|
+
To show attachments, processes, and text separately, set `surface="none"` and compose `ChatBubble` with other components yourself.
|
|
377
|
+
Bubble's `auto` reads the message role through Context and the theme decides the background; `plain` / `filled` can also be chosen explicitly.
|
|
378
|
+
`header` / `footer` are slots for supplementary material and delivery feedback, and business state still comes from the host.
|
|
379
|
+
|
|
380
|
+
`ChatConversation` is an optional scroll container, and the host must provide a constrained height.
|
|
381
|
+
It follows appended content when near the bottom, keeps position when scrolled up, and provides a return-to-latest button.
|
|
382
|
+
The return action participates in normal layout after the message viewport, claiming its own height when shown and returning the space to messages when hidden; it never floats above historical body text.
|
|
383
|
+
It does not implement history prepending, per-message anchors, or persisted reading restoration. Do not stack it on top of an existing application scroll controller;
|
|
384
|
+
the Dashboard keeps using its own controller. `ChatMessageList` still provides only message-record semantics.
|
|
385
|
+
|
|
386
|
+
A host that already has a scroll owner can use `ChatConversationLatest` alone. It is a normal-flow button that installs no controller, sets no positioning container, and does not allocate height to an arbitrary host viewport on its own.
|
|
387
|
+
For example, the following `transcript`, `latestHidden`, and three callbacks all come from the host's existing controller:
|
|
388
|
+
|
|
389
|
+
```tsx
|
|
390
|
+
import { h } from "meowjsx";
|
|
391
|
+
import { Stack, LayoutItem } from "meowtail";
|
|
392
|
+
import { ChatMessageList, ChatConversationLatest } from "meowtail/chat";
|
|
393
|
+
|
|
394
|
+
<Stack gap="none" style={{ height: "100%" }}>
|
|
395
|
+
<LayoutItem
|
|
396
|
+
grow
|
|
397
|
+
basis={0}
|
|
398
|
+
role="region"
|
|
399
|
+
aria-label="Message reading area"
|
|
400
|
+
tabIndex={0}
|
|
401
|
+
style={{ overflowY: "auto", overflowAnchor: "none" }}
|
|
402
|
+
ref={connectTranscriptViewport}
|
|
403
|
+
onScroll={readTranscriptPosition}
|
|
404
|
+
>
|
|
405
|
+
<ChatMessageList>{transcript}</ChatMessageList>
|
|
406
|
+
</LayoutItem>
|
|
407
|
+
<ChatConversationLatest hidden={latestHidden} onClick={returnToLatest} />
|
|
408
|
+
</Stack>;
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
The parent container must provide a finite height; the LayoutItem in the example is the only scroll viewport, and the button is its sibling.
|
|
412
|
+
The host handles reading position, show/hide, append following, and holding position; `returnToLatest` should scroll to the end, hand focus back to that viewport with `preventScroll`, and then hide the action.
|
|
413
|
+
Do not turn the snippet into absolute positioning and expect it to avoid the body automatically, and do not protect the middle of history with message-end padding or device offsets.
|
|
414
|
+
|
|
415
|
+
`SearchInput` provides a shared shell with a search icon and a native search input; `label` is the required accessible name.
|
|
416
|
+
`className` applies to the shell and `inputClassName` to the input; `id/name/value/disabled/readOnly/aria-*`
|
|
417
|
+
and events all pass to the input, keeping Field descriptions and error associations. Filtering, submission, and result state remain the consumer's responsibility.
|
|
418
|
+
The parts are `root/icon/control`, and the theme decides the default surface, focus, and error boundary.
|
|
419
|
+
|
|
420
|
+
`PathPicker` composes a controlled path input with an optional browse button. The caller provides `value/onValueChange`,
|
|
421
|
+
the accessible name `label`, and an async `onChoose` that returns a path or `null` (canceled); `kind="file" | "directory"`
|
|
422
|
+
only determines the button text, and the host injects the actual selection capability. Without `onChoose`, manual entry still works.
|
|
423
|
+
The component handles waiting, failure feedback, and ignoring results after unmount; it temporarily locks the input while in flight and does not write back an old selection after the parent value or disabled/read-only state changes.
|
|
424
|
+
Choosing only fills in the path; it does not read files, upload files, or grant access. Descriptions, validation, and saving remain the caller's responsibility.
|
|
425
|
+
|
|
426
|
+
`Disclosure` uses native details/summary, accepts `summary: Child` and content children, and supports
|
|
427
|
+
`open/name/onToggle` and other native attributes. `summaryClassName` and `contentClassName` are for host layout;
|
|
428
|
+
the parts are `root/summary/icon/content`. It does not maintain a second expansion state and is not a multi-item Accordion.
|
|
429
|
+
|
|
430
|
+
## Standard theme (meowtail/theme)
|
|
431
|
+
|
|
432
|
+
The standard theme exports `standardTheme`, `standardOptions`, and typed `uiTokens`. The read-only `standardThemeTokens` and `standardThemeStyles` are theme assembly primitives that let extended themes such as MeowSlides reuse the same token/fragment objects; they do not install components or touch the DOM. Tokens and styles
|
|
433
|
+
are both defined in TypeScript; components match CSS through stable part markers and style options, and theme plugins no longer generate
|
|
434
|
+
visual class names. See TypeScript tokens and parameterized configuration (historical reference in the original product repository) for the complete design.
|
|
435
|
+
|
|
436
|
+
Style files use `<responsibility>.styles.ts`; the standard theme groups them by component and conversation responsibility, and application styles are maintained with application modules.
|
|
437
|
+
See the style file organization (historical reference in the original product repository) for naming, component family boundaries, and cascade organization.
|
|
438
|
+
Existing styles have been migrated to this specification, and historical conversation overrides have been merged back into the files owned by messages and the composer.
|
|
439
|
+
|
|
440
|
+
### Component installation and style delivery
|
|
441
|
+
|
|
442
|
+
Component installation and style loading are two explicit steps. `createMeowUI()` registers components and style prop adapters;
|
|
443
|
+
`standardTheme.cssText` provides the complete CSS with variable declarations and component rules. A dynamic host can assemble it like this:
|
|
330
444
|
|
|
331
445
|
```tsx
|
|
332
446
|
import { createRuntime, h } from "meowjsx";
|
|
@@ -343,53 +457,52 @@ const removeTheme = applyTheme(
|
|
|
343
457
|
standardTheme,
|
|
344
458
|
standardOptions.select({ scheme: "light" }),
|
|
345
459
|
);
|
|
346
|
-
const mounted = web.render(<Button variant="quiet"
|
|
460
|
+
const mounted = web.render(<Button variant="quiet">Cancel</Button>, container);
|
|
347
461
|
|
|
348
|
-
//
|
|
462
|
+
// When the host is destroyed:
|
|
349
463
|
mounted.unmount();
|
|
350
464
|
removeTheme();
|
|
351
465
|
removeStyles();
|
|
352
466
|
```
|
|
353
467
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
开放的原生 Props,因此不承诺拒绝所有未知属性。
|
|
468
|
+
When using defaultRuntime, call `installMeowUI(defaultRuntime)` and use the same runtime for the initial render and dynamic controls.
|
|
469
|
+
No separate standard theme plugin needs to be installed. Valid values, defaults, and carrying parts for style props
|
|
470
|
+
are declared by the component contract's `defineStyleProps`; the adapter consumes the props so style options such as variant are not passed through as ordinary DOM attributes.
|
|
471
|
+
`ThemedProps` provides union types and Signal inputs; components keep open native Props and therefore do not promise to reject all unknown attributes.
|
|
359
472
|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
JavaScript
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
`mountStyles`
|
|
473
|
+
A static host composes `standardTheme.cssText` with application CSS at build time, writes a `.css` file loaded by HTML,
|
|
474
|
+
and outputs root attributes through `themeAttributes(standardTheme, config)`. Styles can load before client-side
|
|
475
|
+
JavaScript runs. The Dashboard and Meowbook use this delivery path;
|
|
476
|
+
dynamic previews use `mountStyles(document, cssText)`, with the host holding the returned cleanup function.
|
|
477
|
+
Source code maintains no `.css` files, and generated CSS is still a browser asset. Module imports themselves do not access the DOM;
|
|
478
|
+
`mountStyles` does not deduplicate across calls, so the host should assemble once within the document or application lifecycle.
|
|
366
479
|
|
|
367
|
-
###
|
|
480
|
+
### Root configuration and local overrides
|
|
368
481
|
|
|
369
|
-
`standardOptions`
|
|
370
|
-
|
|
371
|
-
small/default/large
|
|
372
|
-
|
|
373
|
-
|
|
482
|
+
`standardOptions` has a built-in scheme; the current standard theme defaults to `auto` and supports light/dark/auto.
|
|
483
|
+
The standard visuals use DeepSeek Harness as their baseline: system fonts, 14px body, 12px supporting text, and 16px titles; buttons
|
|
484
|
+
use 28/36/44px for small/default/large, and inputs default to 32px. Controls, menus, and large panels use their corresponding
|
|
485
|
+
radii and materials, and applications compose pages from the same language. See [third-party notices](THIRD_PARTY_NOTICES.md) for reference sources and licenses,
|
|
486
|
+
and the migration record (historical reference in the original product repository) for the implementation scope and verification not yet finished.
|
|
374
487
|
|
|
375
488
|
```tsx
|
|
376
489
|
import { Theme } from "meowcss/web";
|
|
377
490
|
|
|
378
491
|
<Theme theme={standardTheme} config={standardOptions.select({ scheme: "dark" })}>
|
|
379
|
-
<Button
|
|
492
|
+
<Button>Save</Button>
|
|
380
493
|
<Theme config={standardOptions.select({ scheme: "light" })}>
|
|
381
494
|
<Preview />
|
|
382
495
|
</Theme>
|
|
383
496
|
</Theme>;
|
|
384
497
|
```
|
|
385
498
|
|
|
386
|
-
`Theme`
|
|
387
|
-
|
|
388
|
-
`themeAttributes
|
|
499
|
+
`Theme` binds configuration only and does not load CSS. Dimensions omitted from a local config inherit from the parent; removing a local selection restores
|
|
500
|
+
inheritance, and component instances and drafts do not need rebuilding. Existing DOM roots use `applyTheme`, static HTML uses
|
|
501
|
+
`themeAttributes`, and the three share attribute semantics. Do not create a new Theme component for each theme.
|
|
389
502
|
|
|
390
|
-
###
|
|
503
|
+
### Styles and component options
|
|
391
504
|
|
|
392
|
-
|
|
505
|
+
Ordinary CSS keeps the template form; tokens and parts are referenced in TypeScript to avoid hand-writing generated names:
|
|
393
506
|
|
|
394
507
|
```ts
|
|
395
508
|
import { buttonContract, buttonOptions } from "meowtail";
|
|
@@ -406,26 +519,26 @@ const applicationStyles = css`
|
|
|
406
519
|
`;
|
|
407
520
|
```
|
|
408
521
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
`style`
|
|
522
|
+
The host explicitly composes CSS in the order of standard theme, application base, and application overrides. hover, focus, media queries, and animation
|
|
523
|
+
continue to be handled by CSS; native states match on native attributes, and component style options use `when`. `className` and
|
|
524
|
+
`style` remain application extension entry points, and business layout does not enter the standard theme.
|
|
412
525
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
526
|
+
Custom tokens use `defineTokens`, and `defineTheme` composes options, complete defaults, token
|
|
527
|
+
sets, and CSS fragments in one call. Component bindings come from typed part references in the fragment; do not convert the fragment to a string early and
|
|
528
|
+
lose that information. Measurement variables without defaults use `tokenRef`, whose `.name` is passed to `setProperty`.
|
|
529
|
+
See [MeowCSS](../meowcss/README.md) for pure generation and typed adapter usage and scope boundaries.
|
|
417
530
|
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
531
|
+
After building and installing the local package, run `bunx --no-install meowbook serve --config packages/meowtail/meowbook.config.ts` from the repository root to
|
|
532
|
+
open component scenes and check light/dark, desktop and narrow screens, input drafts, and state switching. Sizes are Web adaptations;
|
|
533
|
+
see the DeepSeek migration record above for the current visual baseline. See meow-design (historical reference in the original product repository)
|
|
534
|
+
for design judgment and polishing methods; its historical exploration recipes are not the standard theme specification.
|
|
422
535
|
|
|
423
|
-
###
|
|
536
|
+
### Lifecycle extensions
|
|
424
537
|
|
|
425
|
-
|
|
538
|
+
Static visuals use CSS. Use a shadow only when real DOM, instance state, listeners, or cleanup are needed:
|
|
426
539
|
|
|
427
540
|
```ts
|
|
428
|
-
// Web shadow
|
|
541
|
+
// Web shadow: context.element is a real Element.
|
|
429
542
|
import { defineShadow } from "meowjsx/web";
|
|
430
543
|
|
|
431
544
|
runtime.use({
|
|
@@ -452,24 +565,24 @@ runtime.use({
|
|
|
452
565
|
});
|
|
453
566
|
```
|
|
454
567
|
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
renderToHtml + innerHTML
|
|
458
|
-
|
|
459
|
-
###
|
|
460
|
-
|
|
461
|
-
- `meowcss
|
|
462
|
-
- `src/theme/tokens.ts
|
|
463
|
-
- `src/theme/base.styles.ts`
|
|
464
|
-
|
|
465
|
-
- `src/theme/index.ts
|
|
466
|
-
- `bun test packages/meowtail/tests/unit
|
|
467
|
-
- `tsc --noEmit --project packages/meowtail/tsconfig.json
|
|
468
|
-
`tests/types
|
|
469
|
-
- `tests/browser/theme/parameterized-theme.spec.ts
|
|
470
|
-
`tests/fixtures/theme-prototype-demo.tsx`
|
|
471
|
-
|
|
472
|
-
- Rossovia
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
568
|
+
Register centrally; do not generate wrapper components. A shadow shares the signal/effect/onCleanup lifecycle API with components.
|
|
569
|
+
Plugin uninstall blocks later application; instance cleanup for existing elements is handled by the unmount of their mount. Do not use
|
|
570
|
+
renderToHtml + innerHTML instead of browser mounting that needs a lifecycle.
|
|
571
|
+
|
|
572
|
+
### Files and verification
|
|
573
|
+
|
|
574
|
+
- `meowcss`: shared token/option/CSS generation; `meowcss/meowjsx` handles typed parts and automatic carriers; `meowcss/web` handles the DOM theme lifecycle. See [MeowCSS](../meowcss/README.md).
|
|
575
|
+
- `src/theme/tokens.ts`, `palette.ts`: shared parameters and semantic palettes.
|
|
576
|
+
- `src/theme/base.styles.ts` and the `*.styles.ts` files under `components/chat/icons/shared`: CSS templates written by responsibility;
|
|
577
|
+
highlight-specific tokens live in `shared/code-highlight.tokens.ts`.
|
|
578
|
+
- `src/theme/index.ts`: explicit assembly and public exports of the standard theme.
|
|
579
|
+
- `bun test packages/meowtail/tests/unit`: component and standard theme contracts; shared token/option contracts are verified in MeowCSS tests.
|
|
580
|
+
- `tsc --noEmit --project packages/meowtail/tsconfig.json`: typechecks the implementation, showcase scenes, browser tests, and
|
|
581
|
+
public type contracts in `tests/types/`; type cases are not run by Bun.
|
|
582
|
+
- `tests/browser/theme/parameterized-theme.spec.ts`: parameterized theme, local override, and real component composition regressions, targeting
|
|
583
|
+
the standalone test scenes in `tests/fixtures/theme-prototype-demo.tsx` and `tests/fixtures/real-controls-demo.tsx`,
|
|
584
|
+
loaded by this package's dedicated Playwright test config and not part of the component gallery.
|
|
585
|
+
- Dashboard composition verification for Rossovia is still maintained by the product repository and is not a runnable command in this library; the library keeps no tests that depend on a product checkout.
|
|
586
|
+
|
|
587
|
+
Browser acceptance covers the corresponding scenes and cannot be replaced by passing types or build. Component registration must apply to the runtime that actually renders;
|
|
588
|
+
content that needs a lifecycle is mounted with render rather than inserted as an HTML string.
|