@discuss-ds/ui 0.30.0 → 0.30.1

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
@@ -674,9 +674,9 @@ interface QuestionEditorCardProps extends Omit<React.HTMLAttributes<HTMLDivEleme
674
674
  titlePlaceholderTone?: 'muted' | 'regular';
675
675
  /** Shortest title (in characters) that may be saved. Turns on the title guardrail: see `QuestionHeader`'s `titleMinLength`. */
676
676
  titleMinLength?: number;
677
- /** A title longer than this many characters switches to the regular 16px body style and shows `titleRecommendedNote` under it. See `QuestionHeader`. */
677
+ /** A title longer than this many characters switches to the regular 16px body style, and shows `titleRecommendedNote` under it when given. See `QuestionHeader`. */
678
678
  titleRecommendedMax?: number;
679
- /** The recommendation shown under a title that is longer than `titleRecommendedMax`. */
679
+ /** Optional text shown under a title that is longer than `titleRecommendedMax`; leave it out to change only the style. */
680
680
  titleRecommendedNote?: React.ReactNode;
681
681
  /** The question is being edited: accent border, counter and footer are shown. */
682
682
  active?: boolean;
@@ -737,10 +737,10 @@ interface QuestionHeaderProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
737
737
  titleMinLength?: number;
738
738
  /**
739
739
  * Editor mode: a title longer than this many characters (counted live while it is typed) switches to the regular 16px body style
740
- * instead of the heading style and shows `titleRecommendedNote` under it. Both need to be set.
740
+ * instead of the heading style, and shows `titleRecommendedNote` under it when that is given.
741
741
  */
742
742
  titleRecommendedMax?: number;
743
- /** Editor mode: the recommendation shown under a title that is longer than `titleRecommendedMax`. */
743
+ /** Editor mode: optional text shown under a title that is longer than `titleRecommendedMax`. Leave it out to change only the style (for example when the recommendation is shown elsewhere). */
744
744
  titleRecommendedNote?: React.ReactNode;
745
745
  /** Editor mode: action buttons (copy, delete, preview, AI) revealed on hover or focus. */
746
746
  actions?: React.ReactNode;
package/dist/index.d.ts CHANGED
@@ -674,9 +674,9 @@ interface QuestionEditorCardProps extends Omit<React.HTMLAttributes<HTMLDivEleme
674
674
  titlePlaceholderTone?: 'muted' | 'regular';
675
675
  /** Shortest title (in characters) that may be saved. Turns on the title guardrail: see `QuestionHeader`'s `titleMinLength`. */
676
676
  titleMinLength?: number;
677
- /** A title longer than this many characters switches to the regular 16px body style and shows `titleRecommendedNote` under it. See `QuestionHeader`. */
677
+ /** A title longer than this many characters switches to the regular 16px body style, and shows `titleRecommendedNote` under it when given. See `QuestionHeader`. */
678
678
  titleRecommendedMax?: number;
679
- /** The recommendation shown under a title that is longer than `titleRecommendedMax`. */
679
+ /** Optional text shown under a title that is longer than `titleRecommendedMax`; leave it out to change only the style. */
680
680
  titleRecommendedNote?: React.ReactNode;
681
681
  /** The question is being edited: accent border, counter and footer are shown. */
682
682
  active?: boolean;
@@ -737,10 +737,10 @@ interface QuestionHeaderProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
737
737
  titleMinLength?: number;
738
738
  /**
739
739
  * Editor mode: a title longer than this many characters (counted live while it is typed) switches to the regular 16px body style
740
- * instead of the heading style and shows `titleRecommendedNote` under it. Both need to be set.
740
+ * instead of the heading style, and shows `titleRecommendedNote` under it when that is given.
741
741
  */
742
742
  titleRecommendedMax?: number;
743
- /** Editor mode: the recommendation shown under a title that is longer than `titleRecommendedMax`. */
743
+ /** Editor mode: optional text shown under a title that is longer than `titleRecommendedMax`. Leave it out to change only the style (for example when the recommendation is shown elsewhere). */
744
744
  titleRecommendedNote?: React.ReactNode;
745
745
  /** Editor mode: action buttons (copy, delete, preview, AI) revealed on hover or focus. */
746
746
  actions?: React.ReactNode;
package/dist/index.js CHANGED
@@ -2670,7 +2670,7 @@ var QuestionHeader = React40.forwardRef(
2670
2670
  if (editor) {
2671
2671
  const text = typeof title === "string" ? title : "";
2672
2672
  const count = (draft ?? text).length;
2673
- const long = titleRecommendedMax !== void 0 && titleRecommendedNote != null && count > titleRecommendedMax;
2673
+ const long = titleRecommendedMax !== void 0 && count > titleRecommendedMax;
2674
2674
  return /* @__PURE__ */ jsxs29("div", { ref, className: cn("group/header flex w-full flex-col gap-2", className), ...props, children: [
2675
2675
  /* @__PURE__ */ jsxs29("div", { className: "flex items-center justify-between", children: [
2676
2676
  /* @__PURE__ */ jsxs29("div", { className: "flex items-center gap-2", children: [
@@ -2732,7 +2732,7 @@ var QuestionHeader = React40.forwardRef(
2732
2732
  textClassName: long ? "text-body-base" : "text-heading-h4"
2733
2733
  }
2734
2734
  ),
2735
- long && /* @__PURE__ */ jsx41("p", { className: "text-ui-caption text-secondary-muted-foreground", children: titleRecommendedNote }),
2735
+ long && titleRecommendedNote != null && /* @__PURE__ */ jsx41("p", { className: "text-ui-caption text-secondary-muted-foreground", children: titleRecommendedNote }),
2736
2736
  showCounter && titleMinLength === void 0 && /* @__PURE__ */ jsxs29("p", { className: "text-ui-caption text-secondary-muted-foreground", children: [
2737
2737
  count,
2738
2738
  "/",