clio-design-system 0.1.0 → 0.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.
package/README.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  Component library for the Clio app, generated from the Clio design system in Claude Design.
4
4
 
5
+ ## Usage
6
+
7
+ Import the stylesheet once at your app root — it ships the design tokens **and**
8
+ the KaTeX styles that `EquationBlock` needs:
9
+
10
+ ```js
11
+ import 'clio-design-system/styles.css';
12
+ ```
13
+
14
+ `EquationBlock` renders a TeX string to typeset display math via bundled KaTeX —
15
+ just pass `tex`, nothing to mount:
16
+
17
+ ```jsx
18
+ <EquationBlock tex="x_{k+1} = x_k - \eta \nabla f(x_k)" />
19
+ ```
20
+
5
21
  ## Scripts
6
22
 
7
23
  - `npm run dev` — build in watch mode
package/dist/index.cjs CHANGED
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
19
  };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
29
 
20
30
  // src/index.ts
@@ -1521,9 +1531,22 @@ function TextBlock({ text, style, ...rest }) {
1521
1531
  }
1522
1532
 
1523
1533
  // src/components/EquationBlock/EquationBlock.tsx
1534
+ var import_react9 = require("react");
1535
+ var import_katex = __toESM(require("katex"), 1);
1524
1536
  var import_jsx_runtime24 = require("react/jsx-runtime");
1525
1537
  function EquationBlock({ tex, style, ...rest }) {
1526
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { ...rest, style: { margin: "18px 0", textAlign: "center", padding: "10px 0", ...style }, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { style: { fontFamily: "Georgia, serif", fontStyle: "italic", fontSize: "17px", color: "var(--color-text-primary)" }, children: tex }) });
1538
+ const html = (0, import_react9.useMemo)(
1539
+ () => import_katex.default.renderToString(tex, { displayMode: true, throwOnError: false }),
1540
+ [tex]
1541
+ );
1542
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1543
+ "div",
1544
+ {
1545
+ ...rest,
1546
+ style: { margin: "18px 0", textAlign: "center", padding: "10px 0", ...style },
1547
+ dangerouslySetInnerHTML: { __html: html }
1548
+ }
1549
+ );
1527
1550
  }
1528
1551
 
1529
1552
  // src/components/IntuitionCallout/IntuitionCallout.tsx
@@ -1748,10 +1771,10 @@ function TableCard({ title, header, rows, style, ...rest }) {
1748
1771
  }
1749
1772
 
1750
1773
  // src/components/QuizCard/QuizCard.tsx
1751
- var import_react9 = require("react");
1774
+ var import_react10 = require("react");
1752
1775
  var import_jsx_runtime29 = require("react/jsx-runtime");
1753
1776
  function QuizCard({ question, answerOpen, answer, quizLabel, onToggleQuiz, addFlashLabel, onAddFlash, style, ...rest }) {
1754
- const answerId = (0, import_react9.useId)();
1777
+ const answerId = (0, import_react10.useId)();
1755
1778
  return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
1756
1779
  "div",
1757
1780
  {
@@ -1825,14 +1848,14 @@ function ImageCard({ label = "UPLOAD", title, slotId, placeholder, height = 230,
1825
1848
  }
1826
1849
 
1827
1850
  // src/components/RelatedCard/RelatedCard.tsx
1828
- var import_react10 = require("react");
1851
+ var import_react11 = require("react");
1829
1852
  var import_jsx_runtime31 = require("react/jsx-runtime");
1830
1853
  function RelatedCard({ items, style, ...rest }) {
1831
1854
  return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { ...rest, style: { background: "var(--color-surface)", border: "1px solid var(--border-default)", borderRadius: "var(--radius-card)", margin: "24px 0", padding: 16, ...style }, children: [
1832
1855
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { style: { display: "flex", alignItems: "baseline", gap: 10, marginBottom: 10 }, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { style: { fontFamily: "var(--font-family-mono)", fontSize: "var(--font-size-xs)", letterSpacing: "var(--letter-spacing-mono-wide)", color: "var(--color-accent)" }, children: "RELATED" }) }),
1833
1856
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("ul", { role: "list", style: { listStyle: "none", margin: 0, padding: 0, display: "flex", flexDirection: "column", gap: 8 }, children: items.map((it, i) => {
1834
1857
  const Element = it.as ?? (it.href ? "a" : "button");
1835
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("li", { children: (0, import_react10.createElement)(
1858
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("li", { children: (0, import_react11.createElement)(
1836
1859
  Element,
1837
1860
  {
1838
1861
  type: Element === "button" ? "button" : void 0,
@@ -1876,10 +1899,10 @@ function ReferencesCard({ items, style, ...rest }) {
1876
1899
  }
1877
1900
 
1878
1901
  // src/components/AnnotationPanel/AnnotationPanel.tsx
1879
- var import_react11 = require("react");
1902
+ var import_react12 = require("react");
1880
1903
  var import_jsx_runtime33 = require("react/jsx-runtime");
1881
1904
  function AnnotationPanel({ open, value, onChange, placeholder = "Jot your own take here\u2026", ...rest }) {
1882
- const labelId = (0, import_react11.useId)();
1905
+ const labelId = (0, import_react12.useId)();
1883
1906
  if (!open) return null;
1884
1907
  return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { style: { marginTop: 10, background: "var(--color-annotation-fill)", borderLeft: "3px solid var(--color-annotation-border)", borderRadius: "0 8px 8px 0", padding: "10px 14px" }, children: [
1885
1908
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { id: labelId, style: { fontFamily: "var(--font-family-mono)", fontSize: "9.5px", letterSpacing: "0.14em", color: "var(--color-annotation-label)", marginBottom: 5 }, children: "MY NOTE" }),