@howone/sdk 0.3.16 → 0.3.18
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 +7 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -33
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1749,7 +1749,7 @@ import { Icon as Icon4 } from "@iconify/react";
|
|
|
1749
1749
|
// src/components/theme/ThemeToggle.tsx
|
|
1750
1750
|
import * as React6 from "react";
|
|
1751
1751
|
import { Icon as Icon3 } from "@iconify/react";
|
|
1752
|
-
import { jsx as jsx11
|
|
1752
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1753
1753
|
function ThemeToggle({ className }) {
|
|
1754
1754
|
const { setTheme, theme } = useTheme();
|
|
1755
1755
|
const [mounted, setMounted] = React6.useState(false);
|
|
@@ -1764,33 +1764,18 @@ function ThemeToggle({ className }) {
|
|
|
1764
1764
|
}
|
|
1765
1765
|
};
|
|
1766
1766
|
if (!mounted) {
|
|
1767
|
-
return /* @__PURE__ */
|
|
1768
|
-
"button",
|
|
1769
|
-
{
|
|
1770
|
-
className: `relative inline-flex h-10 w-12 items-center justify-center rounded-md border border-input bg-background hover:bg-accent hover:text-accent-foreground ${className || ""}`,
|
|
1771
|
-
disabled: true,
|
|
1772
|
-
children: [
|
|
1773
|
-
/* @__PURE__ */ jsx11(Icon3, { icon: "solar:sun-bold", width: 20, height: 20 }),
|
|
1774
|
-
/* @__PURE__ */ jsx11("span", { className: "sr-only", children: "\u5207\u6362\u4E3B\u9898" })
|
|
1775
|
-
]
|
|
1776
|
-
}
|
|
1777
|
-
);
|
|
1767
|
+
return /* @__PURE__ */ jsx11(Icon3, { icon: "solar:sun-bold", width: 20, height: 20 });
|
|
1778
1768
|
}
|
|
1779
|
-
return /* @__PURE__ */
|
|
1780
|
-
"
|
|
1769
|
+
return /* @__PURE__ */ jsx11(
|
|
1770
|
+
"div",
|
|
1781
1771
|
{
|
|
1782
|
-
|
|
1783
|
-
onClick: handleToggle,
|
|
1784
|
-
children: [
|
|
1785
|
-
theme === "light" ? /* @__PURE__ */ jsx11(Icon3, { icon: "solar:sun-bold", width: 20, height: 20 }) : /* @__PURE__ */ jsx11(Icon3, { icon: "solar:moon-linear", width: 20, height: 20 }),
|
|
1786
|
-
/* @__PURE__ */ jsx11("span", { className: "sr-only", children: "\u5207\u6362\u4E3B\u9898" })
|
|
1787
|
-
]
|
|
1772
|
+
children: theme === "light" ? /* @__PURE__ */ jsx11(Icon3, { icon: "solar:sun-bold", width: 20, height: 20 }) : /* @__PURE__ */ jsx11(Icon3, { icon: "solar:moon-linear", width: 20, height: 20 })
|
|
1788
1773
|
}
|
|
1789
1774
|
);
|
|
1790
1775
|
}
|
|
1791
1776
|
|
|
1792
1777
|
// src/components/ui/Toast/ClayxToast.tsx
|
|
1793
|
-
import { jsx as jsx12, jsxs as
|
|
1778
|
+
import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1794
1779
|
var TOAST_ICONS = {
|
|
1795
1780
|
success: {
|
|
1796
1781
|
icon: "mdi:success",
|
|
@@ -1954,12 +1939,12 @@ var ToastContent = ({ type, title, message, component, closeToast }) => {
|
|
|
1954
1939
|
// gray-50
|
|
1955
1940
|
};
|
|
1956
1941
|
if (component) {
|
|
1957
|
-
return /* @__PURE__ */
|
|
1942
|
+
return /* @__PURE__ */ jsxs8("div", { className: `flex items-start gap-3 !min-h-[90px] w-full backdrop-blur-md p-4 shadow-2xl overflow-hidden ${themeConfig.bgGradient}`, children: [
|
|
1958
1943
|
/* @__PURE__ */ jsx12("div", { className: "flex-1 relative z-10", children: component }),
|
|
1959
1944
|
/* @__PURE__ */ jsx12("div", { className: "relative z-10", children: /* @__PURE__ */ jsx12(CloseButton, { closeToast: handleClose }) })
|
|
1960
1945
|
] });
|
|
1961
1946
|
}
|
|
1962
|
-
return /* @__PURE__ */
|
|
1947
|
+
return /* @__PURE__ */ jsxs8("div", { className: `flex items-start gap-3 !min-h-[90px] w-full backdrop-blur-md p-4 shadow-2xl relative overflow-hidden ${themeConfig.bgGradient}`, children: [
|
|
1963
1948
|
/* @__PURE__ */ jsx12(
|
|
1964
1949
|
"div",
|
|
1965
1950
|
{
|
|
@@ -2019,7 +2004,7 @@ var ToastContent = ({ type, title, message, component, closeToast }) => {
|
|
|
2019
2004
|
) })
|
|
2020
2005
|
}
|
|
2021
2006
|
) }),
|
|
2022
|
-
/* @__PURE__ */
|
|
2007
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex flex-col gap-1 flex-1 relative z-10", children: [
|
|
2023
2008
|
title && /* @__PURE__ */ jsx12(
|
|
2024
2009
|
"div",
|
|
2025
2010
|
{
|
|
@@ -2048,7 +2033,7 @@ var ToastContent = ({ type, title, message, component, closeToast }) => {
|
|
|
2048
2033
|
};
|
|
2049
2034
|
var defaultToastOptions = {
|
|
2050
2035
|
position: "bottom-right",
|
|
2051
|
-
autoClose:
|
|
2036
|
+
autoClose: 1500,
|
|
2052
2037
|
hideProgressBar: true,
|
|
2053
2038
|
closeOnClick: false,
|
|
2054
2039
|
pauseOnHover: true,
|
|
@@ -2102,11 +2087,11 @@ var ClayxToast = {
|
|
|
2102
2087
|
};
|
|
2103
2088
|
|
|
2104
2089
|
// src/components/ui/LimitUpgradeToast.tsx
|
|
2105
|
-
import { jsx as jsx13, jsxs as
|
|
2090
|
+
import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2106
2091
|
var LimitToastContainer = ({ message, onUpgrade, closeToast }) => {
|
|
2107
2092
|
const [hover, setHover] = React8.useState(false);
|
|
2108
2093
|
const [closeHover, setCloseHover] = React8.useState(false);
|
|
2109
|
-
return /* @__PURE__ */
|
|
2094
|
+
return /* @__PURE__ */ jsxs9("div", { className: "relative w-full max-w-[420px] overflow-hidden rounded-md bg-gradient-to-br from-[#1A1A1A] via-[#151515] to-[#1A1A1A] shadow-[0_20px_60px_rgba(168,85,247,0.2)] backdrop-blur-sm", children: [
|
|
2110
2095
|
/* @__PURE__ */ jsx13(
|
|
2111
2096
|
"div",
|
|
2112
2097
|
{
|
|
@@ -2145,9 +2130,9 @@ var LimitToastContainer = ({ message, onUpgrade, closeToast }) => {
|
|
|
2145
2130
|
),
|
|
2146
2131
|
/* @__PURE__ */ jsx13("div", { className: "absolute -top-16 -right-16 h-32 w-32 rounded-full bg-gradient-to-br from-purple-500/20 via-pink-500/10 to-transparent blur-3xl animate-pulse" }),
|
|
2147
2132
|
/* @__PURE__ */ jsx13("div", { className: "absolute -bottom-16 -left-16 h-32 w-32 rounded-full bg-gradient-to-tr from-blue-500/10 to-transparent blur-2xl animate-pulse", style: { animationDelay: "1s" } }),
|
|
2148
|
-
/* @__PURE__ */ jsx13("div", { className: "relative z-10 flex items-start gap-4 p-4", children: /* @__PURE__ */
|
|
2149
|
-
/* @__PURE__ */
|
|
2150
|
-
/* @__PURE__ */
|
|
2133
|
+
/* @__PURE__ */ jsx13("div", { className: "relative z-10 flex items-start gap-4 p-4", children: /* @__PURE__ */ jsxs9("div", { className: "flex flex-1 flex-col gap-3", children: [
|
|
2134
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex items-center justify-between", children: [
|
|
2135
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-2", children: [
|
|
2151
2136
|
/* @__PURE__ */ jsx13("div", { className: "text-lg font-bold text-white", children: "Upgrade Required" }),
|
|
2152
2137
|
/* @__PURE__ */ jsx13("div", { className: "px-2 py-0.5 text-xs font-bold bg-purple-500/20 text-purple-400 rounded-md border border-purple-500/30", children: "Premium" })
|
|
2153
2138
|
] }),
|
|
@@ -2191,7 +2176,7 @@ var LimitToastContainer = ({ message, onUpgrade, closeToast }) => {
|
|
|
2191
2176
|
backgroundImage: hover ? "linear-gradient(to right, #9333ea, #db2777)" : "linear-gradient(to right, #a855f7, #ec4899)",
|
|
2192
2177
|
boxShadow: hover ? "0 10px 15px -3px rgba(168,85,247,0.3), 0 4px 6px -2px rgba(168,85,247,0.3)" : "none"
|
|
2193
2178
|
},
|
|
2194
|
-
children: /* @__PURE__ */
|
|
2179
|
+
children: /* @__PURE__ */ jsxs9("span", { className: "flex items-center gap-2", children: [
|
|
2195
2180
|
/* @__PURE__ */ jsx13(Icon5, { icon: "solar:rocket-2-bold", className: "w-4 h-4" }),
|
|
2196
2181
|
"Upgrade Now"
|
|
2197
2182
|
] })
|
|
@@ -3758,7 +3743,7 @@ function createClient(opts) {
|
|
|
3758
3743
|
if (typeof window === "undefined") return;
|
|
3759
3744
|
const loc = redirect || window.location.href;
|
|
3760
3745
|
try {
|
|
3761
|
-
const root = env3.
|
|
3746
|
+
const root = env3.AUTH_ROOT_VALUE;
|
|
3762
3747
|
const authUrl = new URL("/auth", String(root));
|
|
3763
3748
|
authUrl.searchParams.set("redirect_uri", String(loc));
|
|
3764
3749
|
if (opts?.projectId) authUrl.searchParams.set("project_id", String(opts.projectId));
|
|
@@ -3766,7 +3751,7 @@ function createClient(opts) {
|
|
|
3766
3751
|
} catch {
|
|
3767
3752
|
const encoded = encodeURIComponent(String(loc));
|
|
3768
3753
|
const pid = opts?.projectId ? `&project_id=${encodeURIComponent(String(opts.projectId))}` : "";
|
|
3769
|
-
const root = env3.
|
|
3754
|
+
const root = env3.AUTH_ROOT_VALUE;
|
|
3770
3755
|
window.location.href = `${root}/auth?redirect_uri=${encoded}${pid}`;
|
|
3771
3756
|
}
|
|
3772
3757
|
},
|