@pritzlaff/nano-elements 0.2.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,19 +1,7 @@
1
1
  # @pritzlaff/nano-elements
2
2
 
3
- Lit elements over `@pritzlaff/nano-core` components.
4
-
5
- - **`ModelElement`:** shows and drives one model. Give it a `registry` and a `model` (an instance id), and
6
- optionally a `watch` list of more instances whose sources it reads. It joins the registry as a hidden
7
- subscriber of each, re-renders when they publish, and calls the model's actions through its own handle:
8
- `this.read(op)` gives the latest value, and `this.act(op, arg)` calls an action, keeping a refusal in
9
- `this.problem`.
10
- - **`PlacedElement`:** a ModelElement that brings its own component (`static component`).
11
- - **On the page,** it shows the instance named by its `name` attribute, in the registry provided for the
12
- document. If no instance has that name, it creates one and removes it when the element goes.
13
- - **Moving it** (as a dock does) keeps the instance.
14
- - **Without a `name`,** it gets a generated one.
15
- - **`provide(document, registry)`:** sets the registry that placed elements use.
16
- - **`base`:** the shared styles (the puzzle prototype's palette).
3
+ Lit elements: the nano kit (command, select, calendar, menu, data table, tree, agent parts, ...), `base` (the shared
4
+ styles) and the `--nano-*` theme contract.
17
5
 
18
6
  ## Theming: the `--nano-*` contract
19
7
 
@@ -65,8 +53,9 @@ Elements, defined on import:
65
53
  | `<nano-calendar>`, `<nano-date-picker>` | `value` (ISO `YYYY-MM-DD`) | `change` |
66
54
  | `<nano-menu>` (wraps content; right-click opens it) | `items` (`{ label, shortcut?, danger?, disabled? }`, `{ separator: true }`, `{ heading }`) | `pick` (the item) |
67
55
  | `<nano-hover-card>` (`open-delay`, `close-delay`) | content, and a `card` slot | |
68
- | `<nano-data-table>` (`filter`, `selectable`, `page-size`) | `columns` (`{ key, label, sortable?, align?, render? }`), `rows` | `selection` (the rows) |
56
+ | `<nano-data-table>` (`filter`, `selectable`, `page-size`) | `columns` (`{ key, label, sortable?, align?, width?, minWidth?, render? }`; each resizes by its header's edge, drag or ←/→), `rows` | `selection` (the rows) |
69
57
  | `<nano-code-block>` (`language`) | `code` | |
58
+ | `<nano-tree>` (`open-depth`); `reveal(id, { focus? })` | `nodes` (`{ id, label, kind?, count?, badge?, terms?, end?, body?, children? }`), `query`, `selected` | `select` (`{ id }`; cancel it to keep `selected` yours) |
70
59
  | `toast(title, { description?, variant?, duration? })` | shows in one `<nano-toaster>`, made on first use | |
71
60
 
72
61
  Agent pieces, display only, on the AI SDK's data shapes: `<nano-tool>` (`.tool`: a tool part — `type`, `state`,
package/attrs.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare function setAttrs(el: Element | undefined, all?: Record<string, string | undefined>): void;
package/index.d.ts CHANGED
@@ -1,12 +1,10 @@
1
- export { ModelElement } from './model-element.js';
2
- export { PlacedElement, provide, providedRegistry } from './placed-element.js';
3
1
  export { base } from './styles.js';
4
2
  export { kit } from './kit.js';
5
3
  export { NANO_TOKENS, t, tv, type NanoToken } from './tokens.js';
6
- export type { Catalog, CatalogEntry } from './catalog.js';
7
4
  export { NanoCommand, NanoSelect, type Item } from './kit/select.js';
8
5
  export { NanoCalendar, NanoDatePicker } from './kit/calendar.js';
9
6
  export { NanoMenu, NanoHoverCard, NanoToaster, NanoCodeBlock, toast, type MenuItem, type Toast } from './kit/overlays.js';
10
7
  export { NanoDataTable, type Column } from './kit/data-table.js';
11
8
  export { NanoTool, NanoTask, NanoSubagent, NanoCli, type ToolPart, type Task, type TaskItem, type Subagent, type Run } from './agent/parts.js';
12
9
  export { NanoTrace, NanoTestResults, type Span, type TestCase, type TestResults } from './agent/timeline.js';
10
+ export { NanoTree, type TreeNode } from './kit/tree.js';