@caqophony/ui 0.9.5 → 0.9.7

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/dist/charts.js CHANGED
@@ -197,6 +197,23 @@ var BAR_TOKENS = {
197
197
  text: "--muted-foreground",
198
198
  grid: "--border"
199
199
  };
200
+ function cornerOf(el) {
201
+ if (getComputedStyle(el).getPropertyValue("--radius").trim() === "")
202
+ throw new Error(
203
+ "BarChart: the token --radius is not set on the page: the chart draws in the kit's tokens, so the page loads @caqophony/ui/styles.css"
204
+ );
205
+ const probe = document.createElement("span");
206
+ probe.style.borderTopLeftRadius = "calc(var(--radius) * 0.5)";
207
+ el.appendChild(probe);
208
+ const computed = getComputedStyle(probe).borderTopLeftRadius;
209
+ el.removeChild(probe);
210
+ const px = parseFloat(computed);
211
+ if (!Number.isFinite(px))
212
+ throw new Error(
213
+ `BarChart: the bars' corner did not compute to a length from --radius (${computed || "empty"})`
214
+ );
215
+ return px;
216
+ }
200
217
  function paletteOf(el) {
201
218
  const style = getComputedStyle(el);
202
219
  const read = (name) => {
@@ -210,7 +227,8 @@ function paletteOf(el) {
210
227
  return {
211
228
  bar: read(BAR_TOKENS.bar),
212
229
  text: read(BAR_TOKENS.text),
213
- grid: read(BAR_TOKENS.grid)
230
+ grid: read(BAR_TOKENS.grid),
231
+ corner: cornerOf(el)
214
232
  };
215
233
  }
216
234
  var valueTick = (unit) => (tickValue) => formatValue(
@@ -244,7 +262,7 @@ function BarChart({
244
262
  data: data.map((d) => d.value),
245
263
  backgroundColor: fill,
246
264
  borderWidth: 0,
247
- borderRadius: 4
265
+ borderRadius: palette?.corner
248
266
  }
249
267
  ]
250
268
  };
@@ -163,6 +163,7 @@ function watchScrollHintX(mark, write) {
163
163
  }
164
164
  let last;
165
165
  const update = () => {
166
+ if (!scroller.isConnected || !mark.isConnected) return;
166
167
  const state = scrollHintXState(
167
168
  scroller,
168
169
  scrollHintXSlotWidth(mark, scroller)
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  Icon
4
- } from "./chunk-KXI4UQPS.js";
4
+ } from "./chunk-3K3AFMSH.js";
5
5
  import {
6
6
  cn
7
7
  } from "./chunk-DP5WQAPO.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  CONTENT_GUTTER,
4
4
  Icon
5
- } from "./chunk-KXI4UQPS.js";
5
+ } from "./chunk-3K3AFMSH.js";
6
6
  import {
7
7
  cn
8
8
  } from "./chunk-DP5WQAPO.js";
package/dist/index.d.mts CHANGED
@@ -418,8 +418,15 @@ interface ConfirmDialogProps {
418
418
  confirmVariant?: 'default' | 'destructive';
419
419
  /** Additional class for the dialog container */
420
420
  className?: string;
421
+ /**
422
+ * The confirmed action's failure, drawn inside the panel above the buttons
423
+ * (#7445). The dialog stays open: it closes only when the caller's success
424
+ * handler closes it, so the person sees why nothing happened and can retry or
425
+ * cancel. A failure drawn outside the dialog would sit under its overlay.
426
+ */
427
+ error?: string | null;
421
428
  }
422
- declare function ConfirmDialog({ title, message, confirmLabel, onConfirm, onCancel, isLoading, confirmTestId, cancelTestId, dialogTestId, cancelLabel, confirmVariant, className, }: ConfirmDialogProps): react_jsx_runtime.JSX.Element;
429
+ declare function ConfirmDialog({ title, message, confirmLabel, onConfirm, onCancel, isLoading, confirmTestId, cancelTestId, dialogTestId, cancelLabel, confirmVariant, className, error, }: ConfirmDialogProps): react_jsx_runtime.JSX.Element;
423
430
 
424
431
  /** Supported DiceBear avatar styles */
425
432
  type DiceBearStyle = 'adventurer' | 'adventurer-neutral' | 'avataaars' | 'avataaars-neutral' | 'big-ears' | 'big-ears-neutral' | 'bottts' | 'bottts-neutral' | 'croodles' | 'croodles-neutral' | 'fun-emoji' | 'icons' | 'identicon' | 'initials' | 'lorelei' | 'lorelei-neutral' | 'micah' | 'miniavs' | 'notionists' | 'notionists-neutral' | 'open-peeps' | 'personas' | 'pixel-art' | 'pixel-art-neutral' | 'rings' | 'shapes' | 'thumbs';
@@ -569,7 +576,7 @@ interface SkeletonRowProps {
569
576
  /**
570
577
  * SkeletonRow — a row loading placeholder with avatar and text lines.
571
578
  *
572
- * Mirrors the Figma skeletonRow helper: card bg, border, rounded-[10px],
579
+ * Mirrors the Figma skeletonRow helper: card bg, border, corners at 1.25x the project --radius (10px at the default 0.5rem),
573
580
  * padding 14px/18px, gap 14px, with 36px circle avatar + 2 bars (200x12, 140x10).
574
581
  */
575
582
  declare function SkeletonRow({ className }: SkeletonRowProps): react_jsx_runtime.JSX.Element;
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  buttonVariants,
12
12
  useModalSurface,
13
13
  usePanelRef
14
- } from "./chunk-A3GODQ6C.js";
14
+ } from "./chunk-GUPC7YZ7.js";
15
15
  import {
16
16
  Alert,
17
17
  EMPTY_VALUE_GLYPH,
@@ -19,7 +19,7 @@ import {
19
19
  INTENT_SUBTLE_STYLES,
20
20
  IntentBadge,
21
21
  isEmptyValue
22
- } from "./chunk-MRVYXQE3.js";
22
+ } from "./chunk-G462BTOB.js";
23
23
  import {
24
24
  CONTENT_GUTTER,
25
25
  ICONS,
@@ -28,7 +28,7 @@ import {
28
28
  SCROLL_HINT_X,
29
29
  ScrollHintXMark,
30
30
  ScrollHintYMark
31
- } from "./chunk-KXI4UQPS.js";
31
+ } from "./chunk-3K3AFMSH.js";
32
32
  import {
33
33
  cn
34
34
  } from "./chunk-DP5WQAPO.js";
@@ -1162,7 +1162,8 @@ function ConfirmDialog({
1162
1162
  dialogTestId,
1163
1163
  cancelLabel = "Cancel",
1164
1164
  confirmVariant = "default",
1165
- className
1165
+ className,
1166
+ error = null
1166
1167
  }) {
1167
1168
  const panel = React6.useRef(null);
1168
1169
  useModalSurface(true, panel, isLoading ? void 0 : onCancel);
@@ -1201,6 +1202,7 @@ function ConfirmDialog({
1201
1202
  children: message
1202
1203
  }
1203
1204
  ),
1205
+ /* @__PURE__ */ jsx10(FormError, { error, className: "mt-4" }),
1204
1206
  /* @__PURE__ */ jsxs7("div", { className: "mt-6 flex justify-end gap-3", children: [
1205
1207
  /* @__PURE__ */ jsx10(
1206
1208
  Button,
@@ -1302,39 +1304,39 @@ import { Check, AlertTriangle, X, Info } from "lucide-react";
1302
1304
  import { jsx as jsx12 } from "react/jsx-runtime";
1303
1305
  var intentConfig = {
1304
1306
  success: {
1305
- outerBg: "bg-[rgba(33,196,93,0.10)] dark:bg-[rgba(33,196,93,0.10)]",
1306
- innerBg: "bg-[rgba(33,196,93,0.20)] dark:bg-[rgba(33,196,93,0.20)]",
1307
- iconColor: "text-[#21c45d] dark:text-[#21c45d]",
1307
+ outerBg: "bg-intent-success/10",
1308
+ innerBg: "bg-intent-success/20",
1309
+ iconColor: "text-intent-success",
1308
1310
  Icon: Check
1309
1311
  },
1310
1312
  warning: {
1311
- outerBg: "bg-[rgba(245,159,10,0.10)] dark:bg-[rgba(245,159,10,0.10)]",
1312
- innerBg: "bg-[rgba(245,159,10,0.20)] dark:bg-[rgba(245,159,10,0.20)]",
1313
- iconColor: "text-[#f59f0a] dark:text-[#f59f0a]",
1313
+ outerBg: "bg-intent-warning/10",
1314
+ innerBg: "bg-intent-warning/20",
1315
+ iconColor: "text-intent-warning",
1314
1316
  Icon: AlertTriangle
1315
1317
  },
1316
1318
  error: {
1317
- outerBg: "bg-[rgba(239,67,67,0.10)] dark:bg-[rgba(239,67,67,0.10)]",
1318
- innerBg: "bg-[rgba(239,67,67,0.20)] dark:bg-[rgba(239,67,67,0.20)]",
1319
- iconColor: "text-[#ef4343] dark:text-[#ef4343]",
1319
+ outerBg: "bg-intent-error/10",
1320
+ innerBg: "bg-intent-error/20",
1321
+ iconColor: "text-intent-error",
1320
1322
  Icon: X
1321
1323
  },
1322
1324
  info: {
1323
- outerBg: "bg-[rgba(60,131,246,0.10)] dark:bg-[rgba(60,131,246,0.10)]",
1324
- innerBg: "bg-[rgba(60,131,246,0.20)] dark:bg-[rgba(60,131,246,0.20)]",
1325
- iconColor: "text-[#3c83f6] dark:text-[#3c83f6]",
1325
+ outerBg: "bg-intent-info/10",
1326
+ innerBg: "bg-intent-info/20",
1327
+ iconColor: "text-intent-info",
1326
1328
  Icon: Info
1327
1329
  }
1328
1330
  };
1329
1331
  var sizeConfig = {
1330
1332
  md: {
1331
- outer: "w-[80px] h-[80px] rounded-[40px]",
1332
- inner: "w-[48px] h-[48px] rounded-[24px]",
1333
+ outer: "w-[80px] h-[80px] rounded-full",
1334
+ inner: "w-[48px] h-[48px] rounded-full",
1333
1335
  iconSize: 24
1334
1336
  },
1335
1337
  sm: {
1336
- outer: "w-[48px] h-[48px] rounded-[24px]",
1337
- inner: "w-[28px] h-[28px] rounded-[14px]",
1338
+ outer: "w-[48px] h-[48px] rounded-full",
1339
+ inner: "w-[28px] h-[28px] rounded-full",
1338
1340
  iconSize: 14
1339
1341
  }
1340
1342
  };
@@ -1521,7 +1523,7 @@ function SkeletonRow({ className = "" }) {
1521
1523
  {
1522
1524
  "data-testid": "skeleton-row",
1523
1525
  className: cn(
1524
- "flex w-full items-center gap-3.5 rounded-[10px] border border-border bg-card px-[18px] py-[14px] dark:border-border dark:bg-card",
1526
+ "flex w-full items-center gap-3.5 rounded-[calc(var(--radius)*1.25)] border border-border bg-card px-[18px] py-[14px] dark:border-border dark:bg-card",
1525
1527
  className
1526
1528
  ),
1527
1529
  children: [
package/dist/marketing.js CHANGED
@@ -3,10 +3,10 @@ import {
3
3
  Button,
4
4
  Container,
5
5
  NavbarMenu
6
- } from "./chunk-A3GODQ6C.js";
6
+ } from "./chunk-GUPC7YZ7.js";
7
7
  import {
8
8
  ScrollHintXMark
9
- } from "./chunk-KXI4UQPS.js";
9
+ } from "./chunk-3K3AFMSH.js";
10
10
  import {
11
11
  cn
12
12
  } from "./chunk-DP5WQAPO.js";
@@ -590,7 +590,12 @@ interface TextProps {
590
590
  align?: 'start' | 'center';
591
591
  /** Cap the line length for reading. */
592
592
  measure?: boolean;
593
- as?: 'p' | 'span' | 'div';
593
+ /**
594
+ * The element. `h3` and `h4` make a small heading on the body face: a
595
+ * feature or card title under a band's `Display` heading, sized by `size`
596
+ * and `weight` like any running text (#6958 item 8).
597
+ */
598
+ as?: 'p' | 'span' | 'div' | 'h3' | 'h4';
594
599
  children: ReactNode;
595
600
  }
596
601
  /** Running text on the theme's body face. */
package/dist/material.js CHANGED
@@ -1,12 +1,12 @@
1
1
  'use client';
2
2
  import {
3
3
  IntentBadge
4
- } from "./chunk-MRVYXQE3.js";
4
+ } from "./chunk-G462BTOB.js";
5
5
  import {
6
6
  CONTENT_GUTTER,
7
7
  Icon,
8
8
  ScrollHintXMark
9
- } from "./chunk-KXI4UQPS.js";
9
+ } from "./chunk-3K3AFMSH.js";
10
10
  import {
11
11
  cn
12
12
  } from "./chunk-DP5WQAPO.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caqophony/ui",
3
- "version": "0.9.5",
3
+ "version": "0.9.7",
4
4
  "description": "Generic, optional React UI reuse library (Gossamer tokens). Centrally maintained by Caqophony.",
5
5
  "license": "MIT",
6
6
  "author": "Caqophony",