@superbuilders/incept-renderer 0.1.8 → 0.1.11

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.js CHANGED
@@ -480,7 +480,7 @@ var choiceIndicatorVariants = cva(
480
480
  "data-[state=unchecked]:bg-background data-[state=unchecked]:border-2 data-[state=unchecked]:border-input data-[state=unchecked]:text-muted-foreground",
481
481
  "data-[state=checked]:border-2 data-[state=checked]:border-[var(--choice-complement)] data-[state=checked]:text-[var(--choice-foreground)]",
482
482
  "data-[filled=true]:data-[state=checked]:bg-[var(--choice-complement)]",
483
- "data-[filled=true]:data-[state=checked]:shadow-[inset_0_0_0_2px_rgb(255_255_255)] dark:data-[filled=true]:data-[state=checked]:shadow-[inset_0_0_0_2px_rgb(255_255_255)]",
483
+ "data-[filled=true]:data-[state=checked]:shadow-[inset_0_0_0_3px_rgb(255_255_255)] dark:data-[filled=true]:data-[state=checked]:shadow-[inset_0_0_0_3px_hsl(var(--background))]",
484
484
  "focus-visible:ring-[var(--choice-complement)] focus-visible:ring-[3px]",
485
485
  "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive"
486
486
  ],
@@ -509,31 +509,38 @@ function ChoiceIndicator({
509
509
  letter,
510
510
  type = "radio",
511
511
  showLetter = true,
512
- ...props
512
+ id,
513
+ value,
514
+ checked,
515
+ onCheckedChange,
516
+ disabled
513
517
  }) {
514
518
  const baseClassName = cn(choiceIndicatorVariants({ palette }), className);
515
519
  if (type === "checkbox") {
516
- const checkboxProps = props;
517
520
  return /* @__PURE__ */ jsx(
518
521
  CheckboxPrimitive.Root,
519
522
  {
520
523
  "data-slot": "choice-indicator",
521
524
  "data-palette": palette,
522
- "data-filled": !showLetter,
525
+ "data-filled": !showLetter ? "true" : void 0,
523
526
  className: baseClassName,
524
- ...checkboxProps,
527
+ id,
528
+ checked,
529
+ onCheckedChange,
530
+ disabled,
525
531
  children: showLetter && /* @__PURE__ */ jsx("span", { className: "data-[state=unchecked]:block data-[state=checked]:hidden", children: letter })
526
532
  }
527
533
  );
528
534
  }
529
- const radioProps = props;
530
535
  return /* @__PURE__ */ jsx(
531
536
  RadioGroupPrimitive.Item,
532
537
  {
533
538
  "data-slot": "choice-indicator",
534
539
  "data-palette": palette,
535
540
  className: baseClassName,
536
- ...radioProps,
541
+ id,
542
+ value: value ?? "",
543
+ disabled,
537
544
  children: letter
538
545
  }
539
546
  );
@@ -1886,14 +1893,16 @@ function SortableItem({
1886
1893
  style,
1887
1894
  ...attributes,
1888
1895
  ...listeners,
1896
+ "data-disabled": disabled,
1897
+ "data-dragging": isDragging,
1889
1898
  className: cn(
1890
- "bg-background border rounded-lg shadow-sm touch-none select-none",
1899
+ "qti-order-item",
1891
1900
  // Styling differs based on orientation
1892
- isHorizontal ? "px-4 py-2 min-w-[100px] flex items-center justify-center text-center" : "p-4 w-full flex items-center gap-3",
1893
- disabled ? "cursor-default opacity-90 bg-muted/50" : "cursor-grab active:cursor-grabbing hover:border-macaw/50 hover:shadow-md"
1901
+ isHorizontal ? "min-w-[100px] flex items-center justify-center text-center" : "w-full flex items-center gap-3",
1902
+ disabled ? "cursor-default" : "cursor-grab active:cursor-grabbing"
1894
1903
  ),
1895
1904
  children: [
1896
- !isHorizontal && /* @__PURE__ */ jsx("div", { className: "text-muted-foreground shrink-0", children: /* @__PURE__ */ jsx(DragHandleIcon, {}) }),
1905
+ !isHorizontal && /* @__PURE__ */ jsx("div", { className: "qti-order-item-handle shrink-0", children: /* @__PURE__ */ jsx(DragHandleIcon, {}) }),
1897
1906
  /* @__PURE__ */ jsx(HTMLContent, { html: contentHtml })
1898
1907
  ]
1899
1908
  }
@@ -1903,12 +1912,13 @@ function DragOverlayItem({ contentHtml, isHorizontal }) {
1903
1912
  return /* @__PURE__ */ jsxs(
1904
1913
  "div",
1905
1914
  {
1915
+ "data-dragging": "true",
1906
1916
  className: cn(
1907
- "bg-background border-2 border-macaw rounded-lg shadow-xl cursor-grabbing z-50",
1908
- isHorizontal ? "px-4 py-2 min-w-[100px] flex items-center justify-center" : "p-4 w-full flex items-center gap-3"
1917
+ "qti-order-item cursor-grabbing z-50",
1918
+ isHorizontal ? "min-w-[100px] flex items-center justify-center" : "w-full flex items-center gap-3"
1909
1919
  ),
1910
1920
  children: [
1911
- !isHorizontal && /* @__PURE__ */ jsx("div", { className: "text-macaw shrink-0", children: /* @__PURE__ */ jsx(DragHandleIcon, {}) }),
1921
+ !isHorizontal && /* @__PURE__ */ jsx("div", { className: "qti-order-item-handle shrink-0", children: /* @__PURE__ */ jsx(DragHandleIcon, {}) }),
1912
1922
  /* @__PURE__ */ jsx(HTMLContent, { html: contentHtml })
1913
1923
  ]
1914
1924
  }
@@ -1962,14 +1972,9 @@ function OrderInteraction({
1962
1972
  styles: { active: { opacity: "0.4" } }
1963
1973
  })
1964
1974
  };
1965
- const getContainerStyles = () => {
1966
- if (!hasSubmitted) {
1967
- return "bg-muted/30 border-transparent";
1968
- }
1969
- if (isCorrect) {
1970
- return "bg-owl/10 border-owl";
1971
- }
1972
- return "bg-cardinal/10 border-cardinal";
1975
+ const getContainerCorrectness = () => {
1976
+ if (!hasSubmitted) return void 0;
1977
+ return isCorrect;
1973
1978
  };
1974
1979
  return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
1975
1980
  interaction.promptHtml && /* @__PURE__ */ jsx(HTMLContent, { html: interaction.promptHtml }),
@@ -1984,11 +1989,8 @@ function OrderInteraction({
1984
1989
  /* @__PURE__ */ jsx(SortableContext, { items: items.map((i) => i.id), strategy, disabled: disabled || hasSubmitted, children: /* @__PURE__ */ jsx(
1985
1990
  "div",
1986
1991
  {
1987
- className: cn(
1988
- "rounded-xl p-4 transition-colors border-2",
1989
- isHorizontal ? "flex flex-wrap gap-3" : "flex flex-col gap-2",
1990
- getContainerStyles()
1991
- ),
1992
+ "data-correct": getContainerCorrectness(),
1993
+ className: cn("qti-order-container", isHorizontal ? "flex flex-wrap" : "flex flex-col"),
1992
1994
  children: items.map((item) => /* @__PURE__ */ jsx(
1993
1995
  SortableItem,
1994
1996
  {