@athenaintel/react 0.11.1 → 0.11.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.
package/README.md CHANGED
@@ -357,6 +357,24 @@ text anchors, and positioned citations are also preserved by `parseAthenaCitatio
357
357
  `page_rect` may include `unit=percent` (the default) or `unit=point`; retain the unit so the region
358
358
  maps to the correct PDF coordinates.
359
359
 
360
+ ## Styling
361
+
362
+ `styles.css` is a self-contained stylesheet compiled at package build time. One import styles every SDK component — the host app does **not** need Tailwind:
363
+
364
+ ```tsx
365
+ import '@athenaintel/react/styles.css';
366
+ ```
367
+
368
+ It contains the design tokens, the Tailwind utilities the SDK components use, and an element reset (preflight) **scoped to the SDK's own chrome** (`.aui-root` trees and `.athena-sdk-chrome` roots, including portaled tooltips/popups). It never restyles the host page — not even host components you nest inside `AthenaProvider` to use hooks like `useSendMessage`: the reset only reaches SDK-rendered roots, design tokens live on the provider's `.athena-sdk` wrapper (inert custom properties) rather than `:root`, and everything ships in CSS cascade layers so any unlayered host rule wins on conflict.
369
+
370
+ Hosts that already run **Tailwind v4** (like the athena-app template) may instead — or additionally — compile the SDK's classes themselves:
371
+
372
+ ```css
373
+ @source "../node_modules/@athenaintel/react/dist";
374
+ ```
375
+
376
+ Importing `styles.css` alongside a host Tailwind build is harmless (utilities are identical and layered). One caveat for themed Tailwind hosts: token values set on the `.athena-sdk` element shadow values inherited from `:root`, so define your app's token overrides on `.athena-sdk` too (`:root, .athena-sdk { --primary: …; }`) — or use the `theme` prop below, which always wins.
377
+
360
378
  ## Theming
361
379
 
362
380
  ```tsx
@@ -369,6 +387,15 @@ import { themes } from '@athenaintel/react';
369
387
 
370
388
  Preset themes: `light`, `dark`, `midnight`, `warm`, `purple`, `green`.
371
389
 
390
+ For CSS-level theming without the `theme` prop, set the design-token custom properties on `.athena-sdk` (unlayered rules override the SDK's layered defaults):
391
+
392
+ ```css
393
+ .athena-sdk {
394
+ --primary: oklch(0.4 0.15 260);
395
+ --radius: 1rem;
396
+ }
397
+ ```
398
+
372
399
  ## Key Components
373
400
 
374
401
  - **`<AthenaProvider>`** — Runtime, auth, theming, and configuration
package/dist/index.cjs CHANGED
@@ -72,7 +72,7 @@ function _interopNamespaceDefault(e) {
72
72
  }
73
73
  const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
74
74
  const ReactDOM__namespace = /* @__PURE__ */ _interopNamespaceDefault(ReactDOM);
75
- const version$1 = "0.11.1";
75
+ const version$1 = "0.11.2";
76
76
  const packageJson = {
77
77
  version: version$1
78
78
  };
@@ -16562,6 +16562,9 @@ function TooltipContent({
16562
16562
  "data-slot": "tooltip-content",
16563
16563
  sideOffset,
16564
16564
  className: cn(
16565
+ // Portaled outside the provider wrapper — carries the SDK scope
16566
+ // classes itself so tokens and the scoped reset still apply.
16567
+ "athena-sdk athena-sdk-chrome",
16565
16568
  "bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
16566
16569
  className
16567
16570
  ),
@@ -21021,10 +21024,14 @@ function AthenaProvider({
21021
21024
  );
21022
21025
  }
21023
21026
  let result = /* @__PURE__ */ jsxRuntime.jsx(PostHogProvider, { config: posthogConfig, children: inner });
21024
- if (themeStyleVars) {
21025
- result = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "athena-themed", style: themeStyleVars, children: result });
21026
- }
21027
- return result;
21027
+ return /* @__PURE__ */ jsxRuntime.jsx(
21028
+ "div",
21029
+ {
21030
+ className: themeStyleVars ? "athena-sdk athena-themed" : "athena-sdk",
21031
+ style: themeStyleVars,
21032
+ children: result
21033
+ }
21034
+ );
21028
21035
  }
21029
21036
  function OrderedMap(content) {
21030
21037
  this.content = content;
@@ -55474,7 +55481,7 @@ const MentionSuggestionPopup = React.forwardRef(({ store: store2, query, command
55474
55481
  {
55475
55482
  ref: refs.setFloating,
55476
55483
  style: floatingStyles,
55477
- className: "z-[9999]",
55484
+ className: "athena-sdk athena-sdk-chrome z-[9999]",
55478
55485
  onMouseDown: (e) => e.preventDefault(),
55479
55486
  children: /* @__PURE__ */ jsxRuntime.jsx(
55480
55487
  MentionSuggestionList,
@@ -62781,7 +62788,7 @@ const AthenaAssetEmbed = ({
62781
62788
  if (error2) onError == null ? void 0 : onError(new Error(error2));
62782
62789
  }, [error2, onError]);
62783
62790
  if (isLoading) {
62784
- return loadingFallback ?? /* @__PURE__ */ jsxRuntime.jsxs("output", { className: "flex h-full w-full items-center justify-center", children: [
62791
+ return loadingFallback ?? /* @__PURE__ */ jsxRuntime.jsxs("output", { className: "athena-sdk-chrome flex h-full w-full items-center justify-center", children: [
62785
62792
  /* @__PURE__ */ jsxRuntime.jsx(LoaderCircle, { className: "size-6 animate-spin text-muted-foreground" }),
62786
62793
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Loading asset" })
62787
62794
  ] });
@@ -62792,7 +62799,7 @@ const AthenaAssetEmbed = ({
62792
62799
  return errorFallback ?? /* @__PURE__ */ jsxRuntime.jsxs(
62793
62800
  "div",
62794
62801
  {
62795
- className: "flex h-full w-full items-center justify-center gap-2 p-4 text-sm text-muted-foreground",
62802
+ className: "athena-sdk-chrome flex h-full w-full items-center justify-center gap-2 p-4 text-sm text-muted-foreground",
62796
62803
  role: "alert",
62797
62804
  children: [
62798
62805
  /* @__PURE__ */ jsxRuntime.jsx(CircleAlert, { className: "size-4 text-destructive" }),
@@ -63165,21 +63172,27 @@ const AthenaLayout = ({
63165
63172
  /* @__PURE__ */ jsxRuntime.jsx(
63166
63173
  "div",
63167
63174
  {
63168
- className: "flex h-full w-1 shrink-0 cursor-col-resize items-center bg-border/40 transition-colors hover:bg-border active:bg-primary/30",
63175
+ className: "athena-sdk-chrome flex h-full w-1 shrink-0 cursor-col-resize items-center bg-border/40 transition-colors hover:bg-border active:bg-primary/30",
63169
63176
  onPointerDown,
63170
63177
  onPointerMove,
63171
63178
  onPointerUp
63172
63179
  }
63173
63180
  ),
63174
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full flex-1 flex-col overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(AssetPanel, { manageAssetPanelHostRegistration: false }) })
63181
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "athena-sdk-chrome flex h-full flex-1 flex-col overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(AssetPanel, { manageAssetPanelHostRegistration: false }) })
63175
63182
  ] });
63176
63183
  };
63177
63184
  function ThreadList({ className }) {
63178
63185
  const statewireList = useAthenaStatewireThreadList();
63179
63186
  if (statewireList) {
63180
- return /* @__PURE__ */ jsxRuntime.jsx(StatewireThreadList, { list: statewireList, className });
63187
+ return /* @__PURE__ */ jsxRuntime.jsx(
63188
+ StatewireThreadList,
63189
+ {
63190
+ list: statewireList,
63191
+ className: cn("athena-sdk-chrome", className)
63192
+ }
63193
+ );
63181
63194
  }
63182
- return /* @__PURE__ */ jsxRuntime.jsx(LegacyThreadList, { className });
63195
+ return /* @__PURE__ */ jsxRuntime.jsx(LegacyThreadList, { className: cn("athena-sdk-chrome", className) });
63183
63196
  }
63184
63197
  function LegacyThreadList({ className }) {
63185
63198
  const refresh = useRefreshThreadList();