@discuss-ds/ui 0.10.1 → 0.12.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/dist/index.d.cts CHANGED
@@ -655,6 +655,8 @@ interface QuestionEditorCardProps extends Omit<React.HTMLAttributes<HTMLDivEleme
655
655
  onAdd?: () => void;
656
656
  /** Footer: opens paste-many-choices. */
657
657
  onPaste?: () => void;
658
+ /** Inline error shown at the bottom of the card, e.g. "Not available in Self-Paced". Keep it as short as possible. */
659
+ error?: React.ReactNode;
658
660
  /** Optional strip under the card body, e.g. an "Inferred" assumption note. */
659
661
  note?: React.ReactNode;
660
662
  /** Makes the "Question N" tag a drag handle for reordering. See `QuestionHeader`'s `dragHandleProps`. */
@@ -898,6 +900,8 @@ interface ActivityStructureProps extends Omit<React.HTMLAttributes<HTMLElement>,
898
900
  stats: ActivityStat[];
899
901
  /** Text sections (e.g. Research Goal, Target Audience), optionally with tags. */
900
902
  sections?: ActivitySection[];
903
+ /** Optional control (e.g. a button) shown at the right of the title. */
904
+ action?: React.ReactNode;
901
905
  /** Called with `(sectionId, tag)` when a tag's remove button is pressed. Omit for read-only tags. */
902
906
  onRemoveTag?: (sectionId: string, tag: string) => void;
903
907
  /** Called with the section id by the dashed "Add tag" chip. Omit to hide it. */
package/dist/index.d.ts CHANGED
@@ -655,6 +655,8 @@ interface QuestionEditorCardProps extends Omit<React.HTMLAttributes<HTMLDivEleme
655
655
  onAdd?: () => void;
656
656
  /** Footer: opens paste-many-choices. */
657
657
  onPaste?: () => void;
658
+ /** Inline error shown at the bottom of the card, e.g. "Not available in Self-Paced". Keep it as short as possible. */
659
+ error?: React.ReactNode;
658
660
  /** Optional strip under the card body, e.g. an "Inferred" assumption note. */
659
661
  note?: React.ReactNode;
660
662
  /** Makes the "Question N" tag a drag handle for reordering. See `QuestionHeader`'s `dragHandleProps`. */
@@ -898,6 +900,8 @@ interface ActivityStructureProps extends Omit<React.HTMLAttributes<HTMLElement>,
898
900
  stats: ActivityStat[];
899
901
  /** Text sections (e.g. Research Goal, Target Audience), optionally with tags. */
900
902
  sections?: ActivitySection[];
903
+ /** Optional control (e.g. a button) shown at the right of the title. */
904
+ action?: React.ReactNode;
901
905
  /** Called with `(sectionId, tag)` when a tag's remove button is pressed. Omit for read-only tags. */
902
906
  onRemoveTag?: (sectionId: string, tag: string) => void;
903
907
  /** Called with the section id by the dashed "Add tag" chip. Omit to hide it. */
package/dist/index.js CHANGED
@@ -2502,7 +2502,8 @@ import {
2502
2502
  Eye,
2503
2503
  Plus as Plus3,
2504
2504
  Sparkle as Sparkle2,
2505
- Trash as Trash3
2505
+ Trash as Trash3,
2506
+ Warning as Warning2
2506
2507
  } from "@phosphor-icons/react";
2507
2508
 
2508
2509
  // src/components/Question Types/QuestionHeader.tsx
@@ -2615,6 +2616,7 @@ var QuestionEditorCard = React41.forwardRef(
2615
2616
  onAdd,
2616
2617
  onPaste,
2617
2618
  note,
2619
+ error,
2618
2620
  dragHandleProps,
2619
2621
  children,
2620
2622
  ...props
@@ -2687,6 +2689,10 @@ var QuestionEditorCard = React41.forwardRef(
2687
2689
  ),
2688
2690
  children
2689
2691
  ] }),
2692
+ error && /* @__PURE__ */ jsxs29("p", { className: "flex items-center gap-1 text-ui-caption text-destructive-foreground", children: [
2693
+ /* @__PURE__ */ jsx42(Warning2, { size: 16, "aria-hidden": true, className: "shrink-0" }),
2694
+ error
2695
+ ] }),
2690
2696
  footer && /* @__PURE__ */ jsxs29("div", { className: "flex items-center justify-between", children: [
2691
2697
  /* @__PURE__ */ jsx42("p", { className: "text-ui-caption text-secondary-muted-foreground", children: countLabel }),
2692
2698
  /* @__PURE__ */ jsxs29("div", { className: "flex items-center gap-2", children: [
@@ -2733,7 +2739,7 @@ QuestionEditorCard.displayName = "QuestionEditorCard";
2733
2739
 
2734
2740
  // src/components/Question Types/QuestionNavItem.tsx
2735
2741
  import * as React43 from "react";
2736
- import { DotsSixVertical as DotsSixVertical2, Warning as Warning2 } from "@phosphor-icons/react";
2742
+ import { DotsSixVertical as DotsSixVertical2, Warning as Warning3 } from "@phosphor-icons/react";
2737
2743
  import { Slot as Slot3 } from "radix-ui";
2738
2744
 
2739
2745
  // src/components/Question Types/QuestionTypeIcon.tsx
@@ -2778,7 +2784,7 @@ var QuestionNavItem = React43.forwardRef(
2778
2784
  children: [
2779
2785
  /* @__PURE__ */ jsxs30("span", { "aria-hidden": "true", className: "relative flex size-4 shrink-0 items-center justify-center", children: [
2780
2786
  /* @__PURE__ */ jsx44(DotsSixVertical2, { size: 16, className: "hidden group-hover/nav:block" }),
2781
- /* @__PURE__ */ jsx44("span", { className: "group-hover/nav:hidden", children: error ? /* @__PURE__ */ jsx44(Warning2, { size: 16, className: "text-destructive" }) : /* @__PURE__ */ jsx44(
2787
+ /* @__PURE__ */ jsx44("span", { className: "group-hover/nav:hidden", children: error ? /* @__PURE__ */ jsx44(Warning3, { size: 16, className: "text-destructive-foreground" }) : /* @__PURE__ */ jsx44(
2782
2788
  QuestionTypeIcon,
2783
2789
  {
2784
2790
  type: questionType,
@@ -3378,14 +3384,17 @@ EditableTag.displayName = "EditableTag";
3378
3384
  // src/components/Research-Specific/ActivityStructure.tsx
3379
3385
  import { jsx as jsx53, jsxs as jsxs39 } from "react/jsx-runtime";
3380
3386
  var ActivityStructure = React52.forwardRef(
3381
- ({ className, title = "Activity Structure", stats, sections, onRemoveTag, onAddTag, addTagLabel = "Add tag", children, ...props }, ref) => /* @__PURE__ */ jsxs39(
3387
+ ({ className, title = "Activity Structure", stats, sections, onRemoveTag, onAddTag, addTagLabel = "Add tag", action, children, ...props }, ref) => /* @__PURE__ */ jsxs39(
3382
3388
  "section",
3383
3389
  {
3384
3390
  ref,
3385
3391
  className: cn("flex w-full max-w-96.5 flex-col gap-4 rounded-xl bg-surface p-4", className),
3386
3392
  ...props,
3387
3393
  children: [
3388
- /* @__PURE__ */ jsx53("h3", { className: "text-heading-h3 text-primary", children: title }),
3394
+ /* @__PURE__ */ jsxs39("div", { className: "flex items-center justify-between gap-2", children: [
3395
+ /* @__PURE__ */ jsx53("h3", { className: "text-body-section text-surface-foreground", children: title }),
3396
+ action
3397
+ ] }),
3389
3398
  stats.length > 0 && /* @__PURE__ */ jsx53("div", { className: "grid grid-cols-2 gap-3", children: stats.map(({ id, ...stat }) => /* @__PURE__ */ jsx53(StatCard, { ...stat }, id)) }),
3390
3399
  sections?.map(({ id, heading, body, tags }) => /* @__PURE__ */ jsxs39("div", { className: "flex flex-col gap-2", children: [
3391
3400
  /* @__PURE__ */ jsx53("h4", { className: "text-heading-h4 text-surface-foreground", children: heading }),