@arc-lo/ui 0.3.0 → 0.3.1

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.cjs CHANGED
@@ -634,10 +634,16 @@ var Footer = react.forwardRef(
634
634
  }
635
635
  );
636
636
  Footer.displayName = "PromptBox.Footer";
637
+ var ArrowUpIcon = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 19V5M5 12l7-7 7 7" }) });
637
638
  var SubmitButton = react.forwardRef(
638
- ({ children, className, ...props }, ref) => {
639
+ ({ children, variant = "default", loadingLabel, className, ...props }, ref) => {
639
640
  const { value, isSubmitting, disabled } = usePromptBoxContext();
640
641
  const isEmpty = !value.trim();
642
+ const isIcon = variant === "icon";
643
+ const content = children ?? (isIcon ? isSubmitting ? /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", className: "animate-spin", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) }) : /* @__PURE__ */ jsxRuntime.jsx(ArrowUpIcon, {}) : variant === "icon-text" ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1.5", children: [
644
+ isSubmitting ? /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", className: "animate-spin", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) }) : /* @__PURE__ */ jsxRuntime.jsx(ArrowUpIcon, {}),
645
+ isSubmitting ? loadingLabel ?? "Sending..." : "Send"
646
+ ] }) : isSubmitting ? loadingLabel ?? "Sending..." : "Send");
641
647
  return /* @__PURE__ */ jsxRuntime.jsx(
642
648
  "button",
643
649
  {
@@ -646,11 +652,12 @@ var SubmitButton = react.forwardRef(
646
652
  disabled: isEmpty || isSubmitting || disabled,
647
653
  style: { backgroundColor: themeVars.accent, color: themeVars.accentFg },
648
654
  className: cn(
649
- "arclo-prompt-submit ml-auto rounded-xl px-4 py-2 text-sm font-medium transition-all hover:brightness-90 disabled:opacity-25 cursor-pointer disabled:cursor-default",
655
+ "arclo-prompt-submit ml-auto transition-all hover:brightness-90 disabled:opacity-25 cursor-pointer disabled:cursor-default",
656
+ isIcon ? "rounded-xl p-2" : "rounded-xl px-4 py-2 text-sm font-medium",
650
657
  className
651
658
  ),
652
659
  ...props,
653
- children: children ?? (isSubmitting ? "Sending..." : "Send")
660
+ children: content
654
661
  }
655
662
  );
656
663
  }