@discuss-ds/ui 0.31.0 → 0.33.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
@@ -327,6 +327,10 @@ interface InlineEditMark {
327
327
  end: number;
328
328
  /** Corrections offered in the mark's card, best first (at most three are shown). Used with `onMarkApply`: with one the card has an Apply button; with several each is a choice applied by a click on it and there is no Apply button. An empty string offers to remove the marked text (the button reads "Remove"). */
329
329
  suggestions?: string[];
330
+ /** The colour of the underline: `destructive` (default, for mistakes such as typos) or `warning` (for a recommendation, such as wording that could be clearer). */
331
+ tone?: 'destructive' | 'warning';
332
+ /** Why the words are marked, shown in the mark's card above the suggestions. Without it the card is unchanged. */
333
+ message?: string;
330
334
  }
331
335
 
332
336
  interface InlineEditProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
@@ -383,8 +387,9 @@ interface InlineEditProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'on
383
387
  textClassName?: string;
384
388
  /**
385
389
  * Ranges of the saved text to underline in the destructive colour, for example misspelled words found by a spell checker. `start` is the
386
- * first character and `end` the one after the last. Read mode only: the text box shown while editing has no underline. Ranges that are
387
- * out of bounds, empty or overlapping are ignored.
390
+ * first character and `end` the one after the last. While the field is being edited the underlines stay (as plain lines: they take no click),
391
+ * moving with the text typed after them and going away when the words they mark are changed. Ranges that are out of bounds, empty or
392
+ * overlapping are ignored.
388
393
  */
389
394
  marks?: InlineEditMark[];
390
395
  /**
@@ -559,10 +564,10 @@ declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<Dropdo
559
564
 
560
565
  type ToastVariant = 'info' | 'success' | 'warning' | 'destructive';
561
566
  declare const toastVariants: (props?: ({
562
- variant?: "destructive" | "success" | "info" | "warning" | null | undefined;
567
+ variant?: "destructive" | "success" | "warning" | "info" | null | undefined;
563
568
  } & class_variance_authority_types.ClassProp) | undefined) => string;
564
569
  declare const inlineVariants: (props?: ({
565
- variant?: "destructive" | "success" | "info" | "warning" | "neutral" | null | undefined;
570
+ variant?: "destructive" | "success" | "warning" | "info" | "neutral" | null | undefined;
566
571
  } & class_variance_authority_types.ClassProp) | undefined) => string;
567
572
  type ToastInlineVariant = ToastVariant | 'neutral';
568
573
  declare const ToastProvider: React.FC<Toast$1.ToastProviderProps>;
@@ -580,6 +585,8 @@ declare const ToastAction: React.ForwardRefExoticComponent<Toast$1.ToastActionPr
580
585
  interface ToastInlineProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof inlineVariants> {
581
586
  /** Buttons shown after the message, for example a ghost "Dismiss" and an outline "Fix" (both `size="sm"`). */
582
587
  actions?: React.ReactNode;
588
+ /** Where the actions sit: `end` (default) after the message on the same line, or `bottom` under the message, for messages long enough to wrap. */
589
+ actionsPlacement?: 'end' | 'bottom';
583
590
  /** Show a close button and call this when it is pressed. */
584
591
  onClose?: () => void;
585
592
  closeLabel?: string;
@@ -683,7 +690,12 @@ declare const OpenEndAnswer: React.ForwardRefExoticComponent<OpenEndAnswerProps
683
690
 
684
691
  declare const QuestionCard: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
685
692
 
686
- type QuestionType = 'select-one' | 'select-multiple' | 'ranking' | 'upload' | 'rating' | 'open-end' | 'screen-recording';
693
+ /**
694
+ * `upload` is the generic file upload; `upload-video`, `upload-photo` and `upload-document` say which kind of file the respondent sends (a video icon, an image icon, a file-with-text
695
+ * icon for PDF/PPTX/DOCX). A video upload shares the video camera with screen recording: no method offers both,
696
+ * so they never meet in one activity.
697
+ */
698
+ type QuestionType = 'select-one' | 'select-multiple' | 'ranking' | 'upload' | 'upload-video' | 'upload-photo' | 'upload-document' | 'rating' | 'open-end' | 'screen-recording';
687
699
  interface QuestionTypeIconProps extends Omit<IconProps, 'weight'> {
688
700
  type: QuestionType;
689
701
  }
@@ -1045,6 +1057,8 @@ interface StatCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'chil
1045
1057
  value: React.ReactNode;
1046
1058
  /** Leading icon beside the value (24px). */
1047
1059
  icon?: React.ReactNode;
1060
+ /** Small muted text under the value that says what it refers to or breaks it down ("11 open-ended · 5 closed-ended"). */
1061
+ caption?: React.ReactNode;
1048
1062
  }
1049
1063
  declare const StatCard: React.ForwardRefExoticComponent<StatCardProps & React.RefAttributes<HTMLDivElement>>;
1050
1064
 
package/dist/index.d.ts CHANGED
@@ -327,6 +327,10 @@ interface InlineEditMark {
327
327
  end: number;
328
328
  /** Corrections offered in the mark's card, best first (at most three are shown). Used with `onMarkApply`: with one the card has an Apply button; with several each is a choice applied by a click on it and there is no Apply button. An empty string offers to remove the marked text (the button reads "Remove"). */
329
329
  suggestions?: string[];
330
+ /** The colour of the underline: `destructive` (default, for mistakes such as typos) or `warning` (for a recommendation, such as wording that could be clearer). */
331
+ tone?: 'destructive' | 'warning';
332
+ /** Why the words are marked, shown in the mark's card above the suggestions. Without it the card is unchanged. */
333
+ message?: string;
330
334
  }
331
335
 
332
336
  interface InlineEditProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
@@ -383,8 +387,9 @@ interface InlineEditProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'on
383
387
  textClassName?: string;
384
388
  /**
385
389
  * Ranges of the saved text to underline in the destructive colour, for example misspelled words found by a spell checker. `start` is the
386
- * first character and `end` the one after the last. Read mode only: the text box shown while editing has no underline. Ranges that are
387
- * out of bounds, empty or overlapping are ignored.
390
+ * first character and `end` the one after the last. While the field is being edited the underlines stay (as plain lines: they take no click),
391
+ * moving with the text typed after them and going away when the words they mark are changed. Ranges that are out of bounds, empty or
392
+ * overlapping are ignored.
388
393
  */
389
394
  marks?: InlineEditMark[];
390
395
  /**
@@ -559,10 +564,10 @@ declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<Dropdo
559
564
 
560
565
  type ToastVariant = 'info' | 'success' | 'warning' | 'destructive';
561
566
  declare const toastVariants: (props?: ({
562
- variant?: "destructive" | "success" | "info" | "warning" | null | undefined;
567
+ variant?: "destructive" | "success" | "warning" | "info" | null | undefined;
563
568
  } & class_variance_authority_types.ClassProp) | undefined) => string;
564
569
  declare const inlineVariants: (props?: ({
565
- variant?: "destructive" | "success" | "info" | "warning" | "neutral" | null | undefined;
570
+ variant?: "destructive" | "success" | "warning" | "info" | "neutral" | null | undefined;
566
571
  } & class_variance_authority_types.ClassProp) | undefined) => string;
567
572
  type ToastInlineVariant = ToastVariant | 'neutral';
568
573
  declare const ToastProvider: React.FC<Toast$1.ToastProviderProps>;
@@ -580,6 +585,8 @@ declare const ToastAction: React.ForwardRefExoticComponent<Toast$1.ToastActionPr
580
585
  interface ToastInlineProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof inlineVariants> {
581
586
  /** Buttons shown after the message, for example a ghost "Dismiss" and an outline "Fix" (both `size="sm"`). */
582
587
  actions?: React.ReactNode;
588
+ /** Where the actions sit: `end` (default) after the message on the same line, or `bottom` under the message, for messages long enough to wrap. */
589
+ actionsPlacement?: 'end' | 'bottom';
583
590
  /** Show a close button and call this when it is pressed. */
584
591
  onClose?: () => void;
585
592
  closeLabel?: string;
@@ -683,7 +690,12 @@ declare const OpenEndAnswer: React.ForwardRefExoticComponent<OpenEndAnswerProps
683
690
 
684
691
  declare const QuestionCard: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
685
692
 
686
- type QuestionType = 'select-one' | 'select-multiple' | 'ranking' | 'upload' | 'rating' | 'open-end' | 'screen-recording';
693
+ /**
694
+ * `upload` is the generic file upload; `upload-video`, `upload-photo` and `upload-document` say which kind of file the respondent sends (a video icon, an image icon, a file-with-text
695
+ * icon for PDF/PPTX/DOCX). A video upload shares the video camera with screen recording: no method offers both,
696
+ * so they never meet in one activity.
697
+ */
698
+ type QuestionType = 'select-one' | 'select-multiple' | 'ranking' | 'upload' | 'upload-video' | 'upload-photo' | 'upload-document' | 'rating' | 'open-end' | 'screen-recording';
687
699
  interface QuestionTypeIconProps extends Omit<IconProps, 'weight'> {
688
700
  type: QuestionType;
689
701
  }
@@ -1045,6 +1057,8 @@ interface StatCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'chil
1045
1057
  value: React.ReactNode;
1046
1058
  /** Leading icon beside the value (24px). */
1047
1059
  icon?: React.ReactNode;
1060
+ /** Small muted text under the value that says what it refers to or breaks it down ("11 open-ended · 5 closed-ended"). */
1061
+ caption?: React.ReactNode;
1048
1062
  }
1049
1063
  declare const StatCard: React.ForwardRefExoticComponent<StatCardProps & React.RefAttributes<HTMLDivElement>>;
1050
1064