@deframe-sdk/components 0.1.55 → 0.1.56

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.mjs CHANGED
@@ -90,7 +90,7 @@ function ActionButton(_a) {
90
90
  );
91
91
  }
92
92
  var CloseButton = ({ onClick, testId, ariaLabel = "Close", className }) => {
93
- const baseClasses = "w-12 h-12 rounded-[var(--deframe-widget-size-radius-full)] flex items-center justify-center text-[color:var(--deframe-widget-color-text-secondary)] hover:text-[color:var(--deframe-widget-color-brand-primary)] transition-colors cursor-pointer";
93
+ const baseClasses = "w-12 h-12 rounded-[var(--deframe-widget-size-radius-sm)] flex items-center justify-center text-[color:var(--deframe-widget-color-text-secondary)] hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_92%,transparent)] transition-[background] duration-150 cursor-pointer";
94
94
  return /* @__PURE__ */ jsx(
95
95
  "button",
96
96
  {
@@ -6438,8 +6438,8 @@ var SwapFromCardViewSimple = ({
6438
6438
  {
6439
6439
  "data-test-id": "swap-from-card-simple",
6440
6440
  className: wrapperClasses,
6441
- onMouseEnter: handleMouseEnter,
6442
- onMouseLeave: handleMouseLeave,
6441
+ onMouseEnter: selectedToken ? handleMouseEnter : void 0,
6442
+ onMouseLeave: selectedToken ? handleMouseLeave : void 0,
6443
6443
  children: [
6444
6444
  /* @__PURE__ */ jsxs(
6445
6445
  "div",
@@ -11394,7 +11394,7 @@ var EarnTokenSelectorSimpleView = ({
11394
11394
  "flex-shrink-0"
11395
11395
  ].join(" ");
11396
11396
  const stateClasses = {
11397
- interactive: "cursor-pointer hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_72%,transparent)]",
11397
+ interactive: "cursor-pointer hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_92%,transparent)]",
11398
11398
  static: "cursor-default"
11399
11399
  };
11400
11400
  const selectorClasses = twMerge(
@@ -11833,15 +11833,20 @@ var EarnDepositFormViewSimple = ({
11833
11833
  const hasError = !!insufficientBalanceMessage || !!bytecodeErrorMessage;
11834
11834
  const isSubmitDisabled = !hasToken || submitDisabled || !amountValue || amountValue === "0" || amountValue === "";
11835
11835
  const [cardHovered, setCardHovered] = React6__default.useState(false);
11836
- const hideTimerRef = React6__default.useRef(void 0);
11837
- function handleHoverStart() {
11838
- clearTimeout(hideTimerRef.current);
11836
+ const hideTimerRef = React6__default.useRef(null);
11837
+ const handleHoverStart = React6__default.useCallback(() => {
11838
+ if (hideTimerRef.current) {
11839
+ clearTimeout(hideTimerRef.current);
11840
+ hideTimerRef.current = null;
11841
+ }
11839
11842
  setCardHovered(true);
11840
- }
11841
- function handleHoverEnd() {
11843
+ }, []);
11844
+ const handleHoverEnd = React6__default.useCallback(() => {
11842
11845
  hideTimerRef.current = setTimeout(() => setCardHovered(false), 150);
11843
- }
11844
- React6__default.useEffect(() => () => clearTimeout(hideTimerRef.current), []);
11846
+ }, []);
11847
+ React6__default.useEffect(() => () => {
11848
+ if (hideTimerRef.current) clearTimeout(hideTimerRef.current);
11849
+ }, []);
11845
11850
  const panelBaseClasses = [
11846
11851
  "relative flex flex-col overflow-hidden w-[420px]",
11847
11852
  "rounded-[var(--deframe-widget-size-radius-md)]",
@@ -12013,13 +12018,11 @@ var EarnDepositFormViewSimple = ({
12013
12018
  {
12014
12019
  "data-slot": "deposit-simple-chips-row",
12015
12020
  "data-test-id": "earn-deposit-form-view-simple-chips-row",
12016
- initial: { opacity: 0, height: 0, marginTop: 0 },
12017
- animate: { opacity: 1, height: "auto", marginTop: "var(--deframe-widget-size-gap-sm)" },
12018
- exit: { opacity: 0, height: 0, marginTop: 0 },
12021
+ initial: { opacity: 0, height: 0 },
12022
+ animate: { opacity: 1, height: "auto" },
12023
+ exit: { opacity: 0, height: 0 },
12019
12024
  transition: { duration: 0.15, ease: "easeOut" },
12020
- style: { overflow: "hidden" },
12021
- onMouseEnter: handleHoverStart,
12022
- onMouseLeave: handleHoverEnd,
12025
+ className: "overflow-hidden mt-[var(--deframe-widget-size-gap-sm)]",
12023
12026
  children: /* @__PURE__ */ jsx(
12024
12027
  EarnPercentageButtonsSimpleView,
12025
12028
  {
@@ -12050,10 +12053,8 @@ var EarnDepositFormViewSimple = ({
12050
12053
  "text-[15px] text-[color:var(--deframe-widget-color-text-secondary)]",
12051
12054
  "border-[color:var(--deframe-widget-color-border-secondary)]",
12052
12055
  "outline-none",
12053
- "transition-[background,color,border-color] duration-150",
12054
- "hover:opacity-100",
12055
- "hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_60%,transparent)]",
12056
- "hover:text-[color:var(--deframe-widget-color-text-primary)]"
12056
+ "transition-[background] duration-150",
12057
+ "hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_92%,transparent)]"
12057
12058
  ].join(" "),
12058
12059
  onClick: onBack,
12059
12060
  "aria-label": cancelLabel,
@@ -14300,10 +14301,8 @@ var OnchainDepositFormSimpleView = ({
14300
14301
  "text-[15px] text-[color:var(--deframe-widget-color-text-secondary)]",
14301
14302
  "border-[color:var(--deframe-widget-color-border-secondary)]",
14302
14303
  "outline-none",
14303
- "transition-[background,color,border-color] duration-150",
14304
- "hover:opacity-100",
14305
- "hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_60%,transparent)]",
14306
- "hover:text-[color:var(--deframe-widget-color-text-primary)]"
14304
+ "transition-[background] duration-150",
14305
+ "hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_92%,transparent)]"
14307
14306
  ].join(" "),
14308
14307
  onClick: onBack,
14309
14308
  "aria-label": labels.backLabel,
@@ -14848,15 +14847,20 @@ var OnchainWithdrawFormSimpleView = ({
14848
14847
  const hasAddressError = !!transferError;
14849
14848
  const isSubmitDisabledInternal = !hasToken || isSubmitDisabled || isProcessing || !amount || amount === "0" || amount === "" || !destinationAddress.trim();
14850
14849
  const [cardHovered, setCardHovered] = React6__default.useState(false);
14851
- const hideTimerRef = React6__default.useRef(void 0);
14852
- function handleHoverStart() {
14853
- clearTimeout(hideTimerRef.current);
14850
+ const hideTimerRef = React6__default.useRef(null);
14851
+ const handleHoverStart = React6__default.useCallback(() => {
14852
+ if (hideTimerRef.current) {
14853
+ clearTimeout(hideTimerRef.current);
14854
+ hideTimerRef.current = null;
14855
+ }
14854
14856
  setCardHovered(true);
14855
- }
14856
- function handleHoverEnd() {
14857
+ }, []);
14858
+ const handleHoverEnd = React6__default.useCallback(() => {
14857
14859
  hideTimerRef.current = setTimeout(() => setCardHovered(false), 150);
14858
- }
14859
- React6__default.useEffect(() => () => clearTimeout(hideTimerRef.current), []);
14860
+ }, []);
14861
+ React6__default.useEffect(() => () => {
14862
+ if (hideTimerRef.current) clearTimeout(hideTimerRef.current);
14863
+ }, []);
14860
14864
  const panelBaseClasses = [
14861
14865
  "relative flex flex-col overflow-hidden w-[420px]",
14862
14866
  "rounded-[var(--deframe-widget-size-radius-md)]",
@@ -17150,15 +17154,20 @@ var OfframpInputFormSimpleView = ({
17150
17154
  localStorage.setItem(STORAGE_KEY, type);
17151
17155
  }
17152
17156
  const [cardHovered, setCardHovered] = React6__default.useState(false);
17153
- const hideTimerRef = React6__default.useRef(void 0);
17154
- function handleHoverStart() {
17155
- clearTimeout(hideTimerRef.current);
17157
+ const hideTimerRef = React6__default.useRef(null);
17158
+ const handleHoverStart = React6__default.useCallback(() => {
17159
+ if (hideTimerRef.current) {
17160
+ clearTimeout(hideTimerRef.current);
17161
+ hideTimerRef.current = null;
17162
+ }
17156
17163
  setCardHovered(true);
17157
- }
17158
- function handleHoverEnd() {
17164
+ }, []);
17165
+ const handleHoverEnd = React6__default.useCallback(() => {
17159
17166
  hideTimerRef.current = setTimeout(() => setCardHovered(false), 150);
17160
- }
17161
- React6__default.useEffect(() => () => clearTimeout(hideTimerRef.current), []);
17167
+ }, []);
17168
+ React6__default.useEffect(() => () => {
17169
+ if (hideTimerRef.current) clearTimeout(hideTimerRef.current);
17170
+ }, []);
17162
17171
  const hasAmountError = !!amountWarningMessage;
17163
17172
  const hasPixKeyError = !!error || !!offrampError;
17164
17173
  const isSubmitDisabledInternal = submitDisabled || !amount || amount === "0" || !pixKey.trim();
@@ -17210,10 +17219,8 @@ var OfframpInputFormSimpleView = ({
17210
17219
  "text-[15px] text-[color:var(--deframe-widget-color-text-secondary)]",
17211
17220
  "border-[color:var(--deframe-widget-color-border-secondary)]",
17212
17221
  "outline-none",
17213
- "transition-[background,color,border-color] duration-150",
17214
- "hover:opacity-100",
17215
- "hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_60%,transparent)]",
17216
- "hover:text-[color:var(--deframe-widget-color-text-primary)]"
17222
+ "transition-[background] duration-150",
17223
+ "hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_92%,transparent)]"
17217
17224
  ].join(" ");
17218
17225
  const submitButtonClasses = [
17219
17226
  "flex-1 h-12 rounded-[var(--deframe-widget-size-radius-sm)]",
@@ -17358,13 +17365,11 @@ var OfframpInputFormSimpleView = ({
17358
17365
  {
17359
17366
  "data-slot": "offramp-input-form-simple-chips-row",
17360
17367
  "data-test-id": "offramp-input-form-simple-view-chips-row",
17361
- initial: { opacity: 0, height: 0, marginTop: 0 },
17362
- animate: { opacity: 1, height: "auto", marginTop: "var(--deframe-widget-size-gap-sm)" },
17363
- exit: { opacity: 0, height: 0, marginTop: 0 },
17368
+ initial: { opacity: 0, height: 0 },
17369
+ animate: { opacity: 1, height: "auto" },
17370
+ exit: { opacity: 0, height: 0 },
17364
17371
  transition: { duration: 0.15, ease: "easeOut" },
17365
- style: { overflow: "hidden" },
17366
- onMouseEnter: handleHoverStart,
17367
- onMouseLeave: handleHoverEnd,
17372
+ className: "overflow-hidden mt-[var(--deframe-widget-size-gap-sm)]",
17368
17373
  children: /* @__PURE__ */ jsx(
17369
17374
  EarnPercentageButtonsSimpleView,
17370
17375
  {