Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/storybook/src/components/ui/badge.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type VariantProps, cva } from "class-variance-authority";
import * as React from "react";
import type * as React from "react";

import { cn } from "#lib/utils";

Expand Down
8 changes: 4 additions & 4 deletions apps/storybook/src/components/ui/form.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as LabelPrimitive from "@radix-ui/react-label";
import type * as LabelPrimitive from "@radix-ui/react-label";
import { Slot } from "@radix-ui/react-slot";
import * as React from "react";
import {
Controller,
ControllerProps,
FieldPath,
FieldValues,
type ControllerProps,
type FieldPath,
type FieldValues,
FormProvider,
useFormContext,
} from "react-hook-form";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { useAttestationEasSdk } from "@geist/ui-react/hooks/eas/sdk/use-attestat
import { EAS_CONTRACT_ADDRESS } from "@geist/ui-react/lib/eas/abi";
import { SCHEMA_BY_NAME } from "@geist/ui-react/lib/eas/attest.fixture";
import { NO_EXPIRATION } from "@geist/ui-react/lib/eas/request";
import { SchemaItem, createEAS } from "@geist/ui-react/lib/eas/sdk/eas";
import { type SchemaItem, createEAS } from "@geist/ui-react/lib/eas/sdk/eas";
import { createTestEthersSigner } from "@geist/ui-react/lib/test-utils-isomorphic";
import type { Meta, StoryObj } from "@storybook/react";
import { encodeBytes32String } from "ethers";
import { Chain, Hex, zeroHash } from "viem";
import { type Chain, type Hex, zeroHash } from "viem";
import { mainnet, optimism, optimismSepolia, sepolia } from "viem/chains";
import { withToaster } from "../decorators/toaster";
import { withWalletControl } from "../decorators/wallet-control";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@ import {
SCHEMA_BY_NAME,
SCHEMA_FIXTURE_IS_A_FRIEND,
} from "@geist/ui-react/lib/eas/attest.fixture";
import { AttestationRequestData } from "@geist/ui-react/lib/eas/viem/onchain";
import type { AttestationRequestData } from "@geist/ui-react/lib/eas/viem/onchain";
import type { Meta, StoryObj } from "@storybook/react";
import { Account, Address, Chain, Hex, stringToHex, zeroHash } from "viem";
import {
type Account,
type Address,
type Chain,
type Hex,
stringToHex,
zeroHash,
} from "viem";
import { sepolia } from "viem/chains";
import { withToaster } from "../decorators/toaster";
import { withMockAccount, withWagmiProvider } from "../decorators/wagmi";
Expand Down
4 changes: 2 additions & 2 deletions apps/storybook/src/stories/codec/CodecForm.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { base16 as base16S, base64 as base64S } from "@scure/base";
import { Atom, atom, useAtom } from "jotai";
import { Atom, type atom, useAtom } from "jotai";
import { base16 } from "multiformats/bases/base16";
import { base64 } from "multiformats/bases/base64";
import { CID, MultibaseEncoder } from "multiformats/cid";
import { CID, type MultibaseEncoder } from "multiformats/cid";
import * as json from "multiformats/codecs/json";
import { sha256 } from "multiformats/hashes/sha2";
import { Suspense, useEffect, useMemo, useState } from "react";
Expand Down
3 changes: 2 additions & 1 deletion apps/storybook/src/stories/filecoin/UploadDropzone.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Upload, X } from "lucide-react";
import React, { useState, useRef, useCallback } from "react";
import type React from "react";
import { useCallback, useRef, useState } from "react";
import { Alert, AlertDescription } from "#components/ui/alert";
import { Button } from "#components/ui/button";
import { Card } from "#components/ui/card";
Expand Down
8 changes: 6 additions & 2 deletions apps/storybook/src/stories/filecoin/UploadForm.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@ import {
} from "@geist/ui-react/lib/filecoin/storacha/isomorphic";

import { withToaster } from "../decorators/toaster";
import { UploadFilesParams, UploadForm, UploadFormType } from "./UploadForm";
import {
type UploadFilesParams,
UploadForm,
UploadFormType,
} from "./UploadForm";
import { uploadSuccessToast } from "./upload-toast";

import config from "@geist/domain/config";
import { IpfsGateway } from "@geist/ui-react/lib/filecoin/gateway";
import { FileLike } from "@web3-storage/w3up-client/types";
import type { FileLike } from "@web3-storage/w3up-client/types";

const meta = {
title: "Filecoin/UploadForm",
Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/src/stories/filecoin/UploadForm.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { zodResolver } from "@hookform/resolvers/zod";
import { useForm } from "react-hook-form";
import { ZodType, z } from "zod";
import { type ZodType, z } from "zod";

import { FileInputField } from "@geist/ui-react/components/file/file-input-field";
import { toast } from "@geist/ui-react/hooks/shadcn/use-toast";
Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/src/stories/privy/privy-login.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
PrivyLogin,
PrivyLoginProvider,
} from "@geist/ui-react/components/privy/privy-login";
import { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react";

interface PrivyLoginProps {
appId: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { Meta, StoryObj } from "@storybook/react";
import { Atom, atom, useAtom } from "jotai";
import { type Atom, atom, useAtom } from "jotai";

import { TYPED_DATA } from "@geist/domain/signature/type-data";
import { SignatureForm } from "@geist/ui-react/components/signature/signature-form";
import { useMemo } from "react";
import {
http,
Account,
type Account,
createPublicClient,
createWalletClient,
verifyMessage,
Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/src/stories/token/TokenChip.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TokenChip } from "@geist/ui-react/components/token/token-chip";
import { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react";
import { mainnet, optimismSepolia } from "viem/chains";
import { withWagmiProvider } from "../decorators/wagmi";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TokenChipWithInfo } from "@geist/ui-react/components/token/token-chip-with-info";
import { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react";

const meta = {
title: "OnchainInfo/TokenChipWithInfo",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TransferButton } from "@geist/ui-react/components/transfer/transfer-button";
import { Meta, StoryObj } from "@storybook/react";
import type { Meta, StoryObj } from "@storybook/react";
import { useMemo, useState } from "react";
import type { Account } from "viem";
import { Label } from "#components/ui/label";
Expand Down
5 changes: 4 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
"linter": {
"enabled": true,
"rules": {
"recommended": false
"recommended": false,
"style": {
"useImportType": "info"
}
}
},
"javascript": {
Expand Down
2 changes: 1 addition & 1 deletion packages/domain/src/signature/type-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// and fixture from [micro-eth-signer](https://github.com/debuggingfuture/micro-eth-signer/blob/main/test/typed-data.test.js)

import { EIP712Domain } from "micro-eth-signer/typed-data";
import { TypedData } from "viem";
import type { TypedData } from "viem";

export const EIP721_TYPES = {
Person: [
Expand Down
4 changes: 2 additions & 2 deletions packages/domain/src/signature/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ethers } from "ethers";
import {
Address,
Hex,
type Address,
type Hex,
hashMessage,
hashTypedData,
recoverAddress,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Address } from "viem";
import type { Address } from "viem";
import { useChainId } from "wagmi";
import { Badge } from "#components/shadcn/badge";
import { useGetAttestations } from "#hooks/eas/use-get-attestations";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Label } from "@radix-ui/react-label";
import { format } from "date-fns";
import { useMemo } from "react";
import { type Address, Hex } from "viem";
import type { Address, Hex } from "viem";
import { mainnet } from "viem/chains";
import { useChainId } from "wagmi";
import {
Expand All @@ -17,7 +17,7 @@ import { Skeleton } from "#components/shadcn/skeleton";
import { useGetAttestationWithUid } from "#hooks/eas/use-get-attestation-with-uid.js";
import { getShortHex } from "#lib/utils/hex";
import { AttestationSchemaBadge } from "./attestation-schema-badge";
import { AttestationMeta, asAttestationMeta } from "./attestations";
import { type AttestationMeta, asAttestationMeta } from "./attestations";

const AttestationCardContent = ({
chainId,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ColumnDef } from "@tanstack/react-table";
import type { ColumnDef } from "@tanstack/react-table";
import { useMemo } from "react";
import { type Address, fromBlobs } from "viem";
import { mainnet } from "viem/chains";
Expand All @@ -8,7 +8,7 @@ import { useGetAttestations } from "#hooks/eas/use-get-attestations";
import { getEasscanAttestationUrl } from "#lib/eas/easscan";
import { truncate } from "#lib/utils/hex";
import { AttestationSchemaBadge } from "./attestation-schema-badge";
import { AttestationMeta } from "./attestations";
import type { AttestationMeta } from "./attestations";
import { asAttestationMeta } from "./attestations";

// This type is used to define the shape of our data.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { format, formatDistance, subDays } from "date-fns";
import type { Address } from "viem";
import { AttestationQueryResult } from "#hooks/eas/use-get-attestations";
import type { AttestationQueryResult } from "#hooks/eas/use-get-attestations";

// TODO sync graphql type
export const asAttestationMeta = (attestation: AttestationQueryResult) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import config from "@geist/domain/config";
import { Loader2, Upload } from "lucide-react";
import { Button } from "#components/shadcn/button";
import { useUploadAttestationWithLighthouse } from "#hooks/eas/use-upload-attestation";
import { UploadAttestationParams } from "./attestations";
import type { UploadAttestationParams } from "./attestations";

// this is a controlled component that depends on an external state
export function UploadAttestation(props: UploadAttestationParams) {
Expand Down
4 changes: 2 additions & 2 deletions packages/ui-react/src/components/data-table.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
ColumnDef,
SortingState,
type ColumnDef,
type SortingState,
flexRender,
getCoreRowModel,
getPaginationRowModel,
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-react/src/components/identity/name.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AddressOrEns } from "#hooks/ens/efp";
import type { AddressOrEns } from "#hooks/ens/efp";
import { useEnsData } from "#hooks/ens/use-efp-api";

export const Name = ({ addressOrEns }: { addressOrEns: AddressOrEns }) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-react/src/components/privy/privy-login.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PrivyProvider, usePrivy } from "@privy-io/react-auth";
import { PropsWithChildren } from "react";
import type { PropsWithChildren } from "react";
import { Button } from "#components/shadcn/button";

export function PrivyLoginProvider({
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-react/src/components/shadcn/badge.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type VariantProps, cva } from "class-variance-authority";
import * as React from "react";
import type * as React from "react";

import { cn } from "#lib/shadcn/utils";

Expand Down
8 changes: 4 additions & 4 deletions packages/ui-react/src/components/shadcn/form.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as LabelPrimitive from "@radix-ui/react-label";
import type * as LabelPrimitive from "@radix-ui/react-label";
import { Slot } from "@radix-ui/react-slot";
import * as React from "react";
import {
Controller,
ControllerProps,
FieldPath,
FieldValues,
type ControllerProps,
type FieldPath,
type FieldValues,
FormProvider,
useFormContext,
} from "react-hook-form";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { atom, useAtom } from "jotai";
import { type atom, useAtom } from "jotai";
import type { Hex } from "viem";

import { zodResolver } from "@hookform/resolvers/zod";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect, useMemo, useState } from "react";
import { AddressOrEns, EfpFollowerWithName } from "#hooks/ens/efp";
import type { AddressOrEns, EfpFollowerWithName } from "#hooks/ens/efp";
import { getNames } from "#hooks/ens/use-ensjs";
import { FollowerListScrollable } from "./follower-list";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ScrollArea } from "#components/shadcn/scroll-area";
import { Separator } from "#components/shadcn/separator";
import { EfpFollowerWithName } from "#hooks/ens/efp";
import type { EfpFollowerWithName } from "#hooks/ens/efp";

export const FollowerListScrollable = ({
followers,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Card, CardContent } from "#components/shadcn/card";
import { useEnsData, useUserStats } from "#hooks/ens/use-efp-api";

import { useEffect, useState } from "react";
import { AddressOrEns } from "#hooks/ens/efp";
import type { AddressOrEns } from "#hooks/ens/efp";

export type NameWithEfpFollowerCount = { name: string; followers: number };

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
TokenChipWithInfo,
TokenChipWithInfoProps,
type TokenChipWithInfoProps,
} from "@geist/ui-react/components/token/token-chip-with-info";
import { render, screen } from "@testing-library/react";
import { describe, expect, it, vi } from "vitest";
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-react/src/components/token/token-chip.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Address, Chain, erc20Abi } from "viem";
import { type Address, type Chain, erc20Abi } from "viem";
import { mainnet } from "viem/chains";
import { useConfig } from "wagmi";
import { useTokenInfo } from "./token";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Token } from "@geist/domain/token/token";
import { TransactionMeta } from "@geist/domain/transaction/transaction";
import type { TransactionMeta } from "@geist/domain/transaction/transaction";
import { Label } from "@radix-ui/react-label";
import { AddressBadge } from "#components/identity/address-badge";
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { Skeleton } from "#components/shadcn/skeleton";
import { useGetTransactions } from "#hooks/data/use-blockscout";
import { GetTxnByFilterQuery, asTransactionMeta } from "#lib/blockscout/api";
import {
type GetTxnByFilterQuery,
asTransactionMeta,
} from "#lib/blockscout/api";
import { Explorer } from "#lib/explorer/url";
import { TransactionTable } from "./transaction-table";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { resolveChainById } from "@geist/domain/chain/chain-resolver";
import { TransactionMeta } from "@geist/domain/transaction/transaction";
import { ColumnDef } from "@tanstack/react-table";
import type { TransactionMeta } from "@geist/domain/transaction/transaction";
import type { ColumnDef } from "@tanstack/react-table";
import { ArrowUpDown, ExternalLink } from "lucide-react";
import { formatEther } from "viem";
import { DataTable } from "#components/data-table";
Expand Down
13 changes: 8 additions & 5 deletions packages/ui-react/src/components/transfer/transfer-button.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { MutationOptions } from "@tanstack/react-query";
import { Config, SendTransactionErrorType } from "@wagmi/core";
import type { MutationOptions } from "@tanstack/react-query";
import type { Config, SendTransactionErrorType } from "@wagmi/core";
import { Loader2 } from "lucide-react";
import { Account, parseEther } from "viem";
import { type Account, parseEther } from "viem";
import { useSendTransaction } from "wagmi";
import { SendTransactionData, SendTransactionVariables } from "wagmi/query";
import { Button, ButtonProps } from "#components/shadcn/button";
import type {
SendTransactionData,
SendTransactionVariables,
} from "wagmi/query";
import { Button, type ButtonProps } from "#components/shadcn/button";

type TransferButtonProps = {
/** Amount to transfer in ETH */
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-react/src/hooks/data/use-blockscout.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { TransactionMeta } from "@geist/domain/transaction/transaction";
import { useQuery } from "@tanstack/react-query";
import {
GetTxnByFilterQuery,
type GetTxnByFilterQuery,
asTransactionMeta,
getTransaction,
getTxnsByFilter,
Expand Down
6 changes: 3 additions & 3 deletions packages/ui-react/src/hooks/eas/sdk/use-attestation.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { SchemaEncoder } from "@ethereum-attestation-service/eas-sdk";
import { NO_EXPIRATION } from "@geist/ui-react/lib/eas/request";
import type { AttestationRequestData } from "@geist/ui-react/lib/eas/viem/onchain";
import { Signer, ZeroHash } from "ethers";
import { type Signer, ZeroHash } from "ethers";
import { useMemo } from "react";
import {
Account,
Address,
Chain,
type Address,
type Chain,
Hex,
createWalletClient,
stringToHex,
Expand Down
Loading
Loading