@estiva-app/ui 0.39.0 → 0.41.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/dist/Chip.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ReactNode } from 'react';
1
+ import type { MouseEventHandler, ReactNode } from 'react';
2
2
  /**
3
3
  * Peek's Chip (2026-08-28), verbatim: a 20px pill in one of six colour
4
4
  * types, with room for a 12px icon either side. Under Signal the label is
@@ -16,7 +16,15 @@ export interface ChipProps {
16
16
  label?: string;
17
17
  leadingIcon?: ReactNode;
18
18
  trailingIcon?: ReactNode;
19
+ /**
20
+ * The chip is a link: a real anchor with the chip's own round shape, so the
21
+ * keyboard ring is round too. It sits above a row's covering `Link`, so the
22
+ * row opens one thing and the chip another (UIG-33, Katerina 28 September).
23
+ */
24
+ href?: string;
25
+ /** With `href`: a router app takes the click here, like `Link`. */
26
+ onClick?: MouseEventHandler<HTMLAnchorElement>;
19
27
  className?: string;
20
28
  }
21
- export declare function Chip({ type, label, leadingIcon, trailingIcon, className }: ChipProps): import("react").JSX.Element;
29
+ export declare function Chip({ type, label, leadingIcon, trailingIcon, href, onClick, className }: ChipProps): import("react").JSX.Element;
22
30
  //# sourceMappingURL=Chip.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../src/Chip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC;;;;;;;;;;GAUG;AACH,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAA;AAErF,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,YAAY,CAAC,EAAE,SAAS,CAAA;IACxB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAWD,wBAAgB,IAAI,CAAC,EAAE,IAAgB,EAAE,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,SAAS,+BAkBhG"}
1
+ {"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../src/Chip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAIzD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAA;AAErF,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,YAAY,CAAC,EAAE,SAAS,CAAA;IACxB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,mEAAmE;IACnE,OAAO,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAA;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAWD,wBAAgB,IAAI,CAAC,EAAE,IAAgB,EAAE,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,SAAS,+BAsB/G"}
package/dist/Link.d.ts CHANGED
@@ -16,6 +16,15 @@ import type { ComponentPropsWithRef, ReactNode } from 'react';
16
16
  * and a solid version became this one, solid (her ruling, 13 September).
17
17
  * - `plain` — no look at all: a card or a row that is a link draws itself.
18
18
  *
19
+ * **`cover`: a row that is one link** (UIG-33, Katerina 28 September). The link
20
+ * stretches an invisible layer over the nearest box the app has given
21
+ * `relative` (a row, a table row), so a click anywhere on it opens the link, and
22
+ * the keyboard ring goes round that whole box rather than round the words. The
23
+ * row stays the app's own: its size, its fill, its hover. A second link inside
24
+ * the row stays clickable when it comes after the covering link and is
25
+ * `relative` itself, which a `Chip` with an `href` already is. Both apps
26
+ * stretched a link by hand before this, each under a written exception.
27
+ *
19
28
  * **Navigation is the app's.** The package cannot know a router, so like
20
29
  * `NavItem` it renders a real anchor and passes every anchor prop through: a
21
30
  * router app hands in `onClick`, prevents the default and navigates, and the
@@ -36,7 +45,12 @@ export interface LinkProps extends ComponentPropsWithRef<'a'> {
36
45
  * Its size and colour still come from the text around it (UIG-9, 17 September).
37
46
  */
38
47
  truncate?: boolean;
48
+ /**
49
+ * The link covers the row it sits in: a click anywhere on the row opens it,
50
+ * and the keyboard ring goes round the whole row. Give the row `relative`.
51
+ */
52
+ cover?: boolean;
39
53
  children: ReactNode;
40
54
  }
41
- export declare function Link({ href, variant, external, truncate, className, children, ...props }: LinkProps): import("react").JSX.Element;
55
+ export declare function Link({ href, variant, external, truncate, cover, className, children, ...props }: LinkProps): import("react").JSX.Element;
42
56
  //# sourceMappingURL=Link.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../src/Link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAG7D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,YAAY,GAAG,OAAO,CAAA;AASnE,MAAM,WAAW,SAAU,SAAQ,qBAAqB,CAAC,GAAG,CAAC;IAC3D,IAAI,EAAE,MAAM,CAAA;IACZ,sBAAsB;IACtB,OAAO,CAAC,EAAE,WAAW,CAAA;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,OAAgB,EAAE,QAAgB,EAAE,QAAgB,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,+BAW5H"}
1
+ {"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../src/Link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAG7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,YAAY,GAAG,OAAO,CAAA;AAgBnE,MAAM,WAAW,SAAU,SAAQ,qBAAqB,CAAC,GAAG,CAAC;IAC3D,IAAI,EAAE,MAAM,CAAA;IACZ,sBAAsB;IACtB,OAAO,CAAC,EAAE,WAAW,CAAA;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,OAAgB,EAAE,QAAgB,EAAE,QAAgB,EAAE,KAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,+BAW3I"}
@@ -0,0 +1,78 @@
1
+ import type { ReactNode } from 'react';
2
+ /**
3
+ * Formatted text, drawn: headings, paragraphs, lists, a quote, code, a divider,
4
+ * a table and links.
5
+ *
6
+ * Both apps drew the same thing twice, from the same source — the text tree the
7
+ * protocol package builds (`toRenderTree` → `RenderBlock`, `RenderInline`) —
8
+ * and the two had drifted: headings, list markers, quotes and code differed,
9
+ * one app had tables and the other dropped them, one had links and the other
10
+ * printed the brackets (UIG-30). The look here is Katerina's picks of
11
+ * 28 September, one per difference, most of them Peek's.
12
+ *
13
+ * **It takes the tree, not the text.** The caller parses (the format comes from
14
+ * the item's tag, never from the body) and hands the blocks in. So this package
15
+ * does not depend on the protocol, and a caller can leave out a block it draws
16
+ * elsewhere before passing the rest. The types below are the tree's shape; the
17
+ * protocol's own types fit them.
18
+ *
19
+ * **Safe by construction.** The tree has nothing left to parse, and every
20
+ * string here reaches the page as a React child, so it is text. Nothing is set
21
+ * as HTML.
22
+ *
23
+ * **What a word points at stays the app's.** A person, an item from another
24
+ * app, a name the app recognises in plain text: `renderReference`,
25
+ * `renderText` and `renderBlock` are where each app draws its own.
26
+ */
27
+ /** A run of text and the marks on it — the protocol's `RenderInline`. */
28
+ export interface RichTextRun {
29
+ text: string;
30
+ marks: readonly string[];
31
+ /** A `nostr:` address this run stands for. `text` is the address itself. */
32
+ reference?: string;
33
+ }
34
+ /** A block of the tree — the protocol's `RenderBlock`. */
35
+ export interface RichTextBlock {
36
+ type: string;
37
+ /** What the document called a block the tree does not know. */
38
+ typeName?: string;
39
+ /** The block's address, when it has one. Drawn as `data-block-id`. */
40
+ id?: string;
41
+ level?: 1 | 2 | 3;
42
+ language?: string;
43
+ /** A numbered list's first number. */
44
+ start?: number;
45
+ attrs?: Record<string, unknown>;
46
+ inline?: readonly RichTextRun[];
47
+ children?: readonly RichTextBlock[];
48
+ }
49
+ export type RichTextSize = 'default' | 'small';
50
+ export interface RichTextProps {
51
+ /** The tree, already parsed. */
52
+ blocks: readonly RichTextBlock[];
53
+ /**
54
+ * Default `default`, the size of text you read. `small` is the same text one
55
+ * step down, with every heading, list, quote and table kept: an item shown
56
+ * inside a card.
57
+ */
58
+ size?: RichTextSize;
59
+ /**
60
+ * Draws plain text: what is left of a run once its links are drawn. Where an
61
+ * app turns words it recognises into chips. By default the text as it is.
62
+ */
63
+ renderText?: (text: string) => ReactNode;
64
+ /** Draws a run that stands for an address. By default its text. */
65
+ renderReference?: (reference: string, run: RichTextRun) => ReactNode;
66
+ /**
67
+ * Draws a block this part has no design for (an attachment, a widget). Return
68
+ * `undefined` to leave it to the part, which draws its words.
69
+ */
70
+ renderBlock?: (block: RichTextBlock) => ReactNode | undefined;
71
+ }
72
+ /**
73
+ * RichText's look, for a box you draw yourself: an editor's, so that what is
74
+ * being written looks the same as what is read. Put it on the editor's root.
75
+ */
76
+ export declare function richTextClassName(size?: RichTextSize, className?: string): string;
77
+ export declare function RichText({ blocks, size, renderText, renderReference, renderBlock, }: RichTextProps): import("react").JSX.Element | null;
78
+ //# sourceMappingURL=RichText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RichText.d.ts","sourceRoot":"","sources":["../src/RichText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,OAAO,CAAA;AAIlD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,yEAAyE;AACzE,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;IACxB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,0DAA0D;AAC1D,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,sEAAsE;IACtE,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,MAAM,CAAC,EAAE,SAAS,WAAW,EAAE,CAAA;IAC/B,QAAQ,CAAC,EAAE,SAAS,aAAa,EAAE,CAAA;CACpC;AAED,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,OAAO,CAAA;AAE9C,MAAM,WAAW,aAAa;IAC5B,gCAAgC;IAChC,MAAM,EAAE,SAAS,aAAa,EAAE,CAAA;IAChC;;;;OAIG;IACH,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,SAAS,CAAA;IACxC,mEAAmE;IACnE,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,KAAK,SAAS,CAAA;IACpE;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,SAAS,GAAG,SAAS,CAAA;CAC9D;AA0BD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,GAAE,YAAwB,EAAE,SAAS,CAAC,EAAE,MAAM,UAGnF;AAyKD,wBAAgB,QAAQ,CAAC,EACvB,MAAM,EACN,IAAgB,EAChB,UAA2B,EAC3B,eAA+C,EAC/C,WAAW,GACZ,EAAE,aAAa,sCAQf"}
@@ -232,7 +232,7 @@ var PART_LOOK_PROPS = {
232
232
  IconButton: ["variant", "pressed", "glow"],
233
233
  InputChip: ["truncate"],
234
234
  Kbd: ["tone"],
235
- Link: ["variant", "truncate"],
235
+ Link: ["variant", "truncate", "cover"],
236
236
  MenuItem: ["size", "selected", "destructive"],
237
237
  MenuSub: ["selected"],
238
238
  NavItem: ["active"],
@@ -242,6 +242,7 @@ var PART_LOOK_PROPS = {
242
242
  RailItem: ["active"],
243
243
  Reaction: ["pressed"],
244
244
  ReactionPicker: ["surface"],
245
+ RichText: ["size"],
245
246
  SectionHeader: ["hover"],
246
247
  SectionLabel: ["tone", "truncate"],
247
248
  Select: ["size"],