@estiva-app/ui 0.90.1 → 0.90.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.
@@ -9,20 +9,28 @@ import type { ComponentPropsWithRef, ReactNode } from 'react';
9
9
  *
10
10
  * - the person tone is `person`, not `mention` — every chip here is a
11
11
  * mention of something;
12
- * - the alignment is a class (`align-top h-[1.4em]`), not a `style` object,
13
- * so it is part of the class list like every other size in the package;
12
+ * - the alignment is a class, not a `style` object, so it is part of the
13
+ * class list like every other size in the package;
14
14
  * - a chip that leads somewhere takes `href` and `onClick`, the way `NavItem`
15
15
  * does: the package draws an anchor, the app's router takes the click.
16
16
  *
17
- * **Why `align-top` and `1.4em`.** `1.4em` is the body text's line height,
18
- * so the chip is exactly one line tall; `vertical-align: top` pins it to the
19
- * line box, which keeps the line at 19.6px and the chip's words level with
20
- * the sentence's, with or without an icon. Measured in Peek on 2026-09-13:
21
- * `text-bottom` made the line 21.2px and lifted the chip's words 1.6px;
22
- * `baseline` lifted them 3.8px once an icon came first.
17
+ * **Why the baseline.** The chip's words sit on the sentence's baseline,
18
+ * whatever the line's height and whatever wraps the chip. `items-baseline`
19
+ * makes its words the chip's baseline, and `align-baseline` puts that on the
20
+ * sentence's; the `icon` slot, and any child holding an icon or a picture or
21
+ * holding nothing at all (an app's own chip in an editor, a colour swatch), is
22
+ * centred instead, because such a child has no baseline of its own and would
23
+ * sit with its bottom edge on the words' (3.8px high, measured 2026-09-13). `1.4em` keeps the chip one 14px
24
+ * line tall.
25
+ *
26
+ * It was `align-top` until PEE-72 (2026-10-29), which held only while the
27
+ * line was 19.6px and the chip was the line's own child. RichText's 21px
28
+ * lines (0.64) put every chip's words 1px high, measured on peek.estiva.app;
29
+ * a link's chip inside its hover card's trigger (0.75) was level only by
30
+ * chance, its baseline taken from its icon.
23
31
  */
24
32
  /** The shape every tone shares. Exported for a rich-text editor that renders chips from strings. */
25
- export declare const INLINE_CHIP_CLASSES = "inline-flex h-[1.4em] items-center gap-1 rounded-sm px-1 mx-0.5 align-top text-body-2 font-normal select-none";
33
+ export declare const INLINE_CHIP_CLASSES = "inline-flex h-[1.4em] items-baseline gap-1 rounded-sm px-1 mx-0.5 align-baseline text-body-2 font-normal select-none [&>:is(svg,img,:empty)]:self-center [&>:has(svg,img)]:self-center";
26
34
  /** What a chip is made of, by what it stands for. */
27
35
  export declare const INLINE_CHIP_TONE_CLASSES: {
28
36
  /** A thing or a place — anything that is not a person. */
@@ -34,11 +42,12 @@ export declare const INLINE_CHIP_TONE_CLASSES: {
34
42
  /**
35
43
  * A reference nobody could resolve — still a mention, just an anonymous one.
36
44
  * Its height is the body line's 19.6px written out, because `1.4em` here is
37
- * the caption's em: 16.8px, with the letters 1.8px above the sentence's
38
- * baseline. At 19.6px they sit 0.4px off it (measured 2026-09-14; Peek's
39
- * copy of this chip still has the 16.8px box).
45
+ * the caption's em, 16.8px. Its smaller letters would set a baseline of
46
+ * their own and make the line 3px taller, so a strut — an invisible letter
47
+ * in the body's type, no wider than nothing, its gap taken back — sets the
48
+ * chip's baseline and the letters sit on it.
40
49
  */
41
- readonly quiet: "h-[19.6px] bg-bg-active text-text-muted font-mono text-caption";
50
+ readonly quiet: "h-[19.6px] bg-bg-active text-text-muted font-mono text-caption before:invisible before:-mr-1 before:w-0 before:font-sans before:text-body-2 before:content-['x']";
42
51
  /** A file this reader cannot open — deleted, or not theirs to see: said in words, quieter than a link. */
43
52
  readonly muted: "bg-bg-active text-text-muted";
44
53
  };
@@ -1 +1 @@
1
- {"version":3,"file":"InlineChip.d.ts","sourceRoot":"","sources":["../src/InlineChip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAI7D;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,oGAAoG;AACpG,eAAO,MAAM,mBAAmB,kHACiF,CAAA;AAEjH,qDAAqD;AACrD,eAAO,MAAM,wBAAwB;IACnC,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IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC;IACnF,mDAAmD;IACnD,IAAI,CAAC,EAAE,cAAc,CAAA;IACrB,mFAAmF;IACnF,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,wBAAgB,UAAU,CAAC,EAAE,IAAgB,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,+BAsB1G"}
package/dist/index.js CHANGED
@@ -265,7 +265,7 @@ function TooltipSurface({ label, shortcut, placement }) {
265
265
  function WithTooltip({ label, shortcut, placement = "top", wrapperClassName, inline = false, children }) {
266
266
  const Wrapper = inline ? "span" : "div";
267
267
  return /* @__PURE__ */ jsxs(BaseTooltip.Root, { disableHoverablePopup: true, children: [
268
- /* @__PURE__ */ jsx5(BaseTooltip.Trigger, { delay: OPEN_DELAY, render: /* @__PURE__ */ jsx5(Wrapper, { className: cn("inline-flex shrink-0", inline && "align-top", wrapperClassName) }), children }),
268
+ /* @__PURE__ */ jsx5(BaseTooltip.Trigger, { delay: OPEN_DELAY, render: /* @__PURE__ */ jsx5(Wrapper, { className: cn("inline-flex shrink-0", inline && "align-baseline", wrapperClassName) }), children }),
269
269
  /* @__PURE__ */ jsx5(TooltipSurface, { label, shortcut, placement })
270
270
  ] });
271
271
  }
@@ -2419,7 +2419,7 @@ function CommandPaletteProposal({ source, mark, children }) {
2419
2419
 
2420
2420
  // src/InlineChip.tsx
2421
2421
  import { Fragment as Fragment7, jsx as jsx33, jsxs as jsxs24 } from "react/jsx-runtime";
2422
- var INLINE_CHIP_CLASSES = "inline-flex h-[1.4em] items-center gap-1 rounded-sm px-1 mx-0.5 align-top text-body-2 font-normal select-none";
2422
+ var INLINE_CHIP_CLASSES = "inline-flex h-[1.4em] items-baseline gap-1 rounded-sm px-1 mx-0.5 align-baseline text-body-2 font-normal select-none [&>:is(svg,img,:empty)]:self-center [&>:has(svg,img)]:self-center";
2423
2423
  var INLINE_CHIP_TONE_CLASSES = {
2424
2424
  /** A thing or a place — anything that is not a person. */
2425
2425
  neutral: "bg-bg-active text-text-primary",
@@ -2430,11 +2430,12 @@ var INLINE_CHIP_TONE_CLASSES = {
2430
2430
  /**
2431
2431
  * A reference nobody could resolve — still a mention, just an anonymous one.
2432
2432
  * Its height is the body line's 19.6px written out, because `1.4em` here is
2433
- * the caption's em: 16.8px, with the letters 1.8px above the sentence's
2434
- * baseline. At 19.6px they sit 0.4px off it (measured 2026-09-14; Peek's
2435
- * copy of this chip still has the 16.8px box).
2433
+ * the caption's em, 16.8px. Its smaller letters would set a baseline of
2434
+ * their own and make the line 3px taller, so a strut — an invisible letter
2435
+ * in the body's type, no wider than nothing, its gap taken back — sets the
2436
+ * chip's baseline and the letters sit on it.
2436
2437
  */
2437
- quiet: "h-[19.6px] bg-bg-active text-text-muted font-mono text-caption",
2438
+ quiet: "h-[19.6px] bg-bg-active text-text-muted font-mono text-caption before:invisible before:-mr-1 before:w-0 before:font-sans before:text-body-2 before:content-['x']",
2438
2439
  /** A file this reader cannot open — deleted, or not theirs to see: said in words, quieter than a link. */
2439
2440
  muted: "bg-bg-active text-text-muted"
2440
2441
  };
@@ -2444,7 +2445,7 @@ function inlineChipClassName(tone, className) {
2444
2445
  function InlineChip({ tone = "neutral", icon, href, className, children, ...props }) {
2445
2446
  const inApp = useInAppClick(href, props.onClick);
2446
2447
  const body = /* @__PURE__ */ jsxs24(Fragment7, { children: [
2447
- icon && /* @__PURE__ */ jsx33("span", { className: "flex size-4 shrink-0 items-center justify-center text-text-secondary", children: icon }),
2448
+ icon && /* @__PURE__ */ jsx33("span", { className: "flex size-4 shrink-0 items-center justify-center self-center text-text-secondary", children: icon }),
2448
2449
  children
2449
2450
  ] });
2450
2451
  const classes = inlineChipClassName(tone, className);