meowtail 0.2.0-alpha.0 → 0.2.0-alpha.2

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.
Files changed (163) hide show
  1. package/AGENT-COMPONENTS.md +65 -65
  2. package/ASSISTANT.md +35 -35
  3. package/JSON.md +11 -11
  4. package/README.md +413 -385
  5. package/THIRD_PARTY_NOTICES.md +8 -0
  6. package/dist/src/chat/assistant-composer.js +58 -98
  7. package/dist/src/chat/assistant-content.d.ts +1 -3
  8. package/dist/src/chat/assistant-content.js +36 -44
  9. package/dist/src/chat/assistant-markdown.js +4 -8
  10. package/dist/src/chat/assistant-question.js +13 -14
  11. package/dist/src/chat/assistant.js +27 -26
  12. package/dist/src/chat/attachments.d.ts +3 -2
  13. package/dist/src/chat/attachments.js +43 -34
  14. package/dist/src/chat/composer-panel.d.ts +16 -0
  15. package/dist/src/chat/composer-panel.js +11 -0
  16. package/dist/src/chat/composer.d.ts +7 -3
  17. package/dist/src/chat/composer.js +71 -22
  18. package/dist/src/chat/conversation.js +2 -2
  19. package/dist/src/chat/index.d.ts +1 -0
  20. package/dist/src/chat/index.js +1 -0
  21. package/dist/src/chat/message-list.js +1 -1
  22. package/dist/src/chat/message.js +3 -3
  23. package/dist/src/chat/question.js +1 -1
  24. package/dist/src/chat/sources.js +1 -1
  25. package/dist/src/chat/task.js +9 -15
  26. package/dist/src/chat/tool-call.js +7 -14
  27. package/dist/src/components/accordion.d.ts +24 -0
  28. package/dist/src/components/accordion.js +50 -0
  29. package/dist/src/components/action-rail.d.ts +19 -0
  30. package/dist/src/components/action-rail.js +13 -0
  31. package/dist/src/components/add-button.js +1 -1
  32. package/dist/src/components/alert.d.ts +2 -0
  33. package/dist/src/components/alert.js +2 -1
  34. package/dist/src/components/app-bar.d.ts +17 -0
  35. package/dist/src/components/app-bar.js +10 -0
  36. package/dist/src/components/avatar.d.ts +22 -0
  37. package/dist/src/components/avatar.js +44 -0
  38. package/dist/src/components/breadcrumb.js +1 -1
  39. package/dist/src/components/checkbox.d.ts +6 -2
  40. package/dist/src/components/checkbox.js +36 -8
  41. package/dist/src/components/choice-group.d.ts +1 -0
  42. package/dist/src/components/choice-group.js +12 -17
  43. package/dist/src/components/choice-select.d.ts +3 -1
  44. package/dist/src/components/choice-select.js +56 -54
  45. package/dist/src/components/code-block.d.ts +3 -3
  46. package/dist/src/components/code-block.js +31 -27
  47. package/dist/src/components/context-menu.d.ts +16 -0
  48. package/dist/src/components/context-menu.js +49 -0
  49. package/dist/src/components/credential-source.js +12 -12
  50. package/dist/src/components/diff-block.js +1 -1
  51. package/dist/src/components/disclosure.d.ts +2 -2
  52. package/dist/src/components/disclosure.js +1 -1
  53. package/dist/src/components/hover-card.js +2 -2
  54. package/dist/src/components/image-lightbox.js +3 -3
  55. package/dist/src/components/image-preview.js +1 -1
  56. package/dist/src/components/index.d.ts +12 -0
  57. package/dist/src/components/index.js +12 -0
  58. package/dist/src/components/json-block.js +2 -2
  59. package/dist/src/components/json-tree.js +3 -3
  60. package/dist/src/components/link.d.ts +13 -0
  61. package/dist/src/components/link.js +9 -0
  62. package/dist/src/components/list-group.d.ts +1 -1
  63. package/dist/src/components/menu-button.d.ts +13 -0
  64. package/dist/src/components/menu-button.js +10 -0
  65. package/dist/src/components/menu.d.ts +4 -0
  66. package/dist/src/components/menu.js +3 -3
  67. package/dist/src/components/meta-row.d.ts +34 -0
  68. package/dist/src/components/meta-row.js +61 -0
  69. package/dist/src/components/nav-item.js +2 -5
  70. package/dist/src/components/number-input.d.ts +29 -0
  71. package/dist/src/components/number-input.js +137 -0
  72. package/dist/src/components/output-block.js +8 -15
  73. package/dist/src/components/page-frame.d.ts +6 -2
  74. package/dist/src/components/page-frame.js +2 -2
  75. package/dist/src/components/path-picker.js +9 -14
  76. package/dist/src/components/pill.js +2 -5
  77. package/dist/src/components/popover.js +4 -4
  78. package/dist/src/components/process-group.d.ts +2 -2
  79. package/dist/src/components/progress.d.ts +15 -0
  80. package/dist/src/components/progress.js +12 -0
  81. package/dist/src/components/rail-item.d.ts +2 -2
  82. package/dist/src/components/rail-section.d.ts +1 -1
  83. package/dist/src/components/read-block.js +2 -2
  84. package/dist/src/components/resource-card.d.ts +1 -1
  85. package/dist/src/components/resource-link.d.ts +1 -1
  86. package/dist/src/components/risk-confirmation.js +2 -5
  87. package/dist/src/components/search-block.js +2 -3
  88. package/dist/src/components/segmented-control.js +3 -3
  89. package/dist/src/components/skeleton-boundary.js +4 -7
  90. package/dist/src/components/slider.d.ts +22 -0
  91. package/dist/src/components/slider.js +49 -0
  92. package/dist/src/components/table.d.ts +41 -0
  93. package/dist/src/components/table.js +146 -0
  94. package/dist/src/components/tabs.d.ts +1 -1
  95. package/dist/src/components/tabs.js +11 -20
  96. package/dist/src/components/terminal-block.js +6 -6
  97. package/dist/src/components/text-shimmer.js +2 -5
  98. package/dist/src/components/web-block.js +3 -3
  99. package/dist/src/components/work-card.d.ts +2 -2
  100. package/dist/src/components/work-card.js +1 -1
  101. package/dist/src/icons/README.md +13 -2
  102. package/dist/src/icons/icon-frame.d.ts +11 -0
  103. package/dist/src/icons/icon-frame.js +4 -0
  104. package/dist/src/icons/icon-source.d.ts +17 -0
  105. package/dist/src/icons/icon-source.js +6 -0
  106. package/dist/src/icons/icon.d.ts +44 -37
  107. package/dist/src/icons/icon.js +55 -128
  108. package/dist/src/icons/index.d.ts +1 -0
  109. package/dist/src/icons/index.js +1 -0
  110. package/dist/src/icons/lucide.d.ts +1 -0
  111. package/dist/src/icons/lucide.js +4 -0
  112. package/dist/src/registry/index.d.ts +99 -5
  113. package/dist/src/registry/index.js +28 -3
  114. package/dist/src/shared/execution-state.js +7 -7
  115. package/dist/src/theme/chat/composer-panel.styles.d.ts +1 -0
  116. package/dist/src/theme/chat/composer-panel.styles.js +47 -0
  117. package/dist/src/theme/chat/composer.styles.js +69 -60
  118. package/dist/src/theme/chat/task.styles.js +5 -6
  119. package/dist/src/theme/components/accordion.styles.d.ts +1 -0
  120. package/dist/src/theme/components/accordion.styles.js +63 -0
  121. package/dist/src/theme/components/action-rail.styles.d.ts +1 -0
  122. package/dist/src/theme/components/action-rail.styles.js +47 -0
  123. package/dist/src/theme/components/alert.styles.js +42 -1
  124. package/dist/src/theme/components/app-bar.styles.d.ts +1 -0
  125. package/dist/src/theme/components/app-bar.styles.js +48 -0
  126. package/dist/src/theme/components/avatar.styles.d.ts +1 -0
  127. package/dist/src/theme/components/avatar.styles.js +52 -0
  128. package/dist/src/theme/components/button.styles.js +9 -0
  129. package/dist/src/theme/components/card.styles.js +2 -0
  130. package/dist/src/theme/components/code-block.styles.js +7 -0
  131. package/dist/src/theme/components/context-menu.styles.d.ts +1 -0
  132. package/dist/src/theme/components/context-menu.styles.js +14 -0
  133. package/dist/src/theme/components/dialog.styles.js +7 -0
  134. package/dist/src/theme/components/link.styles.d.ts +1 -0
  135. package/dist/src/theme/components/link.styles.js +33 -0
  136. package/dist/src/theme/components/list-group.styles.js +1 -0
  137. package/dist/src/theme/components/menu.styles.js +9 -3
  138. package/dist/src/theme/components/meta-row.styles.d.ts +1 -0
  139. package/dist/src/theme/components/meta-row.styles.js +66 -0
  140. package/dist/src/theme/components/number-input.styles.d.ts +1 -0
  141. package/dist/src/theme/components/number-input.styles.js +106 -0
  142. package/dist/src/theme/components/output-block.styles.js +9 -0
  143. package/dist/src/theme/components/page-frame.styles.js +7 -1
  144. package/dist/src/theme/components/page-header.styles.js +7 -0
  145. package/dist/src/theme/components/progress.styles.d.ts +1 -0
  146. package/dist/src/theme/components/progress.styles.js +71 -0
  147. package/dist/src/theme/components/resource-card.styles.js +7 -0
  148. package/dist/src/theme/components/slider.styles.d.ts +1 -0
  149. package/dist/src/theme/components/slider.styles.js +129 -0
  150. package/dist/src/theme/components/table.styles.d.ts +1 -0
  151. package/dist/src/theme/components/table.styles.js +156 -0
  152. package/dist/src/theme/components/tag.styles.js +3 -3
  153. package/dist/src/theme/components/toggle.styles.js +10 -0
  154. package/dist/src/theme/components/toolbar.styles.js +7 -0
  155. package/dist/src/theme/index.d.ts +15 -15
  156. package/dist/src/theme/index.js +24 -0
  157. package/dist/src/theme/palette.d.ts +1 -1
  158. package/dist/src/theme/palette.js +1 -1
  159. package/dist/src/theme/shared/code-highlight.tokens.d.ts +6 -6
  160. package/dist/src/theme/shared/code-highlight.tokens.js +6 -6
  161. package/dist/src/theme/tokens.d.ts +7 -7
  162. package/dist/src/theme/tokens.js +14 -8
  163. package/package.json +9 -4
@@ -0,0 +1,49 @@
1
+ import { defineComponent, derived, unwrap, } from "meowjsx";
2
+ export const sliderContract = {
3
+ name: "slider",
4
+ parts: ["root", "control", "track", "thumb", "value"],
5
+ };
6
+ function asNumber(value, fallback) {
7
+ const next = Number(value);
8
+ return Number.isFinite(next) ? next : fallback;
9
+ }
10
+ /** Native range control. The visible figure is the same value assistive technology reads. */
11
+ export const Slider = defineComponent(sliderContract, ({ label, value, defaultValue, min = 0, max = 100, step = 1, disabled, name, id, onValueChange, className, onInput, ...props }, context) => {
12
+ const initial = value === undefined ? (defaultValue ?? min) : unwrap(value);
13
+ const local = context.signal(initial);
14
+ const current = value !== undefined ? value : local;
15
+ const readValue = () => unwrap(current);
16
+ const display = derived(() => String(readValue()));
17
+ const fill = derived(() => {
18
+ const next = readValue();
19
+ const range = max - min;
20
+ const pct = range <= 0 ? 0 : Math.min(100, Math.max(0, ((next - min) / range) * 100));
21
+ return `${pct}%`;
22
+ });
23
+ const commit = (event) => {
24
+ const input = event.currentTarget;
25
+ const next = asNumber(input.value, readValue());
26
+ if (value === undefined)
27
+ local.value = next;
28
+ onValueChange?.(next);
29
+ onInput?.(event);
30
+ if (value !== undefined)
31
+ input.value = String(unwrap(value));
32
+ };
33
+ return context.part("root", "div", {
34
+ className,
35
+ style: { "--slider-fill": fill },
36
+ }, context.part("control", "input", {
37
+ ...props,
38
+ id,
39
+ name,
40
+ type: "range",
41
+ min,
42
+ max,
43
+ step,
44
+ disabled,
45
+ "aria-label": label,
46
+ value: display,
47
+ onInput: commit,
48
+ }), context.part("track", "span", { "aria-hidden": "true" }, context.part("thumb", "span", { "aria-hidden": "true" })), context.part("value", "output", { htmlFor: id, "aria-hidden": id ? undefined : "true" }, display));
49
+ });
@@ -0,0 +1,41 @@
1
+ import { type Child, type MaybeSignal, type Props } from "meowjsx";
2
+ export declare const tableContract: {
3
+ readonly name: "table";
4
+ readonly parts: readonly ["root", "scroller", "table", "header", "heading", "sort", "resize", "body", "row", "cell", "select"];
5
+ };
6
+ export type TableSortDirection = "asc" | "desc";
7
+ export interface TableSort {
8
+ columnId: string;
9
+ direction: TableSortDirection;
10
+ }
11
+ export interface TableColumn {
12
+ id: string;
13
+ header: Child;
14
+ width?: number;
15
+ minWidth?: number;
16
+ sortable?: boolean;
17
+ resizable?: boolean;
18
+ align?: "start" | "end";
19
+ }
20
+ export interface TableRow {
21
+ id: string;
22
+ cells: readonly Child[];
23
+ /** Accessible name for the row checkbox when the table is selectable. */
24
+ label?: string;
25
+ disabled?: boolean;
26
+ }
27
+ export interface TableProps extends Props {
28
+ label: string;
29
+ columns: readonly TableColumn[];
30
+ rows: MaybeSignal<readonly TableRow[]>;
31
+ sort?: MaybeSignal<TableSort | undefined>;
32
+ defaultSort?: TableSort;
33
+ onSortChange?: (sort: TableSort) => void;
34
+ selected?: MaybeSignal<readonly string[]>;
35
+ defaultSelected?: readonly string[];
36
+ onSelectedChange?: (ids: readonly string[]) => void;
37
+ selectable?: boolean;
38
+ className?: string;
39
+ }
40
+ /** Data table. Sorting and selection are reported; row order and records stay with the caller. */
41
+ export declare const Table: import("meowjsx").Component<TableProps, "table", "body" | "cell" | "header" | "heading" | "resize" | "root" | "row" | "scroller" | "select" | "sort" | "table">;
@@ -0,0 +1,146 @@
1
+ import { defineComponent, derived, h, keyed, unwrap, } from "meowjsx";
2
+ import { Checkbox } from "./checkbox.js";
3
+ import { Icon } from "../icons/icon.js";
4
+ export const tableContract = {
5
+ name: "table",
6
+ parts: [
7
+ "root",
8
+ "scroller",
9
+ "table",
10
+ "header",
11
+ "heading",
12
+ "sort",
13
+ "resize",
14
+ "body",
15
+ "row",
16
+ "cell",
17
+ "select",
18
+ ],
19
+ };
20
+ const defaultMinWidth = 80;
21
+ function sortFor(column, current) {
22
+ if (!column.sortable)
23
+ return current;
24
+ if (current?.columnId !== column.id)
25
+ return { columnId: column.id, direction: "asc" };
26
+ return { columnId: column.id, direction: current.direction === "asc" ? "desc" : "asc" };
27
+ }
28
+ function ariaSort(column, current) {
29
+ if (!column.sortable)
30
+ return undefined;
31
+ if (current?.columnId !== column.id)
32
+ return "none";
33
+ return current.direction === "asc" ? "ascending" : "descending";
34
+ }
35
+ /** Data table. Sorting and selection are reported; row order and records stay with the caller. */
36
+ export const Table = defineComponent(tableContract, ({ label, columns, rows, sort, defaultSort, onSortChange, selected, defaultSelected = [], onSelectedChange, selectable = false, className, ...props }, context) => {
37
+ const localSort = context.signal(defaultSort);
38
+ const localSelected = context.signal(defaultSelected);
39
+ const rowsView = derived(() => unwrap(rows));
40
+ const sortState = derived(() => (sort === undefined ? localSort.value : unwrap(sort)));
41
+ const selectedState = derived(() => selected === undefined ? localSelected.value : unwrap(selected));
42
+ const widths = context.signal(Object.fromEntries(columns.flatMap((column) => column.width !== undefined ? [[column.id, column.width]] : [])));
43
+ const requestSort = (column) => {
44
+ const next = sortFor(column, sortState.value);
45
+ if (!next)
46
+ return;
47
+ if (sort === undefined)
48
+ localSort.value = next;
49
+ onSortChange?.(next);
50
+ };
51
+ const requestSelected = (ids) => {
52
+ if (selected === undefined)
53
+ localSelected.value = ids;
54
+ onSelectedChange?.(ids);
55
+ };
56
+ const toggleRow = (id, checked) => {
57
+ const next = new Set(selectedState.value);
58
+ if (checked)
59
+ next.add(id);
60
+ else
61
+ next.delete(id);
62
+ requestSelected([...next]);
63
+ };
64
+ const enabledIds = () => rowsView.value.filter((row) => !row.disabled).map((row) => row.id);
65
+ let resize;
66
+ const onResizeMove = (event) => {
67
+ if (!resize)
68
+ return;
69
+ const delta = event.clientX - resize.startX;
70
+ const next = Math.max(resize.minWidth, resize.startWidth + delta);
71
+ widths.value = { ...widths.value, [resize.id]: next };
72
+ };
73
+ const onResizeUp = (event) => {
74
+ if (!resize)
75
+ return;
76
+ event.currentTarget.releasePointerCapture(event.pointerId);
77
+ resize = undefined;
78
+ };
79
+ const headerCell = (column) => {
80
+ const heading = column.sortable
81
+ ? context.part("sort", "button", {
82
+ type: "button",
83
+ onClick: () => requestSort(column),
84
+ }, column.header, h("span", { hidden: derived(() => sortState.value?.columnId !== column.id || sortState.value.direction !== "asc") },
85
+ h(Icon, { name: "arrow-up", size: 12 })), h("span", { hidden: derived(() => sortState.value?.columnId !== column.id || sortState.value.direction !== "desc") },
86
+ h(Icon, { name: "arrow-down", size: 12 })))
87
+ : column.header;
88
+ return context.part("heading", "th", {
89
+ scope: "col",
90
+ "aria-sort": derived(() => ariaSort(column, sortState.value)),
91
+ "data-align": column.align,
92
+ style: derived(() => widths.value[column.id] !== undefined
93
+ ? { width: `${widths.value[column.id]}px` }
94
+ : undefined),
95
+ }, heading, column.resizable === false
96
+ ? null
97
+ : context.part("resize", "span", {
98
+ role: "separator",
99
+ "aria-orientation": "vertical",
100
+ "aria-label": "Resize column",
101
+ onPointerDown: (event) => {
102
+ if (event.button !== 0)
103
+ return;
104
+ event.preventDefault();
105
+ event.currentTarget.setPointerCapture(event.pointerId);
106
+ const startWidth = widths.value[column.id] ?? column.width ?? defaultMinWidth;
107
+ resize = {
108
+ id: column.id,
109
+ startX: event.clientX,
110
+ startWidth,
111
+ minWidth: column.minWidth ?? defaultMinWidth,
112
+ };
113
+ },
114
+ onPointerMove: onResizeMove,
115
+ onPointerUp: onResizeUp,
116
+ onPointerCancel: onResizeUp,
117
+ }));
118
+ };
119
+ return context.part("root", "div", { ...props, className }, context.part("scroller", "div", null, context.part("table", "table", { "aria-label": label }, context.part("header", "thead", null, context.part("row", "tr", null, selectable
120
+ ? context.part("heading", "th", { scope: "col" }, context.part("select", "div", null, h(Checkbox, { label: "Select all rows", labelHidden: true, checked: derived(() => {
121
+ const enabled = enabledIds();
122
+ const chosen = selectedState.value;
123
+ return enabled.length > 0 && enabled.every((id) => chosen.includes(id));
124
+ }), indeterminate: derived(() => {
125
+ const enabled = enabledIds();
126
+ const count = enabled.filter((id) => selectedState.value.includes(id)).length;
127
+ return count > 0 && count < enabled.length;
128
+ }), onChange: (event) => {
129
+ const box = event.currentTarget;
130
+ requestSelected(box.checked ? enabledIds() : []);
131
+ } })))
132
+ : null, ...columns.map(headerCell))), context.part("body", "tbody", null, keyed(rowsView, (row) => row.id, (row) => context.part("row", "tr", {
133
+ "data-row-id": derived(() => row.value.id),
134
+ "data-selected": derived(() => selectedState.value.includes(row.value.id) ? "true" : undefined),
135
+ }, selectable
136
+ ? context.part("cell", "td", { "data-table-select": "" }, context.part("select", "div", null, h(Checkbox, { label: derived(() => {
137
+ const current = row.value;
138
+ if (current.label)
139
+ return current.label;
140
+ const index = rowsView.value.findIndex((item) => item.id === current.id);
141
+ return `Select row ${index + 1}`;
142
+ }), labelHidden: true, disabled: derived(() => Boolean(row.value.disabled)), checked: derived(() => selectedState.value.includes(row.value.id)), onChange: (event) => {
143
+ toggleRow(row.value.id, event.currentTarget.checked);
144
+ } })))
145
+ : null, ...columns.map((column, index) => context.part("cell", "td", { "data-align": column.align }, derived(() => row.value.cells[index])))))))));
146
+ });
@@ -20,5 +20,5 @@ export interface TabsProps extends Props {
20
20
  onValueChange?: (value: string) => void;
21
21
  className?: string;
22
22
  }
23
- /** Horizontal tabs with automatic keyboard activation. Panels remain mounted to preserve drafts. */
23
+ /** Horizontal tabs with automatic keyboard activation. Items are fixed for the mount, and panels stay mounted to preserve drafts. */
24
24
  export declare const Tabs: import("meowjsx").Component<TabsProps, "tabs", "indicator" | "list" | "panel" | "root" | "tab">;
@@ -1,4 +1,4 @@
1
- import { defineComponent, unwrap, } from "meowjsx";
1
+ import { defineComponent, derived, unwrap, } from "meowjsx";
2
2
  import { tokenRef } from "meowcss";
3
3
  export const tabsCount = tokenRef("tabs", "count");
4
4
  export const tabsIndex = tokenRef("tabs", "index");
@@ -6,31 +6,22 @@ export const tabsContract = {
6
6
  name: "tabs",
7
7
  parts: ["root", "list", "indicator", "tab", "panel"],
8
8
  };
9
- /** Horizontal tabs with automatic keyboard activation. Panels remain mounted to preserve drafts. */
9
+ /** Horizontal tabs with automatic keyboard activation. Items are fixed for the mount, and panels stay mounted to preserve drafts. */
10
10
  export const Tabs = defineComponent(tabsContract, ({ id, label, items, value, defaultValue, onValueChange, className, ...props }, context) => {
11
11
  const enabled = items.flatMap((item, index) => (item.disabled ? [] : [index]));
12
12
  const local = context.signal(defaultValue ?? items[enabled[0] ?? -1]?.value ?? "");
13
13
  const focus = context.signal(enabled[0] ?? -1);
14
- const selected = items.map(() => context.signal("false"));
15
- const hidden = items.map(() => context.signal(true));
16
- const tabIndex = items.map(() => context.signal(-1));
17
- const indicatorIndex = context.signal(0);
18
- const indicatorHidden = context.signal(true);
14
+ const current = value !== undefined ? value : local;
15
+ const activeIndex = derived(() => items.findIndex((item) => item.value === unwrap(current) && !item.disabled));
16
+ const indicatorIndex = derived(() => Math.max(0, activeIndex.value));
17
+ const indicatorHidden = derived(() => activeIndex.value < 0);
18
+ const selected = items.map((_, index) => derived(() => String(index === activeIndex.value)));
19
+ const hidden = items.map((_, index) => derived(() => index !== activeIndex.value));
20
+ const tabIndex = items.map((_, index) => derived(() => (index === focus.value ? 0 : -1)));
21
+ // Arrow keys set focus themselves. A host-driven value still moves the roving tabindex.
19
22
  context.effect(() => {
20
- const current = unwrap(value === undefined ? local : value);
21
- const active = items.findIndex((item) => item.value === current && !item.disabled);
22
- indicatorIndex.value = Math.max(0, active);
23
- indicatorHidden.value = active < 0;
23
+ const active = activeIndex.value;
24
24
  focus.value = active >= 0 ? active : (enabled[0] ?? -1);
25
- for (const [index] of items.entries()) {
26
- selected[index].value = String(index === active);
27
- hidden[index].value = index !== active;
28
- }
29
- });
30
- context.effect(() => {
31
- const focused = focus.value;
32
- for (const [index] of items.entries())
33
- tabIndex[index].value = index === focused ? 0 : -1;
34
25
  });
35
26
  const choose = (index) => {
36
27
  const item = items[index];
@@ -60,14 +60,14 @@ export function terminalSpans(text) {
60
60
  }
61
61
  export const TerminalBlock = defineComponent(terminalBlockContract, ({ command, cwd, output = "", running = false, exitCode, signal, maxLines, copyText, onCopy, ...props }, context) => {
62
62
  const status = running
63
- ? "运行中"
63
+ ? "Running"
64
64
  : signal
65
- ? `信号 ${signal}`
65
+ ? `Signal ${signal}`
66
66
  : exitCode === 0
67
- ? "已完成"
67
+ ? "Completed"
68
68
  : typeof exitCode === "number"
69
- ? `退出码 ${exitCode}`
70
- : "退出状态未知";
69
+ ? `Exit code ${exitCode}`
70
+ : "Unknown exit status";
71
71
  const failed = !running && (Boolean(signal) || (typeof exitCode === "number" && exitCode !== 0));
72
72
  const state = running ? "ongoing" : failed ? "error" : exitCode === 0 ? "done" : "warning";
73
73
  const rows = output ? terminalSpans(output) : [];
@@ -94,7 +94,7 @@ export const TerminalBlock = defineComponent(terminalBlockContract, ({ command,
94
94
  ? context.part("status", "span", {
95
95
  "data-terminal-error": failed ? "true" : undefined,
96
96
  }, h(Pill, { style: "color:inherit" }, status))
97
- : null), copyText: copyText ?? output, maxLines: maxLines, onCopy: onCopy, emptyText: running ? "等待输出" : "没有输出", rows: rows.length
97
+ : null), copyText: copyText ?? output, maxLines: maxLines, onCopy: onCopy, emptyText: running ? "Waiting for output" : "No output", rows: rows.length
98
98
  ? rows.map((row) => row.map((span) => context.part("span", "span", {
99
99
  "data-ansi-color": span.color,
100
100
  "data-ansi-bold": span.bold ? "true" : undefined,
@@ -1,4 +1,4 @@
1
- import { defineComponent, createContext, useContext, h, unwrap, } from "meowjsx";
1
+ import { defineComponent, derived, createContext, useContext, h, unwrap, } from "meowjsx";
2
2
  const ShimmerContent = createContext(false);
3
3
  export const textShimmerContract = {
4
4
  name: "text-shimmer",
@@ -9,9 +9,6 @@ export const TextShimmer = defineComponent(textShimmerContract, ({ text, childre
9
9
  const content = text ?? children;
10
10
  if (useContext(ShimmerContent))
11
11
  return context.part("content", "span", { ...props, className }, content);
12
- const activity = context.signal(String(unwrap(active)));
13
- context.effect(() => {
14
- activity.value = String(unwrap(active));
15
- });
12
+ const activity = derived(() => String(unwrap(active)));
16
13
  return context.part("root", "span", { ...props, className, "data-active": activity }, context.part("content", "span", { className: contentClassName }, h(ShimmerContent.Provider, { value: true }, content)), context.part("decoration", "span", { "aria-hidden": "true", inert: true }, context.part("content", "span", { className: contentClassName }, h(ShimmerContent.Provider, { value: true }, content))));
17
14
  });
@@ -23,18 +23,18 @@ export const WebBlock = defineComponent(webBlockContract, (props, context) => {
23
23
  return context.part("root", "section", { ...rest, "data-web-kind": kind }, kind === "fetch"
24
24
  ? [
25
25
  link(props.url),
26
- context.part("meta", "div", {}, `HTTP ${props.statusCode}${truncated ? " · 内容已截断" : ""}`),
26
+ context.part("meta", "div", {}, `HTTP ${props.statusCode}${truncated ? " · Content truncated" : ""}`),
27
27
  ]
28
28
  : [
29
29
  props.answer ? context.part("answer", "div", {}, props.answer) : null,
30
30
  !props.answer && props.sources.length === 0
31
- ? context.part("meta", "div", {}, "没有结果")
31
+ ? context.part("meta", "div", {}, "No results")
32
32
  : null,
33
33
  context.part("sources", "ol", {}, props.sources.map((source, index) => context.part("source", "li", { value: index + 1 }, [
34
34
  link(source.url, source.title),
35
35
  source.snippet ? context.part("snippet", "div", {}, source.snippet) : null,
36
36
  source.publishedAt ? context.part("meta", "div", {}, source.publishedAt) : null,
37
37
  ]))),
38
- truncated ? context.part("meta", "div", {}, "来源列表已截断") : null,
38
+ truncated ? context.part("meta", "div", {}, "Source list truncated") : null,
39
39
  ]);
40
40
  });
@@ -8,9 +8,9 @@ export interface WorkCardProps extends Props {
8
8
  title: Child;
9
9
  /** What the dot says; the words in `status` stay the source of truth. */
10
10
  state?: MaybeSignal<StatusDotState>;
11
- /** Current status in words, for example "正在推进:校对记录格式". */
11
+ /** Current status in words, for example "In progress: reviewing the record format". */
12
12
  status?: Child;
13
- /** A quiet extra fact after the status, for example "已关联 1 项成果". */
13
+ /** A quiet extra fact after the status, for example "1 outcome linked". */
14
14
  detail?: Child;
15
15
  icon?: Child;
16
16
  /** Label of the open affordance; the whole card is the control. */
@@ -6,6 +6,6 @@ export const workCardContract = {
6
6
  parts: ["root", "icon", "copy", "title", "status", "statusText", "detail", "action"],
7
7
  };
8
8
  /** A work reference inside a conversation: one control that opens the work's details. */
9
- export const WorkCard = defineComponent(workCardContract, ({ title, state = "unknown", status, detail, icon, action = "详情", className, children, ...props }, context) => context.part("root", "button", { type: "button", ...props, className }, context.part("icon", "span", { "aria-hidden": "true" }, icon ?? h(Icon, { name: "file-text" })), context.part("copy", "span", null, context.part("title", "strong", null, title), status !== undefined || detail !== undefined
9
+ export const WorkCard = defineComponent(workCardContract, ({ title, state = "unknown", status, detail, icon, action = "Details", className, children, ...props }, context) => context.part("root", "button", { type: "button", ...props, className }, context.part("icon", "span", { "aria-hidden": "true" }, icon ?? h(Icon, { name: "file-text" })), context.part("copy", "span", null, context.part("title", "strong", null, title), status !== undefined || detail !== undefined
10
10
  ? context.part("status", "span", null, h(StatusDot, { state: state, size: 6 }), context.part("statusText", "span", { "data-work-card-status": true }, status), detail ? context.part("detail", "span", null, detail) : null)
11
11
  : null, children), context.part("action", "span", null, action, h(Icon, { name: "chevron-right", size: 14 }))));
@@ -1,9 +1,20 @@
1
1
  # Functional icons
2
2
 
3
- `Icon` renders a local subset of [Lucide](https://github.com/lucide-icons/lucide/tree/main/icons) using native MeowJSX. SVG paths were retrieved from the official repository on 2026-09-21, with no runtime dependency. The upstream [license](https://github.com/lucide-icons/lucide/blob/main/LICENSE) is preserved in `LUCIDE-LICENSE` (ISC and inherited Feather MIT).
3
+ `Icon` renders meowtail's finite semantic icon set through native MeowJSX. The SVG geometry is imported from the pinned `lucide` dependency; no paths are copied into this package, except the optical override documented below. Upstream is ISC with inherited Feather MIT icons: the license is preserved in `LUCIDE-LICENSE` and summarized in `THIRD_PARTY_NOTICES.md`.
4
4
 
5
5
  Use `<Icon name="copy" size={16} />` beside a text label. An icon-only button needs an accessible label on the button. For a standalone meaningful image, provide `label`; otherwise the SVG is decorative. All functional icons use a 24-unit viewBox, currentColor and round joins. SVG presentation attributes provide an 18px size and 2-unit stroke when unthemed; the active theme can override sizing and optical stroke weight through CSS templates using `uiTokens.iconSize` and `uiTokens.iconStroke`. There is no inline style locking these values. Keep brand artwork separate (`MeowlandMark`, `GithubIcon`, `DoodleCat`).
6
6
 
7
+ `IconName` and `iconNames` are the finite semantic inventory used by this library and its JSON contracts. For application icons outside that set, `IconSource` renders caller-supplied structural `IconNode` data through the same frame, size, and accessibility rules:
8
+
9
+ ```tsx
10
+ import { IconSource } from "meowtail/icons";
11
+ import { Bell } from "meowtail/icons/lucide";
12
+
13
+ <IconSource source={Bell} size={16} label="Notifications" />;
14
+ ```
15
+
16
+ `source` is trusted developer input, never untrusted JSON or user-generated markup, and is expected to follow the same 24-unit stroked-outline contract. The pinned Lucide pass-through at `meowtail/icons/lucide` provides the full Lucide surface; its icon names and API belong to Lucide and move only when this package's pinned dependency moves. Bundlers tree-shake unused icons; a native no-bundler import loads the upstream entry as a whole.
17
+
7
18
  `ChatAttachments` uses the shared `file` shape to identify files; `ChatToolCall` uses `chevron-right` for disclosure and `arrow-up-right` for a non-collapsible operation. They remain decorative beside descriptive text. The theme controls geometry and disclosure rotation; these components do not substitute font glyphs for icons.
8
19
 
9
- Add only needed official SVG shapes to `icon.tsx`; `IconName` and `iconNames` stay in sync automatically. The UI Workshop renders that inventory. Existing named icon components remain public convenience entry points for other applications.
20
+ Import a node from `lucide` in `icon.tsx` and add one key to `shapes` when the library needs a new semantic icon; `IconName` and `iconNames` stay in sync automatically. Keep the dependency version, `LUCIDE-LICENSE`, and `THIRD_PARTY_NOTICES.md` in step with that change. `settings` keeps a local optical override because the upstream gear reads larger and rounder at the standard theme's 16px icon size. The UI Workshop renders the semantic inventory. Existing named icon components remain public convenience entry points for other applications.
@@ -0,0 +1,11 @@
1
+ import { type Child } from "meowjsx";
2
+ /** Shared SVG frame for functional icons; the theme owns its optical stroke. */
3
+ export interface IconFrameProps {
4
+ size?: number;
5
+ className?: string;
6
+ /** Omit for decorative icons. Icon-only controls should label the control itself. */
7
+ label?: string;
8
+ dataIcon?: string;
9
+ children?: Child;
10
+ }
11
+ export declare function IconFrame({ size, className, label, dataIcon, children, }: IconFrameProps): Child;
@@ -0,0 +1,4 @@
1
+ import { h } from "meowjsx";
2
+ export function IconFrame({ size = 18, className, label, dataIcon, children, }) {
3
+ return (h("svg", { className: ["meow-icon", className].filter(Boolean).join(" "), "data-icon": dataIcon, width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": label ? undefined : "true", role: label ? "img" : undefined, "aria-label": label, focusable: "false" }, children));
4
+ }
@@ -0,0 +1,17 @@
1
+ import { type Child } from "meowjsx";
2
+ /**
3
+ * Trusted structural icon data: ordered [tag, attributes] SVG pairs.
4
+ * The shape matches Lucide icon nodes and other plain SVG node data; never pass
5
+ * untrusted JSON or user-generated markup through this entry point.
6
+ */
7
+ export type IconNode = ReadonlyArray<readonly [tag: string, attrs: Readonly<Record<string, string | number | undefined>>]>;
8
+ export interface IconSourceProps {
9
+ /** Icon node data supplied by the caller from its own trusted icon source. */
10
+ source: IconNode;
11
+ size?: number;
12
+ className?: string;
13
+ /** Omit for decorative icons. Icon-only controls should label the control itself. */
14
+ label?: string;
15
+ }
16
+ /** Render caller-supplied icon data through the shared functional-icon frame. */
17
+ export declare function IconSource({ source, size, className, label }: IconSourceProps): Child;
@@ -0,0 +1,6 @@
1
+ import { h } from "meowjsx";
2
+ import { IconFrame } from "./icon-frame.js";
3
+ /** Render caller-supplied icon data through the shared functional-icon frame. */
4
+ export function IconSource({ source, size, className, label }) {
5
+ return (h(IconFrame, { size: size, className: className, label: label }, source.map(([tag, attrs]) => h(tag, attrs))));
6
+ }
@@ -1,42 +1,49 @@
1
1
  import { type Child } from "meowjsx";
2
+ declare const settings: () => import("meowjsx").VNode;
2
3
  declare const shapes: {
3
- terminal: () => import("meowjsx").VNode;
4
- menu: () => import("meowjsx").VNode;
5
- settings: () => import("meowjsx").VNode;
6
- "arrow-up": () => import("meowjsx").VNode;
7
- "list-checks": () => import("meowjsx").VNode;
8
- "message-square": () => import("meowjsx").VNode;
9
- map: () => import("meowjsx").VNode;
10
- "user-round": () => import("meowjsx").VNode;
11
- "notebook-tabs": () => import("meowjsx").VNode;
12
- "refresh-cw": () => import("meowjsx").VNode;
13
- paperclip: () => import("meowjsx").VNode;
14
- "arrow-down": () => import("meowjsx").VNode;
15
- "arrow-left": () => import("meowjsx").VNode;
16
- "arrow-right": () => import("meowjsx").VNode;
17
- "arrow-up-right": () => import("meowjsx").VNode;
18
- "file-text": () => import("meowjsx").VNode;
19
- file: () => import("meowjsx").VNode;
20
- folder: () => import("meowjsx").VNode;
21
- "folder-open": () => import("meowjsx").VNode;
22
- copy: () => import("meowjsx").VNode;
23
- x: () => import("meowjsx").VNode;
24
- "chevron-down": () => import("meowjsx").VNode;
25
- "chevron-left": () => import("meowjsx").VNode;
26
- "chevron-right": () => import("meowjsx").VNode;
27
- "chevron-up": () => import("meowjsx").VNode;
28
- search: () => import("meowjsx").VNode;
29
- plus: () => import("meowjsx").VNode;
30
- minus: () => import("meowjsx").VNode;
31
- "panel-left": () => import("meowjsx").VNode;
32
- list: () => import("meowjsx").VNode;
33
- network: () => import("meowjsx").VNode;
34
- "external-link": () => import("meowjsx").VNode;
35
- brain: () => import("meowjsx").VNode;
36
- eye: () => import("meowjsx").VNode;
37
- wrench: () => import("meowjsx").VNode;
38
- "loader-circle": () => import("meowjsx").VNode;
39
- square: () => import("meowjsx").VNode;
4
+ terminal: () => Child;
5
+ menu: () => Child;
6
+ settings: typeof settings;
7
+ "arrow-up": () => Child;
8
+ "list-checks": () => Child;
9
+ "message-square": () => Child;
10
+ map: () => Child;
11
+ "user-round": () => Child;
12
+ "notebook-tabs": () => Child;
13
+ "refresh-cw": () => Child;
14
+ paperclip: () => Child;
15
+ "arrow-down": () => Child;
16
+ "arrow-left": () => Child;
17
+ "arrow-right": () => Child;
18
+ "arrow-up-right": () => Child;
19
+ "file-text": () => Child;
20
+ file: () => Child;
21
+ folder: () => Child;
22
+ "folder-open": () => Child;
23
+ copy: () => Child;
24
+ x: () => Child;
25
+ "chevron-down": () => Child;
26
+ "chevron-left": () => Child;
27
+ "chevron-right": () => Child;
28
+ "chevron-up": () => Child;
29
+ search: () => Child;
30
+ plus: () => Child;
31
+ minus: () => Child;
32
+ "panel-left": () => Child;
33
+ list: () => Child;
34
+ network: () => Child;
35
+ "external-link": () => Child;
36
+ brain: () => Child;
37
+ eye: () => Child;
38
+ wrench: () => Child;
39
+ "loader-circle": () => Child;
40
+ square: () => Child;
41
+ mic: () => Child;
42
+ "shield-check": () => Child;
43
+ gauge: () => Child;
44
+ timer: () => Child;
45
+ database: () => Child;
46
+ history: () => Child;
40
47
  };
41
48
  export type IconName = keyof typeof shapes;
42
49
  export declare const iconNames: IconName[];