@swype-org/react-sdk 0.1.211 → 0.1.213

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.d.cts CHANGED
@@ -665,12 +665,14 @@ declare function PoweredByFooter(): react_jsx_runtime.JSX.Element;
665
665
  interface PrimaryButtonProps {
666
666
  children: ReactNode;
667
667
  onClick?: () => void;
668
+ /** When set, renders as an `<a>` tag instead of `<button>`. */
669
+ href?: string;
668
670
  disabled?: boolean;
669
671
  loading?: boolean;
670
672
  /** Optional icon element rendered left of the label */
671
673
  icon?: ReactNode;
672
674
  }
673
- declare function PrimaryButton({ children, onClick, disabled, loading, icon }: PrimaryButtonProps): react_jsx_runtime.JSX.Element;
675
+ declare function PrimaryButton({ children, onClick, href, disabled, loading, icon }: PrimaryButtonProps): react_jsx_runtime.JSX.Element;
674
676
 
675
677
  interface OutlineButtonProps {
676
678
  children: ReactNode;
package/dist/index.d.ts CHANGED
@@ -665,12 +665,14 @@ declare function PoweredByFooter(): react_jsx_runtime.JSX.Element;
665
665
  interface PrimaryButtonProps {
666
666
  children: ReactNode;
667
667
  onClick?: () => void;
668
+ /** When set, renders as an `<a>` tag instead of `<button>`. */
669
+ href?: string;
668
670
  disabled?: boolean;
669
671
  loading?: boolean;
670
672
  /** Optional icon element rendered left of the label */
671
673
  icon?: ReactNode;
672
674
  }
673
- declare function PrimaryButton({ children, onClick, disabled, loading, icon }: PrimaryButtonProps): react_jsx_runtime.JSX.Element;
675
+ declare function PrimaryButton({ children, onClick, href, disabled, loading, icon }: PrimaryButtonProps): react_jsx_runtime.JSX.Element;
674
676
 
675
677
  interface OutlineButtonProps {
676
678
  children: ReactNode;
package/dist/index.js CHANGED
@@ -2507,20 +2507,32 @@ var rowStyle = {
2507
2507
  alignItems: "center",
2508
2508
  gap: 6
2509
2509
  };
2510
- function PrimaryButton({ children, onClick, disabled, loading, icon }) {
2510
+ function PrimaryButton({ children, onClick, href, disabled, loading, icon }) {
2511
2511
  const { tokens } = useBlinkConfig();
2512
2512
  const isDisabled = disabled || loading;
2513
- return /* @__PURE__ */ jsxs(
2513
+ const content = /* @__PURE__ */ jsxs(Fragment, { children: [
2514
+ icon && /* @__PURE__ */ jsx("span", { style: iconWrapStyle, children: icon }),
2515
+ loading ? "Please wait..." : children
2516
+ ] });
2517
+ if (href && !isDisabled) {
2518
+ return /* @__PURE__ */ jsx(
2519
+ "a",
2520
+ {
2521
+ href,
2522
+ onClick,
2523
+ style: linkButtonStyle(tokens),
2524
+ children: content
2525
+ }
2526
+ );
2527
+ }
2528
+ return /* @__PURE__ */ jsx(
2514
2529
  "button",
2515
2530
  {
2516
2531
  type: "button",
2517
2532
  onClick,
2518
2533
  disabled: isDisabled,
2519
2534
  style: buttonStyle(tokens, isDisabled),
2520
- children: [
2521
- icon && /* @__PURE__ */ jsx("span", { style: iconWrapStyle, children: icon }),
2522
- loading ? "Please wait..." : children
2523
- ]
2535
+ children: content
2524
2536
  }
2525
2537
  );
2526
2538
  }
@@ -2543,6 +2555,10 @@ var buttonStyle = (tokens, disabled) => ({
2543
2555
  justifyContent: "center",
2544
2556
  gap: 8
2545
2557
  });
2558
+ var linkButtonStyle = (tokens) => ({
2559
+ ...buttonStyle(tokens, false),
2560
+ textDecoration: "none"
2561
+ });
2546
2562
  var iconWrapStyle = {
2547
2563
  display: "flex",
2548
2564
  alignItems: "center"
@@ -4980,10 +4996,13 @@ function OpenWalletScreen({
4980
4996
  {
4981
4997
  footer: /* @__PURE__ */ jsxs("div", { style: footerContentStyle, children: [
4982
4998
  error && /* @__PURE__ */ jsx(InfoBanner, { children: error }),
4983
- !loading && /* @__PURE__ */ jsxs(PrimaryButton, { onClick: handleOpen, children: [
4999
+ !loading && (isCustomSchemeUri(deeplinkUri) ? /* @__PURE__ */ jsxs(PrimaryButton, { onClick: handleOpen, children: [
4984
5000
  "Open ",
4985
5001
  displayName
4986
- ] }),
5002
+ ] }) : /* @__PURE__ */ jsxs(PrimaryButton, { href: deeplinkUri, children: [
5003
+ "Open ",
5004
+ displayName
5005
+ ] })),
4987
5006
  error && onRetryStatus && /* @__PURE__ */ jsx(OutlineButton, { onClick: onRetryStatus, children: "Retry status check" }),
4988
5007
  /* @__PURE__ */ jsx("p", { style: hintStyle(tokens.textMuted), children: loading ? "Preparing authorization..." : error ? "Retry the status check after returning to the browser, or reopen your wallet if needed." : "If your wallet didn't open automatically, tap the button above" }),
4989
5008
  /* @__PURE__ */ jsx(PoweredByFooter, {})