cortena-ui 1.1.0 → 1.2.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.
@@ -197,18 +197,26 @@ function subscribeTheme(onChange: () => void): () => void {
197
197
  };
198
198
  }
199
199
 
200
+ // jsdom (the extensions' test environment) has no matchMedia; treat its
201
+ // absence as a light system scheme that never changes, rather than throwing.
202
+ function schemeQuery(): MediaQueryList | null {
203
+ return typeof window !== "undefined" && typeof window.matchMedia === "function"
204
+ ? window.matchMedia(DARK_QUERY)
205
+ : null;
206
+ }
207
+
200
208
  function subscribeScheme(onChange: () => void): () => void {
201
- const query = window.matchMedia(DARK_QUERY);
202
- query.addEventListener("change", onChange);
209
+ const query = schemeQuery();
210
+ query?.addEventListener("change", onChange);
203
211
  const unsubscribeTheme = subscribeTheme(onChange);
204
212
  return () => {
205
- query.removeEventListener("change", onChange);
213
+ query?.removeEventListener("change", onChange);
206
214
  unsubscribeTheme();
207
215
  };
208
216
  }
209
217
 
210
218
  function systemScheme(): ResolvedCortenaTheme {
211
- return window.matchMedia(DARK_QUERY).matches ? "dark" : "light";
219
+ return schemeQuery()?.matches ? "dark" : "light";
212
220
  }
213
221
 
214
222
  /* ── hook ────────────────────────────────────────────────────────────────── */
package/src/index.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  // cortena-ui public surface. One export line per component file; every
2
2
  // component is styled from cortena-design tokens and built on Base UI.
3
3
  export { cn } from "@/lib/cn";
4
+ // The A2UI catalogue and renderer: the vocabulary agents draw with (05-agent-ui.md).
5
+ export * from "@/a2ui";
4
6
  export * from "@/components/chart";
5
7
  export * from "@/components/data-table";
6
8
  export { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "@/components/accordion";