@0xsquid/ui 0.27.1 → 0.27.2-beta.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/README.md CHANGED
@@ -17,16 +17,16 @@ Import styles in your entry point:
17
17
  import "@0xsquid/ui/dist/index.css";
18
18
  ```
19
19
 
20
- Wrap your app with our theme provider `<SquidConfigProvider />` and specify your theme:
20
+ Wrap your app with our theme provider `<ThemeProvider />` and specify your theme:
21
21
 
22
22
  ```jsx
23
- import { SquidConfigProvider, Button } from "@0xsquid/ui";
23
+ import { ThemeProvider, Button } from "@0xsquid/ui";
24
24
 
25
25
  function App() {
26
26
  return (
27
- <SquidConfigProvider theme={yourTheme}>
27
+ <ThemeProvider theme={yourTheme}>
28
28
  <Button label="Hello world" variant="primary" size="md" />
29
- </SquidConfigProvider>
29
+ </ThemeProvider>
30
30
  );
31
31
  }
32
32
  ```
package/dist/cjs/index.js CHANGED
@@ -17227,6 +17227,9 @@ function SunIcon({ size = "24", className, }) {
17227
17227
  function MoonIcon({ size = "20", className, }) {
17228
17228
  return (jsxRuntime.jsx("svg", { width: size, height: size, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, children: jsxRuntime.jsx("path", { d: "M10.0463 2.99972C10.2292 2.73432 10.2427 2.38723 10.0809 2.10846C9.91903 1.8297 9.61096 1.66925 9.28979 1.69647C5.02109 2.05816 1.66992 5.63639 1.66992 9.9982C1.66992 14.5997 5.40018 18.33 10.0017 18.33C14.3636 18.33 17.9419 14.9787 18.3035 10.7098C18.3307 10.3887 18.1702 10.0806 17.8914 9.91879C17.6127 9.75698 17.2656 9.77044 17.0002 9.95336C16.1951 10.5083 15.2201 10.8331 14.1667 10.8331C11.4052 10.8331 9.16667 8.59452 9.16667 5.8331C9.16667 4.77977 9.49145 3.80481 10.0463 2.99972Z", fill: "currentColor" }) }));
17229
17229
  }
17230
+ function SunOutlinedIcon({ size = "24", className, }) {
17231
+ return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", className: className, children: jsxRuntime.jsx("path", { d: "M12 3V2M12 22V21M18.3598 5.64005L19.0698 4.93005M4.93016 19.07L5.64016 18.36M21 12H22M2 12H3M18.3598 18.36L19.0698 19.07M4.93016 4.93005L5.64016 5.64005M15.5355 8.46447C17.4882 10.4171 17.4882 13.5829 15.5355 15.5355C13.5829 17.4882 10.4171 17.4882 8.46447 15.5355C6.51185 13.5829 6.51185 10.4171 8.46447 8.46447C10.4171 6.51185 13.5829 6.51185 15.5355 8.46447Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
17232
+ }
17230
17233
 
17231
17234
  const dockIconClassname = "tw-text-grey-900";
17232
17235
  const dockIconSelectedClassname = "group-data-[squid-theme-type=dark]:tw-text-royal-700 group-data-[squid-theme-type=light]:tw-text-volt-700";
@@ -17282,6 +17285,27 @@ function ImageIcon({ size = "20", className, }) {
17282
17285
  function FilterTimelineIcon({ size = "20", className, }) {
17283
17286
  return (jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", fill: "none", className: className, children: [jsxRuntime.jsx("path", { d: "M5.00117 3.33325C5.46141 3.33325 5.8345 3.70635 5.8345 4.16659V13.8206L6.91042 12.7442C7.23577 12.4186 7.76341 12.4185 8.08894 12.7438C8.41446 13.0692 8.4146 13.5968 8.08925 13.9224L5.59058 16.4224C5.43434 16.5787 5.22241 16.6665 5.00139 16.6666C4.78038 16.6666 4.56839 16.5789 4.41207 16.4227L1.91074 13.9227C1.58521 13.5973 1.58507 13.0697 1.91042 12.7442C2.23577 12.4186 2.76341 12.4185 3.08894 12.7438L4.16784 13.8222V4.16659C4.16784 3.70635 4.54093 3.33325 5.00117 3.33325Z", fill: "currentColor" }), jsxRuntime.jsx("path", { d: "M9.99984 4.99992C9.5396 4.99992 9.1665 5.37301 9.1665 5.83325C9.1665 6.29349 9.5396 6.66659 9.99984 6.66659H16.6665C17.1267 6.66659 17.4998 6.29349 17.4998 5.83325C17.4998 5.37301 17.1267 4.99992 16.6665 4.99992H9.99984Z", fill: "currentColor" }), jsxRuntime.jsx("path", { d: "M13.3332 13.3333C12.8729 13.3333 12.4998 13.7063 12.4998 14.1666C12.4998 14.6268 12.8729 14.9999 13.3332 14.9999H16.6665C17.1267 14.9999 17.4998 14.6268 17.4998 14.1666C17.4998 13.7063 17.1267 13.3333 16.6665 13.3333H13.3332Z", fill: "currentColor" }), jsxRuntime.jsx("path", { d: "M10.8332 9.99992C10.8332 9.53968 11.2063 9.16659 11.6665 9.16659H16.6665C17.1267 9.16659 17.4998 9.53968 17.4998 9.99992C17.4998 10.4602 17.1267 10.8333 16.6665 10.8333H11.6665C11.2063 10.8333 10.8332 10.4602 10.8332 9.99992Z", fill: "currentColor" })] }));
17284
17287
  }
17288
+ function PhoneIcon({ size = "24", className, }) {
17289
+ return (jsxRuntime.jsx("svg", { className: className, xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 25 24", fill: "none", children: jsxRuntime.jsx("path", { d: "M10.5 19H14.5M8.5 22H16.5C17.6046 22 18.5 21.1046 18.5 20V4C18.5 2.89543 17.6046 2 16.5 2H8.5C7.39543 2 6.5 2.89543 6.5 4V20C6.5 21.1046 7.39543 22 8.5 22Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }));
17290
+ }
17291
+ function LaptopIcon({ size = "24", className, }) {
17292
+ return (jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 25 24", fill: "none", className: className, children: [jsxRuntime.jsx("path", { d: "M4.5 6C4.5 4.89543 5.39543 4 6.5 4H18.5C19.6046 4 20.5 4.89543 20.5 6V15C20.5 15.5523 20.0523 16 19.5 16H5.5C4.94772 16 4.5 15.5523 4.5 15V6Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "square", strokeLinejoin: "round" }), jsxRuntime.jsx("path", { d: "M2.5 16H22.5V18C22.5 19.1046 21.6046 20 20.5 20H4.5C3.39543 20 2.5 19.1046 2.5 18V16Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "square", strokeLinejoin: "round" })] }));
17293
+ }
17294
+ function CopyIcon({ size = "20", className, }) {
17295
+ return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 21 20", fill: "none", className: className, children: jsxRuntime.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.16663 6.66666V3.54166C7.16663 2.50612 8.00609 1.66666 9.04163 1.66666H16.9583C17.9938 1.66666 18.8333 2.50612 18.8333 3.54166V11.4583C18.8333 12.4939 17.9938 13.3333 16.9583 13.3333H13.8333V16.4583C13.8333 17.4939 12.9938 18.3333 11.9583 18.3333H4.04163C3.00609 18.3333 2.16663 17.4939 2.16663 16.4583V8.54166C2.16663 7.50612 3.00609 6.66666 4.04163 6.66666H7.16663ZM9.04163 13.3333C8.00609 13.3333 7.16663 12.4939 7.16663 11.4583V8.33332H4.04163C3.92657 8.33332 3.83329 8.4266 3.83329 8.54166V16.4583C3.83329 16.5734 3.92657 16.6667 4.04163 16.6667H11.9583C12.0734 16.6667 12.1666 16.5734 12.1666 16.4583V13.3333H9.04163Z", fill: "currentColor" }) }));
17296
+ }
17297
+ function FileDownloadIcon({ size = "20", className, }) {
17298
+ return (jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 21 20", fill: "none", children: [jsxRuntime.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M6.33337 1.66666H10.5V5.83332C10.5 7.21404 11.6193 8.33332 13 8.33332H17.1667V15.8333C17.1667 17.214 16.0474 18.3333 14.6667 18.3333H6.33337C4.95266 18.3333 3.83337 17.214 3.83337 15.8333V4.16666C3.83337 2.78594 4.95266 1.66666 6.33337 1.66666ZM13.1726 14.3392L11.0893 16.4226C10.7639 16.748 10.2362 16.748 9.91079 16.4226L7.82745 14.3392C7.50201 14.0138 7.50201 13.4862 7.82745 13.1607C8.15289 12.8353 8.68053 12.8353 9.00596 13.1607L9.66671 13.8215V10.8333C9.66671 10.3731 10.0398 9.99999 10.5 9.99999C10.9603 9.99999 11.3334 10.3731 11.3334 10.8333V13.8215L11.9941 13.1607C12.3196 12.8353 12.8472 12.8353 13.1726 13.1607C13.4981 13.4862 13.4981 14.0138 13.1726 14.3392Z", fill: "currentColor" }), jsxRuntime.jsx("path", { d: "M12.1667 2.15481L16.6786 6.66666H13C12.5398 6.66666 12.1667 6.29356 12.1667 5.83332V2.15481Z", fill: "currentColor" })] }));
17299
+ }
17300
+ function CodeSolidSquareIcon({ size = "24", className, }) {
17301
+ return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 25 24", fill: "none", className: className, children: jsxRuntime.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.5 6C3.5 4.34315 4.84315 3 6.5 3H18.5C20.1569 3 21.5 4.34315 21.5 6V18C21.5 19.6569 20.1569 21 18.5 21H6.5C4.84315 21 3.5 19.6569 3.5 18V6ZM11.2071 8.79289C11.5976 9.18342 11.5976 9.81658 11.2071 10.2071L9.41421 12L11.2071 13.7929C11.5976 14.1834 11.5976 14.8166 11.2071 15.2071C10.8166 15.5976 10.1834 15.5976 9.79289 15.2071L8 13.4142C7.21895 12.6332 7.21895 11.3668 8 10.5858L9.79289 8.79289C10.1834 8.40237 10.8166 8.40237 11.2071 8.79289ZM15.2071 8.79289C14.8166 8.40237 14.1834 8.40237 13.7929 8.79289C13.4024 9.18342 13.4024 9.81658 13.7929 10.2071L15.5858 12L13.7929 13.7929C13.4024 14.1834 13.4024 14.8166 13.7929 15.2071C14.1834 15.5976 14.8166 15.5976 15.2071 15.2071L17 13.4142C17.781 12.6332 17.781 11.3668 17 10.5858L15.2071 8.79289Z", fill: "currentColor" }) }));
17302
+ }
17303
+ function CodeBracketsIcon({ size = "20", className, }) {
17304
+ return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", fill: "none", className: className, children: jsxRuntime.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.8688 2.5249C12.3153 2.63652 12.5867 3.08896 12.4751 3.53546L9.14178 16.8688C9.03015 17.3153 8.57771 17.5868 8.13121 17.4752C7.68472 17.3635 7.41325 16.9111 7.52487 16.4646L10.8582 3.13123C10.9698 2.68474 11.4223 2.41327 11.8688 2.5249ZM5.58925 6.07746C5.91469 6.4029 5.91469 6.93053 5.58925 7.25597L3.43443 9.41079C3.10899 9.73623 3.10899 10.2639 3.43443 10.5893L5.58925 12.7441C5.91469 13.0696 5.91469 13.5972 5.58925 13.9226C5.26381 14.2481 4.73617 14.2481 4.41074 13.9226L2.25591 11.7678C1.2796 10.7915 1.27961 9.20859 2.25592 8.23228L4.41074 6.07746C4.73617 5.75202 5.26381 5.75202 5.58925 6.07746ZM14.4107 6.07746C14.7362 5.75202 15.2638 5.75202 15.5892 6.07746L17.7441 8.23228C18.7204 9.20859 18.7204 10.7915 17.7441 11.7678L15.5892 13.9226C15.2638 14.2481 14.7362 14.2481 14.4107 13.9226C14.0853 13.5972 14.0853 13.0696 14.4107 12.7441L16.5656 10.5893C16.891 10.2639 16.891 9.73623 16.5656 9.41079L14.4107 7.25597C14.0853 6.93053 14.0853 6.4029 14.4107 6.07746Z", fill: "currentColor" }) }));
17305
+ }
17306
+ function CommandIcon({ size = "22", className, }) {
17307
+ return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 22 22", fill: "none", className: className, children: jsxRuntime.jsx("path", { d: "M8 17V17C8 16.0219 8.28951 15.0657 8.83205 14.2519L13.1679 7.74808C13.7105 6.93427 14 5.97808 14 5V5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
17308
+ }
17285
17309
 
17286
17310
  function FeeButton(_a) {
17287
17311
  var { feeInUsd = "0", chipLabel = "Fee", className, tooltip } = _a, props = __rest$1(_a, ["feeInUsd", "chipLabel", "className", "tooltip"]);
@@ -18701,6 +18725,69 @@ const useTimer = ({ immediateStart = true, }) => {
18701
18725
  return { timer, stopTimer, startTimer };
18702
18726
  };
18703
18727
 
18728
+ exports.ThemePreference = void 0;
18729
+ (function (ThemePreference) {
18730
+ ThemePreference["LIGHT"] = "light";
18731
+ ThemePreference["DARK"] = "dark";
18732
+ ThemePreference["SYSTEM"] = "system";
18733
+ })(exports.ThemePreference || (exports.ThemePreference = {}));
18734
+ const THEME_STORAGE_KEY = "__squid-app-theme-type__";
18735
+ const THEME_CHANGE_EVENT = "squid-app-theme-change";
18736
+ const THEME_MEDIA_QUERY = "(prefers-color-scheme: light)";
18737
+ function useUserTheme() {
18738
+ const [themePreference, setThemePreference] = React$1.useState(getInitialTheme);
18739
+ const [themeType, setThemeType] = React$1.useState(getEffectiveTheme(themePreference));
18740
+ React$1.useEffect(() => {
18741
+ const handleThemeChange = (e) => {
18742
+ setThemePreference(e.detail);
18743
+ };
18744
+ window.addEventListener(THEME_CHANGE_EVENT, handleThemeChange);
18745
+ return () => {
18746
+ window.removeEventListener(THEME_CHANGE_EVENT, handleThemeChange);
18747
+ };
18748
+ }, []);
18749
+ React$1.useEffect(() => {
18750
+ const mediaQuery = window.matchMedia(THEME_MEDIA_QUERY);
18751
+ const handleChange = () => {
18752
+ if (themePreference === exports.ThemePreference.SYSTEM) {
18753
+ setThemeType(mediaQuery.matches ? "light" : "dark");
18754
+ }
18755
+ };
18756
+ mediaQuery.addEventListener("change", handleChange);
18757
+ handleChange();
18758
+ return () => {
18759
+ mediaQuery.removeEventListener("change", handleChange);
18760
+ };
18761
+ }, [themePreference]);
18762
+ React$1.useEffect(() => {
18763
+ setThemeType(getEffectiveTheme(themePreference));
18764
+ }, [themePreference]);
18765
+ const setThemeManually = (theme) => {
18766
+ setThemePreference(theme);
18767
+ localStorage.setItem(THEME_STORAGE_KEY, theme);
18768
+ window.dispatchEvent(new CustomEvent(THEME_CHANGE_EVENT, { detail: theme }));
18769
+ };
18770
+ const isDarkMode = React$1.useMemo(() => themeType === "dark", [themeType]);
18771
+ return {
18772
+ themePreference,
18773
+ themeType,
18774
+ theme: isDarkMode ? darkTheme : lightTheme,
18775
+ setThemeManually,
18776
+ isDarkMode,
18777
+ };
18778
+ }
18779
+ function getInitialTheme() {
18780
+ var _a;
18781
+ if (typeof window === "undefined")
18782
+ return exports.ThemePreference.SYSTEM;
18783
+ return ((_a = localStorage.getItem(THEME_STORAGE_KEY)) !== null && _a !== void 0 ? _a : exports.ThemePreference.SYSTEM);
18784
+ }
18785
+ function getEffectiveTheme(themeType) {
18786
+ if (themeType !== exports.ThemePreference.SYSTEM)
18787
+ return themeType;
18788
+ return window.matchMedia(THEME_MEDIA_QUERY).matches ? "light" : "dark";
18789
+ }
18790
+
18704
18791
  function BaseDropdownMenuItem({ label, imageUrl, icon, labelClassName, onClick, link, control, detail, isSelected, itemRef, children, contentRef, }) {
18705
18792
  const ContentTag = link
18706
18793
  ? "a"
@@ -18852,7 +18939,7 @@ function HistoryItem({ firstImageUrl, secondImageUrl, dateCompleted, fromAmount,
18852
18939
  onClick,
18853
18940
  }
18854
18941
  : {};
18855
- return (jsxRuntime.jsxs("li", { ref: itemRef, className: cn("tw-relative tw-flex tw-h-list-item-large tw-min-w-list-item-small tw-self-stretch tw-bg-grey-900 tw-px-squid-xs tw-text-grey-300", !!dropdownMenuContent && "tw-highlight-adjacent"), children: [jsxRuntime.jsxs(ItemTag, Object.assign({}, itemTagProps, { className: cn("tw-group/history-item tw-peer/history-item tw-relative tw-flex tw-w-full tw-flex-shrink-0 tw-items-center tw-gap-squid-xs tw-self-stretch tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs", isInteractive && "hover:tw-bg-material-light-thin"), children: [jsxRuntime.jsxs("div", { className: "tw-relative tw-h-10 tw-w-[60px]", children: [!!statusBadge[status].badge && (jsxRuntime.jsx("span", { className: cn("tw-absolute -tw-left-[5px] tw-bottom-0 tw-z-10 tw-flex tw-h-squid-m tw-w-squid-m tw-items-center tw-justify-center tw-overflow-hidden tw-rounded-full tw-border tw-border-grey-900 tw-p-0.5", statusBadge[status].containerClassName), children: statusBadge[status].badge })), jsxRuntime.jsx("img", { src: firstImageUrl, className: "tw-absolute tw-h-10 tw-w-10 tw-rounded-full tw-border tw-border-grey-900" }), jsxRuntime.jsx("img", { src: secondImageUrl, className: "tw-absolute tw-left-5 tw-h-10 tw-w-10 tw-rounded-full tw-border tw-border-grey-900" })] }), jsxRuntime.jsxs("div", { className: "tw-flex tw-h-10 tw-flex-1 tw-flex-col tw-self-stretch", children: [jsxRuntime.jsxs("div", { className: "tw-flex tw-h-5 tw-items-center tw-justify-between tw-text-grey-500", children: [jsxRuntime.jsxs("div", { className: "tw-flex tw-items-center", children: [jsxRuntime.jsx(CaptionText, { children: fromLabel }), jsxRuntime.jsx("span", { className: "tw-text-grey-600", children: jsxRuntime.jsx(ChevronRightSmallIcon, {}) }), jsxRuntime.jsx(CaptionText, { children: toLabel })] }), jsxRuntime.jsx("div", { className: cn("tw-hide-on-parent-hover tw-flex tw-items-center tw-justify-center tw-gap-squid-xxs", !!dropdownMenuContent &&
18942
+ return (jsxRuntime.jsxs("li", { ref: itemRef, className: cn("tw-relative tw-flex tw-h-list-item-large tw-min-w-list-item-small tw-self-stretch tw-bg-grey-900 tw-px-squid-xs tw-text-grey-300", !!dropdownMenuContent && "tw-highlight-adjacent"), children: [jsxRuntime.jsxs(ItemTag, Object.assign({}, itemTagProps, { className: cn("tw-group/history-item tw-peer/history-item tw-relative tw-flex tw-w-full tw-flex-shrink-0 tw-items-center tw-gap-squid-xs tw-self-stretch tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs", isInteractive && "hover:tw-bg-material-light-thin"), children: [jsxRuntime.jsxs("div", { className: "tw-relative tw-h-10 tw-w-[60px]", children: [!!statusBadge[status].badge && (jsxRuntime.jsx("span", { className: cn("tw-absolute -tw-left-[5px] tw-bottom-0 tw-z-10 tw-flex tw-h-squid-m tw-w-squid-m tw-items-center tw-justify-center tw-overflow-hidden tw-rounded-full tw-border tw-border-grey-900 tw-p-0.5", statusBadge[status].containerClassName), children: statusBadge[status].badge })), jsxRuntime.jsx("img", { src: firstImageUrl, className: "tw-absolute tw-h-10 tw-w-10 tw-rounded-full tw-border tw-border-grey-900" }), jsxRuntime.jsx("img", { src: secondImageUrl, className: "tw-absolute tw-left-5 tw-h-10 tw-w-10 tw-rounded-full tw-border tw-border-grey-900" })] }), jsxRuntime.jsxs("div", { className: "tw-flex tw-h-10 tw-flex-1 tw-flex-col tw-self-stretch", children: [jsxRuntime.jsxs("div", { className: "tw-flex tw-h-5 tw-items-center tw-justify-between tw-text-grey-500", children: [jsxRuntime.jsxs("div", { className: "tw-flex tw-items-center", children: [jsxRuntime.jsx(CaptionText, { children: fromLabel }), jsxRuntime.jsx("span", { className: "tw-text-grey-600", children: jsxRuntime.jsx(ChevronRightSmallIcon, {}) }), jsxRuntime.jsx(CaptionText, { children: toLabel })] }), jsxRuntime.jsx("div", { className: cn("tw-flex tw-items-center tw-justify-center tw-gap-squid-xxs tw-hide-on-parent-hover", !!dropdownMenuContent &&
18856
18943
  "tw-transition-opacity group-hover/history-item:tw-hidden group-hover/history-item:tw-opacity-0 peer-focus:tw-hidden peer-focus:tw-opacity-0", isDropdownOpen && "tw-opacity-0"), children: statusLabel })] }), jsxRuntime.jsxs("div", { className: "tw-flex tw-h-5 tw-items-center tw-gap-squid-xxs tw-text-grey-300", children: [jsxRuntime.jsx(BodyText, { size: "small", children: fromAmount }), jsxRuntime.jsx("span", { className: "tw-text-grey-600", children: jsxRuntime.jsx(ChevronLargeRightIcon, {}) }), jsxRuntime.jsx(BodyText, { size: "small", children: toAmount })] })] })] })), !!dropdownMenuContent && (jsxRuntime.jsx(ListItemActionsButton, { ref: openDropdownButtonRef, onClick: openDropdown, isActive: isDropdownOpen, className: "peer-hover/history-item:tw-opacity-100" })), isDropdownOpen && !!dropdownMenuContent ? (jsxRuntime.jsx(DropdownMenu, { menuRef: menuRef, isHidden: !dropdownStyles, className: cn(!!dropdownStyles &&
18857
18944
  dropdownPositionClassMap[dropdownStyles.position]), dropdownRef: dropdownRef, children: dropdownMenuContent })) : null] }));
18858
18945
  }
@@ -62378,9 +62465,10 @@ function blendColors(foreground, background) {
62378
62465
  return rgbToHex(r, g, b);
62379
62466
  }
62380
62467
 
62381
- function SquidConfigProvider({ theme = lightTheme, children, themeType = "light", }) {
62468
+ function ThemeProvider(_a) {
62469
+ var { theme = lightTheme, children, themeType = "light" } = _a, props = __rest$1(_a, ["theme", "children", "themeType"]);
62382
62470
  const parsedStyle = parseSquidTheme(theme);
62383
- return (jsxRuntime.jsx("div", { style: parsedStyle, "data-squid-theme-type": themeType, className: "tw-group tw-relative tw-h-screen tw-font-geist mobile-lg:tw-h-auto", children: children }));
62471
+ return (jsxRuntime.jsx("div", Object.assign({}, props, { style: Object.assign(Object.assign({}, props.style), parsedStyle), "data-squid-theme-type": themeType, className: cn("tw-group tw-relative tw-h-screen tw-font-geist mobile-lg:tw-h-auto", props.className), children: children })));
62384
62472
  }
62385
62473
 
62386
62474
  exports.ActionLayout = ActionLayout;
@@ -62456,16 +62544,20 @@ exports.CircleX = CircleX;
62456
62544
  exports.CircleXFilledIcon = CircleXFilledIcon;
62457
62545
  exports.ClockOutlineIcon = ClockOutlineIcon;
62458
62546
  exports.ClockSolidIcon = ClockSolidIcon;
62547
+ exports.CodeBracketsIcon = CodeBracketsIcon;
62548
+ exports.CodeSolidSquareIcon = CodeSolidSquareIcon;
62459
62549
  exports.CoinsAddIcon = CoinsAddIcon;
62460
62550
  exports.CoinsIcon = CoinsIcon;
62461
62551
  exports.Collapse = Collapse;
62462
62552
  exports.CollapsibleMenu = CollapsibleMenu;
62463
62553
  exports.CollectionIcon = CollectionIcon;
62464
62554
  exports.ColorPaletteIcon = ColorPaletteIcon;
62555
+ exports.CommandIcon = CommandIcon;
62465
62556
  exports.CompassRoundOutlinedIcon = CompassRoundOutlinedIcon;
62466
62557
  exports.CompassRoundSolidIcon = CompassRoundSolidIcon;
62467
62558
  exports.ConsoleIcon = ConsoleIcon;
62468
62559
  exports.Copy = Copy;
62560
+ exports.CopyIcon = CopyIcon;
62469
62561
  exports.CrossAnimatedIcon = CrossAnimatedIcon;
62470
62562
  exports.DashboardFast = DashboardFast;
62471
62563
  exports.DescriptionBlocks = DescriptionBlocks;
@@ -62495,6 +62587,7 @@ exports.FeeButton = FeeButton;
62495
62587
  exports.FeesAction = FeesAction;
62496
62588
  exports.FeesLines = FeesLines;
62497
62589
  exports.FeesTotal = FeesTotal;
62590
+ exports.FileDownloadIcon = FileDownloadIcon;
62498
62591
  exports.FilledHeartIcon = FilledHeartIcon;
62499
62592
  exports.FilterAscendingIcon = FilterAscendingIcon;
62500
62593
  exports.FilterButton = FilterButton;
@@ -62523,6 +62616,7 @@ exports.InteractionHeader = InteractionHeader;
62523
62616
  exports.InteractionProperties = InteractionProperties;
62524
62617
  exports.InteractionTransactionView = InteractionTransactionView;
62525
62618
  exports.Join = Join;
62619
+ exports.LaptopIcon = LaptopIcon;
62526
62620
  exports.LightningIcon = LightningIcon;
62527
62621
  exports.LimitIcon = LimitIcon;
62528
62622
  exports.LinkIcon = LinkIcon;
@@ -62548,6 +62642,7 @@ exports.NotAllowedIcon = NotAllowedIcon;
62548
62642
  exports.NumericInput = NumericInput;
62549
62643
  exports.PathSquareIcon = PathSquareIcon;
62550
62644
  exports.PercentIcon = PercentIcon;
62645
+ exports.PhoneIcon = PhoneIcon;
62551
62646
  exports.PieChartIcon = PieChartIcon;
62552
62647
  exports.PipeSeparator = PipeSeparator;
62553
62648
  exports.PlusIcon = PlusIcon;
@@ -62586,13 +62681,13 @@ exports.SparklesIcon = SparklesIcon;
62586
62681
  exports.SquareArrowCenter = SquareArrowCenter;
62587
62682
  exports.SquareArrowTopLeftIcon = SquareArrowTopLeftIcon;
62588
62683
  exports.SquareArrowTopRight2Icon = SquareArrowTopRight2Icon;
62589
- exports.SquidConfigProvider = SquidConfigProvider;
62590
62684
  exports.SquidLogo = SquidLogo;
62591
62685
  exports.StakeAction = StakeAction;
62592
62686
  exports.StartAction = StartAction;
62593
62687
  exports.StocksIcon = StocksIcon;
62594
62688
  exports.SuccessAction = SuccessAction;
62595
62689
  exports.SunIcon = SunIcon;
62690
+ exports.SunOutlinedIcon = SunOutlinedIcon;
62596
62691
  exports.SunriseIcon = SunriseIcon;
62597
62692
  exports.SwapAction = SwapAction;
62598
62693
  exports.SwapConfiguration = SwapConfiguration;
@@ -62614,6 +62709,7 @@ exports.Switch = Switch;
62614
62709
  exports.TagIcon = TagIcon;
62615
62710
  exports.TagIconFilled = TagIconFilled;
62616
62711
  exports.TextSkeleton = TextSkeleton;
62712
+ exports.ThemeProvider = ThemeProvider;
62617
62713
  exports.ThumbsUp = ThumbsUp;
62618
62714
  exports.Tick = Tick;
62619
62715
  exports.TimeFliesIcon = TimeFliesIcon;
@@ -62655,4 +62751,5 @@ exports.useMediaQuery = useMediaQuery;
62655
62751
  exports.useOnResize = useOnResize;
62656
62752
  exports.useRect = useRect;
62657
62753
  exports.useTimer = useTimer;
62754
+ exports.useUserTheme = useUserTheme;
62658
62755
  exports.useVersion = useVersion;
@@ -38,3 +38,31 @@ export declare function FilterTimelineIcon({ size, className, }: {
38
38
  size?: string;
39
39
  className?: string;
40
40
  }): import("react/jsx-runtime").JSX.Element;
41
+ export declare function PhoneIcon({ size, className, }: {
42
+ size?: string;
43
+ className?: string;
44
+ }): import("react/jsx-runtime").JSX.Element;
45
+ export declare function LaptopIcon({ size, className, }: {
46
+ size?: string;
47
+ className?: string;
48
+ }): import("react/jsx-runtime").JSX.Element;
49
+ export declare function CopyIcon({ size, className, }: {
50
+ size?: string;
51
+ className?: string;
52
+ }): import("react/jsx-runtime").JSX.Element;
53
+ export declare function FileDownloadIcon({ size, className, }: {
54
+ size?: string;
55
+ className?: string;
56
+ }): import("react/jsx-runtime").JSX.Element;
57
+ export declare function CodeSolidSquareIcon({ size, className, }: {
58
+ size?: string;
59
+ className?: string;
60
+ }): import("react/jsx-runtime").JSX.Element;
61
+ export declare function CodeBracketsIcon({ size, className, }: {
62
+ size?: string;
63
+ className?: string;
64
+ }): import("react/jsx-runtime").JSX.Element;
65
+ export declare function CommandIcon({ size, className, }: {
66
+ size?: string;
67
+ className?: string;
68
+ }): import("react/jsx-runtime").JSX.Element;
@@ -10,3 +10,7 @@ export declare function MoonIcon({ size, className, }: {
10
10
  size?: string;
11
11
  className?: string;
12
12
  }): import("react/jsx-runtime").JSX.Element;
13
+ export declare function SunOutlinedIcon({ size, className, }: {
14
+ size?: string;
15
+ className?: string;
16
+ }): import("react/jsx-runtime").JSX.Element;
@@ -4,3 +4,4 @@ export * from "./useCollapsibleMenu";
4
4
  export * from "./useRect";
5
5
  export * from "./useVersion";
6
6
  export * from "./useTimer";
7
+ export * from "./useUserTheme";
@@ -0,0 +1,13 @@
1
+ import { type ThemeType } from "../types";
2
+ export declare enum ThemePreference {
3
+ LIGHT = "light",
4
+ DARK = "dark",
5
+ SYSTEM = "system"
6
+ }
7
+ export declare function useUserTheme(): {
8
+ themePreference: ThemePreference;
9
+ themeType: ThemeType;
10
+ theme: import("../types").SquidTheme;
11
+ setThemeManually: (theme: ThemePreference) => void;
12
+ isDarkMode: boolean;
13
+ };
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import "../styles/compiled-tailwind.css";
3
+ import { type ThemeType } from "../types/components";
4
+ import { type SquidTheme } from "../types/config";
5
+ interface ThemeProviderProps extends React.ComponentProps<"div"> {
6
+ theme?: SquidTheme;
7
+ children?: React.ReactNode;
8
+ themeType?: ThemeType;
9
+ }
10
+ export declare function ThemeProvider({ theme, children, themeType, ...props }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -1 +1 @@
1
- export * from "./SquidConfigProvider";
1
+ export * from "./ThemeProvider";
package/dist/esm/index.js CHANGED
@@ -17207,6 +17207,9 @@ function SunIcon({ size = "24", className, }) {
17207
17207
  function MoonIcon({ size = "20", className, }) {
17208
17208
  return (jsx("svg", { width: size, height: size, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, children: jsx("path", { d: "M10.0463 2.99972C10.2292 2.73432 10.2427 2.38723 10.0809 2.10846C9.91903 1.8297 9.61096 1.66925 9.28979 1.69647C5.02109 2.05816 1.66992 5.63639 1.66992 9.9982C1.66992 14.5997 5.40018 18.33 10.0017 18.33C14.3636 18.33 17.9419 14.9787 18.3035 10.7098C18.3307 10.3887 18.1702 10.0806 17.8914 9.91879C17.6127 9.75698 17.2656 9.77044 17.0002 9.95336C16.1951 10.5083 15.2201 10.8331 14.1667 10.8331C11.4052 10.8331 9.16667 8.59452 9.16667 5.8331C9.16667 4.77977 9.49145 3.80481 10.0463 2.99972Z", fill: "currentColor" }) }));
17209
17209
  }
17210
+ function SunOutlinedIcon({ size = "24", className, }) {
17211
+ return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", className: className, children: jsx("path", { d: "M12 3V2M12 22V21M18.3598 5.64005L19.0698 4.93005M4.93016 19.07L5.64016 18.36M21 12H22M2 12H3M18.3598 18.36L19.0698 19.07M4.93016 4.93005L5.64016 5.64005M15.5355 8.46447C17.4882 10.4171 17.4882 13.5829 15.5355 15.5355C13.5829 17.4882 10.4171 17.4882 8.46447 15.5355C6.51185 13.5829 6.51185 10.4171 8.46447 8.46447C10.4171 6.51185 13.5829 6.51185 15.5355 8.46447Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
17212
+ }
17210
17213
 
17211
17214
  const dockIconClassname = "tw-text-grey-900";
17212
17215
  const dockIconSelectedClassname = "group-data-[squid-theme-type=dark]:tw-text-royal-700 group-data-[squid-theme-type=light]:tw-text-volt-700";
@@ -17262,6 +17265,27 @@ function ImageIcon({ size = "20", className, }) {
17262
17265
  function FilterTimelineIcon({ size = "20", className, }) {
17263
17266
  return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", fill: "none", className: className, children: [jsx("path", { d: "M5.00117 3.33325C5.46141 3.33325 5.8345 3.70635 5.8345 4.16659V13.8206L6.91042 12.7442C7.23577 12.4186 7.76341 12.4185 8.08894 12.7438C8.41446 13.0692 8.4146 13.5968 8.08925 13.9224L5.59058 16.4224C5.43434 16.5787 5.22241 16.6665 5.00139 16.6666C4.78038 16.6666 4.56839 16.5789 4.41207 16.4227L1.91074 13.9227C1.58521 13.5973 1.58507 13.0697 1.91042 12.7442C2.23577 12.4186 2.76341 12.4185 3.08894 12.7438L4.16784 13.8222V4.16659C4.16784 3.70635 4.54093 3.33325 5.00117 3.33325Z", fill: "currentColor" }), jsx("path", { d: "M9.99984 4.99992C9.5396 4.99992 9.1665 5.37301 9.1665 5.83325C9.1665 6.29349 9.5396 6.66659 9.99984 6.66659H16.6665C17.1267 6.66659 17.4998 6.29349 17.4998 5.83325C17.4998 5.37301 17.1267 4.99992 16.6665 4.99992H9.99984Z", fill: "currentColor" }), jsx("path", { d: "M13.3332 13.3333C12.8729 13.3333 12.4998 13.7063 12.4998 14.1666C12.4998 14.6268 12.8729 14.9999 13.3332 14.9999H16.6665C17.1267 14.9999 17.4998 14.6268 17.4998 14.1666C17.4998 13.7063 17.1267 13.3333 16.6665 13.3333H13.3332Z", fill: "currentColor" }), jsx("path", { d: "M10.8332 9.99992C10.8332 9.53968 11.2063 9.16659 11.6665 9.16659H16.6665C17.1267 9.16659 17.4998 9.53968 17.4998 9.99992C17.4998 10.4602 17.1267 10.8333 16.6665 10.8333H11.6665C11.2063 10.8333 10.8332 10.4602 10.8332 9.99992Z", fill: "currentColor" })] }));
17264
17267
  }
17268
+ function PhoneIcon({ size = "24", className, }) {
17269
+ return (jsx("svg", { className: className, xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 25 24", fill: "none", children: jsx("path", { d: "M10.5 19H14.5M8.5 22H16.5C17.6046 22 18.5 21.1046 18.5 20V4C18.5 2.89543 17.6046 2 16.5 2H8.5C7.39543 2 6.5 2.89543 6.5 4V20C6.5 21.1046 7.39543 22 8.5 22Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }));
17270
+ }
17271
+ function LaptopIcon({ size = "24", className, }) {
17272
+ return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 25 24", fill: "none", className: className, children: [jsx("path", { d: "M4.5 6C4.5 4.89543 5.39543 4 6.5 4H18.5C19.6046 4 20.5 4.89543 20.5 6V15C20.5 15.5523 20.0523 16 19.5 16H5.5C4.94772 16 4.5 15.5523 4.5 15V6Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "square", strokeLinejoin: "round" }), jsx("path", { d: "M2.5 16H22.5V18C22.5 19.1046 21.6046 20 20.5 20H4.5C3.39543 20 2.5 19.1046 2.5 18V16Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "square", strokeLinejoin: "round" })] }));
17273
+ }
17274
+ function CopyIcon({ size = "20", className, }) {
17275
+ return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 21 20", fill: "none", className: className, children: jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.16663 6.66666V3.54166C7.16663 2.50612 8.00609 1.66666 9.04163 1.66666H16.9583C17.9938 1.66666 18.8333 2.50612 18.8333 3.54166V11.4583C18.8333 12.4939 17.9938 13.3333 16.9583 13.3333H13.8333V16.4583C13.8333 17.4939 12.9938 18.3333 11.9583 18.3333H4.04163C3.00609 18.3333 2.16663 17.4939 2.16663 16.4583V8.54166C2.16663 7.50612 3.00609 6.66666 4.04163 6.66666H7.16663ZM9.04163 13.3333C8.00609 13.3333 7.16663 12.4939 7.16663 11.4583V8.33332H4.04163C3.92657 8.33332 3.83329 8.4266 3.83329 8.54166V16.4583C3.83329 16.5734 3.92657 16.6667 4.04163 16.6667H11.9583C12.0734 16.6667 12.1666 16.5734 12.1666 16.4583V13.3333H9.04163Z", fill: "currentColor" }) }));
17276
+ }
17277
+ function FileDownloadIcon({ size = "20", className, }) {
17278
+ return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 21 20", fill: "none", children: [jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M6.33337 1.66666H10.5V5.83332C10.5 7.21404 11.6193 8.33332 13 8.33332H17.1667V15.8333C17.1667 17.214 16.0474 18.3333 14.6667 18.3333H6.33337C4.95266 18.3333 3.83337 17.214 3.83337 15.8333V4.16666C3.83337 2.78594 4.95266 1.66666 6.33337 1.66666ZM13.1726 14.3392L11.0893 16.4226C10.7639 16.748 10.2362 16.748 9.91079 16.4226L7.82745 14.3392C7.50201 14.0138 7.50201 13.4862 7.82745 13.1607C8.15289 12.8353 8.68053 12.8353 9.00596 13.1607L9.66671 13.8215V10.8333C9.66671 10.3731 10.0398 9.99999 10.5 9.99999C10.9603 9.99999 11.3334 10.3731 11.3334 10.8333V13.8215L11.9941 13.1607C12.3196 12.8353 12.8472 12.8353 13.1726 13.1607C13.4981 13.4862 13.4981 14.0138 13.1726 14.3392Z", fill: "currentColor" }), jsx("path", { d: "M12.1667 2.15481L16.6786 6.66666H13C12.5398 6.66666 12.1667 6.29356 12.1667 5.83332V2.15481Z", fill: "currentColor" })] }));
17279
+ }
17280
+ function CodeSolidSquareIcon({ size = "24", className, }) {
17281
+ return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 25 24", fill: "none", className: className, children: jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.5 6C3.5 4.34315 4.84315 3 6.5 3H18.5C20.1569 3 21.5 4.34315 21.5 6V18C21.5 19.6569 20.1569 21 18.5 21H6.5C4.84315 21 3.5 19.6569 3.5 18V6ZM11.2071 8.79289C11.5976 9.18342 11.5976 9.81658 11.2071 10.2071L9.41421 12L11.2071 13.7929C11.5976 14.1834 11.5976 14.8166 11.2071 15.2071C10.8166 15.5976 10.1834 15.5976 9.79289 15.2071L8 13.4142C7.21895 12.6332 7.21895 11.3668 8 10.5858L9.79289 8.79289C10.1834 8.40237 10.8166 8.40237 11.2071 8.79289ZM15.2071 8.79289C14.8166 8.40237 14.1834 8.40237 13.7929 8.79289C13.4024 9.18342 13.4024 9.81658 13.7929 10.2071L15.5858 12L13.7929 13.7929C13.4024 14.1834 13.4024 14.8166 13.7929 15.2071C14.1834 15.5976 14.8166 15.5976 15.2071 15.2071L17 13.4142C17.781 12.6332 17.781 11.3668 17 10.5858L15.2071 8.79289Z", fill: "currentColor" }) }));
17282
+ }
17283
+ function CodeBracketsIcon({ size = "20", className, }) {
17284
+ return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", fill: "none", className: className, children: jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.8688 2.5249C12.3153 2.63652 12.5867 3.08896 12.4751 3.53546L9.14178 16.8688C9.03015 17.3153 8.57771 17.5868 8.13121 17.4752C7.68472 17.3635 7.41325 16.9111 7.52487 16.4646L10.8582 3.13123C10.9698 2.68474 11.4223 2.41327 11.8688 2.5249ZM5.58925 6.07746C5.91469 6.4029 5.91469 6.93053 5.58925 7.25597L3.43443 9.41079C3.10899 9.73623 3.10899 10.2639 3.43443 10.5893L5.58925 12.7441C5.91469 13.0696 5.91469 13.5972 5.58925 13.9226C5.26381 14.2481 4.73617 14.2481 4.41074 13.9226L2.25591 11.7678C1.2796 10.7915 1.27961 9.20859 2.25592 8.23228L4.41074 6.07746C4.73617 5.75202 5.26381 5.75202 5.58925 6.07746ZM14.4107 6.07746C14.7362 5.75202 15.2638 5.75202 15.5892 6.07746L17.7441 8.23228C18.7204 9.20859 18.7204 10.7915 17.7441 11.7678L15.5892 13.9226C15.2638 14.2481 14.7362 14.2481 14.4107 13.9226C14.0853 13.5972 14.0853 13.0696 14.4107 12.7441L16.5656 10.5893C16.891 10.2639 16.891 9.73623 16.5656 9.41079L14.4107 7.25597C14.0853 6.93053 14.0853 6.4029 14.4107 6.07746Z", fill: "currentColor" }) }));
17285
+ }
17286
+ function CommandIcon({ size = "22", className, }) {
17287
+ return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 22 22", fill: "none", className: className, children: jsx("path", { d: "M8 17V17C8 16.0219 8.28951 15.0657 8.83205 14.2519L13.1679 7.74808C13.7105 6.93427 14 5.97808 14 5V5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
17288
+ }
17265
17289
 
17266
17290
  function FeeButton(_a) {
17267
17291
  var { feeInUsd = "0", chipLabel = "Fee", className, tooltip } = _a, props = __rest$1(_a, ["feeInUsd", "chipLabel", "className", "tooltip"]);
@@ -18681,6 +18705,69 @@ const useTimer = ({ immediateStart = true, }) => {
18681
18705
  return { timer, stopTimer, startTimer };
18682
18706
  };
18683
18707
 
18708
+ var ThemePreference;
18709
+ (function (ThemePreference) {
18710
+ ThemePreference["LIGHT"] = "light";
18711
+ ThemePreference["DARK"] = "dark";
18712
+ ThemePreference["SYSTEM"] = "system";
18713
+ })(ThemePreference || (ThemePreference = {}));
18714
+ const THEME_STORAGE_KEY = "__squid-app-theme-type__";
18715
+ const THEME_CHANGE_EVENT = "squid-app-theme-change";
18716
+ const THEME_MEDIA_QUERY = "(prefers-color-scheme: light)";
18717
+ function useUserTheme() {
18718
+ const [themePreference, setThemePreference] = useState(getInitialTheme);
18719
+ const [themeType, setThemeType] = useState(getEffectiveTheme(themePreference));
18720
+ useEffect(() => {
18721
+ const handleThemeChange = (e) => {
18722
+ setThemePreference(e.detail);
18723
+ };
18724
+ window.addEventListener(THEME_CHANGE_EVENT, handleThemeChange);
18725
+ return () => {
18726
+ window.removeEventListener(THEME_CHANGE_EVENT, handleThemeChange);
18727
+ };
18728
+ }, []);
18729
+ useEffect(() => {
18730
+ const mediaQuery = window.matchMedia(THEME_MEDIA_QUERY);
18731
+ const handleChange = () => {
18732
+ if (themePreference === ThemePreference.SYSTEM) {
18733
+ setThemeType(mediaQuery.matches ? "light" : "dark");
18734
+ }
18735
+ };
18736
+ mediaQuery.addEventListener("change", handleChange);
18737
+ handleChange();
18738
+ return () => {
18739
+ mediaQuery.removeEventListener("change", handleChange);
18740
+ };
18741
+ }, [themePreference]);
18742
+ useEffect(() => {
18743
+ setThemeType(getEffectiveTheme(themePreference));
18744
+ }, [themePreference]);
18745
+ const setThemeManually = (theme) => {
18746
+ setThemePreference(theme);
18747
+ localStorage.setItem(THEME_STORAGE_KEY, theme);
18748
+ window.dispatchEvent(new CustomEvent(THEME_CHANGE_EVENT, { detail: theme }));
18749
+ };
18750
+ const isDarkMode = useMemo(() => themeType === "dark", [themeType]);
18751
+ return {
18752
+ themePreference,
18753
+ themeType,
18754
+ theme: isDarkMode ? darkTheme : lightTheme,
18755
+ setThemeManually,
18756
+ isDarkMode,
18757
+ };
18758
+ }
18759
+ function getInitialTheme() {
18760
+ var _a;
18761
+ if (typeof window === "undefined")
18762
+ return ThemePreference.SYSTEM;
18763
+ return ((_a = localStorage.getItem(THEME_STORAGE_KEY)) !== null && _a !== void 0 ? _a : ThemePreference.SYSTEM);
18764
+ }
18765
+ function getEffectiveTheme(themeType) {
18766
+ if (themeType !== ThemePreference.SYSTEM)
18767
+ return themeType;
18768
+ return window.matchMedia(THEME_MEDIA_QUERY).matches ? "light" : "dark";
18769
+ }
18770
+
18684
18771
  function BaseDropdownMenuItem({ label, imageUrl, icon, labelClassName, onClick, link, control, detail, isSelected, itemRef, children, contentRef, }) {
18685
18772
  const ContentTag = link
18686
18773
  ? "a"
@@ -18832,7 +18919,7 @@ function HistoryItem({ firstImageUrl, secondImageUrl, dateCompleted, fromAmount,
18832
18919
  onClick,
18833
18920
  }
18834
18921
  : {};
18835
- return (jsxs("li", { ref: itemRef, className: cn("tw-relative tw-flex tw-h-list-item-large tw-min-w-list-item-small tw-self-stretch tw-bg-grey-900 tw-px-squid-xs tw-text-grey-300", !!dropdownMenuContent && "tw-highlight-adjacent"), children: [jsxs(ItemTag, Object.assign({}, itemTagProps, { className: cn("tw-group/history-item tw-peer/history-item tw-relative tw-flex tw-w-full tw-flex-shrink-0 tw-items-center tw-gap-squid-xs tw-self-stretch tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs", isInteractive && "hover:tw-bg-material-light-thin"), children: [jsxs("div", { className: "tw-relative tw-h-10 tw-w-[60px]", children: [!!statusBadge[status].badge && (jsx("span", { className: cn("tw-absolute -tw-left-[5px] tw-bottom-0 tw-z-10 tw-flex tw-h-squid-m tw-w-squid-m tw-items-center tw-justify-center tw-overflow-hidden tw-rounded-full tw-border tw-border-grey-900 tw-p-0.5", statusBadge[status].containerClassName), children: statusBadge[status].badge })), jsx("img", { src: firstImageUrl, className: "tw-absolute tw-h-10 tw-w-10 tw-rounded-full tw-border tw-border-grey-900" }), jsx("img", { src: secondImageUrl, className: "tw-absolute tw-left-5 tw-h-10 tw-w-10 tw-rounded-full tw-border tw-border-grey-900" })] }), jsxs("div", { className: "tw-flex tw-h-10 tw-flex-1 tw-flex-col tw-self-stretch", children: [jsxs("div", { className: "tw-flex tw-h-5 tw-items-center tw-justify-between tw-text-grey-500", children: [jsxs("div", { className: "tw-flex tw-items-center", children: [jsx(CaptionText, { children: fromLabel }), jsx("span", { className: "tw-text-grey-600", children: jsx(ChevronRightSmallIcon, {}) }), jsx(CaptionText, { children: toLabel })] }), jsx("div", { className: cn("tw-hide-on-parent-hover tw-flex tw-items-center tw-justify-center tw-gap-squid-xxs", !!dropdownMenuContent &&
18922
+ return (jsxs("li", { ref: itemRef, className: cn("tw-relative tw-flex tw-h-list-item-large tw-min-w-list-item-small tw-self-stretch tw-bg-grey-900 tw-px-squid-xs tw-text-grey-300", !!dropdownMenuContent && "tw-highlight-adjacent"), children: [jsxs(ItemTag, Object.assign({}, itemTagProps, { className: cn("tw-group/history-item tw-peer/history-item tw-relative tw-flex tw-w-full tw-flex-shrink-0 tw-items-center tw-gap-squid-xs tw-self-stretch tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs", isInteractive && "hover:tw-bg-material-light-thin"), children: [jsxs("div", { className: "tw-relative tw-h-10 tw-w-[60px]", children: [!!statusBadge[status].badge && (jsx("span", { className: cn("tw-absolute -tw-left-[5px] tw-bottom-0 tw-z-10 tw-flex tw-h-squid-m tw-w-squid-m tw-items-center tw-justify-center tw-overflow-hidden tw-rounded-full tw-border tw-border-grey-900 tw-p-0.5", statusBadge[status].containerClassName), children: statusBadge[status].badge })), jsx("img", { src: firstImageUrl, className: "tw-absolute tw-h-10 tw-w-10 tw-rounded-full tw-border tw-border-grey-900" }), jsx("img", { src: secondImageUrl, className: "tw-absolute tw-left-5 tw-h-10 tw-w-10 tw-rounded-full tw-border tw-border-grey-900" })] }), jsxs("div", { className: "tw-flex tw-h-10 tw-flex-1 tw-flex-col tw-self-stretch", children: [jsxs("div", { className: "tw-flex tw-h-5 tw-items-center tw-justify-between tw-text-grey-500", children: [jsxs("div", { className: "tw-flex tw-items-center", children: [jsx(CaptionText, { children: fromLabel }), jsx("span", { className: "tw-text-grey-600", children: jsx(ChevronRightSmallIcon, {}) }), jsx(CaptionText, { children: toLabel })] }), jsx("div", { className: cn("tw-flex tw-items-center tw-justify-center tw-gap-squid-xxs tw-hide-on-parent-hover", !!dropdownMenuContent &&
18836
18923
  "tw-transition-opacity group-hover/history-item:tw-hidden group-hover/history-item:tw-opacity-0 peer-focus:tw-hidden peer-focus:tw-opacity-0", isDropdownOpen && "tw-opacity-0"), children: statusLabel })] }), jsxs("div", { className: "tw-flex tw-h-5 tw-items-center tw-gap-squid-xxs tw-text-grey-300", children: [jsx(BodyText, { size: "small", children: fromAmount }), jsx("span", { className: "tw-text-grey-600", children: jsx(ChevronLargeRightIcon, {}) }), jsx(BodyText, { size: "small", children: toAmount })] })] })] })), !!dropdownMenuContent && (jsx(ListItemActionsButton, { ref: openDropdownButtonRef, onClick: openDropdown, isActive: isDropdownOpen, className: "peer-hover/history-item:tw-opacity-100" })), isDropdownOpen && !!dropdownMenuContent ? (jsx(DropdownMenu, { menuRef: menuRef, isHidden: !dropdownStyles, className: cn(!!dropdownStyles &&
18837
18924
  dropdownPositionClassMap[dropdownStyles.position]), dropdownRef: dropdownRef, children: dropdownMenuContent })) : null] }));
18838
18925
  }
@@ -62358,9 +62445,10 @@ function blendColors(foreground, background) {
62358
62445
  return rgbToHex(r, g, b);
62359
62446
  }
62360
62447
 
62361
- function SquidConfigProvider({ theme = lightTheme, children, themeType = "light", }) {
62448
+ function ThemeProvider(_a) {
62449
+ var { theme = lightTheme, children, themeType = "light" } = _a, props = __rest$1(_a, ["theme", "children", "themeType"]);
62362
62450
  const parsedStyle = parseSquidTheme(theme);
62363
- return (jsx("div", { style: parsedStyle, "data-squid-theme-type": themeType, className: "tw-group tw-relative tw-h-screen tw-font-geist mobile-lg:tw-h-auto", children: children }));
62451
+ return (jsx("div", Object.assign({}, props, { style: Object.assign(Object.assign({}, props.style), parsedStyle), "data-squid-theme-type": themeType, className: cn("tw-group tw-relative tw-h-screen tw-font-geist mobile-lg:tw-h-auto", props.className), children: children })));
62364
62452
  }
62365
62453
 
62366
- export { ActionLayout, ActionLineOutRow, ActionProperties, ActionRow, ActionStatusRow, ActionWrapper, AddressButton, AnimationWrapper, AppContainer, Approve, ApproveAction, ArrowBottomTopIcon, ArrowButton, ArrowCornerDownRightIcon, ArrowDownIcon, ArrowLeftIcon, ArrowOutOfBoxIcon, ArrowRightDownCircleIcon, ArrowRightDownIcon, ArrowRightIcon, ArrowRightUpCircleIcon, ArrowRightUpIcon, ArrowRotate, ArrowSplit, ArrowTriangle, ArrowUpIcon, ArrowWallDownIcon, ArrowsSwapIcon, AssetsButton, AssetsView, BackpackIcon, BadgeImage, BankIcon, BellAlarmIcon, BlockSkeleton, BodyText, Boost, BoostBadge, BoostButton, BorderedContainer, Breadcrumb, BridgeAction, BridgeHeader, BridgeProperties, BridgeTransactionView, BrokenHeartIcon, BubblesIcon, Button$1 as Button, BuyNFTHeader, BuyNFTProperties, BuyNFTTransactionView, CSS_VARS, Calendar, CaptionText, CatSquareIcon, ChainLink, Checkmark1Icon, Checkmark2Icon, ChevronArrowIcon, ChevronDownSmallIcon, ChevronGrabberVerticalIcon, ChevronLargeDownIcon, ChevronLargeRightIcon, ChevronRightSmallIcon, ChevronTopIcon, ChevronTopSmallIcon, Chip, CircleMinusIcon, CirclePlusIcon, CircleX, CircleXFilledIcon, ClockOutlineIcon, ClockSolidIcon, CoinsAddIcon, CoinsIcon, Collapse, CollapsibleMenu, CollectionIcon, ColorPaletteIcon, CompassRoundOutlinedIcon, CompassRoundSolidIcon, ConsoleIcon, Copy, CrossAnimatedIcon, DashboardFast, DescriptionBlocks, DetailsToolbar, DiscordIcon, DockIconAnalytics, DockIconCheckout, DockIconHelp, DockIconProfile, DockIconScan, DockIconSwap, DockSwapIcon, DollarOutlinedIcon, DollarSolidIcon, DotGrid1x3HorizontalIcon, DropdownMenu, DropdownMenuItem, DropdownMenuTitle, EmojiMeh, EmojiSadIcon, EmptyHeartIcon, ErrorMessage, EthereumIcon, ExplosionIcon, EyeOpenIcon, FeeButton, FeesAction, FeesLines, FeesTotal, FilledHeartIcon, FilterAscendingIcon, FilterButton, FilterIcon, FilterTimelineIcon, GasIcon, GhostIcon, GithubIcon, HashLink, HeadingText, HeartSmallIcon, HelpIcon, HistoryItem, HomeIcon, IconButton, IconLabel, Image$1 as Image, ImageIcon, ImageSparkle, IncompleteAction, InfinityIcon, InfoBox, Inline, Input, InteractionHeader, InteractionProperties, InteractionTransactionView, Join, LightningIcon, LimitIcon, LinkIcon, List, ListItem, ListItemActionsButton, Loader, LoadingProvider, LoadingSkeleton, MEDIA_QUERIES, MainView, MaxIcon, Menu, MenuItem, MenuSwapIcon, MirrorIcon, Modal, ModalContent, ModalContentDivider, MoonIcon, NavigationBar, NotAllowedIcon, NumericInput, PathSquareIcon, PercentIcon, PieChartIcon, PipeSeparator, PlusIcon, PoopIcon, PowerIcon, ProductCard, ProfileHeader, ProfileHeaderBackground, PropertiesLayout, PropertyListItem, PunkIcon, RangeInput, ReceiptBillIcon, ReceiveNFTAction, ReceiveTokensAction, RecipientView, RefreshIcon, ReorderIcon, RouteStep, STEP_ITEM_HEIGHT, SearchIcon, SectionTitle, SendTokensAction, SettingsButton, SettingsGearIcon, SettingsItem, SettingsSlider, SettingsSliderIcon, ShoppingBagIcon, SizeTransition, SmileIcon, SnapIcon, SortIcon, SparkleIcon, SparklesIcon, SquareArrowCenter, SquareArrowTopLeftIcon, SquareArrowTopRight2Icon, SquidConfigProvider, SquidLogo, StakeAction, StartAction, StocksIcon, SuccessAction, SunIcon, SunriseIcon, SwapAction, SwapConfiguration, SwapDetailsView, SwapErrorIcon, SwapHeader, SwapIcon, SwapInputsIcon, SwapProgressView, SwapProgressViewHeader, SwapProperties, SwapStepItem, SwapStepSeparator, SwapStepsCollapsed, SwapSuccessIcon, SwapTransactionView, SwapWarningIcon, Switch, TagIcon, TagIconFilled, TextSkeleton, ThumbsUp, Tick, TimeFliesIcon, Timeline, Timestamp, Toast, TokenPair, Tooltip, TradingViewStepsIcon, TransactionAction, TransactionFilters, TransactionHeader, TransactionHeaderLayout, TransactionItem, TransactionProperties, TransactionSearch, TransactionState, TransactionView, TransactionViewLayout, Transfer, TranslateIcon, TriangleExclamation, UsdAmount, WalletFilledIcon, WalletIcon, WalletLink, WalletsView, WrapAction, XSocial, baseTailwindConfig, cn, darkTheme, lightTheme, linkActionTimelineProps, statusTextClassMap, useCollapsibleMenu, useDropdownMenu, useMediaQuery, useOnResize, useRect, useTimer, useVersion };
62454
+ export { ActionLayout, ActionLineOutRow, ActionProperties, ActionRow, ActionStatusRow, ActionWrapper, AddressButton, AnimationWrapper, AppContainer, Approve, ApproveAction, ArrowBottomTopIcon, ArrowButton, ArrowCornerDownRightIcon, ArrowDownIcon, ArrowLeftIcon, ArrowOutOfBoxIcon, ArrowRightDownCircleIcon, ArrowRightDownIcon, ArrowRightIcon, ArrowRightUpCircleIcon, ArrowRightUpIcon, ArrowRotate, ArrowSplit, ArrowTriangle, ArrowUpIcon, ArrowWallDownIcon, ArrowsSwapIcon, AssetsButton, AssetsView, BackpackIcon, BadgeImage, BankIcon, BellAlarmIcon, BlockSkeleton, BodyText, Boost, BoostBadge, BoostButton, BorderedContainer, Breadcrumb, BridgeAction, BridgeHeader, BridgeProperties, BridgeTransactionView, BrokenHeartIcon, BubblesIcon, Button$1 as Button, BuyNFTHeader, BuyNFTProperties, BuyNFTTransactionView, CSS_VARS, Calendar, CaptionText, CatSquareIcon, ChainLink, Checkmark1Icon, Checkmark2Icon, ChevronArrowIcon, ChevronDownSmallIcon, ChevronGrabberVerticalIcon, ChevronLargeDownIcon, ChevronLargeRightIcon, ChevronRightSmallIcon, ChevronTopIcon, ChevronTopSmallIcon, Chip, CircleMinusIcon, CirclePlusIcon, CircleX, CircleXFilledIcon, ClockOutlineIcon, ClockSolidIcon, CodeBracketsIcon, CodeSolidSquareIcon, CoinsAddIcon, CoinsIcon, Collapse, CollapsibleMenu, CollectionIcon, ColorPaletteIcon, CommandIcon, CompassRoundOutlinedIcon, CompassRoundSolidIcon, ConsoleIcon, Copy, CopyIcon, CrossAnimatedIcon, DashboardFast, DescriptionBlocks, DetailsToolbar, DiscordIcon, DockIconAnalytics, DockIconCheckout, DockIconHelp, DockIconProfile, DockIconScan, DockIconSwap, DockSwapIcon, DollarOutlinedIcon, DollarSolidIcon, DotGrid1x3HorizontalIcon, DropdownMenu, DropdownMenuItem, DropdownMenuTitle, EmojiMeh, EmojiSadIcon, EmptyHeartIcon, ErrorMessage, EthereumIcon, ExplosionIcon, EyeOpenIcon, FeeButton, FeesAction, FeesLines, FeesTotal, FileDownloadIcon, FilledHeartIcon, FilterAscendingIcon, FilterButton, FilterIcon, FilterTimelineIcon, GasIcon, GhostIcon, GithubIcon, HashLink, HeadingText, HeartSmallIcon, HelpIcon, HistoryItem, HomeIcon, IconButton, IconLabel, Image$1 as Image, ImageIcon, ImageSparkle, IncompleteAction, InfinityIcon, InfoBox, Inline, Input, InteractionHeader, InteractionProperties, InteractionTransactionView, Join, LaptopIcon, LightningIcon, LimitIcon, LinkIcon, List, ListItem, ListItemActionsButton, Loader, LoadingProvider, LoadingSkeleton, MEDIA_QUERIES, MainView, MaxIcon, Menu, MenuItem, MenuSwapIcon, MirrorIcon, Modal, ModalContent, ModalContentDivider, MoonIcon, NavigationBar, NotAllowedIcon, NumericInput, PathSquareIcon, PercentIcon, PhoneIcon, PieChartIcon, PipeSeparator, PlusIcon, PoopIcon, PowerIcon, ProductCard, ProfileHeader, ProfileHeaderBackground, PropertiesLayout, PropertyListItem, PunkIcon, RangeInput, ReceiptBillIcon, ReceiveNFTAction, ReceiveTokensAction, RecipientView, RefreshIcon, ReorderIcon, RouteStep, STEP_ITEM_HEIGHT, SearchIcon, SectionTitle, SendTokensAction, SettingsButton, SettingsGearIcon, SettingsItem, SettingsSlider, SettingsSliderIcon, ShoppingBagIcon, SizeTransition, SmileIcon, SnapIcon, SortIcon, SparkleIcon, SparklesIcon, SquareArrowCenter, SquareArrowTopLeftIcon, SquareArrowTopRight2Icon, SquidLogo, StakeAction, StartAction, StocksIcon, SuccessAction, SunIcon, SunOutlinedIcon, SunriseIcon, SwapAction, SwapConfiguration, SwapDetailsView, SwapErrorIcon, SwapHeader, SwapIcon, SwapInputsIcon, SwapProgressView, SwapProgressViewHeader, SwapProperties, SwapStepItem, SwapStepSeparator, SwapStepsCollapsed, SwapSuccessIcon, SwapTransactionView, SwapWarningIcon, Switch, TagIcon, TagIconFilled, TextSkeleton, ThemePreference, ThemeProvider, ThumbsUp, Tick, TimeFliesIcon, Timeline, Timestamp, Toast, TokenPair, Tooltip, TradingViewStepsIcon, TransactionAction, TransactionFilters, TransactionHeader, TransactionHeaderLayout, TransactionItem, TransactionProperties, TransactionSearch, TransactionState, TransactionView, TransactionViewLayout, Transfer, TranslateIcon, TriangleExclamation, UsdAmount, WalletFilledIcon, WalletIcon, WalletLink, WalletsView, WrapAction, XSocial, baseTailwindConfig, cn, darkTheme, lightTheme, linkActionTimelineProps, statusTextClassMap, useCollapsibleMenu, useDropdownMenu, useMediaQuery, useOnResize, useRect, useTimer, useUserTheme, useVersion };
@@ -38,3 +38,31 @@ export declare function FilterTimelineIcon({ size, className, }: {
38
38
  size?: string;
39
39
  className?: string;
40
40
  }): import("react/jsx-runtime").JSX.Element;
41
+ export declare function PhoneIcon({ size, className, }: {
42
+ size?: string;
43
+ className?: string;
44
+ }): import("react/jsx-runtime").JSX.Element;
45
+ export declare function LaptopIcon({ size, className, }: {
46
+ size?: string;
47
+ className?: string;
48
+ }): import("react/jsx-runtime").JSX.Element;
49
+ export declare function CopyIcon({ size, className, }: {
50
+ size?: string;
51
+ className?: string;
52
+ }): import("react/jsx-runtime").JSX.Element;
53
+ export declare function FileDownloadIcon({ size, className, }: {
54
+ size?: string;
55
+ className?: string;
56
+ }): import("react/jsx-runtime").JSX.Element;
57
+ export declare function CodeSolidSquareIcon({ size, className, }: {
58
+ size?: string;
59
+ className?: string;
60
+ }): import("react/jsx-runtime").JSX.Element;
61
+ export declare function CodeBracketsIcon({ size, className, }: {
62
+ size?: string;
63
+ className?: string;
64
+ }): import("react/jsx-runtime").JSX.Element;
65
+ export declare function CommandIcon({ size, className, }: {
66
+ size?: string;
67
+ className?: string;
68
+ }): import("react/jsx-runtime").JSX.Element;
@@ -10,3 +10,7 @@ export declare function MoonIcon({ size, className, }: {
10
10
  size?: string;
11
11
  className?: string;
12
12
  }): import("react/jsx-runtime").JSX.Element;
13
+ export declare function SunOutlinedIcon({ size, className, }: {
14
+ size?: string;
15
+ className?: string;
16
+ }): import("react/jsx-runtime").JSX.Element;
@@ -4,3 +4,4 @@ export * from "./useCollapsibleMenu";
4
4
  export * from "./useRect";
5
5
  export * from "./useVersion";
6
6
  export * from "./useTimer";
7
+ export * from "./useUserTheme";
@@ -0,0 +1,13 @@
1
+ import { type ThemeType } from "../types";
2
+ export declare enum ThemePreference {
3
+ LIGHT = "light",
4
+ DARK = "dark",
5
+ SYSTEM = "system"
6
+ }
7
+ export declare function useUserTheme(): {
8
+ themePreference: ThemePreference;
9
+ themeType: ThemeType;
10
+ theme: import("../types").SquidTheme;
11
+ setThemeManually: (theme: ThemePreference) => void;
12
+ isDarkMode: boolean;
13
+ };
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import "../styles/compiled-tailwind.css";
3
+ import { type ThemeType } from "../types/components";
4
+ import { type SquidTheme } from "../types/config";
5
+ interface ThemeProviderProps extends React.ComponentProps<"div"> {
6
+ theme?: SquidTheme;
7
+ children?: React.ReactNode;
8
+ themeType?: ThemeType;
9
+ }
10
+ export declare function ThemeProvider({ theme, children, themeType, ...props }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -1 +1 @@
1
- export * from "./SquidConfigProvider";
1
+ export * from "./ThemeProvider";
package/dist/index.d.ts CHANGED
@@ -711,6 +711,10 @@ declare function MoonIcon({ size, className, }: {
711
711
  size?: string;
712
712
  className?: string;
713
713
  }): react_jsx_runtime.JSX.Element;
714
+ declare function SunOutlinedIcon({ size, className, }: {
715
+ size?: string;
716
+ className?: string;
717
+ }): react_jsx_runtime.JSX.Element;
714
718
 
715
719
  interface DockIconProps {
716
720
  isSelected?: boolean;
@@ -762,6 +766,34 @@ declare function FilterTimelineIcon({ size, className, }: {
762
766
  size?: string;
763
767
  className?: string;
764
768
  }): react_jsx_runtime.JSX.Element;
769
+ declare function PhoneIcon({ size, className, }: {
770
+ size?: string;
771
+ className?: string;
772
+ }): react_jsx_runtime.JSX.Element;
773
+ declare function LaptopIcon({ size, className, }: {
774
+ size?: string;
775
+ className?: string;
776
+ }): react_jsx_runtime.JSX.Element;
777
+ declare function CopyIcon({ size, className, }: {
778
+ size?: string;
779
+ className?: string;
780
+ }): react_jsx_runtime.JSX.Element;
781
+ declare function FileDownloadIcon({ size, className, }: {
782
+ size?: string;
783
+ className?: string;
784
+ }): react_jsx_runtime.JSX.Element;
785
+ declare function CodeSolidSquareIcon({ size, className, }: {
786
+ size?: string;
787
+ className?: string;
788
+ }): react_jsx_runtime.JSX.Element;
789
+ declare function CodeBracketsIcon({ size, className, }: {
790
+ size?: string;
791
+ className?: string;
792
+ }): react_jsx_runtime.JSX.Element;
793
+ declare function CommandIcon({ size, className, }: {
794
+ size?: string;
795
+ className?: string;
796
+ }): react_jsx_runtime.JSX.Element;
765
797
 
766
798
  interface Props {
767
799
  lottieJsonFile: object;
@@ -2540,11 +2572,12 @@ declare function TransactionViewLayout({ isLoading, header, properties, actions,
2540
2572
 
2541
2573
  declare function WalletsView(): react_jsx_runtime.JSX.Element;
2542
2574
 
2543
- declare function SquidConfigProvider({ theme, children, themeType, }: {
2575
+ interface ThemeProviderProps extends React.ComponentProps<"div"> {
2544
2576
  theme?: SquidTheme;
2545
2577
  children?: React.ReactNode;
2546
2578
  themeType?: ThemeType;
2547
- }): react_jsx_runtime.JSX.Element;
2579
+ }
2580
+ declare function ThemeProvider({ theme, children, themeType, ...props }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
2548
2581
 
2549
2582
  type DropdownPosition = "top" | "bottom" | "center";
2550
2583
  type DropdownStyles = {
@@ -2611,6 +2644,19 @@ declare const useTimer: ({ immediateStart, }: {
2611
2644
  startTimer: () => void;
2612
2645
  };
2613
2646
 
2647
+ declare enum ThemePreference {
2648
+ LIGHT = "light",
2649
+ DARK = "dark",
2650
+ SYSTEM = "system"
2651
+ }
2652
+ declare function useUserTheme(): {
2653
+ themePreference: ThemePreference;
2654
+ themeType: ThemeType;
2655
+ theme: SquidTheme;
2656
+ setThemeManually: (theme: ThemePreference) => void;
2657
+ isDarkMode: boolean;
2658
+ };
2659
+
2614
2660
  declare const CSS_VARS: {
2615
2661
  MOVE_WITH_SPRING_BOUNCE_DURATION: string;
2616
2662
  DISPLAY_DELAYED_DURATION: string;
@@ -2654,4 +2700,4 @@ declare const baseTailwindConfig: Config;
2654
2700
  */
2655
2701
  declare const cn: (...inputs: ClassValue[]) => string;
2656
2702
 
2657
- export { type ActionButton, ActionLayout, ActionLineOutRow, ActionProperties, ActionRow, type ActionStatus, ActionStatusRow, ActionWrapper, AddressButton, type AllOrNone, AnimationWrapper, AppContainer, Approve, ApproveAction, ArrowBottomTopIcon, ArrowButton, ArrowCornerDownRightIcon, ArrowDownIcon, ArrowLeftIcon, ArrowOutOfBoxIcon, ArrowRightDownCircleIcon, ArrowRightDownIcon, ArrowRightIcon, ArrowRightUpCircleIcon, ArrowRightUpIcon, ArrowRotate, ArrowSplit, ArrowTriangle, ArrowUpIcon, ArrowWallDownIcon, ArrowsSwapIcon, AssetsButton, type AssetsButtonVariant, AssetsView, BackpackIcon, BadgeImage, BankIcon, type BaseActionProps, type BaseTransactionViewProps, BellAlarmIcon, BlockSkeleton, BodyText, Boost, BoostBadge, BoostButton, BorderedContainer, Breadcrumb, BridgeAction, BridgeHeader, BridgeProperties, BridgeTransactionView, BrokenHeartIcon, BubblesIcon, Button, BuyNFTHeader, BuyNFTProperties, BuyNFTTransactionView, CSS_VARS, Calendar, CaptionText, CatSquareIcon, ChainLink, Checkmark1Icon, Checkmark2Icon, ChevronArrowIcon, ChevronDownSmallIcon, ChevronGrabberVerticalIcon, ChevronLargeDownIcon, ChevronLargeRightIcon, ChevronRightSmallIcon, ChevronTopIcon, ChevronTopSmallIcon, Chip, type ChipProps, CircleMinusIcon, CirclePlusIcon, CircleX, CircleXFilledIcon, ClockOutlineIcon, ClockSolidIcon, CoinsAddIcon, CoinsIcon, Collapse, CollapsibleMenu, CollectionIcon, ColorPaletteIcon, CompassRoundOutlinedIcon, CompassRoundSolidIcon, ConsoleIcon, Copy, CrossAnimatedIcon, DashboardFast, DescriptionBlocks, DetailsToolbar, DiscordIcon, DockIconAnalytics, DockIconCheckout, DockIconHelp, DockIconProfile, DockIconScan, DockIconSwap, DockSwapIcon, DollarOutlinedIcon, DollarSolidIcon, DotGrid1x3HorizontalIcon, DropdownMenu, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuTitle, type DropdownPosition, type DropdownStyles, EmojiMeh, EmojiSadIcon, EmptyHeartIcon, ErrorMessage, EthereumIcon, ExplosionIcon, EyeOpenIcon, FeeButton, FeesAction, type FeesActionProps, FeesLines, FeesTotal, FilledHeartIcon, FilterAscendingIcon, FilterButton, FilterIcon, FilterTimelineIcon, GasIcon, GhostIcon, GithubIcon, HashLink, HeadingText, HeartSmallIcon, HelpIcon, HistoryItem, type HistoryItemStatus, HomeIcon, IconButton, IconLabel, Image, ImageIcon, ImageSparkle, IncompleteAction, InfinityIcon, InfoBox, Inline, Input, InteractionHeader, InteractionProperties, InteractionTransactionView, Join, LightningIcon, LimitIcon, LinkIcon, List, ListItem, ListItemActionsButton, Loader, LoadingProvider, LoadingSkeleton, MEDIA_QUERIES, MainView, MaxIcon, Menu, MenuItem, MenuSwapIcon, MirrorIcon, Modal, ModalContent, ModalContentDivider, MoonIcon, NavigationBar, NotAllowedIcon, NumericInput, PathSquareIcon, PercentIcon, PieChartIcon, PipeSeparator, PlusIcon, PoopIcon, PowerIcon, ProductCard, ProfileHeader, ProfileHeaderBackground, PropertiesLayout, PropertyListItem, type PropertyListItemProps, PunkIcon, RangeInput, ReceiptBillIcon, ReceiveNFTAction, ReceiveTokensAction, RecipientView, RefreshIcon, ReorderIcon, RouteStep, STEP_ITEM_HEIGHT, SearchIcon, SectionTitle, SendTokensAction, SettingsButton, type SettingsButtonProps, type SettingsControl, SettingsGearIcon, SettingsItem, type SettingsItemProps, SettingsSlider, SettingsSliderIcon, type SettingsSliderProps, ShoppingBagIcon, SizeTransition, SmileIcon, SnapIcon, SortIcon, SparkleIcon, SparklesIcon, SquareArrowCenter, SquareArrowTopLeftIcon, SquareArrowTopRight2Icon, SquidConfigProvider, SquidLogo, type SquidTheme, StakeAction, StartAction, StocksIcon, SuccessAction, SunIcon, SunriseIcon, SwapAction, SwapConfiguration, SwapDetailsView, SwapErrorIcon, SwapHeader, type SwapHeaderProps, SwapIcon, SwapInputsIcon, SwapProgressView, SwapProgressViewHeader, SwapProperties, type SwapPropertiesProps, SwapState, type SwapStep, SwapStepItem, SwapStepSeparator, SwapStepsCollapsed, type SwapStepsCollapsedFooterButton, SwapSuccessIcon, SwapTransactionView, SwapWarningIcon, Switch, type SwitchProps, TagIcon, TagIconFilled, TextSkeleton, type ThemeType, ThumbsUp, Tick, TimeFliesIcon, Timeline, Timestamp, Toast, TokenPair, Tooltip, type TooltipProps, type TooltipThreshold, type TooltipWidth, TradingViewStepsIcon, TransactionAction, type TransactionActionProps, type TransactionActionType, TransactionFilters, TransactionHeader, TransactionHeaderLayout, type TransactionHeaderProps, type TransactionHeaderType, TransactionItem, TransactionProperties, type TransactionPropertiesProps, type TransactionPropertiesType, TransactionSearch, TransactionState, TransactionView, TransactionViewLayout, type TransactionViewProps, type TransactionViewType, Transfer, TranslateIcon, TriangleExclamation, UsdAmount, WalletFilledIcon, WalletIcon, WalletLink, WalletsView, WrapAction, XSocial, baseTailwindConfig, cn, darkTheme, lightTheme, linkActionTimelineProps, statusTextClassMap, useCollapsibleMenu, useDropdownMenu, useMediaQuery, useOnResize, useRect, useTimer, useVersion };
2703
+ export { type ActionButton, ActionLayout, ActionLineOutRow, ActionProperties, ActionRow, type ActionStatus, ActionStatusRow, ActionWrapper, AddressButton, type AllOrNone, AnimationWrapper, AppContainer, Approve, ApproveAction, ArrowBottomTopIcon, ArrowButton, ArrowCornerDownRightIcon, ArrowDownIcon, ArrowLeftIcon, ArrowOutOfBoxIcon, ArrowRightDownCircleIcon, ArrowRightDownIcon, ArrowRightIcon, ArrowRightUpCircleIcon, ArrowRightUpIcon, ArrowRotate, ArrowSplit, ArrowTriangle, ArrowUpIcon, ArrowWallDownIcon, ArrowsSwapIcon, AssetsButton, type AssetsButtonVariant, AssetsView, BackpackIcon, BadgeImage, BankIcon, type BaseActionProps, type BaseTransactionViewProps, BellAlarmIcon, BlockSkeleton, BodyText, Boost, BoostBadge, BoostButton, BorderedContainer, Breadcrumb, BridgeAction, BridgeHeader, BridgeProperties, BridgeTransactionView, BrokenHeartIcon, BubblesIcon, Button, BuyNFTHeader, BuyNFTProperties, BuyNFTTransactionView, CSS_VARS, Calendar, CaptionText, CatSquareIcon, ChainLink, Checkmark1Icon, Checkmark2Icon, ChevronArrowIcon, ChevronDownSmallIcon, ChevronGrabberVerticalIcon, ChevronLargeDownIcon, ChevronLargeRightIcon, ChevronRightSmallIcon, ChevronTopIcon, ChevronTopSmallIcon, Chip, type ChipProps, CircleMinusIcon, CirclePlusIcon, CircleX, CircleXFilledIcon, ClockOutlineIcon, ClockSolidIcon, CodeBracketsIcon, CodeSolidSquareIcon, CoinsAddIcon, CoinsIcon, Collapse, CollapsibleMenu, CollectionIcon, ColorPaletteIcon, CommandIcon, CompassRoundOutlinedIcon, CompassRoundSolidIcon, ConsoleIcon, Copy, CopyIcon, CrossAnimatedIcon, DashboardFast, DescriptionBlocks, DetailsToolbar, DiscordIcon, DockIconAnalytics, DockIconCheckout, DockIconHelp, DockIconProfile, DockIconScan, DockIconSwap, DockSwapIcon, DollarOutlinedIcon, DollarSolidIcon, DotGrid1x3HorizontalIcon, DropdownMenu, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuTitle, type DropdownPosition, type DropdownStyles, EmojiMeh, EmojiSadIcon, EmptyHeartIcon, ErrorMessage, EthereumIcon, ExplosionIcon, EyeOpenIcon, FeeButton, FeesAction, type FeesActionProps, FeesLines, FeesTotal, FileDownloadIcon, FilledHeartIcon, FilterAscendingIcon, FilterButton, FilterIcon, FilterTimelineIcon, GasIcon, GhostIcon, GithubIcon, HashLink, HeadingText, HeartSmallIcon, HelpIcon, HistoryItem, type HistoryItemStatus, HomeIcon, IconButton, IconLabel, Image, ImageIcon, ImageSparkle, IncompleteAction, InfinityIcon, InfoBox, Inline, Input, InteractionHeader, InteractionProperties, InteractionTransactionView, Join, LaptopIcon, LightningIcon, LimitIcon, LinkIcon, List, ListItem, ListItemActionsButton, Loader, LoadingProvider, LoadingSkeleton, MEDIA_QUERIES, MainView, MaxIcon, Menu, MenuItem, MenuSwapIcon, MirrorIcon, Modal, ModalContent, ModalContentDivider, MoonIcon, NavigationBar, NotAllowedIcon, NumericInput, PathSquareIcon, PercentIcon, PhoneIcon, PieChartIcon, PipeSeparator, PlusIcon, PoopIcon, PowerIcon, ProductCard, ProfileHeader, ProfileHeaderBackground, PropertiesLayout, PropertyListItem, type PropertyListItemProps, PunkIcon, RangeInput, ReceiptBillIcon, ReceiveNFTAction, ReceiveTokensAction, RecipientView, RefreshIcon, ReorderIcon, RouteStep, STEP_ITEM_HEIGHT, SearchIcon, SectionTitle, SendTokensAction, SettingsButton, type SettingsButtonProps, type SettingsControl, SettingsGearIcon, SettingsItem, type SettingsItemProps, SettingsSlider, SettingsSliderIcon, type SettingsSliderProps, ShoppingBagIcon, SizeTransition, SmileIcon, SnapIcon, SortIcon, SparkleIcon, SparklesIcon, SquareArrowCenter, SquareArrowTopLeftIcon, SquareArrowTopRight2Icon, SquidLogo, type SquidTheme, StakeAction, StartAction, StocksIcon, SuccessAction, SunIcon, SunOutlinedIcon, SunriseIcon, SwapAction, SwapConfiguration, SwapDetailsView, SwapErrorIcon, SwapHeader, type SwapHeaderProps, SwapIcon, SwapInputsIcon, SwapProgressView, SwapProgressViewHeader, SwapProperties, type SwapPropertiesProps, SwapState, type SwapStep, SwapStepItem, SwapStepSeparator, SwapStepsCollapsed, type SwapStepsCollapsedFooterButton, SwapSuccessIcon, SwapTransactionView, SwapWarningIcon, Switch, type SwitchProps, TagIcon, TagIconFilled, TextSkeleton, ThemePreference, ThemeProvider, type ThemeType, ThumbsUp, Tick, TimeFliesIcon, Timeline, Timestamp, Toast, TokenPair, Tooltip, type TooltipProps, type TooltipThreshold, type TooltipWidth, TradingViewStepsIcon, TransactionAction, type TransactionActionProps, type TransactionActionType, TransactionFilters, TransactionHeader, TransactionHeaderLayout, type TransactionHeaderProps, type TransactionHeaderType, TransactionItem, TransactionProperties, type TransactionPropertiesProps, type TransactionPropertiesType, TransactionSearch, TransactionState, TransactionView, TransactionViewLayout, type TransactionViewProps, type TransactionViewType, Transfer, TranslateIcon, TriangleExclamation, UsdAmount, WalletFilledIcon, WalletIcon, WalletLink, WalletsView, WrapAction, XSocial, baseTailwindConfig, cn, darkTheme, lightTheme, linkActionTimelineProps, statusTextClassMap, useCollapsibleMenu, useDropdownMenu, useMediaQuery, useOnResize, useRect, useTimer, useUserTheme, useVersion };
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "url": "git+https://github.com/0xsquid/squid-ui.git"
6
6
  },
7
7
  "description": "Squid's UI components",
8
- "version": "0.27.1",
8
+ "version": "0.27.2-beta.0",
9
9
  "author": "",
10
10
  "license": "MIT",
11
11
  "resolutions": {
@@ -73,6 +73,7 @@
73
73
  "autoprefixer": "10.4.18",
74
74
  "concurrently": "8.2.2",
75
75
  "eslint": "^8.0.1",
76
+ "eslint-config-prettier": "9.1.0",
76
77
  "eslint-config-standard-with-typescript": "^43.0.1",
77
78
  "eslint-plugin-import": "^2.25.2",
78
79
  "eslint-plugin-n": "^15.0.0 || ^16.0.0 ",
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- import "../styles/compiled-tailwind.css";
3
- import { ThemeType } from "../types/components";
4
- import { SquidTheme } from "../types/config";
5
- export declare function SquidConfigProvider({ theme, children, themeType, }: {
6
- theme?: SquidTheme;
7
- children?: React.ReactNode;
8
- themeType?: ThemeType;
9
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- import "../styles/compiled-tailwind.css";
3
- import { ThemeType } from "../types/components";
4
- import { SquidTheme } from "../types/config";
5
- export declare function SquidConfigProvider({ theme, children, themeType, }: {
6
- theme?: SquidTheme;
7
- children?: React.ReactNode;
8
- themeType?: ThemeType;
9
- }): import("react/jsx-runtime").JSX.Element;