@nadicodeai/ui 12.1.25 → 12.1.27

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.
@@ -0,0 +1,23 @@
1
+ /**
2
+ * What stands where a missing page or record would have been
3
+ * ([Failure surfaces](../../../design-system/DESIGN.md#failure-surfaces)): a
4
+ * short note signed by Nadia, one line at a time so the stanza breathes on the
5
+ * spacing ladder rather than on a private leading.
6
+ *
7
+ * The note is written copy signed by Nadia, not a report of anything she did,
8
+ * so the orb takes ambient motion and claims no activity. `orb` is false where
9
+ * the surface's picture already gives Nadia a place to turn in, which is where
10
+ * she belongs when there is one. `scale` is the register the surface reads in:
11
+ * a product screen sets the note one step below a page title, the website one
12
+ * step above it.
13
+ */
14
+ export declare function AbsenceNote({ note, byline, scale, align, orb, className, }: {
15
+ /** The piece, one line per newline. */
16
+ note: string;
17
+ byline: string;
18
+ scale?: "product" | "site";
19
+ align?: "center" | "start";
20
+ orb?: boolean;
21
+ className?: string;
22
+ }): import("react").JSX.Element;
23
+ //# sourceMappingURL=absence-note.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"absence-note.d.ts","sourceRoot":"","sources":["../../src/components/absence-note.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,MAAM,EACN,KAAiB,EACjB,KAAgB,EAChB,GAAU,EACV,SAAS,GACV,EAAE;IACD,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC3B,KAAK,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC3B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BA4BA"}
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { AgentOrb } from "./agent-orb.js";
3
+ import { cn } from "../lib/utils.js";
4
+ /**
5
+ * What stands where a missing page or record would have been
6
+ * ([Failure surfaces](../../../design-system/DESIGN.md#failure-surfaces)): a
7
+ * short note signed by Nadia, one line at a time so the stanza breathes on the
8
+ * spacing ladder rather than on a private leading.
9
+ *
10
+ * The note is written copy signed by Nadia, not a report of anything she did,
11
+ * so the orb takes ambient motion and claims no activity. `orb` is false where
12
+ * the surface's picture already gives Nadia a place to turn in, which is where
13
+ * she belongs when there is one. `scale` is the register the surface reads in:
14
+ * a product screen sets the note one step below a page title, the website one
15
+ * step above it.
16
+ */
17
+ export function AbsenceNote({ note, byline, scale = "product", align = "center", orb = true, className, }) {
18
+ return (_jsxs("div", { className: cn("grid gap-6", align === "center" ? "justify-items-center text-center" : "justify-items-start text-start", className), children: [orb ? (_jsx(AgentOrb, { decorative: true, form: "nadia", motion: "ambient", size: scale === "site" ? 160 : 96 })) : null, _jsx("blockquote", { className: "grid gap-3", children: note.split("\n").map((line) => (_jsx("p", { className: cn("text-balance font-normal", scale === "site" ? "nc-type-heading-lg" : "nc-type-heading-md"), children: line }, line))) }), _jsx("p", { className: "nc-type-label-mono text-muted-foreground", children: byline })] }));
19
+ }
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from "./components/absence-note.js";
1
2
  export * from "./components/accordion.js";
2
3
  export * from "./components/account-menu.js";
3
4
  export * from "./components/action-menu.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,c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
+ export * from "./components/absence-note.js";
1
2
  export * from "./components/accordion.js";
2
3
  export * from "./components/account-menu.js";
3
4
  export * from "./components/action-menu.js";
@@ -1 +1 @@
1
- {"version":3,"file":"agent-orb.d.ts","sourceRoot":"","sources":["../../src/internal/agent-orb.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,QAAQ,EAEb,KAAK,QAAQ,EAId,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,KAAK,aAAa,EAMnB,MAAM,oBAAoB,CAAC;AAE5B,QAAA,MAAM,aAAa;;;;;;;;CAQ0B,CAAC;AAE9C,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,aAAa,CAAC;AACtD,kEAAkE;AAClE,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,OAAO,CAAC;AACpD,MAAM,MAAM,YAAY,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC;AAE7D,kDAAkD;AAClD,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,cAAc,CAAC;AACxD,+FAA+F;AAC/F,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,SAAS,CAAC;AA+BlD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAuDpF;AA4FD,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,cAAc,CAAC;IACrB;;;OAGG;IACH,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,GAClD,CAAC;IAAE,MAAM,CAAC,EAAE,QAAQ,CAAC;IAAC,KAAK,CAAC,EAAE,aAAa,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,S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CAAC;IAAC,KAAK,CAAC,EAAE,aAAa,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC;AAExF,wBAAgB,aAAa,CAAC,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,oBAAoB;;sBAIzC,OAAO;qBAAuB,aAAa;EAqLvF"}
@@ -275,6 +275,17 @@ export function mountAgentOrb(canvas, options) {
275
275
  refresh();
276
276
  });
277
277
  box.observe(canvas);
278
+ // A colour transition on the canvas or on an element it inherits from hands
279
+ // the observer the colour the transition starts from, so the orb reads its
280
+ // colour again when that transition ends. The event bubbles up from where it
281
+ // ran, never down to the canvas, so it is heard on the document.
282
+ function settle(event) {
283
+ if (event.propertyName === "color" &&
284
+ event.target instanceof Node &&
285
+ event.target.contains(canvas))
286
+ refresh();
287
+ }
288
+ document.addEventListener("transitionend", settle, true);
278
289
  motion.addEventListener("change", play);
279
290
  document.addEventListener("visibilitychange", play);
280
291
  window.addEventListener("resize", refresh);
@@ -296,6 +307,7 @@ export function mountAgentOrb(canvas, options) {
296
307
  visibility.disconnect();
297
308
  appearance.disconnect();
298
309
  box.disconnect();
310
+ document.removeEventListener("transitionend", settle, true);
299
311
  motion.removeEventListener("change", play);
300
312
  document.removeEventListener("visibilitychange", play);
301
313
  window.removeEventListener("resize", refresh);
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Which of a surface's absence notes an address gets.
3
+ *
4
+ * The choice is a hash of the address, not a draw: the same address always
5
+ * shows the same note, so a reader who reloads is not handed a different one,
6
+ * two readers comparing the same broken link see the same thing, and a test can
7
+ * name the note it expects. FNV-1a over the path, 32-bit, through `Math.imul`
8
+ * so the multiply stays integer.
9
+ */
10
+ export declare function absenceNoteFor<Note>(path: string, notes: readonly [Note, ...Note[]]): Note;
11
+ //# sourceMappingURL=absence-note.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"absence-note.d.ts","sourceRoot":"","sources":["../../src/lib/absence-note.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,IAAI,EAAE,GAAG,IAAI,EAAE,CAAC,GAAG,IAAI,CAM1F"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Which of a surface's absence notes an address gets.
3
+ *
4
+ * The choice is a hash of the address, not a draw: the same address always
5
+ * shows the same note, so a reader who reloads is not handed a different one,
6
+ * two readers comparing the same broken link see the same thing, and a test can
7
+ * name the note it expects. FNV-1a over the path, 32-bit, through `Math.imul`
8
+ * so the multiply stays integer.
9
+ */
10
+ export function absenceNoteFor(path, notes) {
11
+ let hash = 0x811c9dc5;
12
+ for (let index = 0; index < path.length; index += 1) {
13
+ hash = Math.imul(hash ^ path.charCodeAt(index), 0x01000193) >>> 0;
14
+ }
15
+ return notes[hash % notes.length];
16
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nadicodeai/ui",
3
- "version": "12.1.25",
3
+ "version": "12.1.27",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -36,6 +36,10 @@
36
36
  "types": "./dist/lib/theme-mode.d.ts",
37
37
  "import": "./dist/lib/theme-mode.js"
38
38
  },
39
+ "./lib/absence-note": {
40
+ "types": "./dist/lib/absence-note.d.ts",
41
+ "import": "./dist/lib/absence-note.js"
42
+ },
39
43
  "./lib/format-token-count": {
40
44
  "types": "./dist/lib/format-token-count.d.ts",
41
45
  "import": "./dist/lib/format-token-count.js"
@@ -72,7 +76,7 @@
72
76
  "@assistant-ui/react": "0.15.21",
73
77
  "@assistant-ui/react-markdown": "0.14.16",
74
78
  "@base-ui/react": "^1.8.0",
75
- "@nadicodeai/design-system": "12.1.25",
79
+ "@nadicodeai/design-system": "12.1.27",
76
80
  "class-variance-authority": "^0.7.1",
77
81
  "clsx": "^2.1.1",
78
82
  "cmdk": "^1.1.1",