@discuss-ds/ui 0.30.1 → 0.32.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
@@ -322,6 +322,13 @@ declare const FormMessage: React.ForwardRefExoticComponent<FormMessageProps & Re
322
322
  /** `September 23, 2026 - 11:30 AM` (or just the date when `showTime` is false). */
323
323
  declare function formatDateTime(date: Date, showTime?: boolean): string;
324
324
 
325
+ interface InlineEditMark {
326
+ start: number;
327
+ end: number;
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
+ suggestions?: string[];
330
+ }
331
+
325
332
  interface InlineEditProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
326
333
  /** Controlled value. Pair with `onValueChange`. */
327
334
  value?: string;
@@ -366,7 +373,7 @@ interface InlineEditProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'on
366
373
  /**
367
374
  * `default` is a rounded field. A short single-line label shows the pencil and hugs its text; `multiline` (longer
368
375
  * text) hides the pencil and fills the width. `question` is for question text: it fills the width with no pencil,
369
- * has square corners and shows a 1px bottom border on hover and focus (in the input border colour) that becomes a bolder 2px accent border while `selected`. Enter saves; Shift+Enter adds a
376
+ * has square corners and shows a 1px bottom border on hover and focus (in the input border colour) that becomes a bolder 2px muted accent border while `selected` (light enough to stay distinct from the destructive underline of a marked word). Enter saves; Shift+Enter adds a
370
377
  * line break when `multiline`.
371
378
  */
372
379
  variant?: 'default' | 'question';
@@ -374,6 +381,19 @@ interface InlineEditProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'on
374
381
  selected?: boolean;
375
382
  /** Classes for the displayed/edited text, e.g. a heading text style. The field itself keeps the same box. */
376
383
  textClassName?: string;
384
+ /**
385
+ * 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.
388
+ */
389
+ marks?: InlineEditMark[];
390
+ /**
391
+ * Makes each mark clickable: clicking an underlined word opens a small card with the marked text, its `suggestions` and a Dismiss action,
392
+ * instead of starting the edit. Called with the mark and the suggestion the reader chose; apply it to the value yourself.
393
+ */
394
+ onMarkApply?: (mark: InlineEditMark, replacement: string) => void;
395
+ /** Called when the reader dismisses a mark from its card. Remove the mark to make the underline go away. */
396
+ onMarkDismiss?: (mark: InlineEditMark) => void;
377
397
  }
378
398
  declare const InlineEdit: React.ForwardRefExoticComponent<InlineEditProps & React.RefAttributes<HTMLDivElement>>;
379
399
 
@@ -560,6 +580,8 @@ declare const ToastAction: React.ForwardRefExoticComponent<Toast$1.ToastActionPr
560
580
  interface ToastInlineProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof inlineVariants> {
561
581
  /** Buttons shown after the message, for example a ghost "Dismiss" and an outline "Fix" (both `size="sm"`). */
562
582
  actions?: React.ReactNode;
583
+ /** Where the actions sit: `end` (default) after the message on the same line, or `bottom` under the message, for messages long enough to wrap. */
584
+ actionsPlacement?: 'end' | 'bottom';
563
585
  /** Show a close button and call this when it is pressed. */
564
586
  onClose?: () => void;
565
587
  closeLabel?: string;
@@ -663,6 +685,17 @@ declare const OpenEndAnswer: React.ForwardRefExoticComponent<OpenEndAnswerProps
663
685
 
664
686
  declare const QuestionCard: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
665
687
 
688
+ /**
689
+ * `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
690
+ * icon for PDF/PPTX/DOCX). A video upload shares the video camera with screen recording: no method offers both,
691
+ * so they never meet in one activity.
692
+ */
693
+ type QuestionType = 'select-one' | 'select-multiple' | 'ranking' | 'upload' | 'upload-video' | 'upload-photo' | 'upload-document' | 'rating' | 'open-end' | 'screen-recording';
694
+ interface QuestionTypeIconProps extends Omit<IconProps, 'weight'> {
695
+ type: QuestionType;
696
+ }
697
+ declare function QuestionTypeIcon({ type, size, className, ...props }: QuestionTypeIconProps): React.JSX.Element;
698
+
666
699
  interface QuestionEditorCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title" | "onChange"> {
667
700
  /** Question number shown in the drag-handle tag. */
668
701
  number: number;
@@ -709,6 +742,14 @@ interface QuestionEditorCardProps extends Omit<React.HTMLAttributes<HTMLDivEleme
709
742
  dragHandleProps?: React.ComponentPropsWithRef<'span'>;
710
743
  /** Whether the grip icon shows in the "Question N" tag on hover. Defaults to true; set false when the card can't be moved. See `QuestionHeader`. */
711
744
  showDragHandle?: boolean;
745
+ /** The question's type, shown as an icon in the "Question N" tag in its default and selected states (the grip replaces it on hover). See `QuestionHeader`. */
746
+ questionType?: QuestionType;
747
+ /** Ranges of the saved question text to underline in the destructive colour, such as misspelled words. See `QuestionHeader`'s `titleMarks`. */
748
+ titleMarks?: InlineEditMark[];
749
+ /** Makes the underlined words clickable; called with the mark and the chosen correction. See `QuestionHeader`'s `onTitleMarkApply`. */
750
+ onTitleMarkApply?: (mark: InlineEditMark, replacement: string) => void;
751
+ /** Called when a mark is dismissed from its card. */
752
+ onTitleMarkDismiss?: (mark: InlineEditMark) => void;
712
753
  }
713
754
  declare const QuestionEditorCard: React.ForwardRefExoticComponent<QuestionEditorCardProps & React.RefAttributes<HTMLDivElement>>;
714
755
 
@@ -764,15 +805,20 @@ interface QuestionHeaderProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
764
805
  * can't be moved (for example while a translation is being edited), so the tag doesn't suggest dragging.
765
806
  */
766
807
  showDragHandle?: boolean;
808
+ /**
809
+ * Editor mode: the question's type, shown as a 16px icon at the start of the "Question N" tag in its default and selected states.
810
+ * On hover or focus (when the tag can be dragged) the grip icon replaces it. Leave it out for a tag with the number only.
811
+ */
812
+ questionType?: QuestionType;
813
+ /** Editor mode: ranges of the saved title to underline in the destructive colour (misspelled words, for example). See `InlineEdit`'s `marks`. */
814
+ titleMarks?: InlineEditMark[];
815
+ /** Editor mode: makes the underlined words clickable; called with the mark and the chosen correction. See `InlineEdit`'s `onMarkApply`. */
816
+ onTitleMarkApply?: (mark: InlineEditMark, replacement: string) => void;
817
+ /** Editor mode: called when a mark is dismissed from its card. See `InlineEdit`'s `onMarkDismiss`. */
818
+ onTitleMarkDismiss?: (mark: InlineEditMark) => void;
767
819
  }
768
820
  declare const QuestionHeader: React.ForwardRefExoticComponent<QuestionHeaderProps & React.RefAttributes<HTMLDivElement>>;
769
821
 
770
- type QuestionType = 'select-one' | 'select-multiple' | 'ranking' | 'upload' | 'rating' | 'open-end' | 'screen-recording';
771
- interface QuestionTypeIconProps extends Omit<IconProps, 'weight'> {
772
- type: QuestionType;
773
- }
774
- declare function QuestionTypeIcon({ type, size, className, ...props }: QuestionTypeIconProps): React.JSX.Element;
775
-
776
822
  interface QuestionNavItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
777
823
  /** The question currently open in the editor. */
778
824
  selected?: boolean;
@@ -874,8 +920,17 @@ interface QuestionOptionEditorProps {
874
920
  * are shared with the original.
875
921
  */
876
922
  locked?: boolean;
923
+ /**
924
+ * Ranges of the label to underline in the destructive colour, for example misspelled words found by a spell checker. The underline shows
925
+ * while the label is not being edited. See `InlineEdit`'s `marks`.
926
+ */
927
+ marks?: InlineEditMark[];
928
+ /** Makes each mark clickable: clicking an underlined word opens a card with the corrections and a Dismiss action. See `InlineEdit`'s `onMarkApply`. */
929
+ onMarkApply?: (mark: InlineEditMark, replacement: string) => void;
930
+ /** Called when a mark is dismissed from its card. */
931
+ onMarkDismiss?: (mark: InlineEditMark) => void;
877
932
  }
878
- declare function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTone, minLength, maxLength, onRemove, onAdd, removeDisabled, addDisabled, className, kind, rank, dragHandleProps, lifted, locked }: QuestionOptionEditorProps): React.JSX.Element;
933
+ declare function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTone, minLength, maxLength, onRemove, onAdd, removeDisabled, addDisabled, className, kind, rank, dragHandleProps, lifted, locked, marks, onMarkApply, onMarkDismiss }: QuestionOptionEditorProps): React.JSX.Element;
879
934
 
880
935
  interface RankItemData {
881
936
  id: string;
@@ -997,6 +1052,8 @@ interface StatCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'chil
997
1052
  value: React.ReactNode;
998
1053
  /** Leading icon beside the value (24px). */
999
1054
  icon?: React.ReactNode;
1055
+ /** Small muted text under the value that says what it refers to or breaks it down ("11 open-ended · 5 closed-ended"). */
1056
+ caption?: React.ReactNode;
1000
1057
  }
1001
1058
  declare const StatCard: React.ForwardRefExoticComponent<StatCardProps & React.RefAttributes<HTMLDivElement>>;
1002
1059
 
@@ -1087,4 +1144,4 @@ interface PaginationProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onCha
1087
1144
  }
1088
1145
  declare const Pagination: React.ForwardRefExoticComponent<PaginationProps & React.RefAttributes<HTMLElement>>;
1089
1146
 
1090
- export { AIMiniAvatar, type AIMiniAvatarProps, AIResponseContainer, type AIResponseContainerProps, type AIStatus, type ActivitySection, type ActivityStat, ActivityStructure, type ActivityStructureProps, AskAiInput, type AskAiInputProps, AskAiToggle, type AskAiToggleProps, Badge, type BadgeProps, Button, type ButtonProps, Calendar, type CalendarProps, ChatChoices, type ChatChoicesProps, ChatInput, type ChatInputProps, ChatOption, type ChatOptionActionProps, type ChatOptionCheckboxProps, type ChatOptionProps, type ChatOptionRadioProps, Checkbox, CheckboxField, type CheckboxFieldProps, type CheckboxProps, DatePicker, type DatePickerProps, DateTimePicker, type DateTimePickerProps, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, type DropdownMenuSelectableItemProps, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EditableTag, type EditableTagProps, Field, type FieldControlProps, type FieldProps, type FieldStatus, FileAttachment, type FileAttachmentProps, FileUploadItem, type FileUploadItemProps, FileUploadZone, type FileUploadZoneProps, Form, FormControl, type FormControlProps, FormDescription, type FormDescriptionProps, FormField, FormItem, type FormItemProps, FormLabel, type FormLabelProps, FormMessage, type FormMessageProps, ImagePreview, type ImagePreviewProps, ImageThumbnails, type ImageThumbnailsProps, InlineEdit, type InlineEditProps, Input, type InputProps, InputWithAction, type InputWithActionProps, Label, type LabelProps, MediaInfo, type MediaInfoProps, NumberInput, type NumberInputProps, OpenEndAnswer, type OpenEndAnswerProps, Pagination, type PaginationItemValue, type PaginationProps, Progress, type ProgressProps, ProjectSelector, type ProjectSelectorProps, QuestionCard, type QuestionCheckboxOptionProps, QuestionEditorCard, type QuestionEditorCardProps, QuestionHeader, type QuestionHeaderProps, QuestionNavItem, type QuestionNavItemProps, QuestionOption, QuestionOptionEditor, type QuestionOptionEditorProps, type QuestionOptionProps, QuestionOtherOption, type QuestionOtherOptionProps, type QuestionRadioOptionProps, type QuestionType, QuestionTypeIcon, type QuestionTypeIconProps, RadioGroup, RadioGroupFieldItem, type RadioGroupFieldItemProps, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps, type RankItemData, RankList, type RankListProps, RatingScale, type RatingScaleProps, SearchBar, type SearchBarProps, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, type SelectItemProps, SelectTrigger, type SelectTriggerProps, SelectValue, Slider, type SliderProps, StatCard, type StatCardProps, StatusTag, type StatusTagProps, StimulusCard, type StimulusCardProps, Switch, type SwitchProps, TabItem, type TabItemProps, TabNavigation, TabNavigationContext, type TabNavigationProps, type TabNavigationVariant, Table, TableBody, TableCell, type TableCellProps, TableCellTwoLines, type TableCellTwoLinesProps, TableHead, type TableHeadProps, TableHeader, type TableProps, TableRow, type TableRowProps, Tabs, TabsContent, Tag, type TagProps, Textarea, type TextareaProps, TimeItem, type TimeItemProps, TimePicker, type TimePickerProps, type TimeValue, Timestamp, type TimestampProps, Toast, ToastAction, ToastInline, type ToastInlineProps, type ToastInlineVariant, type ToastProps, ToastProvider, type ToastVariant, ToastViewport, Toggle, type ToggleProps, Tooltip, TooltipContent, type TooltipContentProps, TooltipProvider, TooltipTrigger, TopicActivityRow, type TopicActivityRowProps, TopicCard, TopicCardMetaItem, type TopicCardMetaItemProps, type TopicCardProps, TopicCardTag, UserMessageBubble, type UserMessageBubbleProps, VideoPlayer, type VideoPlayerProps, VolumeControl, type VolumeControlProps, fieldSurfaceClasses, formatDateTime, getPaginationItems, useFormField };
1147
+ export { AIMiniAvatar, type AIMiniAvatarProps, AIResponseContainer, type AIResponseContainerProps, type AIStatus, type ActivitySection, type ActivityStat, ActivityStructure, type ActivityStructureProps, AskAiInput, type AskAiInputProps, AskAiToggle, type AskAiToggleProps, Badge, type BadgeProps, Button, type ButtonProps, Calendar, type CalendarProps, ChatChoices, type ChatChoicesProps, ChatInput, type ChatInputProps, ChatOption, type ChatOptionActionProps, type ChatOptionCheckboxProps, type ChatOptionProps, type ChatOptionRadioProps, Checkbox, CheckboxField, type CheckboxFieldProps, type CheckboxProps, DatePicker, type DatePickerProps, DateTimePicker, type DateTimePickerProps, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, type DropdownMenuSelectableItemProps, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EditableTag, type EditableTagProps, Field, type FieldControlProps, type FieldProps, type FieldStatus, FileAttachment, type FileAttachmentProps, FileUploadItem, type FileUploadItemProps, FileUploadZone, type FileUploadZoneProps, Form, FormControl, type FormControlProps, FormDescription, type FormDescriptionProps, FormField, FormItem, type FormItemProps, FormLabel, type FormLabelProps, FormMessage, type FormMessageProps, ImagePreview, type ImagePreviewProps, ImageThumbnails, type ImageThumbnailsProps, InlineEdit, type InlineEditMark, type InlineEditProps, Input, type InputProps, InputWithAction, type InputWithActionProps, Label, type LabelProps, MediaInfo, type MediaInfoProps, NumberInput, type NumberInputProps, OpenEndAnswer, type OpenEndAnswerProps, Pagination, type PaginationItemValue, type PaginationProps, Progress, type ProgressProps, ProjectSelector, type ProjectSelectorProps, QuestionCard, type QuestionCheckboxOptionProps, QuestionEditorCard, type QuestionEditorCardProps, QuestionHeader, type QuestionHeaderProps, QuestionNavItem, type QuestionNavItemProps, QuestionOption, QuestionOptionEditor, type QuestionOptionEditorProps, type QuestionOptionProps, QuestionOtherOption, type QuestionOtherOptionProps, type QuestionRadioOptionProps, type QuestionType, QuestionTypeIcon, type QuestionTypeIconProps, RadioGroup, RadioGroupFieldItem, type RadioGroupFieldItemProps, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps, type RankItemData, RankList, type RankListProps, RatingScale, type RatingScaleProps, SearchBar, type SearchBarProps, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, type SelectItemProps, SelectTrigger, type SelectTriggerProps, SelectValue, Slider, type SliderProps, StatCard, type StatCardProps, StatusTag, type StatusTagProps, StimulusCard, type StimulusCardProps, Switch, type SwitchProps, TabItem, type TabItemProps, TabNavigation, TabNavigationContext, type TabNavigationProps, type TabNavigationVariant, Table, TableBody, TableCell, type TableCellProps, TableCellTwoLines, type TableCellTwoLinesProps, TableHead, type TableHeadProps, TableHeader, type TableProps, TableRow, type TableRowProps, Tabs, TabsContent, Tag, type TagProps, Textarea, type TextareaProps, TimeItem, type TimeItemProps, TimePicker, type TimePickerProps, type TimeValue, Timestamp, type TimestampProps, Toast, ToastAction, ToastInline, type ToastInlineProps, type ToastInlineVariant, type ToastProps, ToastProvider, type ToastVariant, ToastViewport, Toggle, type ToggleProps, Tooltip, TooltipContent, type TooltipContentProps, TooltipProvider, TooltipTrigger, TopicActivityRow, type TopicActivityRowProps, TopicCard, TopicCardMetaItem, type TopicCardMetaItemProps, type TopicCardProps, TopicCardTag, UserMessageBubble, type UserMessageBubbleProps, VideoPlayer, type VideoPlayerProps, VolumeControl, type VolumeControlProps, fieldSurfaceClasses, formatDateTime, getPaginationItems, useFormField };
package/dist/index.d.ts CHANGED
@@ -322,6 +322,13 @@ declare const FormMessage: React.ForwardRefExoticComponent<FormMessageProps & Re
322
322
  /** `September 23, 2026 - 11:30 AM` (or just the date when `showTime` is false). */
323
323
  declare function formatDateTime(date: Date, showTime?: boolean): string;
324
324
 
325
+ interface InlineEditMark {
326
+ start: number;
327
+ end: number;
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
+ suggestions?: string[];
330
+ }
331
+
325
332
  interface InlineEditProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
326
333
  /** Controlled value. Pair with `onValueChange`. */
327
334
  value?: string;
@@ -366,7 +373,7 @@ interface InlineEditProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'on
366
373
  /**
367
374
  * `default` is a rounded field. A short single-line label shows the pencil and hugs its text; `multiline` (longer
368
375
  * text) hides the pencil and fills the width. `question` is for question text: it fills the width with no pencil,
369
- * has square corners and shows a 1px bottom border on hover and focus (in the input border colour) that becomes a bolder 2px accent border while `selected`. Enter saves; Shift+Enter adds a
376
+ * has square corners and shows a 1px bottom border on hover and focus (in the input border colour) that becomes a bolder 2px muted accent border while `selected` (light enough to stay distinct from the destructive underline of a marked word). Enter saves; Shift+Enter adds a
370
377
  * line break when `multiline`.
371
378
  */
372
379
  variant?: 'default' | 'question';
@@ -374,6 +381,19 @@ interface InlineEditProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'on
374
381
  selected?: boolean;
375
382
  /** Classes for the displayed/edited text, e.g. a heading text style. The field itself keeps the same box. */
376
383
  textClassName?: string;
384
+ /**
385
+ * 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.
388
+ */
389
+ marks?: InlineEditMark[];
390
+ /**
391
+ * Makes each mark clickable: clicking an underlined word opens a small card with the marked text, its `suggestions` and a Dismiss action,
392
+ * instead of starting the edit. Called with the mark and the suggestion the reader chose; apply it to the value yourself.
393
+ */
394
+ onMarkApply?: (mark: InlineEditMark, replacement: string) => void;
395
+ /** Called when the reader dismisses a mark from its card. Remove the mark to make the underline go away. */
396
+ onMarkDismiss?: (mark: InlineEditMark) => void;
377
397
  }
378
398
  declare const InlineEdit: React.ForwardRefExoticComponent<InlineEditProps & React.RefAttributes<HTMLDivElement>>;
379
399
 
@@ -560,6 +580,8 @@ declare const ToastAction: React.ForwardRefExoticComponent<Toast$1.ToastActionPr
560
580
  interface ToastInlineProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof inlineVariants> {
561
581
  /** Buttons shown after the message, for example a ghost "Dismiss" and an outline "Fix" (both `size="sm"`). */
562
582
  actions?: React.ReactNode;
583
+ /** Where the actions sit: `end` (default) after the message on the same line, or `bottom` under the message, for messages long enough to wrap. */
584
+ actionsPlacement?: 'end' | 'bottom';
563
585
  /** Show a close button and call this when it is pressed. */
564
586
  onClose?: () => void;
565
587
  closeLabel?: string;
@@ -663,6 +685,17 @@ declare const OpenEndAnswer: React.ForwardRefExoticComponent<OpenEndAnswerProps
663
685
 
664
686
  declare const QuestionCard: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
665
687
 
688
+ /**
689
+ * `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
690
+ * icon for PDF/PPTX/DOCX). A video upload shares the video camera with screen recording: no method offers both,
691
+ * so they never meet in one activity.
692
+ */
693
+ type QuestionType = 'select-one' | 'select-multiple' | 'ranking' | 'upload' | 'upload-video' | 'upload-photo' | 'upload-document' | 'rating' | 'open-end' | 'screen-recording';
694
+ interface QuestionTypeIconProps extends Omit<IconProps, 'weight'> {
695
+ type: QuestionType;
696
+ }
697
+ declare function QuestionTypeIcon({ type, size, className, ...props }: QuestionTypeIconProps): React.JSX.Element;
698
+
666
699
  interface QuestionEditorCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title" | "onChange"> {
667
700
  /** Question number shown in the drag-handle tag. */
668
701
  number: number;
@@ -709,6 +742,14 @@ interface QuestionEditorCardProps extends Omit<React.HTMLAttributes<HTMLDivEleme
709
742
  dragHandleProps?: React.ComponentPropsWithRef<'span'>;
710
743
  /** Whether the grip icon shows in the "Question N" tag on hover. Defaults to true; set false when the card can't be moved. See `QuestionHeader`. */
711
744
  showDragHandle?: boolean;
745
+ /** The question's type, shown as an icon in the "Question N" tag in its default and selected states (the grip replaces it on hover). See `QuestionHeader`. */
746
+ questionType?: QuestionType;
747
+ /** Ranges of the saved question text to underline in the destructive colour, such as misspelled words. See `QuestionHeader`'s `titleMarks`. */
748
+ titleMarks?: InlineEditMark[];
749
+ /** Makes the underlined words clickable; called with the mark and the chosen correction. See `QuestionHeader`'s `onTitleMarkApply`. */
750
+ onTitleMarkApply?: (mark: InlineEditMark, replacement: string) => void;
751
+ /** Called when a mark is dismissed from its card. */
752
+ onTitleMarkDismiss?: (mark: InlineEditMark) => void;
712
753
  }
713
754
  declare const QuestionEditorCard: React.ForwardRefExoticComponent<QuestionEditorCardProps & React.RefAttributes<HTMLDivElement>>;
714
755
 
@@ -764,15 +805,20 @@ interface QuestionHeaderProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
764
805
  * can't be moved (for example while a translation is being edited), so the tag doesn't suggest dragging.
765
806
  */
766
807
  showDragHandle?: boolean;
808
+ /**
809
+ * Editor mode: the question's type, shown as a 16px icon at the start of the "Question N" tag in its default and selected states.
810
+ * On hover or focus (when the tag can be dragged) the grip icon replaces it. Leave it out for a tag with the number only.
811
+ */
812
+ questionType?: QuestionType;
813
+ /** Editor mode: ranges of the saved title to underline in the destructive colour (misspelled words, for example). See `InlineEdit`'s `marks`. */
814
+ titleMarks?: InlineEditMark[];
815
+ /** Editor mode: makes the underlined words clickable; called with the mark and the chosen correction. See `InlineEdit`'s `onMarkApply`. */
816
+ onTitleMarkApply?: (mark: InlineEditMark, replacement: string) => void;
817
+ /** Editor mode: called when a mark is dismissed from its card. See `InlineEdit`'s `onMarkDismiss`. */
818
+ onTitleMarkDismiss?: (mark: InlineEditMark) => void;
767
819
  }
768
820
  declare const QuestionHeader: React.ForwardRefExoticComponent<QuestionHeaderProps & React.RefAttributes<HTMLDivElement>>;
769
821
 
770
- type QuestionType = 'select-one' | 'select-multiple' | 'ranking' | 'upload' | 'rating' | 'open-end' | 'screen-recording';
771
- interface QuestionTypeIconProps extends Omit<IconProps, 'weight'> {
772
- type: QuestionType;
773
- }
774
- declare function QuestionTypeIcon({ type, size, className, ...props }: QuestionTypeIconProps): React.JSX.Element;
775
-
776
822
  interface QuestionNavItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
777
823
  /** The question currently open in the editor. */
778
824
  selected?: boolean;
@@ -874,8 +920,17 @@ interface QuestionOptionEditorProps {
874
920
  * are shared with the original.
875
921
  */
876
922
  locked?: boolean;
923
+ /**
924
+ * Ranges of the label to underline in the destructive colour, for example misspelled words found by a spell checker. The underline shows
925
+ * while the label is not being edited. See `InlineEdit`'s `marks`.
926
+ */
927
+ marks?: InlineEditMark[];
928
+ /** Makes each mark clickable: clicking an underlined word opens a card with the corrections and a Dismiss action. See `InlineEdit`'s `onMarkApply`. */
929
+ onMarkApply?: (mark: InlineEditMark, replacement: string) => void;
930
+ /** Called when a mark is dismissed from its card. */
931
+ onMarkDismiss?: (mark: InlineEditMark) => void;
877
932
  }
878
- declare function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTone, minLength, maxLength, onRemove, onAdd, removeDisabled, addDisabled, className, kind, rank, dragHandleProps, lifted, locked }: QuestionOptionEditorProps): React.JSX.Element;
933
+ declare function QuestionOptionEditor({ label, onLabelChange, placeholder, placeholderTone, minLength, maxLength, onRemove, onAdd, removeDisabled, addDisabled, className, kind, rank, dragHandleProps, lifted, locked, marks, onMarkApply, onMarkDismiss }: QuestionOptionEditorProps): React.JSX.Element;
879
934
 
880
935
  interface RankItemData {
881
936
  id: string;
@@ -997,6 +1052,8 @@ interface StatCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'chil
997
1052
  value: React.ReactNode;
998
1053
  /** Leading icon beside the value (24px). */
999
1054
  icon?: React.ReactNode;
1055
+ /** Small muted text under the value that says what it refers to or breaks it down ("11 open-ended · 5 closed-ended"). */
1056
+ caption?: React.ReactNode;
1000
1057
  }
1001
1058
  declare const StatCard: React.ForwardRefExoticComponent<StatCardProps & React.RefAttributes<HTMLDivElement>>;
1002
1059
 
@@ -1087,4 +1144,4 @@ interface PaginationProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onCha
1087
1144
  }
1088
1145
  declare const Pagination: React.ForwardRefExoticComponent<PaginationProps & React.RefAttributes<HTMLElement>>;
1089
1146
 
1090
- export { AIMiniAvatar, type AIMiniAvatarProps, AIResponseContainer, type AIResponseContainerProps, type AIStatus, type ActivitySection, type ActivityStat, ActivityStructure, type ActivityStructureProps, AskAiInput, type AskAiInputProps, AskAiToggle, type AskAiToggleProps, Badge, type BadgeProps, Button, type ButtonProps, Calendar, type CalendarProps, ChatChoices, type ChatChoicesProps, ChatInput, type ChatInputProps, ChatOption, type ChatOptionActionProps, type ChatOptionCheckboxProps, type ChatOptionProps, type ChatOptionRadioProps, Checkbox, CheckboxField, type CheckboxFieldProps, type CheckboxProps, DatePicker, type DatePickerProps, DateTimePicker, type DateTimePickerProps, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, type DropdownMenuSelectableItemProps, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EditableTag, type EditableTagProps, Field, type FieldControlProps, type FieldProps, type FieldStatus, FileAttachment, type FileAttachmentProps, FileUploadItem, type FileUploadItemProps, FileUploadZone, type FileUploadZoneProps, Form, FormControl, type FormControlProps, FormDescription, type FormDescriptionProps, FormField, FormItem, type FormItemProps, FormLabel, type FormLabelProps, FormMessage, type FormMessageProps, ImagePreview, type ImagePreviewProps, ImageThumbnails, type ImageThumbnailsProps, InlineEdit, type InlineEditProps, Input, type InputProps, InputWithAction, type InputWithActionProps, Label, type LabelProps, MediaInfo, type MediaInfoProps, NumberInput, type NumberInputProps, OpenEndAnswer, type OpenEndAnswerProps, Pagination, type PaginationItemValue, type PaginationProps, Progress, type ProgressProps, ProjectSelector, type ProjectSelectorProps, QuestionCard, type QuestionCheckboxOptionProps, QuestionEditorCard, type QuestionEditorCardProps, QuestionHeader, type QuestionHeaderProps, QuestionNavItem, type QuestionNavItemProps, QuestionOption, QuestionOptionEditor, type QuestionOptionEditorProps, type QuestionOptionProps, QuestionOtherOption, type QuestionOtherOptionProps, type QuestionRadioOptionProps, type QuestionType, QuestionTypeIcon, type QuestionTypeIconProps, RadioGroup, RadioGroupFieldItem, type RadioGroupFieldItemProps, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps, type RankItemData, RankList, type RankListProps, RatingScale, type RatingScaleProps, SearchBar, type SearchBarProps, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, type SelectItemProps, SelectTrigger, type SelectTriggerProps, SelectValue, Slider, type SliderProps, StatCard, type StatCardProps, StatusTag, type StatusTagProps, StimulusCard, type StimulusCardProps, Switch, type SwitchProps, TabItem, type TabItemProps, TabNavigation, TabNavigationContext, type TabNavigationProps, type TabNavigationVariant, Table, TableBody, TableCell, type TableCellProps, TableCellTwoLines, type TableCellTwoLinesProps, TableHead, type TableHeadProps, TableHeader, type TableProps, TableRow, type TableRowProps, Tabs, TabsContent, Tag, type TagProps, Textarea, type TextareaProps, TimeItem, type TimeItemProps, TimePicker, type TimePickerProps, type TimeValue, Timestamp, type TimestampProps, Toast, ToastAction, ToastInline, type ToastInlineProps, type ToastInlineVariant, type ToastProps, ToastProvider, type ToastVariant, ToastViewport, Toggle, type ToggleProps, Tooltip, TooltipContent, type TooltipContentProps, TooltipProvider, TooltipTrigger, TopicActivityRow, type TopicActivityRowProps, TopicCard, TopicCardMetaItem, type TopicCardMetaItemProps, type TopicCardProps, TopicCardTag, UserMessageBubble, type UserMessageBubbleProps, VideoPlayer, type VideoPlayerProps, VolumeControl, type VolumeControlProps, fieldSurfaceClasses, formatDateTime, getPaginationItems, useFormField };
1147
+ export { AIMiniAvatar, type AIMiniAvatarProps, AIResponseContainer, type AIResponseContainerProps, type AIStatus, type ActivitySection, type ActivityStat, ActivityStructure, type ActivityStructureProps, AskAiInput, type AskAiInputProps, AskAiToggle, type AskAiToggleProps, Badge, type BadgeProps, Button, type ButtonProps, Calendar, type CalendarProps, ChatChoices, type ChatChoicesProps, ChatInput, type ChatInputProps, ChatOption, type ChatOptionActionProps, type ChatOptionCheckboxProps, type ChatOptionProps, type ChatOptionRadioProps, Checkbox, CheckboxField, type CheckboxFieldProps, type CheckboxProps, DatePicker, type DatePickerProps, DateTimePicker, type DateTimePickerProps, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, type DropdownMenuSelectableItemProps, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EditableTag, type EditableTagProps, Field, type FieldControlProps, type FieldProps, type FieldStatus, FileAttachment, type FileAttachmentProps, FileUploadItem, type FileUploadItemProps, FileUploadZone, type FileUploadZoneProps, Form, FormControl, type FormControlProps, FormDescription, type FormDescriptionProps, FormField, FormItem, type FormItemProps, FormLabel, type FormLabelProps, FormMessage, type FormMessageProps, ImagePreview, type ImagePreviewProps, ImageThumbnails, type ImageThumbnailsProps, InlineEdit, type InlineEditMark, type InlineEditProps, Input, type InputProps, InputWithAction, type InputWithActionProps, Label, type LabelProps, MediaInfo, type MediaInfoProps, NumberInput, type NumberInputProps, OpenEndAnswer, type OpenEndAnswerProps, Pagination, type PaginationItemValue, type PaginationProps, Progress, type ProgressProps, ProjectSelector, type ProjectSelectorProps, QuestionCard, type QuestionCheckboxOptionProps, QuestionEditorCard, type QuestionEditorCardProps, QuestionHeader, type QuestionHeaderProps, QuestionNavItem, type QuestionNavItemProps, QuestionOption, QuestionOptionEditor, type QuestionOptionEditorProps, type QuestionOptionProps, QuestionOtherOption, type QuestionOtherOptionProps, type QuestionRadioOptionProps, type QuestionType, QuestionTypeIcon, type QuestionTypeIconProps, RadioGroup, RadioGroupFieldItem, type RadioGroupFieldItemProps, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps, type RankItemData, RankList, type RankListProps, RatingScale, type RatingScaleProps, SearchBar, type SearchBarProps, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, type SelectItemProps, SelectTrigger, type SelectTriggerProps, SelectValue, Slider, type SliderProps, StatCard, type StatCardProps, StatusTag, type StatusTagProps, StimulusCard, type StimulusCardProps, Switch, type SwitchProps, TabItem, type TabItemProps, TabNavigation, TabNavigationContext, type TabNavigationProps, type TabNavigationVariant, Table, TableBody, TableCell, type TableCellProps, TableCellTwoLines, type TableCellTwoLinesProps, TableHead, type TableHeadProps, TableHeader, type TableProps, TableRow, type TableRowProps, Tabs, TabsContent, Tag, type TagProps, Textarea, type TextareaProps, TimeItem, type TimeItemProps, TimePicker, type TimePickerProps, type TimeValue, Timestamp, type TimestampProps, Toast, ToastAction, ToastInline, type ToastInlineProps, type ToastInlineVariant, type ToastProps, ToastProvider, type ToastVariant, ToastViewport, Toggle, type ToggleProps, Tooltip, TooltipContent, type TooltipContentProps, TooltipProvider, TooltipTrigger, TopicActivityRow, type TopicActivityRowProps, TopicCard, TopicCardMetaItem, type TopicCardMetaItemProps, type TopicCardProps, TopicCardTag, UserMessageBubble, type UserMessageBubbleProps, VideoPlayer, type VideoPlayerProps, VolumeControl, type VolumeControlProps, fieldSurfaceClasses, formatDateTime, getPaginationItems, useFormField };