@discuss-ds/ui 0.15.0 → 0.16.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
@@ -772,8 +772,14 @@ interface QuestionOptionEditorProps {
772
772
  * the pointer; the row left behind in the list is dimmed by the caller.
773
773
  */
774
774
  lifted?: boolean;
775
+ /**
776
+ * Locks the row's place in the list: the label stays editable, but there is no drag grip (hover keeps the radio or checkbox
777
+ * indicator; a ranking row keeps its number) and no remove or add buttons. For editing a translation, where the options themselves
778
+ * are shared with the original.
779
+ */
780
+ locked?: boolean;
775
781
  }
776
- declare function QuestionOptionEditor({ label, onLabelChange, onRemove, onAdd, className, kind, rank, dragHandleProps, lifted }: QuestionOptionEditorProps): React.JSX.Element;
782
+ declare function QuestionOptionEditor({ label, onLabelChange, onRemove, onAdd, className, kind, rank, dragHandleProps, lifted, locked }: QuestionOptionEditorProps): React.JSX.Element;
777
783
 
778
784
  interface RankItemData {
779
785
  id: string;
package/dist/index.d.ts CHANGED
@@ -772,8 +772,14 @@ interface QuestionOptionEditorProps {
772
772
  * the pointer; the row left behind in the list is dimmed by the caller.
773
773
  */
774
774
  lifted?: boolean;
775
+ /**
776
+ * Locks the row's place in the list: the label stays editable, but there is no drag grip (hover keeps the radio or checkbox
777
+ * indicator; a ranking row keeps its number) and no remove or add buttons. For editing a translation, where the options themselves
778
+ * are shared with the original.
779
+ */
780
+ locked?: boolean;
775
781
  }
776
- declare function QuestionOptionEditor({ label, onLabelChange, onRemove, onAdd, className, kind, rank, dragHandleProps, lifted }: QuestionOptionEditorProps): React.JSX.Element;
782
+ declare function QuestionOptionEditor({ label, onLabelChange, onRemove, onAdd, className, kind, rank, dragHandleProps, lifted, locked }: QuestionOptionEditorProps): React.JSX.Element;
777
783
 
778
784
  interface RankItemData {
779
785
  id: string;
package/dist/index.js CHANGED
@@ -2884,7 +2884,7 @@ var QuestionOtherOption = React44.forwardRef(
2884
2884
  }
2885
2885
  );
2886
2886
  QuestionOtherOption.displayName = "QuestionOtherOption";
2887
- function QuestionOptionEditor({ label, onLabelChange, onRemove, onAdd, className, kind, rank, dragHandleProps, lifted }) {
2887
+ function QuestionOptionEditor({ label, onLabelChange, onRemove, onAdd, className, kind, rank, dragHandleProps, lifted, locked }) {
2888
2888
  const reveal = kind !== void 0;
2889
2889
  const gripProps = dragHandleProps ? {
2890
2890
  "aria-label": rank ? `Reorder option ${rank}` : "Reorder option",
@@ -2905,7 +2905,7 @@ function QuestionOptionEditor({ label, onLabelChange, onRemove, onAdd, className
2905
2905
  ),
2906
2906
  children: [
2907
2907
  kind === "rank" ? /* @__PURE__ */ jsxs31(Fragment8, { children: [
2908
- grip,
2908
+ !locked && grip,
2909
2909
  /* @__PURE__ */ jsx45(
2910
2910
  "span",
2911
2911
  {
@@ -2914,7 +2914,7 @@ function QuestionOptionEditor({ label, onLabelChange, onRemove, onAdd, className
2914
2914
  children: rank
2915
2915
  }
2916
2916
  )
2917
- ] }) : reveal ? /* @__PURE__ */ jsxs31("span", { ...gripProps, className: cn("relative flex size-5 shrink-0 items-center justify-center", gripProps.className), children: [
2917
+ ] }) : reveal && locked ? /* @__PURE__ */ jsx45("span", { "aria-hidden": "true", className: "relative flex size-5 shrink-0 items-center justify-center", children: /* @__PURE__ */ jsx45("span", { className: cn("inline-flex size-4 border-2 border-input bg-surface", kind === "radio" ? "rounded-full" : "rounded-xxs") }) }) : reveal ? /* @__PURE__ */ jsxs31("span", { ...gripProps, className: cn("relative flex size-5 shrink-0 items-center justify-center", gripProps.className), children: [
2918
2918
  /* @__PURE__ */ jsx45(
2919
2919
  "span",
2920
2920
  {
@@ -2937,7 +2937,7 @@ function QuestionOptionEditor({ label, onLabelChange, onRemove, onAdd, className
2937
2937
  )
2938
2938
  }
2939
2939
  )
2940
- ] }) : grip,
2940
+ ] }) : locked ? null : grip,
2941
2941
  /* @__PURE__ */ jsx45(
2942
2942
  "input",
2943
2943
  {
@@ -2950,7 +2950,7 @@ function QuestionOptionEditor({ label, onLabelChange, onRemove, onAdd, className
2950
2950
  ]
2951
2951
  }
2952
2952
  ),
2953
- /* @__PURE__ */ jsxs31(
2953
+ !locked && /* @__PURE__ */ jsxs31(
2954
2954
  "div",
2955
2955
  {
2956
2956
  className: cn(