@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/README.md +337 -13
- package/dist/actions/index.js.map +1 -1
- package/dist/components/index.js +29 -27
- package/dist/components/index.js.map +1 -1
- package/dist/index.js +29 -27
- package/dist/index.js.map +1 -1
- package/dist/styles/duolingo.css +221 -0
- package/dist/styles/duolingo.css.map +1 -0
- package/dist/styles/duolingo.d.ts +2 -0
- package/dist/styles/themes.css +356 -37
- package/dist/styles/themes.css.map +1 -1
- package/package.json +5 -1
package/dist/components/index.js
CHANGED
|
@@ -345,7 +345,7 @@ var choiceIndicatorVariants = cva(
|
|
|
345
345
|
"data-[state=unchecked]:bg-background data-[state=unchecked]:border-2 data-[state=unchecked]:border-input data-[state=unchecked]:text-muted-foreground",
|
|
346
346
|
"data-[state=checked]:border-2 data-[state=checked]:border-[var(--choice-complement)] data-[state=checked]:text-[var(--choice-foreground)]",
|
|
347
347
|
"data-[filled=true]:data-[state=checked]:bg-[var(--choice-complement)]",
|
|
348
|
-
"data-[filled=true]:data-[state=checked]:shadow-[
|
|
348
|
+
"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))]",
|
|
349
349
|
"focus-visible:ring-[var(--choice-complement)] focus-visible:ring-[3px]",
|
|
350
350
|
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive"
|
|
351
351
|
],
|
|
@@ -374,31 +374,38 @@ function ChoiceIndicator({
|
|
|
374
374
|
letter,
|
|
375
375
|
type = "radio",
|
|
376
376
|
showLetter = true,
|
|
377
|
-
|
|
377
|
+
id,
|
|
378
|
+
value,
|
|
379
|
+
checked,
|
|
380
|
+
onCheckedChange,
|
|
381
|
+
disabled
|
|
378
382
|
}) {
|
|
379
383
|
const baseClassName = cn(choiceIndicatorVariants({ palette }), className);
|
|
380
384
|
if (type === "checkbox") {
|
|
381
|
-
const checkboxProps = props;
|
|
382
385
|
return /* @__PURE__ */ jsx(
|
|
383
386
|
CheckboxPrimitive.Root,
|
|
384
387
|
{
|
|
385
388
|
"data-slot": "choice-indicator",
|
|
386
389
|
"data-palette": palette,
|
|
387
|
-
"data-filled": !showLetter,
|
|
390
|
+
"data-filled": !showLetter ? "true" : void 0,
|
|
388
391
|
className: baseClassName,
|
|
389
|
-
|
|
392
|
+
id,
|
|
393
|
+
checked,
|
|
394
|
+
onCheckedChange,
|
|
395
|
+
disabled,
|
|
390
396
|
children: showLetter && /* @__PURE__ */ jsx("span", { className: "data-[state=unchecked]:block data-[state=checked]:hidden", children: letter })
|
|
391
397
|
}
|
|
392
398
|
);
|
|
393
399
|
}
|
|
394
|
-
const radioProps = props;
|
|
395
400
|
return /* @__PURE__ */ jsx(
|
|
396
401
|
RadioGroupPrimitive.Item,
|
|
397
402
|
{
|
|
398
403
|
"data-slot": "choice-indicator",
|
|
399
404
|
"data-palette": palette,
|
|
400
405
|
className: baseClassName,
|
|
401
|
-
|
|
406
|
+
id,
|
|
407
|
+
value: value ?? "",
|
|
408
|
+
disabled,
|
|
402
409
|
children: letter
|
|
403
410
|
}
|
|
404
411
|
);
|
|
@@ -1751,14 +1758,16 @@ function SortableItem({
|
|
|
1751
1758
|
style,
|
|
1752
1759
|
...attributes,
|
|
1753
1760
|
...listeners,
|
|
1761
|
+
"data-disabled": disabled,
|
|
1762
|
+
"data-dragging": isDragging,
|
|
1754
1763
|
className: cn(
|
|
1755
|
-
"
|
|
1764
|
+
"qti-order-item",
|
|
1756
1765
|
// Styling differs based on orientation
|
|
1757
|
-
isHorizontal ? "
|
|
1758
|
-
disabled ? "cursor-default
|
|
1766
|
+
isHorizontal ? "min-w-[100px] flex items-center justify-center text-center" : "w-full flex items-center gap-3",
|
|
1767
|
+
disabled ? "cursor-default" : "cursor-grab active:cursor-grabbing"
|
|
1759
1768
|
),
|
|
1760
1769
|
children: [
|
|
1761
|
-
!isHorizontal && /* @__PURE__ */ jsx("div", { className: "
|
|
1770
|
+
!isHorizontal && /* @__PURE__ */ jsx("div", { className: "qti-order-item-handle shrink-0", children: /* @__PURE__ */ jsx(DragHandleIcon, {}) }),
|
|
1762
1771
|
/* @__PURE__ */ jsx(HTMLContent, { html: contentHtml })
|
|
1763
1772
|
]
|
|
1764
1773
|
}
|
|
@@ -1768,12 +1777,13 @@ function DragOverlayItem({ contentHtml, isHorizontal }) {
|
|
|
1768
1777
|
return /* @__PURE__ */ jsxs(
|
|
1769
1778
|
"div",
|
|
1770
1779
|
{
|
|
1780
|
+
"data-dragging": "true",
|
|
1771
1781
|
className: cn(
|
|
1772
|
-
"
|
|
1773
|
-
isHorizontal ? "
|
|
1782
|
+
"qti-order-item cursor-grabbing z-50",
|
|
1783
|
+
isHorizontal ? "min-w-[100px] flex items-center justify-center" : "w-full flex items-center gap-3"
|
|
1774
1784
|
),
|
|
1775
1785
|
children: [
|
|
1776
|
-
!isHorizontal && /* @__PURE__ */ jsx("div", { className: "
|
|
1786
|
+
!isHorizontal && /* @__PURE__ */ jsx("div", { className: "qti-order-item-handle shrink-0", children: /* @__PURE__ */ jsx(DragHandleIcon, {}) }),
|
|
1777
1787
|
/* @__PURE__ */ jsx(HTMLContent, { html: contentHtml })
|
|
1778
1788
|
]
|
|
1779
1789
|
}
|
|
@@ -1827,14 +1837,9 @@ function OrderInteraction({
|
|
|
1827
1837
|
styles: { active: { opacity: "0.4" } }
|
|
1828
1838
|
})
|
|
1829
1839
|
};
|
|
1830
|
-
const
|
|
1831
|
-
if (!hasSubmitted)
|
|
1832
|
-
|
|
1833
|
-
}
|
|
1834
|
-
if (isCorrect) {
|
|
1835
|
-
return "bg-owl/10 border-owl";
|
|
1836
|
-
}
|
|
1837
|
-
return "bg-cardinal/10 border-cardinal";
|
|
1840
|
+
const getContainerCorrectness = () => {
|
|
1841
|
+
if (!hasSubmitted) return void 0;
|
|
1842
|
+
return isCorrect;
|
|
1838
1843
|
};
|
|
1839
1844
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
1840
1845
|
interaction.promptHtml && /* @__PURE__ */ jsx(HTMLContent, { html: interaction.promptHtml }),
|
|
@@ -1849,11 +1854,8 @@ function OrderInteraction({
|
|
|
1849
1854
|
/* @__PURE__ */ jsx(SortableContext, { items: items.map((i) => i.id), strategy, disabled: disabled || hasSubmitted, children: /* @__PURE__ */ jsx(
|
|
1850
1855
|
"div",
|
|
1851
1856
|
{
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
isHorizontal ? "flex flex-wrap gap-3" : "flex flex-col gap-2",
|
|
1855
|
-
getContainerStyles()
|
|
1856
|
-
),
|
|
1857
|
+
"data-correct": getContainerCorrectness(),
|
|
1858
|
+
className: cn("qti-order-container", isHorizontal ? "flex flex-wrap" : "flex flex-col"),
|
|
1857
1859
|
children: items.map((item) => /* @__PURE__ */ jsx(
|
|
1858
1860
|
SortableItem,
|
|
1859
1861
|
{
|