From 226c29b1c0e6012e3f7306b918ddc36f79594b19 Mon Sep 17 00:00:00 2001 From: Tal Derei Date: Thu, 20 Jun 2024 00:08:57 -0700 Subject: [PATCH 1/9] ui package imports --- apps/minifront/package.json | 2 +- apps/minifront/postcss.config.js | 2 +- .../dashboard/assets-table/equivalent-values.tsx | 2 +- .../components/dashboard/assets-table/index.tsx | 8 ++++---- .../minifront/src/components/dashboard/layout.tsx | 2 +- .../components/dashboard/transaction-table.tsx | 2 +- .../src/components/extension-not-connected.tsx | 8 ++++---- .../src/components/extension-not-installed.tsx | 4 ++-- .../extension-transport-disconnected.tsx | 4 ++-- apps/minifront/src/components/header/header.tsx | 4 ++-- .../src/components/header/menu/desktop-nav.tsx | 2 +- .../minifront/src/components/header/menu/menu.tsx | 2 +- .../src/components/header/menu/mobile-nav.tsx | 7 ++++++- .../src/components/header/menu/provider.tsx | 2 +- .../src/components/header/menu/tablet-nav.tsx | 2 +- .../src/components/ibc/ibc-in/assets-table.tsx | 6 +++--- .../src/components/ibc/ibc-in/chain-dropdown.tsx | 10 +++++----- .../components/ibc/ibc-in/destination-addr.tsx | 2 +- .../src/components/ibc/ibc-in/ibc-in-request.tsx | 10 +++++----- .../components/ibc/ibc-in/wallet-addr-card.tsx | 2 +- .../ibc/ibc-in/wallet-connect-button.tsx | 4 ++-- .../src/components/ibc/ibc-out/chain-selector.tsx | 4 ++-- .../src/components/ibc/ibc-out/ibc-out-form.tsx | 4 ++-- apps/minifront/src/components/ibc/layout.tsx | 2 +- apps/minifront/src/components/layout.tsx | 4 ++-- apps/minifront/src/components/not-found.tsx | 2 +- apps/minifront/src/components/send/layout.tsx | 2 +- apps/minifront/src/components/send/receive.tsx | 2 +- .../src/components/send/send-form/index.tsx | 4 ++-- .../src/components/shared/asset-selector.tsx | 15 ++++++++++----- .../src/components/shared/balance-selector.tsx | 15 ++++++++++----- .../shared/edu-panels/edu-info-card.tsx | 6 +++--- .../src/components/shared/error-boundary.tsx | 2 +- apps/minifront/src/components/shared/gas-fee.tsx | 7 +++++-- .../src/components/shared/input-block.tsx | 4 ++-- .../src/components/shared/input-token.tsx | 6 +++--- apps/minifront/src/components/shared/tabs.tsx | 2 +- .../account/delegation-value-view/index.tsx | 2 +- .../staking-actions/form-dialog.tsx | 10 +++++----- .../staking-actions/index.tsx | 2 +- .../validator-info-component.tsx | 6 +++--- .../components/staking/account/header/index.tsx | 8 ++++---- .../staking/account/header/unbonding-tokens.tsx | 4 ++-- apps/minifront/src/components/staking/layout.tsx | 2 +- .../src/components/staking/validator-info-row.tsx | 2 +- .../src/components/staking/validators-table.tsx | 2 +- .../src/components/swap/auction-list/filters.tsx | 2 +- .../src/components/swap/auction-list/index.tsx | 6 +++--- .../auction-list/query-latest-state-button.tsx | 4 ++-- .../src/components/swap/duration-slider.tsx | 2 +- .../components/swap/swap-form/estimate-button.tsx | 6 +++--- .../src/components/swap/swap-form/index.tsx | 4 ++-- .../components/swap/swap-form/output/index.tsx | 4 ++-- .../swap/swap-form/simulate-swap-result/index.tsx | 2 +- .../simulate-swap-result/price-impact.tsx | 4 ++-- .../simulate-swap-result/traces/index.tsx | 2 +- .../simulate-swap-result/traces/trace/index.tsx | 2 +- .../components/swap/swap-form/simulate-swap.tsx | 2 +- .../swap/swap-form/token-swap-input.tsx | 8 ++++---- .../src/components/swap/unclaimed-swaps.tsx | 8 ++++---- .../minifront/src/components/tx-details/index.tsx | 4 ++-- .../src/components/tx-details/tx-viewer.tsx | 6 +++--- apps/minifront/src/icons/box.tsx | 2 +- apps/minifront/src/icons/drag-handle-dots.tsx | 2 +- apps/minifront/src/icons/swap.tsx | 2 +- apps/minifront/src/state/helpers.ts | 2 +- apps/minifront/src/state/ibc-in/index.tsx | 2 +- apps/minifront/src/state/ibc-out.ts | 2 +- .../src/state/swap/dutch-auction/index.ts | 2 +- apps/minifront/src/state/swap/instant-swap.ts | 2 +- apps/node-status/package.json | 2 +- apps/node-status/postcss.config.js | 2 +- .../node-status/src/components/error-boundary.tsx | 2 +- .../src/components/frontend-referral.tsx | 2 +- apps/node-status/src/components/header.tsx | 2 +- apps/node-status/src/components/node-info.tsx | 4 ++-- apps/node-status/src/components/sync-info.tsx | 2 +- .../node-status/src/components/validator-info.tsx | 2 +- apps/node-status/src/main.tsx | 2 +- packages/ui/package.json | 14 +++++++------- packages/ui/tsconfig.json | 7 ++++++- pnpm-lock.yaml | 8 ++++---- 82 files changed, 180 insertions(+), 157 deletions(-) diff --git a/apps/minifront/package.json b/apps/minifront/package.json index 7e5aae1fa5..b02f09f7b4 100644 --- a/apps/minifront/package.json +++ b/apps/minifront/package.json @@ -28,6 +28,7 @@ "@penumbra-zone/protobuf": "workspace:*", "@penumbra-zone/transport-dom": "workspace:*", "@penumbra-zone/types": "workspace:*", + "@penumbra-zone/ui": "workspace:*", "@penumbra-zone/zquery": "workspace:*", "@radix-ui/react-dialog": "1.0.5", "@radix-ui/react-icons": "^1.3.0", @@ -35,7 +36,6 @@ "@radix-ui/react-navigation-menu": "^1.1.4", "@radix-ui/react-portal": "^1.0.4", "@remix-run/router": "^1.16.1", - "@repo/ui": "workspace:*", "@tanstack/react-query": "4.36.1", "bech32": "^2.0.0", "bignumber.js": "^9.1.2", diff --git a/apps/minifront/postcss.config.js b/apps/minifront/postcss.config.js index a2051ffd15..8e18cdcb77 100644 --- a/apps/minifront/postcss.config.js +++ b/apps/minifront/postcss.config.js @@ -1 +1 @@ -export { default } from '@repo/ui/postcss.config.js'; +export { default } from '@penumbra-zone/ui/postcss.config.js'; diff --git a/apps/minifront/src/components/dashboard/assets-table/equivalent-values.tsx b/apps/minifront/src/components/dashboard/assets-table/equivalent-values.tsx index 095f9bf5ea..0a3bd48673 100644 --- a/apps/minifront/src/components/dashboard/assets-table/equivalent-values.tsx +++ b/apps/minifront/src/components/dashboard/assets-table/equivalent-values.tsx @@ -1,7 +1,7 @@ import { ValueView } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; import { asValueView } from '@penumbra-zone/getters/equivalent-value'; import { getDisplayDenomFromView, getEquivalentValues } from '@penumbra-zone/getters/value-view'; -import { ValueViewComponent } from '@repo/ui/components/ui/tx/view/value'; +import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/tx/view/value'; export const EquivalentValues = ({ valueView }: { valueView?: ValueView }) => { const equivalentValuesAsValueViews = (getEquivalentValues.optional()(valueView) ?? []).map( diff --git a/apps/minifront/src/components/dashboard/assets-table/index.tsx b/apps/minifront/src/components/dashboard/assets-table/index.tsx index ee714bea71..27fd206e08 100644 --- a/apps/minifront/src/components/dashboard/assets-table/index.tsx +++ b/apps/minifront/src/components/dashboard/assets-table/index.tsx @@ -1,5 +1,5 @@ -import { AddressIcon } from '@repo/ui/components/ui/address-icon'; -import { AddressComponent } from '@repo/ui/components/ui/address-component'; +import { AddressIcon } from '@penumbra-zone/ui/components/ui/address-icon'; +import { AddressComponent } from '@penumbra-zone/ui/components/ui/address-component'; import { Table, TableBody, @@ -7,8 +7,8 @@ import { TableHead, TableHeader, TableRow, -} from '@repo/ui/components/ui/table'; -import { ValueViewComponent } from '@repo/ui/components/ui/tx/view/value'; +} from '@penumbra-zone/ui/components/ui/table'; +import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/tx/view/value'; import { EquivalentValues } from './equivalent-values'; import { Fragment } from 'react'; import { shouldDisplay } from './helpers'; diff --git a/apps/minifront/src/components/dashboard/layout.tsx b/apps/minifront/src/components/dashboard/layout.tsx index e19268058a..75be0a7667 100644 --- a/apps/minifront/src/components/dashboard/layout.tsx +++ b/apps/minifront/src/components/dashboard/layout.tsx @@ -1,4 +1,4 @@ -import { Card } from '@repo/ui/components/ui/card'; +import { Card } from '@penumbra-zone/ui/components/ui/card'; import { dashboardTabs, dashboardTabsHelper } from './constants'; import { Outlet } from 'react-router-dom'; import { EduInfoCard } from '../shared/edu-panels/edu-info-card'; diff --git a/apps/minifront/src/components/dashboard/transaction-table.tsx b/apps/minifront/src/components/dashboard/transaction-table.tsx index e88b7a5a67..2853129fc2 100644 --- a/apps/minifront/src/components/dashboard/transaction-table.tsx +++ b/apps/minifront/src/components/dashboard/transaction-table.tsx @@ -5,7 +5,7 @@ import { TableHead, TableHeader, TableRow, -} from '@repo/ui/components/ui/table'; +} from '@penumbra-zone/ui/components/ui/table'; import { Link } from 'react-router-dom'; import { shorten } from '@penumbra-zone/types/string'; import { memo } from 'react'; diff --git a/apps/minifront/src/components/extension-not-connected.tsx b/apps/minifront/src/components/extension-not-connected.tsx index 196a3f935b..5c7cfd4864 100644 --- a/apps/minifront/src/components/extension-not-connected.tsx +++ b/apps/minifront/src/components/extension-not-connected.tsx @@ -1,7 +1,7 @@ -import { Button } from '@repo/ui/components/ui/button'; -import { Toaster } from '@repo/ui/components/ui/toaster'; -import { SplashPage } from '@repo/ui/components/ui/splash-page'; -import { errorToast, warningToast } from '@repo/ui/lib/toast/presets'; +import { Button } from '@penumbra-zone/ui/components/ui/button'; +import { Toaster } from '@penumbra-zone/ui/components/ui/toaster'; +import { SplashPage } from '@penumbra-zone/ui/components/ui/splash-page'; +import { errorToast, warningToast } from '@penumbra-zone/ui/lib/toast/presets'; import { HeadTag } from './metadata/head-tag'; import { useState } from 'react'; diff --git a/apps/minifront/src/components/extension-not-installed.tsx b/apps/minifront/src/components/extension-not-installed.tsx index aa2a33e400..5944e6fd92 100644 --- a/apps/minifront/src/components/extension-not-installed.tsx +++ b/apps/minifront/src/components/extension-not-installed.tsx @@ -1,5 +1,5 @@ -import { Button } from '@repo/ui/components/ui/button'; -import { SplashPage } from '@repo/ui/components/ui/splash-page'; +import { Button } from '@penumbra-zone/ui/components/ui/button'; +import { SplashPage } from '@penumbra-zone/ui/components/ui/splash-page'; import { HeadTag } from './metadata/head-tag'; const CHROME_EXTENSION_ID = 'lkpmkhpnhknhmibgnmmhdhgdilepfghe'; diff --git a/apps/minifront/src/components/extension-transport-disconnected.tsx b/apps/minifront/src/components/extension-transport-disconnected.tsx index 1db1922b5a..62abfab944 100644 --- a/apps/minifront/src/components/extension-transport-disconnected.tsx +++ b/apps/minifront/src/components/extension-transport-disconnected.tsx @@ -1,6 +1,6 @@ -import { SplashPage } from '@repo/ui/components/ui/splash-page'; +import { SplashPage } from '@penumbra-zone/ui/components/ui/splash-page'; import { HeadTag } from './metadata/head-tag'; -import { Button } from '@repo/ui/components/ui/button'; +import { Button } from '@penumbra-zone/ui/components/ui/button'; export const ExtensionTransportDisconnected = () => { return ( diff --git a/apps/minifront/src/components/header/header.tsx b/apps/minifront/src/components/header/header.tsx index 825b8d82fc..642845b131 100644 --- a/apps/minifront/src/components/header/header.tsx +++ b/apps/minifront/src/components/header/header.tsx @@ -1,5 +1,5 @@ -import { CondensedBlockSyncStatus } from '@repo/ui/components/ui/block-sync-status/condensed'; -import { TestnetBanner } from '@repo/ui/components/ui/testnet-banner'; +import { CondensedBlockSyncStatus } from '@penumbra-zone/ui/components/ui/block-sync-status/condensed'; +import { TestnetBanner } from '@penumbra-zone/ui/components/ui/testnet-banner'; import { useEffect, useState } from 'react'; import { Link } from 'react-router-dom'; import { getChainId } from '../../fetchers/chain-id'; diff --git a/apps/minifront/src/components/header/menu/desktop-nav.tsx b/apps/minifront/src/components/header/menu/desktop-nav.tsx index b7592a47a4..546bdc607d 100644 --- a/apps/minifront/src/components/header/menu/desktop-nav.tsx +++ b/apps/minifront/src/components/header/menu/desktop-nav.tsx @@ -1,4 +1,4 @@ -import { cn } from '@repo/ui/lib/utils'; +import { cn } from '@penumbra-zone/ui/lib/utils'; import * as NavigationMenu from '@radix-ui/react-navigation-menu'; import { usePagePath } from '../../../fetchers/page-path'; import { dashboardLink, headerLinks } from '../constants'; diff --git a/apps/minifront/src/components/header/menu/menu.tsx b/apps/minifront/src/components/header/menu/menu.tsx index 3d4423e795..9099cba7f7 100644 --- a/apps/minifront/src/components/header/menu/menu.tsx +++ b/apps/minifront/src/components/header/menu/menu.tsx @@ -1,4 +1,4 @@ -import { cn } from '@repo/ui/lib/utils'; +import { cn } from '@penumbra-zone/ui/lib/utils'; import { DesktopNav } from './desktop-nav'; import { MobileNav } from './mobile-nav'; import { ProviderMenu } from './provider'; diff --git a/apps/minifront/src/components/header/menu/mobile-nav.tsx b/apps/minifront/src/components/header/menu/mobile-nav.tsx index 178a62b72d..4f41ce40f2 100644 --- a/apps/minifront/src/components/header/menu/mobile-nav.tsx +++ b/apps/minifront/src/components/header/menu/mobile-nav.tsx @@ -1,4 +1,9 @@ -import { Sheet, SheetContent, SheetHeader, SheetTrigger } from '@repo/ui/components/ui/sheet'; +import { + Sheet, + SheetContent, + SheetHeader, + SheetTrigger, +} from '@penumbra-zone/ui/components/ui/sheet'; import { HamburgerMenuIcon } from '@radix-ui/react-icons'; import { headerLinks } from '../constants'; import { Link } from 'react-router-dom'; diff --git a/apps/minifront/src/components/header/menu/provider.tsx b/apps/minifront/src/components/header/menu/provider.tsx index 1a7d621496..b6ff4edfae 100644 --- a/apps/minifront/src/components/header/menu/provider.tsx +++ b/apps/minifront/src/components/header/menu/provider.tsx @@ -1,4 +1,4 @@ -import { cn } from '@repo/ui/lib/utils'; +import { cn } from '@penumbra-zone/ui/lib/utils'; import * as NavigationMenu from '@radix-ui/react-navigation-menu'; import { getChainId } from '../../../fetchers/chain-id'; import { useCallback, useEffect, useState } from 'react'; diff --git a/apps/minifront/src/components/header/menu/tablet-nav.tsx b/apps/minifront/src/components/header/menu/tablet-nav.tsx index d3ef809a17..319da0403a 100644 --- a/apps/minifront/src/components/header/menu/tablet-nav.tsx +++ b/apps/minifront/src/components/header/menu/tablet-nav.tsx @@ -1,4 +1,4 @@ -import { cn } from '@repo/ui/lib/utils'; +import { cn } from '@penumbra-zone/ui/lib/utils'; import * as NavigationMenu from '@radix-ui/react-navigation-menu'; import { usePagePath } from '../../../fetchers/page-path'; import { dashboardLink, headerLinks } from '../constants'; diff --git a/apps/minifront/src/components/ibc/ibc-in/assets-table.tsx b/apps/minifront/src/components/ibc/ibc-in/assets-table.tsx index 50de9d4ae6..4a2d0c11a6 100644 --- a/apps/minifront/src/components/ibc/ibc-in/assets-table.tsx +++ b/apps/minifront/src/components/ibc/ibc-in/assets-table.tsx @@ -8,9 +8,9 @@ import { TableHead, TableHeader, TableRow, -} from '@repo/ui/components/ui/table'; -import { Avatar, AvatarImage } from '@repo/ui/components/ui/avatar'; -import { Identicon } from '@repo/ui/components/ui/identicon'; +} from '@penumbra-zone/ui/components/ui/table'; +import { Avatar, AvatarImage } from '@penumbra-zone/ui/components/ui/avatar'; +import { Identicon } from '@penumbra-zone/ui/components/ui/identicon'; import { LineWave } from 'react-loader-spinner'; export const AssetsTable = () => { diff --git a/apps/minifront/src/components/ibc/ibc-in/chain-dropdown.tsx b/apps/minifront/src/components/ibc/ibc-in/chain-dropdown.tsx index e1e3d7919e..767591c5e7 100644 --- a/apps/minifront/src/components/ibc/ibc-in/chain-dropdown.tsx +++ b/apps/minifront/src/components/ibc/ibc-in/chain-dropdown.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { useMemo } from 'react'; import { useManager } from '@cosmos-kit/react'; -import { Popover, PopoverContent, PopoverTrigger } from '@repo/ui/components/ui/popover'; +import { Popover, PopoverContent, PopoverTrigger } from '@penumbra-zone/ui/components/ui/popover'; import { ChevronsUpDown } from 'lucide-react'; import { Command, @@ -9,12 +9,12 @@ import { CommandGroup, CommandInput, CommandItem, -} from '@repo/ui/components/ui/command'; -import { Button } from '@repo/ui/components/ui/button'; +} from '@penumbra-zone/ui/components/ui/command'; +import { Button } from '@penumbra-zone/ui/components/ui/button'; import { ibcInSelector } from '../../../state/ibc-in'; import { useStore } from '../../../state'; -import { Avatar, AvatarImage } from '@repo/ui/components/ui/avatar'; -import { Identicon } from '@repo/ui/components/ui/identicon'; +import { Avatar, AvatarImage } from '@penumbra-zone/ui/components/ui/avatar'; +import { Identicon } from '@penumbra-zone/ui/components/ui/identicon'; export interface ChainInfo { chainName: string; diff --git a/apps/minifront/src/components/ibc/ibc-in/destination-addr.tsx b/apps/minifront/src/components/ibc/ibc-in/destination-addr.tsx index ad04f087f6..339184ebf7 100644 --- a/apps/minifront/src/components/ibc/ibc-in/destination-addr.tsx +++ b/apps/minifront/src/components/ibc/ibc-in/destination-addr.tsx @@ -1,6 +1,6 @@ import { AllSlices } from '../../../state'; import { useStoreShallow } from '../../../utils/use-store-shallow'; -import { AccountSwitcher } from '@repo/ui/components/ui/account-switcher'; +import { AccountSwitcher } from '@penumbra-zone/ui/components/ui/account-switcher'; const addrsSelector = ({ ibcIn }: AllSlices) => ({ account: ibcIn.account, diff --git a/apps/minifront/src/components/ibc/ibc-in/ibc-in-request.tsx b/apps/minifront/src/components/ibc/ibc-in/ibc-in-request.tsx index f48f6b71c2..a5a227a431 100644 --- a/apps/minifront/src/components/ibc/ibc-in/ibc-in-request.tsx +++ b/apps/minifront/src/components/ibc/ibc-in/ibc-in-request.tsx @@ -7,12 +7,12 @@ import { SelectItem, SelectTrigger, SelectValue, -} from '@repo/ui/components/ui/select'; -import { Avatar, AvatarImage } from '@repo/ui/components/ui/avatar'; -import { Identicon } from '@repo/ui/components/ui/identicon'; -import { Input } from '@repo/ui/components/ui/input'; +} from '@penumbra-zone/ui/components/ui/select'; +import { Avatar, AvatarImage } from '@penumbra-zone/ui/components/ui/avatar'; +import { Identicon } from '@penumbra-zone/ui/components/ui/identicon'; +import { Input } from '@penumbra-zone/ui/components/ui/input'; import { DestinationAddr } from './destination-addr'; -import { Button } from '@repo/ui/components/ui/button'; +import { Button } from '@penumbra-zone/ui/components/ui/button'; import { LockClosedIcon } from '@radix-ui/react-icons'; const isReadySelector = (state: AllSlices) => { diff --git a/apps/minifront/src/components/ibc/ibc-in/wallet-addr-card.tsx b/apps/minifront/src/components/ibc/ibc-in/wallet-addr-card.tsx index 3379a92b1d..3c34414c6e 100644 --- a/apps/minifront/src/components/ibc/ibc-in/wallet-addr-card.tsx +++ b/apps/minifront/src/components/ibc/ibc-in/wallet-addr-card.tsx @@ -1,4 +1,4 @@ -import { Identicon } from '@repo/ui/components/ui/identicon'; +import { Identicon } from '@penumbra-zone/ui/components/ui/identicon'; interface UserInfoProps { address: string; diff --git a/apps/minifront/src/components/ibc/ibc-in/wallet-connect-button.tsx b/apps/minifront/src/components/ibc/ibc-in/wallet-connect-button.tsx index f022f7ad4f..89b0b1fb26 100644 --- a/apps/minifront/src/components/ibc/ibc-in/wallet-connect-button.tsx +++ b/apps/minifront/src/components/ibc/ibc-in/wallet-connect-button.tsx @@ -1,11 +1,11 @@ import { WalletStatus } from 'cosmos-kit'; -import { WalletIcon } from '@repo/ui/components/ui/icons/wallet'; +import { WalletIcon } from '@penumbra-zone/ui/components/ui/icons/wallet'; import { MouseEventHandler } from 'react'; import { useStore } from '../../../state'; import { ibcInSelector } from '../../../state/ibc-in'; import { useChainConnector } from './hooks'; -import { cn } from '@repo/ui/lib/utils'; +import { cn } from '@penumbra-zone/ui/lib/utils'; export const ConnectWalletButton = () => { const { connect, openView, status } = useChainConnector(); diff --git a/apps/minifront/src/components/ibc/ibc-out/chain-selector.tsx b/apps/minifront/src/components/ibc/ibc-out/chain-selector.tsx index 21f9241596..ef137ab3e7 100644 --- a/apps/minifront/src/components/ibc/ibc-out/chain-selector.tsx +++ b/apps/minifront/src/components/ibc/ibc-out/chain-selector.tsx @@ -4,8 +4,8 @@ import { SelectItem, SelectTrigger, SelectValue, -} from '@repo/ui/components/ui/select'; -import { cn } from '@repo/ui/lib/utils'; +} from '@penumbra-zone/ui/components/ui/select'; +import { cn } from '@penumbra-zone/ui/lib/utils'; import { useState } from 'react'; import { useStore } from '../../../state'; import { ibcOutSelector } from '../../../state/ibc-out'; diff --git a/apps/minifront/src/components/ibc/ibc-out/ibc-out-form.tsx b/apps/minifront/src/components/ibc/ibc-out/ibc-out-form.tsx index 7df458ffb7..8750f6a751 100644 --- a/apps/minifront/src/components/ibc/ibc-out/ibc-out-form.tsx +++ b/apps/minifront/src/components/ibc/ibc-out/ibc-out-form.tsx @@ -1,5 +1,5 @@ -import { Button } from '@repo/ui/components/ui/button'; -import { Input } from '@repo/ui/components/ui/input'; +import { Button } from '@penumbra-zone/ui/components/ui/button'; +import { Input } from '@penumbra-zone/ui/components/ui/input'; import { ChainSelector } from './chain-selector'; import { useLoaderData } from 'react-router-dom'; import { useStore } from '../../../state'; diff --git a/apps/minifront/src/components/ibc/layout.tsx b/apps/minifront/src/components/ibc/layout.tsx index 6f627f049b..06c0bfb385 100644 --- a/apps/minifront/src/components/ibc/layout.tsx +++ b/apps/minifront/src/components/ibc/layout.tsx @@ -1,4 +1,4 @@ -import { Card } from '@repo/ui/components/ui/card'; +import { Card } from '@penumbra-zone/ui/components/ui/card'; import { IbcOutForm } from './ibc-out/ibc-out-form'; import { InterchainUi } from './ibc-in/interchain-ui'; import { LongArrowIcon } from './long-arrow'; diff --git a/apps/minifront/src/components/layout.tsx b/apps/minifront/src/components/layout.tsx index d126cf8ca9..86087aabe4 100644 --- a/apps/minifront/src/components/layout.tsx +++ b/apps/minifront/src/components/layout.tsx @@ -1,9 +1,9 @@ import { Outlet } from 'react-router-dom'; import { HeadTag } from './metadata/head-tag'; import { Header } from './header/header'; -import { Toaster } from '@repo/ui/components/ui/toaster'; +import { Toaster } from '@penumbra-zone/ui/components/ui/toaster'; import { Footer } from './footer/footer'; -import '@repo/ui/styles/globals.css'; +import '@penumbra-zone/ui/styles/globals.css'; import { MotionConfig } from 'framer-motion'; export const Layout = () => { diff --git a/apps/minifront/src/components/not-found.tsx b/apps/minifront/src/components/not-found.tsx index 2c8a9b6a66..e15f3e3e57 100644 --- a/apps/minifront/src/components/not-found.tsx +++ b/apps/minifront/src/components/not-found.tsx @@ -1,4 +1,4 @@ -import { SplashPage } from '@repo/ui/components/ui/splash-page'; +import { SplashPage } from '@penumbra-zone/ui/components/ui/splash-page'; export const NotFound = () => { return That page could not be found. ; diff --git a/apps/minifront/src/components/send/layout.tsx b/apps/minifront/src/components/send/layout.tsx index a35368214a..56f99ef69a 100644 --- a/apps/minifront/src/components/send/layout.tsx +++ b/apps/minifront/src/components/send/layout.tsx @@ -1,4 +1,4 @@ -import { Card } from '@repo/ui/components/ui/card'; +import { Card } from '@penumbra-zone/ui/components/ui/card'; import { sendTabs, sendTabsHelper } from './constants'; import { SendTab } from './types'; import { usePagePath } from '../../fetchers/page-path'; diff --git a/apps/minifront/src/components/send/receive.tsx b/apps/minifront/src/components/send/receive.tsx index 7b2c08703e..3433883f99 100644 --- a/apps/minifront/src/components/send/receive.tsx +++ b/apps/minifront/src/components/send/receive.tsx @@ -1,4 +1,4 @@ -import { SelectAccount } from '@repo/ui/components/ui/select-account'; +import { SelectAccount } from '@penumbra-zone/ui/components/ui/select-account'; import { getAddrByIndex } from '../../fetchers/address'; export const Receive = () => { diff --git a/apps/minifront/src/components/send/send-form/index.tsx b/apps/minifront/src/components/send/send-form/index.tsx index 8f4901b40f..4182bf4326 100644 --- a/apps/minifront/src/components/send/send-form/index.tsx +++ b/apps/minifront/src/components/send/send-form/index.tsx @@ -1,5 +1,5 @@ -import { Button } from '@repo/ui/components/ui/button'; -import { Input } from '@repo/ui/components/ui/input'; +import { Button } from '@penumbra-zone/ui/components/ui/button'; +import { Input } from '@penumbra-zone/ui/components/ui/input'; import { useStore } from '../../../state'; import { sendSelector, diff --git a/apps/minifront/src/components/shared/asset-selector.tsx b/apps/minifront/src/components/shared/asset-selector.tsx index 4cb7d654af..1bbd870fe0 100644 --- a/apps/minifront/src/components/shared/asset-selector.tsx +++ b/apps/minifront/src/components/shared/asset-selector.tsx @@ -1,14 +1,19 @@ -import { Dialog, DialogClose, DialogContent, DialogHeader } from '@repo/ui/components/ui/dialog'; -import { AssetIcon } from '@repo/ui/components/ui/tx/view/asset-icon'; +import { + Dialog, + DialogClose, + DialogContent, + DialogHeader, +} from '@penumbra-zone/ui/components/ui/dialog'; +import { AssetIcon } from '@penumbra-zone/ui/components/ui/tx/view/asset-icon'; import { Metadata, ValueView, } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; -import { ValueViewComponent } from '@repo/ui/components/ui/tx/view/value'; +import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/tx/view/value'; import { useEffect, useId, useMemo, useState } from 'react'; -import { IconInput } from '@repo/ui/components/ui/icon-input'; +import { IconInput } from '@penumbra-zone/ui/components/ui/icon-input'; import { MagnifyingGlassIcon } from '@radix-ui/react-icons'; -import { Box } from '@repo/ui/components/ui/box'; +import { Box } from '@penumbra-zone/ui/components/ui/box'; import { motion } from 'framer-motion'; interface AssetSelectorProps { diff --git a/apps/minifront/src/components/shared/balance-selector.tsx b/apps/minifront/src/components/shared/balance-selector.tsx index 683b4e3122..a3c41a5743 100644 --- a/apps/minifront/src/components/shared/balance-selector.tsx +++ b/apps/minifront/src/components/shared/balance-selector.tsx @@ -1,13 +1,18 @@ import { MagnifyingGlassIcon } from '@radix-ui/react-icons'; import { useId, useState } from 'react'; -import { IconInput } from '@repo/ui/components/ui/icon-input'; -import { Dialog, DialogClose, DialogContent, DialogHeader } from '@repo/ui/components/ui/dialog'; -import { cn } from '@repo/ui/lib/utils'; -import { ValueViewComponent } from '@repo/ui/components/ui/tx/view/value'; +import { IconInput } from '@penumbra-zone/ui/components/ui/icon-input'; +import { + Dialog, + DialogClose, + DialogContent, + DialogHeader, +} from '@penumbra-zone/ui/components/ui/dialog'; +import { cn } from '@penumbra-zone/ui/lib/utils'; +import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/tx/view/value'; import { BalancesResponse } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/view/v1/view_pb'; import { getAddressIndex } from '@penumbra-zone/getters/address-view'; import { getDisplayDenomFromView, getSymbolFromValueView } from '@penumbra-zone/getters/value-view'; -import { Box } from '@repo/ui/components/ui/box'; +import { Box } from '@penumbra-zone/ui/components/ui/box'; import { motion } from 'framer-motion'; const bySearch = (search: string) => (balancesResponse: BalancesResponse) => diff --git a/apps/minifront/src/components/shared/edu-panels/edu-info-card.tsx b/apps/minifront/src/components/shared/edu-panels/edu-info-card.tsx index 5f2e1f2528..74204548fc 100644 --- a/apps/minifront/src/components/shared/edu-panels/edu-info-card.tsx +++ b/apps/minifront/src/components/shared/edu-panels/edu-info-card.tsx @@ -1,6 +1,6 @@ -import { Card } from '@repo/ui/components/ui/card'; -import { cn } from '@repo/ui/lib/utils'; -import { GradientHeader } from '@repo/ui/components/ui/gradient-header'; +import { Card } from '@penumbra-zone/ui/components/ui/card'; +import { cn } from '@penumbra-zone/ui/lib/utils'; +import { GradientHeader } from '@penumbra-zone/ui/components/ui/gradient-header'; import { EduPanel, eduPanelContent } from './content'; import { motion } from 'framer-motion'; diff --git a/apps/minifront/src/components/shared/error-boundary.tsx b/apps/minifront/src/components/shared/error-boundary.tsx index eb9e4e77d4..f7a7d9f707 100644 --- a/apps/minifront/src/components/shared/error-boundary.tsx +++ b/apps/minifront/src/components/shared/error-boundary.tsx @@ -5,7 +5,7 @@ import { NotFound } from '../not-found'; import { ExtensionTransportDisconnected } from '../extension-transport-disconnected'; import { ExtensionNotInstalled } from '../extension-not-installed'; import { Code, ConnectError } from '@connectrpc/connect'; -import { SplashPage } from '@repo/ui/components/ui/splash-page'; +import { SplashPage } from '@penumbra-zone/ui/components/ui/splash-page'; export const ErrorBoundary = () => { const error = useRouteError(); diff --git a/apps/minifront/src/components/shared/gas-fee.tsx b/apps/minifront/src/components/shared/gas-fee.tsx index 9481013a90..338710a768 100644 --- a/apps/minifront/src/components/shared/gas-fee.tsx +++ b/apps/minifront/src/components/shared/gas-fee.tsx @@ -2,9 +2,12 @@ import { Fee, FeeTier_Tier, } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/fee/v1/fee_pb'; -import { SegmentedPicker, SegmentedPickerOption } from '@repo/ui/components/ui/segmented-picker'; +import { + SegmentedPicker, + SegmentedPickerOption, +} from '@penumbra-zone/ui/components/ui/segmented-picker'; import { InputBlock } from './input-block'; -import { ValueViewComponent } from '@repo/ui/components/ui/tx/view/value'; +import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/tx/view/value'; import { Metadata, ValueView, diff --git a/apps/minifront/src/components/shared/input-block.tsx b/apps/minifront/src/components/shared/input-block.tsx index 4d58d46e61..2061f7add5 100644 --- a/apps/minifront/src/components/shared/input-block.tsx +++ b/apps/minifront/src/components/shared/input-block.tsx @@ -1,7 +1,7 @@ -import { cn } from '@repo/ui/lib/utils'; +import { cn } from '@penumbra-zone/ui/lib/utils'; import { Validation, validationResult } from './validation-result'; import { ReactNode } from 'react'; -import { Box } from '@repo/ui/components/ui/box'; +import { Box } from '@penumbra-zone/ui/components/ui/box'; interface InputBlockProps { label: string; diff --git a/apps/minifront/src/components/shared/input-token.tsx b/apps/minifront/src/components/shared/input-token.tsx index 851cde1feb..a6837dc721 100644 --- a/apps/minifront/src/components/shared/input-token.tsx +++ b/apps/minifront/src/components/shared/input-token.tsx @@ -1,10 +1,10 @@ -import { Input } from '@repo/ui/components/ui/input'; -import { cn } from '@repo/ui/lib/utils'; +import { Input } from '@penumbra-zone/ui/components/ui/input'; +import { cn } from '@penumbra-zone/ui/lib/utils'; import BalanceSelector from './balance-selector'; import { Validation } from './validation-result'; import { InputBlock } from './input-block'; import { BalancesResponse } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/view/v1/view_pb'; -import { BalanceValueView } from '@repo/ui/components/ui/balance-value-view'; +import { BalanceValueView } from '@penumbra-zone/ui/components/ui/balance-value-view'; import { getFormattedAmtFromValueView } from '@penumbra-zone/types/value-view'; interface InputTokenProps { diff --git a/apps/minifront/src/components/shared/tabs.tsx b/apps/minifront/src/components/shared/tabs.tsx index b772708277..2a0488bf2f 100644 --- a/apps/minifront/src/components/shared/tabs.tsx +++ b/apps/minifront/src/components/shared/tabs.tsx @@ -1,6 +1,6 @@ import { PagePath } from '../metadata/paths'; import { useNavigate } from 'react-router-dom'; -import { SegmentedPicker } from '@repo/ui/components/ui/segmented-picker'; +import { SegmentedPicker } from '@penumbra-zone/ui/components/ui/segmented-picker'; import { ComponentProps } from 'react'; export interface Tab { diff --git a/apps/minifront/src/components/staking/account/delegation-value-view/index.tsx b/apps/minifront/src/components/staking/account/delegation-value-view/index.tsx index d6db861ee4..fe6b39a780 100644 --- a/apps/minifront/src/components/staking/account/delegation-value-view/index.tsx +++ b/apps/minifront/src/components/staking/account/delegation-value-view/index.tsx @@ -1,6 +1,6 @@ import { ValueView } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; import { ValidatorInfoComponent } from './validator-info-component'; -import { ValueViewComponent } from '@repo/ui/components/ui/tx/view/value'; +import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/tx/view/value'; import { StakingActions } from './staking-actions'; import { memo, useMemo } from 'react'; import { diff --git a/apps/minifront/src/components/staking/account/delegation-value-view/staking-actions/form-dialog.tsx b/apps/minifront/src/components/staking/account/delegation-value-view/staking-actions/form-dialog.tsx index 49e7c3f94e..95a5b3412a 100644 --- a/apps/minifront/src/components/staking/account/delegation-value-view/staking-actions/form-dialog.tsx +++ b/apps/minifront/src/components/staking/account/delegation-value-view/staking-actions/form-dialog.tsx @@ -1,14 +1,14 @@ -import { Button } from '@repo/ui/components/ui/button'; -import { Dialog, DialogContent, DialogHeader } from '@repo/ui/components/ui/dialog'; -import { IdentityKeyComponent } from '@repo/ui/components/ui/identity-key-component'; -import { Input } from '@repo/ui/components/ui/input'; +import { Button } from '@penumbra-zone/ui/components/ui/button'; +import { Dialog, DialogContent, DialogHeader } from '@penumbra-zone/ui/components/ui/dialog'; +import { IdentityKeyComponent } from '@penumbra-zone/ui/components/ui/identity-key-component'; +import { Input } from '@penumbra-zone/ui/components/ui/input'; import { InputBlock } from '../../../../shared/input-block'; import { Validator } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/stake/v1/stake_pb'; import { ValueView } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; import { FormEvent } from 'react'; import { getIdentityKey } from '@penumbra-zone/getters/validator'; import { getFormattedAmtFromValueView } from '@penumbra-zone/types/value-view'; -import { BalanceValueView } from '@repo/ui/components/ui/balance-value-view'; +import { BalanceValueView } from '@penumbra-zone/ui/components/ui/balance-value-view'; const getCapitalizedAction = (action: 'delegate' | 'undelegate') => action.replace(/^./, firstCharacter => firstCharacter.toLocaleUpperCase()); diff --git a/apps/minifront/src/components/staking/account/delegation-value-view/staking-actions/index.tsx b/apps/minifront/src/components/staking/account/delegation-value-view/staking-actions/index.tsx index 8868a039ca..0456131e86 100644 --- a/apps/minifront/src/components/staking/account/delegation-value-view/staking-actions/index.tsx +++ b/apps/minifront/src/components/staking/account/delegation-value-view/staking-actions/index.tsx @@ -1,4 +1,4 @@ -import { Button } from '@repo/ui/components/ui/button'; +import { Button } from '@penumbra-zone/ui/components/ui/button'; import { ValidatorInfo } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/stake/v1/stake_pb'; import { ValueView } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; import { FormDialog } from './form-dialog'; diff --git a/apps/minifront/src/components/staking/account/delegation-value-view/validator-info-component.tsx b/apps/minifront/src/components/staking/account/delegation-value-view/validator-info-component.tsx index 64d39801e8..e803c8e626 100644 --- a/apps/minifront/src/components/staking/account/delegation-value-view/validator-info-component.tsx +++ b/apps/minifront/src/components/staking/account/delegation-value-view/validator-info-component.tsx @@ -1,11 +1,11 @@ import { ValidatorInfo } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/stake/v1/stake_pb'; -import { IdentityKeyComponent } from '@repo/ui/components/ui/identity-key-component'; +import { IdentityKeyComponent } from '@penumbra-zone/ui/components/ui/identity-key-component'; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, -} from '@repo/ui/components/ui/tooltip'; +} from '@penumbra-zone/ui/components/ui/tooltip'; import { useStore } from '../../../../state'; import { getIdentityKeyFromValidatorInfo, @@ -13,7 +13,7 @@ import { } from '@penumbra-zone/getters/validator-info'; import { calculateCommissionAsPercentage } from '@penumbra-zone/types/staking'; import { Metadata } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; -import { AssetIcon } from '@repo/ui/components/ui/tx/view/asset-icon'; +import { AssetIcon } from '@penumbra-zone/ui/components/ui/tx/view/asset-icon'; /** * Renders a single `ValidatorInfo`: its name and identity key, diff --git a/apps/minifront/src/components/staking/account/header/index.tsx b/apps/minifront/src/components/staking/account/header/index.tsx index cedb23deb8..166e604d8c 100644 --- a/apps/minifront/src/components/staking/account/header/index.tsx +++ b/apps/minifront/src/components/staking/account/header/index.tsx @@ -1,7 +1,7 @@ -import { Button } from '@repo/ui/components/ui/button'; -import { Card, CardContent } from '@repo/ui/components/ui/card'; -import { AccountSwitcher } from '@repo/ui/components/ui/account-switcher'; -import { ValueViewComponent } from '@repo/ui/components/ui/tx/view/value'; +import { Button } from '@penumbra-zone/ui/components/ui/button'; +import { Card, CardContent } from '@penumbra-zone/ui/components/ui/card'; +import { AccountSwitcher } from '@penumbra-zone/ui/components/ui/account-switcher'; +import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/tx/view/value'; import { Stat } from './stat'; import { AllSlices } from '../../../../state'; import { UnbondingTokens } from './unbonding-tokens'; diff --git a/apps/minifront/src/components/staking/account/header/unbonding-tokens.tsx b/apps/minifront/src/components/staking/account/header/unbonding-tokens.tsx index a8e5c4bd83..fc3ad4030b 100644 --- a/apps/minifront/src/components/staking/account/header/unbonding-tokens.tsx +++ b/apps/minifront/src/components/staking/account/header/unbonding-tokens.tsx @@ -8,8 +8,8 @@ import { Tooltip, TooltipTrigger, TooltipContent, -} from '@repo/ui/components/ui/tooltip'; -import { ValueViewComponent } from '@repo/ui/components/ui/tx/view/value'; +} from '@penumbra-zone/ui/components/ui/tooltip'; +import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/tx/view/value'; import { ReactNode } from 'react'; import { zeroValueView } from '../../../../utils/zero-value-view'; diff --git a/apps/minifront/src/components/staking/layout.tsx b/apps/minifront/src/components/staking/layout.tsx index d9727d13d4..90ca2c5c85 100644 --- a/apps/minifront/src/components/staking/layout.tsx +++ b/apps/minifront/src/components/staking/layout.tsx @@ -1,6 +1,6 @@ import { useEffect } from 'react'; import { AllSlices } from '../../state'; -import { Card, CardContent, CardHeader, CardTitle } from '@repo/ui/components/ui/card'; +import { Card, CardContent, CardHeader, CardTitle } from '@penumbra-zone/ui/components/ui/card'; import { Header } from './account/header'; import { Delegations } from './account/delegations'; import { useStoreShallow } from '../../utils/use-store-shallow'; diff --git a/apps/minifront/src/components/staking/validator-info-row.tsx b/apps/minifront/src/components/staking/validator-info-row.tsx index 3643e7dc20..c53271b87d 100644 --- a/apps/minifront/src/components/staking/validator-info-row.tsx +++ b/apps/minifront/src/components/staking/validator-info-row.tsx @@ -1,5 +1,5 @@ import { ValidatorInfo } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/stake/v1/stake_pb'; -import { TableCell, TableRow } from '@repo/ui/components/ui/table'; +import { TableCell, TableRow } from '@penumbra-zone/ui/components/ui/table'; import { ReactNode } from 'react'; import { Oval } from 'react-loader-spinner'; import { getValidator } from '@penumbra-zone/getters/validator-info'; diff --git a/apps/minifront/src/components/staking/validators-table.tsx b/apps/minifront/src/components/staking/validators-table.tsx index 6d732c7a8c..2c7f731eb3 100644 --- a/apps/minifront/src/components/staking/validators-table.tsx +++ b/apps/minifront/src/components/staking/validators-table.tsx @@ -5,7 +5,7 @@ import { TableHead, TableHeader, TableRow, -} from '@repo/ui/components/ui/table'; +} from '@penumbra-zone/ui/components/ui/table'; import { Oval } from 'react-loader-spinner'; import { ValidatorInfoRow } from './validator-info-row'; import { ValidatorInfo } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/stake/v1/stake_pb'; diff --git a/apps/minifront/src/components/swap/auction-list/filters.tsx b/apps/minifront/src/components/swap/auction-list/filters.tsx index 39217d401f..45deb56089 100644 --- a/apps/minifront/src/components/swap/auction-list/filters.tsx +++ b/apps/minifront/src/components/swap/auction-list/filters.tsx @@ -1,7 +1,7 @@ import { ListFilter } from 'lucide-react'; import { AllSlices } from '../../../state'; import { useStoreShallow } from '../../../utils/use-store-shallow'; -import { PopoverMenu, PopoverMenuItem } from '@repo/ui/components/ui/popover-menu'; +import { PopoverMenu, PopoverMenuItem } from '@penumbra-zone/ui/components/ui/popover-menu'; import type { Filter as TFilter } from '../../../state/swap/dutch-auction'; const filtersSelector = (state: AllSlices) => ({ diff --git a/apps/minifront/src/components/swap/auction-list/index.tsx b/apps/minifront/src/components/swap/auction-list/index.tsx index 8603dee38b..06c2099d53 100644 --- a/apps/minifront/src/components/swap/auction-list/index.tsx +++ b/apps/minifront/src/components/swap/auction-list/index.tsx @@ -1,10 +1,10 @@ import { AllSlices } from '../../../state'; -import { DutchAuctionComponent } from '@repo/ui/components/ui/dutch-auction-component'; +import { DutchAuctionComponent } from '@penumbra-zone/ui/components/ui/dutch-auction-component'; import { useStoreShallow } from '../../../utils/use-store-shallow'; import { AuctionId } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/auction/v1/auction_pb'; -import { GradientHeader } from '@repo/ui/components/ui/gradient-header'; +import { GradientHeader } from '@penumbra-zone/ui/components/ui/gradient-header'; import { QueryLatestStateButton } from './query-latest-state-button'; -import { Card } from '@repo/ui/components/ui/card'; +import { Card } from '@penumbra-zone/ui/components/ui/card'; import { bech32mAuctionId } from '@penumbra-zone/bech32m/pauctid'; import { useMemo } from 'react'; import { getFilteredAuctionInfos } from './get-filtered-auction-infos'; diff --git a/apps/minifront/src/components/swap/auction-list/query-latest-state-button.tsx b/apps/minifront/src/components/swap/auction-list/query-latest-state-button.tsx index ac15fc271d..868e764293 100644 --- a/apps/minifront/src/components/swap/auction-list/query-latest-state-button.tsx +++ b/apps/minifront/src/components/swap/auction-list/query-latest-state-button.tsx @@ -3,10 +3,10 @@ import { TooltipContent, TooltipProvider, TooltipTrigger, -} from '@repo/ui/components/ui/tooltip'; +} from '@penumbra-zone/ui/components/ui/tooltip'; import { ReloadIcon } from '@radix-ui/react-icons'; import { useAuctionInfos, useRevalidateAuctionInfos } from '../../../state/swap/dutch-auction'; -import { cn } from '@repo/ui/lib/utils'; +import { cn } from '@penumbra-zone/ui/lib/utils'; export const QueryLatestStateButton = () => { const { loading } = useAuctionInfos(); diff --git a/apps/minifront/src/components/swap/duration-slider.tsx b/apps/minifront/src/components/swap/duration-slider.tsx index fd63be04fa..4e9cd564a5 100644 --- a/apps/minifront/src/components/swap/duration-slider.tsx +++ b/apps/minifront/src/components/swap/duration-slider.tsx @@ -1,4 +1,4 @@ -import { Slider } from '@repo/ui/components/ui/slider'; +import { Slider } from '@penumbra-zone/ui/components/ui/slider'; import { DURATION_OPTIONS, GDA_RECIPES } from '../../state/swap/constants'; import { useStoreShallow } from '../../utils/use-store-shallow'; import { AllSlices } from '../../state'; diff --git a/apps/minifront/src/components/swap/swap-form/estimate-button.tsx b/apps/minifront/src/components/swap/swap-form/estimate-button.tsx index 023c1283b3..602852bc9b 100644 --- a/apps/minifront/src/components/swap/swap-form/estimate-button.tsx +++ b/apps/minifront/src/components/swap/swap-form/estimate-button.tsx @@ -1,11 +1,11 @@ -import { buttonVariants } from '@repo/ui/components/ui/button'; +import { buttonVariants } from '@penumbra-zone/ui/components/ui/button'; import { Tooltip, TooltipProvider, TooltipTrigger, TooltipContent, -} from '@repo/ui/components/ui/tooltip'; -import { cn } from '@repo/ui/lib/utils'; +} from '@penumbra-zone/ui/components/ui/tooltip'; +import { cn } from '@penumbra-zone/ui/lib/utils'; export const EstimateButton = ({ disabled, diff --git a/apps/minifront/src/components/swap/swap-form/index.tsx b/apps/minifront/src/components/swap/swap-form/index.tsx index d97dc76d07..b3351beecf 100644 --- a/apps/minifront/src/components/swap/swap-form/index.tsx +++ b/apps/minifront/src/components/swap/swap-form/index.tsx @@ -1,11 +1,11 @@ -import { Button } from '@repo/ui/components/ui/button'; +import { Button } from '@penumbra-zone/ui/components/ui/button'; import { AllSlices } from '../../../state'; import { TokenSwapInput } from './token-swap-input'; import { useStoreShallow } from '../../../utils/use-store-shallow'; import { DurationSlider } from '../duration-slider'; import { InputBlock } from '../../shared/input-block'; import { Output } from './output'; -import { Card } from '@repo/ui/components/ui/card'; +import { Card } from '@penumbra-zone/ui/components/ui/card'; import { SimulateSwap } from './simulate-swap'; import { LayoutGroup } from 'framer-motion'; import { useId } from 'react'; diff --git a/apps/minifront/src/components/swap/swap-form/output/index.tsx b/apps/minifront/src/components/swap/swap-form/output/index.tsx index 27f31de1e9..67dfc25ae5 100644 --- a/apps/minifront/src/components/swap/swap-form/output/index.tsx +++ b/apps/minifront/src/components/swap/swap-form/output/index.tsx @@ -1,7 +1,7 @@ -import { Box } from '@repo/ui/components/ui/box'; +import { Box } from '@penumbra-zone/ui/components/ui/box'; import { AllSlices } from '../../../../state'; import { useStoreShallow } from '../../../../utils/use-store-shallow'; -import { Input } from '@repo/ui/components/ui/input'; +import { Input } from '@penumbra-zone/ui/components/ui/input'; import { EstimateButton } from '../estimate-button'; import { EstimatedOutputExplanation } from './estimated-output-explanation'; import { motion } from 'framer-motion'; diff --git a/apps/minifront/src/components/swap/swap-form/simulate-swap-result/index.tsx b/apps/minifront/src/components/swap/swap-form/simulate-swap-result/index.tsx index 2ce41cdef7..91ca13b820 100644 --- a/apps/minifront/src/components/swap/swap-form/simulate-swap-result/index.tsx +++ b/apps/minifront/src/components/swap/swap-form/simulate-swap-result/index.tsx @@ -1,4 +1,4 @@ -import { ValueViewComponent } from '@repo/ui/components/ui/tx/view/value'; +import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/tx/view/value'; import { PriceImpact } from './price-impact'; import { motion } from 'framer-motion'; import { SimulateSwapResult as TSimulateSwapResult } from '../../../../state/swap'; diff --git a/apps/minifront/src/components/swap/swap-form/simulate-swap-result/price-impact.tsx b/apps/minifront/src/components/swap/swap-form/simulate-swap-result/price-impact.tsx index 8637345f7a..5d7790c250 100644 --- a/apps/minifront/src/components/swap/swap-form/simulate-swap-result/price-impact.tsx +++ b/apps/minifront/src/components/swap/swap-form/simulate-swap-result/price-impact.tsx @@ -1,6 +1,6 @@ import { formatNumber } from '@penumbra-zone/types/amount'; -import { Pill } from '@repo/ui/components/ui/pill'; -import { cn } from '@repo/ui/lib/utils'; +import { Pill } from '@penumbra-zone/ui/components/ui/pill'; +import { cn } from '@penumbra-zone/ui/lib/utils'; // The price hit the user takes as a consequence of moving the market with the size of their trade export const PriceImpact = ({ amount = 0 }: { amount?: number }) => { diff --git a/apps/minifront/src/components/swap/swap-form/simulate-swap-result/traces/index.tsx b/apps/minifront/src/components/swap/swap-form/simulate-swap-result/traces/index.tsx index 267a8ded09..d24ead1619 100644 --- a/apps/minifront/src/components/swap/swap-form/simulate-swap-result/traces/index.tsx +++ b/apps/minifront/src/components/swap/swap-form/simulate-swap-result/traces/index.tsx @@ -4,7 +4,7 @@ import { Metadata, ValueView, } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; -import { ValueViewComponent } from '@repo/ui/components/ui/tx/view/value'; +import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/tx/view/value'; import { ArrowDown, ArrowUp } from 'lucide-react'; export const Traces = ({ diff --git a/apps/minifront/src/components/swap/swap-form/simulate-swap-result/traces/trace/index.tsx b/apps/minifront/src/components/swap/swap-form/simulate-swap-result/traces/trace/index.tsx index 593dbe6547..9344d8e9c5 100644 --- a/apps/minifront/src/components/swap/swap-form/simulate-swap-result/traces/trace/index.tsx +++ b/apps/minifront/src/components/swap/swap-form/simulate-swap-result/traces/trace/index.tsx @@ -5,7 +5,7 @@ import { } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; import { SwapExecution_Trace } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/dex/v1/dex_pb'; import { bech32mAssetId } from '@penumbra-zone/bech32m/passet'; -import { ValueViewComponent } from '@repo/ui/components/ui/tx/view/value'; +import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/tx/view/value'; import { Price } from './price'; const getValueView = (metadataByAssetId: Record, { amount, assetId }: Value) => diff --git a/apps/minifront/src/components/swap/swap-form/simulate-swap.tsx b/apps/minifront/src/components/swap/swap-form/simulate-swap.tsx index f96ad56e8f..e37f476fea 100644 --- a/apps/minifront/src/components/swap/swap-form/simulate-swap.tsx +++ b/apps/minifront/src/components/swap/swap-form/simulate-swap.tsx @@ -1,4 +1,4 @@ -import { Box } from '@repo/ui/components/ui/box'; +import { Box } from '@penumbra-zone/ui/components/ui/box'; import { SimulateSwapResult } from './simulate-swap-result'; import { AllSlices } from '../../../state'; import { useStoreShallow } from '../../../utils/use-store-shallow'; diff --git a/apps/minifront/src/components/swap/swap-form/token-swap-input.tsx b/apps/minifront/src/components/swap/swap-form/token-swap-input.tsx index f0606759d4..b40f58bff7 100644 --- a/apps/minifront/src/components/swap/swap-form/token-swap-input.tsx +++ b/apps/minifront/src/components/swap/swap-form/token-swap-input.tsx @@ -1,8 +1,8 @@ import { BalancesResponse } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/view/v1/view_pb'; -import { BalanceValueView } from '@repo/ui/components/ui/balance-value-view'; -import { Box } from '@repo/ui/components/ui/box'; -import { CandlestickPlot } from '@repo/ui/components/ui/candlestick-plot'; -import { Input } from '@repo/ui/components/ui/input'; +import { BalanceValueView } from '@penumbra-zone/ui/components/ui/balance-value-view'; +import { Box } from '@penumbra-zone/ui/components/ui/box'; +import { CandlestickPlot } from '@penumbra-zone/ui/components/ui/candlestick-plot'; +import { Input } from '@penumbra-zone/ui/components/ui/input'; import { joinLoHiAmount } from '@penumbra-zone/types/amount'; import { getAmount, diff --git a/apps/minifront/src/components/swap/unclaimed-swaps.tsx b/apps/minifront/src/components/swap/unclaimed-swaps.tsx index 60e036b723..573c5e3b05 100644 --- a/apps/minifront/src/components/swap/unclaimed-swaps.tsx +++ b/apps/minifront/src/components/swap/unclaimed-swaps.tsx @@ -1,11 +1,11 @@ -import { Button } from '@repo/ui/components/ui/button'; -import { Card } from '@repo/ui/components/ui/card'; -import { AssetIcon } from '@repo/ui/components/ui/tx/view/asset-icon'; +import { Button } from '@penumbra-zone/ui/components/ui/button'; +import { Card } from '@penumbra-zone/ui/components/ui/card'; +import { AssetIcon } from '@penumbra-zone/ui/components/ui/tx/view/asset-icon'; import { AllSlices } from '../../state'; import { useUnclaimedSwaps } from '../../state/unclaimed-swaps'; import { getSwapRecordCommitment } from '@penumbra-zone/getters/swap-record'; import { uint8ArrayToBase64 } from '@penumbra-zone/types/base64'; -import { GradientHeader } from '@repo/ui/components/ui/gradient-header'; +import { GradientHeader } from '@penumbra-zone/ui/components/ui/gradient-header'; import { useStoreShallow } from '../../utils/use-store-shallow'; const unclaimedSwapsSelector = (state: AllSlices) => ({ diff --git a/apps/minifront/src/components/tx-details/index.tsx b/apps/minifront/src/components/tx-details/index.tsx index 4bef010067..cb332aa19f 100644 --- a/apps/minifront/src/components/tx-details/index.tsx +++ b/apps/minifront/src/components/tx-details/index.tsx @@ -1,5 +1,5 @@ -import { Card } from '@repo/ui/components/ui/card'; -import { FadeTransition } from '@repo/ui/components/ui/fade-transition'; +import { Card } from '@penumbra-zone/ui/components/ui/card'; +import { FadeTransition } from '@penumbra-zone/ui/components/ui/fade-transition'; import { TxViewer } from './tx-viewer'; import { EduInfoCard } from '../shared/edu-panels/edu-info-card'; import { EduPanel } from '../shared/edu-panels/content'; diff --git a/apps/minifront/src/components/tx-details/tx-viewer.tsx b/apps/minifront/src/components/tx-details/tx-viewer.tsx index 4109663abf..0d13c4c9ee 100644 --- a/apps/minifront/src/components/tx-details/tx-viewer.tsx +++ b/apps/minifront/src/components/tx-details/tx-viewer.tsx @@ -1,9 +1,9 @@ -import { JsonViewer } from '@repo/ui/components/ui/json-viewer'; -import { TransactionViewComponent } from '@repo/ui/components/ui/tx/view/transaction'; +import { JsonViewer } from '@penumbra-zone/ui/components/ui/json-viewer'; +import { TransactionViewComponent } from '@penumbra-zone/ui/components/ui/tx/view/transaction'; import { TransactionInfo } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/view/v1/view_pb'; import type { Jsonified } from '@penumbra-zone/types/jsonified'; import { useState } from 'react'; -import { SegmentedPicker } from '@repo/ui/components/ui/segmented-picker'; +import { SegmentedPicker } from '@penumbra-zone/ui/components/ui/segmented-picker'; import { asPublicTransactionView } from '@penumbra-zone/perspective/translators/transaction-view'; import { typeRegistry } from '@penumbra-zone/protobuf'; import { useQuery } from '@tanstack/react-query'; diff --git a/apps/minifront/src/icons/box.tsx b/apps/minifront/src/icons/box.tsx index 4c4bc56df1..e4422bc14f 100644 --- a/apps/minifront/src/icons/box.tsx +++ b/apps/minifront/src/icons/box.tsx @@ -1,4 +1,4 @@ -import { cn } from '@repo/ui/lib/utils'; +import { cn } from '@penumbra-zone/ui/lib/utils'; export const BoxIcon = ({ stroke = '#BDB8B8', diff --git a/apps/minifront/src/icons/drag-handle-dots.tsx b/apps/minifront/src/icons/drag-handle-dots.tsx index 192c20ad1a..f5c45a3bf3 100644 --- a/apps/minifront/src/icons/drag-handle-dots.tsx +++ b/apps/minifront/src/icons/drag-handle-dots.tsx @@ -1,4 +1,4 @@ -import { cn } from '@repo/ui/lib/utils'; +import { cn } from '@penumbra-zone/ui/lib/utils'; export const DragHandleDotsIcon = ({ stroke = '#BDB8B8', diff --git a/apps/minifront/src/icons/swap.tsx b/apps/minifront/src/icons/swap.tsx index 33eac1849c..f8564e0179 100644 --- a/apps/minifront/src/icons/swap.tsx +++ b/apps/minifront/src/icons/swap.tsx @@ -1,4 +1,4 @@ -import { cn } from '@repo/ui/lib/utils'; +import { cn } from '@penumbra-zone/ui/lib/utils'; export const SwapIcon = ({ stroke = '#BDB8B8', diff --git a/apps/minifront/src/state/helpers.ts b/apps/minifront/src/state/helpers.ts index ed36b76bab..c3928c16f0 100644 --- a/apps/minifront/src/state/helpers.ts +++ b/apps/minifront/src/state/helpers.ts @@ -15,7 +15,7 @@ import { } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/transaction/v1/transaction_pb'; import { TransactionId } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/txhash/v1/txhash_pb'; import { PartialMessage } from '@bufbuild/protobuf'; -import { TransactionToast } from '@repo/ui/lib/toast/transaction-toast'; +import { TransactionToast } from '@penumbra-zone/ui/lib/toast/transaction-toast'; import { TransactionClassification } from '@penumbra-zone/perspective/transaction/classification'; import { uint8ArrayToHex } from '@penumbra-zone/types/hex'; diff --git a/apps/minifront/src/state/ibc-in/index.tsx b/apps/minifront/src/state/ibc-in/index.tsx index 9a71643faf..659c247e33 100644 --- a/apps/minifront/src/state/ibc-in/index.tsx +++ b/apps/minifront/src/state/ibc-in/index.tsx @@ -4,7 +4,7 @@ import { ChainWalletContext } from '@cosmos-kit/core'; import { AllSlices, SliceCreator } from '..'; import { getAddrByIndex } from '../../fetchers/address'; import { bech32mAddress } from '@penumbra-zone/bech32m/penumbra'; -import { Toast } from '@repo/ui/lib/toast/toast'; +import { Toast } from '@penumbra-zone/ui/lib/toast/toast'; import { shorten } from '@penumbra-zone/types/string'; import { Address } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/keys/v1/keys_pb'; import { bech32CompatAddress } from '@penumbra-zone/bech32m/penumbracompat1'; diff --git a/apps/minifront/src/state/ibc-out.ts b/apps/minifront/src/state/ibc-out.ts index ff76528616..ad7c32a668 100644 --- a/apps/minifront/src/state/ibc-out.ts +++ b/apps/minifront/src/state/ibc-out.ts @@ -19,7 +19,7 @@ import { amountMoreThanBalance } from './send'; import { getAssetId } from '@penumbra-zone/getters/metadata'; import { assetPatterns } from '@penumbra-zone/types/assets'; import { bech32, bech32m } from 'bech32'; -import { errorToast } from '@repo/ui/lib/toast/presets'; +import { errorToast } from '@penumbra-zone/ui/lib/toast/presets'; import { Chain } from '@penumbra-labs/registry'; import { Metadata } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; import { Channel } from '@buf/cosmos_ibc.bufbuild_es/ibc/core/channel/v1/channel_pb'; diff --git a/apps/minifront/src/state/swap/dutch-auction/index.ts b/apps/minifront/src/state/swap/dutch-auction/index.ts index ac01a821f9..bc0e2c4e66 100644 --- a/apps/minifront/src/state/swap/dutch-auction/index.ts +++ b/apps/minifront/src/state/swap/dutch-auction/index.ts @@ -7,7 +7,7 @@ import { sendSimulateTradeRequest } from '../helpers'; import { fromBaseUnitAmount, isZero, multiplyAmountByNumber } from '@penumbra-zone/types/amount'; import { getDisplayDenomExponent } from '@penumbra-zone/getters/metadata'; import { Amount } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/num/v1/num_pb'; -import { errorToast } from '@repo/ui/lib/toast/presets'; +import { errorToast } from '@penumbra-zone/ui/lib/toast/presets'; import { ZQueryState, createZQuery } from '@penumbra-zone/zquery'; import { AuctionInfo, getAuctionInfos } from '../../../fetchers/auction-infos'; import { Metadata } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; diff --git a/apps/minifront/src/state/swap/instant-swap.ts b/apps/minifront/src/state/swap/instant-swap.ts index f37bf96864..70afdb5668 100644 --- a/apps/minifront/src/state/swap/instant-swap.ts +++ b/apps/minifront/src/state/swap/instant-swap.ts @@ -10,7 +10,7 @@ import { import { BigNumber } from 'bignumber.js'; import { getAddressByIndex } from '../../fetchers/address'; import { StateCommitment } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/crypto/tct/v1/tct_pb'; -import { errorToast } from '@repo/ui/lib/toast/presets'; +import { errorToast } from '@penumbra-zone/ui/lib/toast/presets'; import { SwapExecution, SwapExecution_Trace, diff --git a/apps/node-status/package.json b/apps/node-status/package.json index 6d51617c2c..068a10d97b 100644 --- a/apps/node-status/package.json +++ b/apps/node-status/package.json @@ -14,7 +14,7 @@ "dependencies": { "@connectrpc/connect-web": "^1.4.0", "@penumbra-zone/protobuf": "workspace:*", - "@repo/ui": "workspace:*", + "@penumbra-zone/ui": "workspace:*", "date-fns": "^3.6.0", "react": "^18.3.1", "react-dom": "^18.3.1", diff --git a/apps/node-status/postcss.config.js b/apps/node-status/postcss.config.js index a2051ffd15..8e18cdcb77 100644 --- a/apps/node-status/postcss.config.js +++ b/apps/node-status/postcss.config.js @@ -1 +1 @@ -export { default } from '@repo/ui/postcss.config.js'; +export { default } from '@penumbra-zone/ui/postcss.config.js'; diff --git a/apps/node-status/src/components/error-boundary.tsx b/apps/node-status/src/components/error-boundary.tsx index e22f665d07..3110463191 100644 --- a/apps/node-status/src/components/error-boundary.tsx +++ b/apps/node-status/src/components/error-boundary.tsx @@ -1,4 +1,4 @@ -import { SplashPage } from '@repo/ui/components/ui/splash-page'; +import { SplashPage } from '@penumbra-zone/ui/components/ui/splash-page'; import { useRouteError } from 'react-router-dom'; export const ErrorBoundary = () => { diff --git a/apps/node-status/src/components/frontend-referral.tsx b/apps/node-status/src/components/frontend-referral.tsx index d3e9465002..cffca9789a 100644 --- a/apps/node-status/src/components/frontend-referral.tsx +++ b/apps/node-status/src/components/frontend-referral.tsx @@ -1,4 +1,4 @@ -import { Button } from '@repo/ui/components/ui/button'; +import { Button } from '@penumbra-zone/ui/components/ui/button'; import { devFrontend, prodFrontend } from '../constants'; export const FrontendReferral = () => { diff --git a/apps/node-status/src/components/header.tsx b/apps/node-status/src/components/header.tsx index 72459311d8..7581827bac 100644 --- a/apps/node-status/src/components/header.tsx +++ b/apps/node-status/src/components/header.tsx @@ -1,6 +1,6 @@ import { Link } from 'react-router-dom'; import { LineWave } from 'react-loader-spinner'; -import { cn } from '@repo/ui/lib/utils'; +import { cn } from '@penumbra-zone/ui/lib/utils'; import { useDelayedIsLoading } from '../fetching/refetch-hook'; export const Header = () => { diff --git a/apps/node-status/src/components/node-info.tsx b/apps/node-status/src/components/node-info.tsx index db4660aa9c..c6b7c31c4e 100644 --- a/apps/node-status/src/components/node-info.tsx +++ b/apps/node-status/src/components/node-info.tsx @@ -1,6 +1,6 @@ import { useLoaderData } from 'react-router-dom'; -import { Card } from '@repo/ui/components/ui/card'; -import { Identicon } from '@repo/ui/components/ui/identicon'; +import { Card } from '@penumbra-zone/ui/components/ui/card'; +import { Identicon } from '@penumbra-zone/ui/components/ui/identicon'; import { IndexLoaderResponse } from '../fetching/loader'; import { uint8ArrayToString } from '@penumbra-zone/types/string'; diff --git a/apps/node-status/src/components/sync-info.tsx b/apps/node-status/src/components/sync-info.tsx index cb9ae6ab95..db6d6309b6 100644 --- a/apps/node-status/src/components/sync-info.tsx +++ b/apps/node-status/src/components/sync-info.tsx @@ -1,6 +1,6 @@ import { useLoaderData } from 'react-router-dom'; import { IndexLoaderResponse } from '../fetching/loader'; -import { Card } from '@repo/ui/components/ui/card'; +import { Card } from '@penumbra-zone/ui/components/ui/card'; import { format } from 'date-fns'; import { SyncInfo as SyncInfoProto } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/util/tendermint_proxy/v1/tendermint_proxy_pb'; diff --git a/apps/node-status/src/components/validator-info.tsx b/apps/node-status/src/components/validator-info.tsx index a86f5bc9e6..7baaf8b33d 100644 --- a/apps/node-status/src/components/validator-info.tsx +++ b/apps/node-status/src/components/validator-info.tsx @@ -1,5 +1,5 @@ import { useLoaderData } from 'react-router-dom'; -import { Card } from '@repo/ui/components/ui/card'; +import { Card } from '@penumbra-zone/ui/components/ui/card'; import { IndexLoaderResponse } from '../fetching/loader'; import { PublicKey } from '@buf/tendermint_tendermint.bufbuild_es/tendermint/crypto/keys_pb'; import { uint8ArrayToHex } from '@penumbra-zone/types/hex'; diff --git a/apps/node-status/src/main.tsx b/apps/node-status/src/main.tsx index bdd8ec53e7..df941faf75 100644 --- a/apps/node-status/src/main.tsx +++ b/apps/node-status/src/main.tsx @@ -3,7 +3,7 @@ import { createRoot } from 'react-dom/client'; import { RouterProvider } from 'react-router-dom'; import { router } from './components/router'; -import '@repo/ui/styles/globals.css'; +import '@penumbra-zone/ui/styles/globals.css'; const Main = () => ( diff --git a/packages/ui/package.json b/packages/ui/package.json index 5f9e2b040a..db73bbb228 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,14 +1,13 @@ { - "name": "@repo/ui", + "name": "@penumbra-zone/ui", "version": "5.0.0", - "private": true, "license": "(MIT OR Apache-2.0)", "type": "module", "engine": { "node": ">=22" }, "scripts": { - "build-storybook": "storybook build", + "build": "tsc --build && tsc-alias", "lint": "eslint components lib", "storybook": "storybook dev -p 6006", "test": "vitest run", @@ -16,12 +15,13 @@ }, "files": [ "dist", + "components", "postcss.config.js", "fonts", "styles" ], "exports": { - "./components/ui/*": "./components/ui/*.tsx", + "./components/*": "./components/*.tsx", "./components/ui/dutch-auction-component": "./components/ui/dutch-auction-component/index.tsx", "./components/ui/identicon": "./components/ui/identicon/index.tsx", "./components/ui/slider": "./components/ui/slider/index.tsx", @@ -35,9 +35,9 @@ }, "publishConfig": { "exports": { - "./components/ui/*": { - "default": "./dist/components/ui/*.js", - "types": "./dist/components/ui/*.d.ts" + "./components/*": { + "default": "./dist/components/*.js", + "types": "./dist/components/*.d.ts" }, "./components/ui/dutch-auction-component": { "default": "./dist/components/ui/dutch-auction-component/index.js", diff --git a/packages/ui/tsconfig.json b/packages/ui/tsconfig.json index c16819a147..05c1ed2982 100644 --- a/packages/ui/tsconfig.json +++ b/packages/ui/tsconfig.json @@ -1,4 +1,9 @@ { "extends": "@repo/tsconfig/vite.json", - "include": ["components", "lib", "tests-setup.ts"] + "include": ["components", "lib", "tests-setup.ts"], + "compilerOptions": { + "outDir": "dist", + "declarationMap": false, + "sourceMap": false + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 23bdd02a40..d470dc7b9a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -165,6 +165,9 @@ importers: '@penumbra-zone/types': specifier: workspace:* version: link:../../packages/types + '@penumbra-zone/ui': + specifier: workspace:* + version: link:../../packages/ui '@penumbra-zone/zquery': specifier: workspace:* version: link:../../packages/zquery @@ -186,9 +189,6 @@ importers: '@remix-run/router': specifier: ^1.16.1 version: 1.16.1 - '@repo/ui': - specifier: workspace:* - version: link:../../packages/ui '@tanstack/react-query': specifier: 4.36.1 version: 4.36.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -277,7 +277,7 @@ importers: '@penumbra-zone/protobuf': specifier: workspace:* version: link:../../packages/protobuf - '@repo/ui': + '@penumbra-zone/ui': specifier: workspace:* version: link:../../packages/ui date-fns: From 9a3308be519ca2e25f0b950a743bb32f155d188c Mon Sep 17 00:00:00 2001 From: Max Korsunov Date: Thu, 20 Jun 2024 12:30:53 +0200 Subject: [PATCH 2/9] fix(ui): move penumbra packages to dev dependencies --- packages/ui/package.json | 6 +++--- pnpm-lock.yaml | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/ui/package.json b/packages/ui/package.json index db73bbb228..3de0f67e53 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -125,6 +125,9 @@ "tinycolor2": "^1.6.0" }, "devDependencies": { + "@penumbra-zone/getters": "workspace:*", + "@penumbra-zone/perspective": "workspace:*", + "@repo/tailwind-config": "workspace:*", "@storybook/addon-essentials": "^8.1.1", "@storybook/addon-interactions": "^8.1.1", "@storybook/addon-links": "^8.1.1", @@ -145,9 +148,6 @@ "peerDependencies": { "@buf/penumbra-zone_penumbra.bufbuild_es": "1.10.0-20240616005217-ca45ca80333e.1", "@bufbuild/protobuf": "^1.10.0", - "@penumbra-zone/getters": "workspace:*", - "@penumbra-zone/perspective": "workspace:*", - "@repo/tailwind-config": "workspace:*", "postcss": "^8.4.38", "react": "^18.3.1", "tailwindcss": "^3.4.3" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d470dc7b9a..a76e46613b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -638,12 +638,6 @@ importers: '@penumbra-zone/bech32m': specifier: workspace:* version: link:../bech32m - '@penumbra-zone/getters': - specifier: workspace:* - version: link:../getters - '@penumbra-zone/perspective': - specifier: workspace:* - version: link:../perspective '@penumbra-zone/types': specifier: workspace:* version: link:../types @@ -692,9 +686,6 @@ importers: '@radix-ui/react-tooltip': specifier: ^1.0.7 version: 1.0.7(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@repo/tailwind-config': - specifier: workspace:* - version: link:../tailwind-config '@testing-library/jest-dom': specifier: ^6.4.5 version: 6.4.6(vitest@1.6.0(@types/node@20.14.4)(@vitest/browser@1.6.0(playwright@1.44.1)(vitest@1.6.0))(jsdom@24.1.0(bufferutil@4.0.8)(utf-8-validate@6.0.4))(terser@5.31.1)) @@ -783,6 +774,15 @@ importers: specifier: ^1.6.0 version: 1.6.0 devDependencies: + '@penumbra-zone/getters': + specifier: workspace:* + version: link:../getters + '@penumbra-zone/perspective': + specifier: workspace:* + version: link:../perspective + '@repo/tailwind-config': + specifier: workspace:* + version: link:../tailwind-config '@storybook/addon-essentials': specifier: ^8.1.1 version: 8.1.10(@types/react-dom@18.3.0)(@types/react@18.3.3)(prettier@3.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) From 4ba99543788b7bd23d20e7e355d00f06faa09ccc Mon Sep 17 00:00:00 2001 From: Max Korsunov Date: Thu, 20 Jun 2024 12:51:08 +0200 Subject: [PATCH 3/9] fix(ui): don't export components directory from UI --- packages/ui/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/ui/package.json b/packages/ui/package.json index 3de0f67e53..7bc30730e4 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -15,7 +15,6 @@ }, "files": [ "dist", - "components", "postcss.config.js", "fonts", "styles" From cfe8035e1aa028d43d1094b25e1398e3757a0334 Mon Sep 17 00:00:00 2001 From: Max Korsunov Date: Thu, 20 Jun 2024 15:22:31 +0200 Subject: [PATCH 4/9] feat(ui): #1336: start separating ui components --- .../dashboard/assets-table/index.tsx | 4 +- .../account-switcher.test.tsx | 2 +- .../index.tsx} | 6 +-- packages/ui/components/ui/address.tsx | 0 .../{ => address}/address-component.test.tsx | 0 .../ui/{ => address}/address-component.tsx | 2 +- .../ui/{ => address}/address-icon.tsx | 4 +- packages/ui/components/ui/address/index.ts | 2 + .../components/ui/avatar/avatar.stories.tsx | 26 ++++++++++ .../ui/{avatar.tsx => avatar/index.tsx} | 2 +- packages/ui/components/ui/box/box.stories.tsx | 40 ++++++++++++++++ .../components/ui/{box.tsx => box/index.tsx} | 2 +- .../ui/{ => button}/button.stories.tsx | 2 +- .../ui/{button.tsx => button/index.tsx} | 2 +- .../ui/components/ui/card/card.stories.tsx | 48 +++++++++++++++++++ .../ui/{card.tsx => card/index.tsx} | 2 +- .../components/ui/dialog/dialog.stories.tsx | 34 +++++++++++++ .../ui/{dialog.tsx => dialog/index.tsx} | 2 +- .../ui/{pill.tsx => pill/index.tsx} | 0 .../ui/components/ui/pill/pill.stories.tsx | 25 ++++++++++ packages/ui/components/ui/select-account.tsx | 4 +- .../ui/{table.tsx => table/index.tsx} | 2 +- .../ui/components/ui/table/table.stories.tsx | 40 ++++++++++++++++ .../ui/{tabs.tsx => tabs/index.tsx} | 2 +- .../ui/components/ui/tabs/tabs.stories.tsx | 35 ++++++++++++++ .../ui/components/ui/tx/view/address-view.tsx | 4 +- packages/ui/readme.md | 28 +++++++++++ 27 files changed, 299 insertions(+), 21 deletions(-) rename packages/ui/components/ui/{ => account-switcher}/account-switcher.test.tsx (98%) rename packages/ui/components/ui/{account-switcher.tsx => account-switcher/index.tsx} (97%) delete mode 100644 packages/ui/components/ui/address.tsx rename packages/ui/components/ui/{ => address}/address-component.test.tsx (100%) rename packages/ui/components/ui/{ => address}/address-component.tsx (93%) rename packages/ui/components/ui/{ => address}/address-icon.tsx (85%) create mode 100644 packages/ui/components/ui/address/index.ts create mode 100644 packages/ui/components/ui/avatar/avatar.stories.tsx rename packages/ui/components/ui/{avatar.tsx => avatar/index.tsx} (97%) create mode 100644 packages/ui/components/ui/box/box.stories.tsx rename packages/ui/components/ui/{box.tsx => box/index.tsx} (98%) rename packages/ui/components/ui/{ => button}/button.stories.tsx (91%) rename packages/ui/components/ui/{button.tsx => button/index.tsx} (98%) create mode 100644 packages/ui/components/ui/card/card.stories.tsx rename packages/ui/components/ui/{card.tsx => card/index.tsx} (98%) create mode 100644 packages/ui/components/ui/dialog/dialog.stories.tsx rename packages/ui/components/ui/{dialog.tsx => dialog/index.tsx} (99%) rename packages/ui/components/ui/{pill.tsx => pill/index.tsx} (100%) create mode 100644 packages/ui/components/ui/pill/pill.stories.tsx rename packages/ui/components/ui/{table.tsx => table/index.tsx} (98%) create mode 100644 packages/ui/components/ui/table/table.stories.tsx rename packages/ui/components/ui/{tabs.tsx => tabs/index.tsx} (97%) create mode 100644 packages/ui/components/ui/tabs/tabs.stories.tsx create mode 100644 packages/ui/readme.md diff --git a/apps/minifront/src/components/dashboard/assets-table/index.tsx b/apps/minifront/src/components/dashboard/assets-table/index.tsx index 27fd206e08..bf946ba0d5 100644 --- a/apps/minifront/src/components/dashboard/assets-table/index.tsx +++ b/apps/minifront/src/components/dashboard/assets-table/index.tsx @@ -1,5 +1,5 @@ -import { AddressIcon } from '@penumbra-zone/ui/components/ui/address-icon'; -import { AddressComponent } from '@penumbra-zone/ui/components/ui/address-component'; +import { AddressIcon } from '@penumbra-zone/ui/components/ui/address/address-icon'; +import { AddressComponent } from '@penumbra-zone/ui/components/ui/address/address-component'; import { Table, TableBody, diff --git a/packages/ui/components/ui/account-switcher.test.tsx b/packages/ui/components/ui/account-switcher/account-switcher.test.tsx similarity index 98% rename from packages/ui/components/ui/account-switcher.test.tsx rename to packages/ui/components/ui/account-switcher/account-switcher.test.tsx index d7917b1be4..b57c7323c2 100644 --- a/packages/ui/components/ui/account-switcher.test.tsx +++ b/packages/ui/components/ui/account-switcher/account-switcher.test.tsx @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest'; -import { AccountSwitcher } from './account-switcher'; +import { AccountSwitcher } from '.'; import { fireEvent, render } from '@testing-library/react'; describe('', () => { diff --git a/packages/ui/components/ui/account-switcher.tsx b/packages/ui/components/ui/account-switcher/index.tsx similarity index 97% rename from packages/ui/components/ui/account-switcher.tsx rename to packages/ui/components/ui/account-switcher/index.tsx index 0ce8bd5afb..5f63eea8bb 100644 --- a/packages/ui/components/ui/account-switcher.tsx +++ b/packages/ui/components/ui/account-switcher/index.tsx @@ -1,8 +1,8 @@ import { ArrowLeftIcon, ArrowRightIcon } from 'lucide-react'; import { useMemo, useState } from 'react'; -import { cn } from '../../lib/utils'; -import { Button } from './button'; -import { Input } from './input'; +import { cn } from '../../../lib/utils'; +import { Button } from '../button'; +import { Input } from '../input'; const MAX_INDEX = 2 ** 32; diff --git a/packages/ui/components/ui/address.tsx b/packages/ui/components/ui/address.tsx deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/packages/ui/components/ui/address-component.test.tsx b/packages/ui/components/ui/address/address-component.test.tsx similarity index 100% rename from packages/ui/components/ui/address-component.test.tsx rename to packages/ui/components/ui/address/address-component.test.tsx diff --git a/packages/ui/components/ui/address-component.tsx b/packages/ui/components/ui/address/address-component.tsx similarity index 93% rename from packages/ui/components/ui/address-component.tsx rename to packages/ui/components/ui/address/address-component.tsx index 40d9ca228b..4d0ec27e71 100644 --- a/packages/ui/components/ui/address-component.tsx +++ b/packages/ui/components/ui/address/address-component.tsx @@ -1,7 +1,7 @@ import { Address } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/keys/v1/keys_pb'; import { bech32mAddress } from '@penumbra-zone/bech32m/penumbra'; -interface AddressComponentProps { +export interface AddressComponentProps { address: Address; ephemeral?: boolean; } diff --git a/packages/ui/components/ui/address-icon.tsx b/packages/ui/components/ui/address/address-icon.tsx similarity index 85% rename from packages/ui/components/ui/address-icon.tsx rename to packages/ui/components/ui/address/address-icon.tsx index fc14ce11c7..5b6e1fe4b1 100644 --- a/packages/ui/components/ui/address-icon.tsx +++ b/packages/ui/components/ui/address/address-icon.tsx @@ -1,8 +1,8 @@ -import { Identicon } from './identicon'; +import { Identicon } from '../identicon'; import { Address } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/keys/v1/keys_pb'; import { bech32mAddress } from '@penumbra-zone/bech32m/penumbra'; -interface AddressIconProps { +export interface AddressIconProps { address: Address; size: number; } diff --git a/packages/ui/components/ui/address/index.ts b/packages/ui/components/ui/address/index.ts new file mode 100644 index 0000000000..fab022d05a --- /dev/null +++ b/packages/ui/components/ui/address/index.ts @@ -0,0 +1,2 @@ +export { AddressIcon, type AddressIconProps } from './address-icon'; +export { AddressComponent, type AddressComponentProps } from './address-component'; diff --git a/packages/ui/components/ui/avatar/avatar.stories.tsx b/packages/ui/components/ui/avatar/avatar.stories.tsx new file mode 100644 index 0000000000..5d855fd77a --- /dev/null +++ b/packages/ui/components/ui/avatar/avatar.stories.tsx @@ -0,0 +1,26 @@ +import type { Meta, StoryObj } from '@storybook/react'; + +import { Avatar, AvatarImage } from '.'; + +const meta: Meta = { + component: Avatar, + title: 'Avatar', + tags: ['autodocs'], +}; +export default meta; + +type Story = StoryObj; + +const EXAMPLE_URL = + 'https://images.unsplash.com/photo-1473830394358-91588751b241?q=80&w=2970&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D'; + +export const Full: Story = { + args: {}, + render: args => { + return ( + + + + ); + }, +}; diff --git a/packages/ui/components/ui/avatar.tsx b/packages/ui/components/ui/avatar/index.tsx similarity index 97% rename from packages/ui/components/ui/avatar.tsx rename to packages/ui/components/ui/avatar/index.tsx index 5b6d80ea87..c5f4894664 100644 --- a/packages/ui/components/ui/avatar.tsx +++ b/packages/ui/components/ui/avatar/index.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import * as AvatarPrimitive from '@radix-ui/react-avatar'; -import { cn } from '../../lib/utils'; +import { cn } from '../../../lib/utils'; const Avatar = React.forwardRef< React.ElementRef, diff --git a/packages/ui/components/ui/box/box.stories.tsx b/packages/ui/components/ui/box/box.stories.tsx new file mode 100644 index 0000000000..919c344db7 --- /dev/null +++ b/packages/ui/components/ui/box/box.stories.tsx @@ -0,0 +1,40 @@ +import type { Meta, StoryObj } from '@storybook/react'; + +import { Box } from '.'; + +const meta: Meta = { + component: Box, + title: 'Box', + tags: ['autodocs'], +}; +export default meta; + +type Story = StoryObj; + +export const Basic: Story = { + args: { + children: 'Box', + }, +}; + +export const WithLabel: Story = { + args: { + children: 'Box', + label: 'Label', + headerContent: 'Header content', + }, +}; + +export const SpacingCompact: Story = { + args: { + children: 'Box', + spacing: 'compact', + }, +}; + +export const RedBorder: Story = { + args: { + children: 'Box', + state: 'error', + }, +}; diff --git a/packages/ui/components/ui/box.tsx b/packages/ui/components/ui/box/index.tsx similarity index 98% rename from packages/ui/components/ui/box.tsx rename to packages/ui/components/ui/box/index.tsx index 87835dfe6d..25529d0386 100644 --- a/packages/ui/components/ui/box.tsx +++ b/packages/ui/components/ui/box/index.tsx @@ -1,7 +1,7 @@ import { cva, VariantProps } from 'class-variance-authority'; import { motion } from 'framer-motion'; import { PropsWithChildren, ReactNode } from 'react'; -import { cn } from '../../lib/utils'; +import { cn } from '../../../lib/utils'; import { RESOLVED_TAILWIND_CONFIG } from '@repo/tailwind-config/resolved-tailwind-config'; const variants = cva('rounded-lg border bg-background', { diff --git a/packages/ui/components/ui/button.stories.tsx b/packages/ui/components/ui/button/button.stories.tsx similarity index 91% rename from packages/ui/components/ui/button.stories.tsx rename to packages/ui/components/ui/button/button.stories.tsx index 3e75704290..3ab8f87b8e 100644 --- a/packages/ui/components/ui/button.stories.tsx +++ b/packages/ui/components/ui/button/button.stories.tsx @@ -1,6 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { Button } from './button'; +import { Button } from './index'; const meta: Meta = { component: Button, diff --git a/packages/ui/components/ui/button.tsx b/packages/ui/components/ui/button/index.tsx similarity index 98% rename from packages/ui/components/ui/button.tsx rename to packages/ui/components/ui/button/index.tsx index 1396535f59..d0f90f813c 100644 --- a/packages/ui/components/ui/button.tsx +++ b/packages/ui/components/ui/button/index.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { Slot } from '@radix-ui/react-slot'; import { cva, type VariantProps } from 'class-variance-authority'; -import { cn } from '../../lib/utils'; +import { cn } from '../../../lib/utils'; const buttonVariants = cva( 'inline-flex items-center justify-center rounded-lg px-4 font-bold ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50', diff --git a/packages/ui/components/ui/card/card.stories.tsx b/packages/ui/components/ui/card/card.stories.tsx new file mode 100644 index 0000000000..6a5749a092 --- /dev/null +++ b/packages/ui/components/ui/card/card.stories.tsx @@ -0,0 +1,48 @@ +import type { Meta, StoryObj } from '@storybook/react'; + +import { Card, CardHeader, CardTitle, CardContent, CardDescription, CardFooter } from '.'; + +const meta: Meta = { + component: Card, + title: 'Card', + tags: ['autodocs'], +}; +export default meta; + +type Story = StoryObj; + +export const Basic: Story = { + args: { + children: 'Save', + }, +}; + +export const Gradient: Story = { + args: { + children: 'Save', + gradient: true, + }, +}; + +export const Light: Story = { + args: { + children: 'Save', + light: true, + }, +}; + +export const Full: Story = { + args: {}, + render: args => { + return ( + + + Card Title + + Card Description + This is content + Card footer + + ); + }, +}; diff --git a/packages/ui/components/ui/card.tsx b/packages/ui/components/ui/card/index.tsx similarity index 98% rename from packages/ui/components/ui/card.tsx rename to packages/ui/components/ui/card/index.tsx index e20249008e..3b0b9b202b 100644 --- a/packages/ui/components/ui/card.tsx +++ b/packages/ui/components/ui/card/index.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { cn } from '../../lib/utils'; +import { cn } from '../../../lib/utils'; import { motion } from 'framer-motion'; export interface CardProps extends React.HTMLAttributes { diff --git a/packages/ui/components/ui/dialog/dialog.stories.tsx b/packages/ui/components/ui/dialog/dialog.stories.tsx new file mode 100644 index 0000000000..780050fda7 --- /dev/null +++ b/packages/ui/components/ui/dialog/dialog.stories.tsx @@ -0,0 +1,34 @@ +import type { Meta, StoryObj } from '@storybook/react'; + +import { Dialog, DialogHeader, DialogClose, DialogContent, DialogTrigger } from '.'; +import { Button } from '../button'; + +const meta: Meta = { + component: Dialog, + title: 'Dialog', + tags: ['autodocs'], +}; +export default meta; + +type Story = StoryObj; + +export const Full: Story = { + args: {}, + render: args => { + return ( + + + + + + + Header here, which includes a built-in close button. +

Content here

+ +
Clicking anything inside here will close the dialog.
+
+
+
+ ); + }, +}; diff --git a/packages/ui/components/ui/dialog.tsx b/packages/ui/components/ui/dialog/index.tsx similarity index 99% rename from packages/ui/components/ui/dialog.tsx rename to packages/ui/components/ui/dialog/index.tsx index 31a52702db..67ad4393a1 100644 --- a/packages/ui/components/ui/dialog.tsx +++ b/packages/ui/components/ui/dialog/index.tsx @@ -3,7 +3,7 @@ import * as React from 'react'; import * as DialogPrimitive from '@radix-ui/react-dialog'; import { Cross2Icon } from '@radix-ui/react-icons'; -import { cn } from '../../lib/utils'; +import { cn } from '../../../lib/utils'; import { cva, VariantProps } from 'class-variance-authority'; import { motion } from 'framer-motion'; diff --git a/packages/ui/components/ui/pill.tsx b/packages/ui/components/ui/pill/index.tsx similarity index 100% rename from packages/ui/components/ui/pill.tsx rename to packages/ui/components/ui/pill/index.tsx diff --git a/packages/ui/components/ui/pill/pill.stories.tsx b/packages/ui/components/ui/pill/pill.stories.tsx new file mode 100644 index 0000000000..8e7ad193d8 --- /dev/null +++ b/packages/ui/components/ui/pill/pill.stories.tsx @@ -0,0 +1,25 @@ +import type { Meta, StoryObj } from '@storybook/react'; + +import { Pill } from '.'; + +const meta: Meta = { + component: Pill, + title: 'Pill', + tags: ['autodocs'], +}; +export default meta; + +type Story = StoryObj; + +export const Basic: Story = { + args: { + children: 'Pill', + }, +}; + +export const Dashed: Story = { + args: { + children: 'Pill', + variant: 'dashed', + }, +}; diff --git a/packages/ui/components/ui/select-account.tsx b/packages/ui/components/ui/select-account.tsx index 4600c12039..b2d7a33968 100644 --- a/packages/ui/components/ui/select-account.tsx +++ b/packages/ui/components/ui/select-account.tsx @@ -1,11 +1,11 @@ -import { AddressIcon } from './address-icon'; +import { AddressIcon } from './address/address-icon'; import { InfoIcon } from 'lucide-react'; import { CopyToClipboardIconButton } from './copy-to-clipboard-icon-button'; import { IncognitoIcon } from './icons/incognito'; import { Switch } from './switch'; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './tooltip'; import { useEffect, useState } from 'react'; -import { AddressComponent } from './address-component'; +import { AddressComponent } from './address/address-component'; import { Address } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/keys/v1/keys_pb'; import { AccountSwitcher } from './account-switcher'; import { bech32mAddress } from '@penumbra-zone/bech32m/penumbra'; diff --git a/packages/ui/components/ui/table.tsx b/packages/ui/components/ui/table/index.tsx similarity index 98% rename from packages/ui/components/ui/table.tsx rename to packages/ui/components/ui/table/index.tsx index 9b20a84243..72ddd18717 100644 --- a/packages/ui/components/ui/table.tsx +++ b/packages/ui/components/ui/table/index.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { cn } from '../../lib/utils'; +import { cn } from '../../../lib/utils'; const Table = React.forwardRef>( ({ className, ...props }, ref) => ( diff --git a/packages/ui/components/ui/table/table.stories.tsx b/packages/ui/components/ui/table/table.stories.tsx new file mode 100644 index 0000000000..d9a5372255 --- /dev/null +++ b/packages/ui/components/ui/table/table.stories.tsx @@ -0,0 +1,40 @@ +import type { Meta, StoryObj } from '@storybook/react'; + +import { Table, TableBody, TableHead, TableHeader, TableRow, TableCell } from '.'; + +const meta: Meta = { + component: Table, + title: 'Table', + tags: ['autodocs'], +}; +export default meta; + +type Story = StoryObj; + +export const Full: Story = { + args: {}, + render: args => { + return ( + + + + Block Height + Description + Transaction Hash + + + + + + +

10000

+

Some description

+

hash

+

Action

+
+
+
+
+ ); + }, +}; diff --git a/packages/ui/components/ui/tabs.tsx b/packages/ui/components/ui/tabs/index.tsx similarity index 97% rename from packages/ui/components/ui/tabs.tsx rename to packages/ui/components/ui/tabs/index.tsx index 341aeeeb00..4bfd45269b 100644 --- a/packages/ui/components/ui/tabs.tsx +++ b/packages/ui/components/ui/tabs/index.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import * as TabsPrimitive from '@radix-ui/react-tabs'; -import { cn } from '../../lib/utils'; +import { cn } from '../../../lib/utils'; const Tabs = TabsPrimitive.Root; diff --git a/packages/ui/components/ui/tabs/tabs.stories.tsx b/packages/ui/components/ui/tabs/tabs.stories.tsx new file mode 100644 index 0000000000..8fda569be9 --- /dev/null +++ b/packages/ui/components/ui/tabs/tabs.stories.tsx @@ -0,0 +1,35 @@ +import type { Meta, StoryObj } from '@storybook/react'; + +import { Tabs, TabsContent, TabsList, TabsTrigger } from '.'; +import { useState } from 'react'; + +const meta: Meta = { + component: Tabs, + title: 'Tabs', + tags: ['autodocs'], +}; +export default meta; + +type Story = StoryObj; + +export const Full: Story = { + args: { + defaultValue: 'one', + }, + render: args => { + const [active, setActive] = useState(args.defaultValue); + + return ( + + + One + Two + Three + + Content for one + Content for two + Content for three + + ); + }, +}; diff --git a/packages/ui/components/ui/tx/view/address-view.tsx b/packages/ui/components/ui/tx/view/address-view.tsx index 461fd0db85..d04c678f92 100644 --- a/packages/ui/components/ui/tx/view/address-view.tsx +++ b/packages/ui/components/ui/tx/view/address-view.tsx @@ -1,7 +1,7 @@ -import { AddressIcon } from '../../address-icon'; +import { AddressIcon } from '../../address/address-icon'; import { AddressView } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/keys/v1/keys_pb'; import { CopyToClipboardIconButton } from '../../copy-to-clipboard-icon-button'; -import { AddressComponent } from '../../address-component'; +import { AddressComponent } from '../../address/address-component'; import { bech32mAddress } from '@penumbra-zone/bech32m/penumbra'; interface AddressViewProps { diff --git a/packages/ui/readme.md b/packages/ui/readme.md new file mode 100644 index 0000000000..a428260a7a --- /dev/null +++ b/packages/ui/readme.md @@ -0,0 +1,28 @@ +# Penumbra UI + +This package contains the UI components for the Penumbra web. + +## Set up + +First, install the library: + +```bash +npm i @penumbra-zone/ui +``` + +Then, configure the Tailwind in your project. Edit `tailwind.config.js`: + +```js +export default { + content: [ + // Parses the classes of the UI components + './node_modules/@penumbra-zone/ui/**/*.js' + ], +} +``` + +Finally, import the library CSS to the entry point of your app: + +```js +import '@penumbra-zone/ui/styles/globals.css'; +``` From 912054ce992bfe6225054273e23e927d3914aa8d Mon Sep 17 00:00:00 2001 From: Max Korsunov Date: Thu, 20 Jun 2024 20:22:48 +0200 Subject: [PATCH 5/9] feat(ui): #1336: Put all components in directories --- .../assets-table/equivalent-values.tsx | 2 +- .../dashboard/assets-table/index.tsx | 5 +- .../src/components/header/header.tsx | 2 +- .../minifront/src/components/send/receive.tsx | 2 +- .../src/components/shared/asset-selector.tsx | 4 +- .../components/shared/balance-selector.tsx | 2 +- .../src/components/shared/gas-fee.tsx | 2 +- .../account/delegation-value-view/index.tsx | 2 +- .../validator-info-component.tsx | 2 +- .../staking/account/header/index.tsx | 2 +- .../account/header/unbonding-tokens.tsx | 2 +- .../components/swap/auction-list/filters.tsx | 2 +- .../swap-form/simulate-swap-result/index.tsx | 2 +- .../simulate-swap-result/traces/index.tsx | 2 +- .../traces/trace/index.tsx | 2 +- .../src/components/swap/unclaimed-swaps.tsx | 2 +- .../src/components/tx-details/tx-viewer.tsx | 2 +- .../ui/address-view/address-view.stories.tsx | 63 +++++++++++++++ .../address-view.test.tsx | 2 +- .../index.tsx} | 6 +- .../ui/address/{index.ts => index.tsx} | 0 .../ui/asset-icon/asset-icon.stories.tsx | 44 +++++++++++ .../asset-icon/delegation-token-icon.tsx | 0 .../ui/{tx/view => }/asset-icon/index.tsx | 4 +- .../asset-icon/unbonding-token-icon.tsx | 0 .../index.tsx} | 2 +- .../balance-value-view.test.tsx | 2 +- .../index.tsx} | 4 +- .../{condensed.tsx => index.tsx} | 0 .../index.tsx} | 0 .../ui/{command.tsx => command/index.tsx} | 4 +- .../ui/components/ui/conditional-wrap.tsx | 32 -------- .../copy-to-clipboard-icon-button.tsx | 0 .../copy-to-clipboard.tsx | 4 +- .../components/ui/copy-to-clipboard/index.ts | 2 + .../progress-bar/index.tsx | 2 +- .../index.tsx} | 2 +- .../index.tsx} | 0 .../{icon-input.tsx => icon-input/index.tsx} | 2 +- .../components/ui/{ => icons}/back-icon.tsx | 2 +- .../index.tsx} | 2 +- .../ui/{input.tsx => input/index.tsx} | 2 +- .../index.tsx} | 0 packages/ui/components/ui/network.stories.tsx | 18 ----- packages/ui/components/ui/network.tsx | 34 -------- packages/ui/components/ui/popover/index.tsx | 2 + .../ui/{ => popover}/popover-menu.stories.tsx | 2 +- .../ui/{ => popover}/popover-menu.tsx | 0 .../components/ui/{ => popover}/popover.tsx | 2 +- .../ui/{progress.tsx => progress/index.tsx} | 2 +- .../index.tsx} | 2 +- .../segmented-picker.stories.tsx | 2 +- .../segmented-picker.test.tsx | 2 +- packages/ui/components/ui/select/index.tsx | 13 ++++ .../ui/{ => select}/select-account.tsx | 18 ++--- .../ui/{ => select}/select-list.stories.tsx | 0 .../ui/{ => select}/select-list.tsx | 2 +- .../ui/components/ui/{ => select}/select.tsx | 2 +- .../ui/{separator.tsx => separator/index.tsx} | 0 .../ui/{sheet.tsx => sheet/index.tsx} | 2 +- .../index.tsx} | 6 +- .../ui/{switch.tsx => switch/index.tsx} | 2 +- .../index.tsx} | 0 .../testnet-banner.test.tsx | 2 +- .../ui/{toaster.tsx => toaster/index.tsx} | 0 .../components/ui/{ => toaster}/toaster.css | 0 .../ui/{ => toaster}/toaster.stories.tsx | 4 +- .../ui/{toggle.tsx => toggle/index.tsx} | 2 +- .../ui/{tooltip.tsx => tooltip/index.tsx} | 2 +- .../ui/tx/{view => }/action-view.tsx | 24 +++--- .../action-details.tsx | 0 .../action-dutch-auction-end.tsx | 2 +- .../action-dutch-auction-schedule-view.tsx | 2 +- .../action-dutch-auction-withdraw-view.tsx | 4 +- .../tx/{view => actions-views}/delegate.tsx | 2 +- .../isc20-withdrawal.tsx | 2 +- .../ui/tx/{view => actions-views}/output.tsx | 4 +- .../ui/tx/{view => actions-views}/spend.tsx | 4 +- .../swap/index.test.tsx | 2 +- .../tx/{view => actions-views}/swap/index.tsx | 6 +- .../swap/one-way-swap.tsx | 2 +- .../swap}/swap-claim.tsx | 6 +- .../swap}/transaction-id.tsx | 2 +- .../undelegate-claim.tsx | 2 +- .../tx/{view => actions-views}/undelegate.tsx | 2 +- .../unimplemented-view.tsx | 2 +- .../value-with-address.tsx | 2 +- .../ui/tx/{view/transaction.tsx => index.tsx} | 2 +- .../components/ui/tx/{view => }/memo-view.tsx | 4 +- .../components/ui/tx/{view => }/registry.tsx | 0 .../components/ui/tx/transaction.stories.tsx | 78 +++++++++++++++++++ .../components/ui/tx/{view => }/viewbox.tsx | 6 +- .../ui/{tx/view => }/value/index.test.tsx | 2 +- .../ui/{tx/view => }/value/index.tsx | 0 .../ui/components/ui/value/value.stories.tsx | 67 ++++++++++++++++ .../ui/{tx/view => }/value/value.tsx | 4 +- packages/ui/package.json | 36 ++------- packages/ui/tsconfig.json | 6 +- 98 files changed, 391 insertions(+), 225 deletions(-) create mode 100644 packages/ui/components/ui/address-view/address-view.stories.tsx rename packages/ui/components/ui/{tx/view => address-view}/address-view.test.tsx (97%) rename packages/ui/components/ui/{tx/view/address-view.tsx => address-view/index.tsx} (88%) rename packages/ui/components/ui/address/{index.ts => index.tsx} (100%) create mode 100644 packages/ui/components/ui/asset-icon/asset-icon.stories.tsx rename packages/ui/components/ui/{tx/view => }/asset-icon/delegation-token-icon.tsx (100%) rename packages/ui/components/ui/{tx/view => }/asset-icon/index.tsx (94%) rename packages/ui/components/ui/{tx/view => }/asset-icon/unbonding-token-icon.tsx (100%) rename packages/ui/components/ui/{auction-id-component.tsx => auction-id-component/index.tsx} (91%) rename packages/ui/components/ui/{ => balance-value-view}/balance-value-view.test.tsx (97%) rename packages/ui/components/ui/{balance-value-view.tsx => balance-value-view/index.tsx} (93%) rename packages/ui/components/ui/block-sync-status/{condensed.tsx => index.tsx} (100%) rename packages/ui/components/ui/{candlestick-plot.tsx => candlestick-plot/index.tsx} (100%) rename packages/ui/components/ui/{command.tsx => command/index.tsx} (98%) delete mode 100644 packages/ui/components/ui/conditional-wrap.tsx rename packages/ui/components/ui/{ => copy-to-clipboard}/copy-to-clipboard-icon-button.tsx (100%) rename packages/ui/components/ui/{ => copy-to-clipboard}/copy-to-clipboard.tsx (94%) create mode 100644 packages/ui/components/ui/copy-to-clipboard/index.ts rename packages/ui/components/ui/{fade-transition.tsx => fade-transition/index.tsx} (93%) rename packages/ui/components/ui/{gradient-header.tsx => gradient-header/index.tsx} (100%) rename packages/ui/components/ui/{icon-input.tsx => icon-input/index.tsx} (94%) rename packages/ui/components/ui/{ => icons}/back-icon.tsx (93%) rename packages/ui/components/ui/{identity-key-component.tsx => identity-key-component/index.tsx} (92%) rename packages/ui/components/ui/{input.tsx => input/index.tsx} (97%) rename packages/ui/components/ui/{json-viewer.tsx => json-viewer/index.tsx} (100%) delete mode 100644 packages/ui/components/ui/network.stories.tsx delete mode 100644 packages/ui/components/ui/network.tsx create mode 100644 packages/ui/components/ui/popover/index.tsx rename packages/ui/components/ui/{ => popover}/popover-menu.stories.tsx (96%) rename packages/ui/components/ui/{ => popover}/popover-menu.tsx (100%) rename packages/ui/components/ui/{ => popover}/popover.tsx (96%) rename packages/ui/components/ui/{progress.tsx => progress/index.tsx} (97%) rename packages/ui/components/ui/{segmented-picker.tsx => segmented-picker/index.tsx} (98%) rename packages/ui/components/ui/{ => segmented-picker}/segmented-picker.stories.tsx (93%) rename packages/ui/components/ui/{ => segmented-picker}/segmented-picker.test.tsx (96%) create mode 100644 packages/ui/components/ui/select/index.tsx rename packages/ui/components/ui/{ => select}/select-account.tsx (86%) rename packages/ui/components/ui/{ => select}/select-list.stories.tsx (100%) rename packages/ui/components/ui/{ => select}/select-list.tsx (98%) rename packages/ui/components/ui/{ => select}/select.tsx (99%) rename packages/ui/components/ui/{separator.tsx => separator/index.tsx} (100%) rename packages/ui/components/ui/{sheet.tsx => sheet/index.tsx} (99%) rename packages/ui/components/ui/{splash-page.tsx => splash-page/index.tsx} (86%) rename packages/ui/components/ui/{switch.tsx => switch/index.tsx} (96%) rename packages/ui/components/ui/{testnet-banner.tsx => testnet-banner/index.tsx} (100%) rename packages/ui/components/ui/{ => testnet-banner}/testnet-banner.test.tsx (95%) rename packages/ui/components/ui/{toaster.tsx => toaster/index.tsx} (100%) rename packages/ui/components/ui/{ => toaster}/toaster.css (100%) rename packages/ui/components/ui/{ => toaster}/toaster.stories.tsx (88%) rename packages/ui/components/ui/{toggle.tsx => toggle/index.tsx} (97%) rename packages/ui/components/ui/{tooltip.tsx => tooltip/index.tsx} (97%) rename packages/ui/components/ui/tx/{view => }/action-view.tsx (82%) rename packages/ui/components/ui/tx/{view => actions-views}/action-details.tsx (100%) rename packages/ui/components/ui/tx/{view => actions-views}/action-dutch-auction-end.tsx (94%) rename packages/ui/components/ui/tx/{view => actions-views}/action-dutch-auction-schedule-view.tsx (94%) rename packages/ui/components/ui/tx/{view => actions-views}/action-dutch-auction-withdraw-view.tsx (92%) rename packages/ui/components/ui/tx/{view => actions-views}/delegate.tsx (97%) rename packages/ui/components/ui/tx/{view => actions-views}/isc20-withdrawal.tsx (97%) rename packages/ui/components/ui/tx/{view => actions-views}/output.tsx (90%) rename packages/ui/components/ui/tx/{view => actions-views}/spend.tsx (90%) rename packages/ui/components/ui/tx/{view => actions-views}/swap/index.test.tsx (96%) rename packages/ui/components/ui/tx/{view => actions-views}/swap/index.tsx (94%) rename packages/ui/components/ui/tx/{view => actions-views}/swap/one-way-swap.tsx (92%) rename packages/ui/components/ui/tx/{view => actions-views/swap}/swap-claim.tsx (95%) rename packages/ui/components/ui/tx/{view => actions-views/swap}/transaction-id.tsx (93%) rename packages/ui/components/ui/tx/{view => actions-views}/undelegate-claim.tsx (96%) rename packages/ui/components/ui/tx/{view => actions-views}/undelegate.tsx (97%) rename packages/ui/components/ui/tx/{view => actions-views}/unimplemented-view.tsx (91%) rename packages/ui/components/ui/tx/{view => actions-views}/value-with-address.tsx (93%) rename packages/ui/components/ui/tx/{view/transaction.tsx => index.tsx} (97%) rename packages/ui/components/ui/tx/{view => }/memo-view.tsx (90%) rename packages/ui/components/ui/tx/{view => }/registry.tsx (100%) create mode 100644 packages/ui/components/ui/tx/transaction.stories.tsx rename packages/ui/components/ui/tx/{view => }/viewbox.tsx (91%) rename packages/ui/components/ui/{tx/view => }/value/index.test.tsx (97%) rename packages/ui/components/ui/{tx/view => }/value/index.tsx (100%) create mode 100644 packages/ui/components/ui/value/value.stories.tsx rename packages/ui/components/ui/{tx/view => }/value/value.tsx (93%) diff --git a/apps/minifront/src/components/dashboard/assets-table/equivalent-values.tsx b/apps/minifront/src/components/dashboard/assets-table/equivalent-values.tsx index 0a3bd48673..c980b56110 100644 --- a/apps/minifront/src/components/dashboard/assets-table/equivalent-values.tsx +++ b/apps/minifront/src/components/dashboard/assets-table/equivalent-values.tsx @@ -1,7 +1,7 @@ import { ValueView } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; import { asValueView } from '@penumbra-zone/getters/equivalent-value'; import { getDisplayDenomFromView, getEquivalentValues } from '@penumbra-zone/getters/value-view'; -import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/tx/view/value'; +import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/value'; export const EquivalentValues = ({ valueView }: { valueView?: ValueView }) => { const equivalentValuesAsValueViews = (getEquivalentValues.optional()(valueView) ?? []).map( diff --git a/apps/minifront/src/components/dashboard/assets-table/index.tsx b/apps/minifront/src/components/dashboard/assets-table/index.tsx index bf946ba0d5..1a4af57b97 100644 --- a/apps/minifront/src/components/dashboard/assets-table/index.tsx +++ b/apps/minifront/src/components/dashboard/assets-table/index.tsx @@ -1,5 +1,4 @@ -import { AddressIcon } from '@penumbra-zone/ui/components/ui/address/address-icon'; -import { AddressComponent } from '@penumbra-zone/ui/components/ui/address/address-component'; +import { AddressComponent, AddressIcon } from '@penumbra-zone/ui/components/ui/address'; import { Table, TableBody, @@ -8,7 +7,7 @@ import { TableHeader, TableRow, } from '@penumbra-zone/ui/components/ui/table'; -import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/tx/view/value'; +import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/value'; import { EquivalentValues } from './equivalent-values'; import { Fragment } from 'react'; import { shouldDisplay } from './helpers'; diff --git a/apps/minifront/src/components/header/header.tsx b/apps/minifront/src/components/header/header.tsx index 642845b131..361438747b 100644 --- a/apps/minifront/src/components/header/header.tsx +++ b/apps/minifront/src/components/header/header.tsx @@ -1,4 +1,4 @@ -import { CondensedBlockSyncStatus } from '@penumbra-zone/ui/components/ui/block-sync-status/condensed'; +import { CondensedBlockSyncStatus } from '@penumbra-zone/ui/components/ui/block-sync-status'; import { TestnetBanner } from '@penumbra-zone/ui/components/ui/testnet-banner'; import { useEffect, useState } from 'react'; import { Link } from 'react-router-dom'; diff --git a/apps/minifront/src/components/send/receive.tsx b/apps/minifront/src/components/send/receive.tsx index 3433883f99..f4723d8dce 100644 --- a/apps/minifront/src/components/send/receive.tsx +++ b/apps/minifront/src/components/send/receive.tsx @@ -1,4 +1,4 @@ -import { SelectAccount } from '@penumbra-zone/ui/components/ui/select-account'; +import { SelectAccount } from '@penumbra-zone/ui/components/ui/select'; import { getAddrByIndex } from '../../fetchers/address'; export const Receive = () => { diff --git a/apps/minifront/src/components/shared/asset-selector.tsx b/apps/minifront/src/components/shared/asset-selector.tsx index 1bbd870fe0..0e551e2484 100644 --- a/apps/minifront/src/components/shared/asset-selector.tsx +++ b/apps/minifront/src/components/shared/asset-selector.tsx @@ -4,12 +4,12 @@ import { DialogContent, DialogHeader, } from '@penumbra-zone/ui/components/ui/dialog'; -import { AssetIcon } from '@penumbra-zone/ui/components/ui/tx/view/asset-icon'; +import { AssetIcon } from '@penumbra-zone/ui/components/ui/asset-icon'; import { Metadata, ValueView, } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; -import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/tx/view/value'; +import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/value'; import { useEffect, useId, useMemo, useState } from 'react'; import { IconInput } from '@penumbra-zone/ui/components/ui/icon-input'; import { MagnifyingGlassIcon } from '@radix-ui/react-icons'; diff --git a/apps/minifront/src/components/shared/balance-selector.tsx b/apps/minifront/src/components/shared/balance-selector.tsx index a3c41a5743..3f5d5a1392 100644 --- a/apps/minifront/src/components/shared/balance-selector.tsx +++ b/apps/minifront/src/components/shared/balance-selector.tsx @@ -8,7 +8,7 @@ import { DialogHeader, } from '@penumbra-zone/ui/components/ui/dialog'; import { cn } from '@penumbra-zone/ui/lib/utils'; -import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/tx/view/value'; +import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/value'; import { BalancesResponse } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/view/v1/view_pb'; import { getAddressIndex } from '@penumbra-zone/getters/address-view'; import { getDisplayDenomFromView, getSymbolFromValueView } from '@penumbra-zone/getters/value-view'; diff --git a/apps/minifront/src/components/shared/gas-fee.tsx b/apps/minifront/src/components/shared/gas-fee.tsx index 338710a768..8422e6430d 100644 --- a/apps/minifront/src/components/shared/gas-fee.tsx +++ b/apps/minifront/src/components/shared/gas-fee.tsx @@ -7,7 +7,7 @@ import { SegmentedPickerOption, } from '@penumbra-zone/ui/components/ui/segmented-picker'; import { InputBlock } from './input-block'; -import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/tx/view/value'; +import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/value'; import { Metadata, ValueView, diff --git a/apps/minifront/src/components/staking/account/delegation-value-view/index.tsx b/apps/minifront/src/components/staking/account/delegation-value-view/index.tsx index fe6b39a780..3597f61da9 100644 --- a/apps/minifront/src/components/staking/account/delegation-value-view/index.tsx +++ b/apps/minifront/src/components/staking/account/delegation-value-view/index.tsx @@ -1,6 +1,6 @@ import { ValueView } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; import { ValidatorInfoComponent } from './validator-info-component'; -import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/tx/view/value'; +import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/value'; import { StakingActions } from './staking-actions'; import { memo, useMemo } from 'react'; import { diff --git a/apps/minifront/src/components/staking/account/delegation-value-view/validator-info-component.tsx b/apps/minifront/src/components/staking/account/delegation-value-view/validator-info-component.tsx index e803c8e626..9e0a164c33 100644 --- a/apps/minifront/src/components/staking/account/delegation-value-view/validator-info-component.tsx +++ b/apps/minifront/src/components/staking/account/delegation-value-view/validator-info-component.tsx @@ -13,7 +13,7 @@ import { } from '@penumbra-zone/getters/validator-info'; import { calculateCommissionAsPercentage } from '@penumbra-zone/types/staking'; import { Metadata } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; -import { AssetIcon } from '@penumbra-zone/ui/components/ui/tx/view/asset-icon'; +import { AssetIcon } from '@penumbra-zone/ui/components/ui/asset-icon'; /** * Renders a single `ValidatorInfo`: its name and identity key, diff --git a/apps/minifront/src/components/staking/account/header/index.tsx b/apps/minifront/src/components/staking/account/header/index.tsx index 166e604d8c..7296f7e4fb 100644 --- a/apps/minifront/src/components/staking/account/header/index.tsx +++ b/apps/minifront/src/components/staking/account/header/index.tsx @@ -1,7 +1,7 @@ import { Button } from '@penumbra-zone/ui/components/ui/button'; import { Card, CardContent } from '@penumbra-zone/ui/components/ui/card'; import { AccountSwitcher } from '@penumbra-zone/ui/components/ui/account-switcher'; -import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/tx/view/value'; +import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/value'; import { Stat } from './stat'; import { AllSlices } from '../../../../state'; import { UnbondingTokens } from './unbonding-tokens'; diff --git a/apps/minifront/src/components/staking/account/header/unbonding-tokens.tsx b/apps/minifront/src/components/staking/account/header/unbonding-tokens.tsx index fc3ad4030b..a2cbaa0eee 100644 --- a/apps/minifront/src/components/staking/account/header/unbonding-tokens.tsx +++ b/apps/minifront/src/components/staking/account/header/unbonding-tokens.tsx @@ -9,7 +9,7 @@ import { TooltipTrigger, TooltipContent, } from '@penumbra-zone/ui/components/ui/tooltip'; -import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/tx/view/value'; +import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/value'; import { ReactNode } from 'react'; import { zeroValueView } from '../../../../utils/zero-value-view'; diff --git a/apps/minifront/src/components/swap/auction-list/filters.tsx b/apps/minifront/src/components/swap/auction-list/filters.tsx index 45deb56089..0852aee80e 100644 --- a/apps/minifront/src/components/swap/auction-list/filters.tsx +++ b/apps/minifront/src/components/swap/auction-list/filters.tsx @@ -1,7 +1,7 @@ import { ListFilter } from 'lucide-react'; import { AllSlices } from '../../../state'; import { useStoreShallow } from '../../../utils/use-store-shallow'; -import { PopoverMenu, PopoverMenuItem } from '@penumbra-zone/ui/components/ui/popover-menu'; +import { PopoverMenu, PopoverMenuItem } from '@penumbra-zone/ui/components/ui/popover'; import type { Filter as TFilter } from '../../../state/swap/dutch-auction'; const filtersSelector = (state: AllSlices) => ({ diff --git a/apps/minifront/src/components/swap/swap-form/simulate-swap-result/index.tsx b/apps/minifront/src/components/swap/swap-form/simulate-swap-result/index.tsx index 91ca13b820..44866a98cc 100644 --- a/apps/minifront/src/components/swap/swap-form/simulate-swap-result/index.tsx +++ b/apps/minifront/src/components/swap/swap-form/simulate-swap-result/index.tsx @@ -1,4 +1,4 @@ -import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/tx/view/value'; +import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/value'; import { PriceImpact } from './price-impact'; import { motion } from 'framer-motion'; import { SimulateSwapResult as TSimulateSwapResult } from '../../../../state/swap'; diff --git a/apps/minifront/src/components/swap/swap-form/simulate-swap-result/traces/index.tsx b/apps/minifront/src/components/swap/swap-form/simulate-swap-result/traces/index.tsx index d24ead1619..7dfe61ee85 100644 --- a/apps/minifront/src/components/swap/swap-form/simulate-swap-result/traces/index.tsx +++ b/apps/minifront/src/components/swap/swap-form/simulate-swap-result/traces/index.tsx @@ -4,7 +4,7 @@ import { Metadata, ValueView, } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; -import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/tx/view/value'; +import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/value'; import { ArrowDown, ArrowUp } from 'lucide-react'; export const Traces = ({ diff --git a/apps/minifront/src/components/swap/swap-form/simulate-swap-result/traces/trace/index.tsx b/apps/minifront/src/components/swap/swap-form/simulate-swap-result/traces/trace/index.tsx index 9344d8e9c5..68ce5d60b2 100644 --- a/apps/minifront/src/components/swap/swap-form/simulate-swap-result/traces/trace/index.tsx +++ b/apps/minifront/src/components/swap/swap-form/simulate-swap-result/traces/trace/index.tsx @@ -5,7 +5,7 @@ import { } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; import { SwapExecution_Trace } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/dex/v1/dex_pb'; import { bech32mAssetId } from '@penumbra-zone/bech32m/passet'; -import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/tx/view/value'; +import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/value'; import { Price } from './price'; const getValueView = (metadataByAssetId: Record, { amount, assetId }: Value) => diff --git a/apps/minifront/src/components/swap/unclaimed-swaps.tsx b/apps/minifront/src/components/swap/unclaimed-swaps.tsx index 573c5e3b05..8a7d4a730c 100644 --- a/apps/minifront/src/components/swap/unclaimed-swaps.tsx +++ b/apps/minifront/src/components/swap/unclaimed-swaps.tsx @@ -1,6 +1,6 @@ import { Button } from '@penumbra-zone/ui/components/ui/button'; import { Card } from '@penumbra-zone/ui/components/ui/card'; -import { AssetIcon } from '@penumbra-zone/ui/components/ui/tx/view/asset-icon'; +import { AssetIcon } from '@penumbra-zone/ui/components/ui/asset-icon'; import { AllSlices } from '../../state'; import { useUnclaimedSwaps } from '../../state/unclaimed-swaps'; import { getSwapRecordCommitment } from '@penumbra-zone/getters/swap-record'; diff --git a/apps/minifront/src/components/tx-details/tx-viewer.tsx b/apps/minifront/src/components/tx-details/tx-viewer.tsx index 0d13c4c9ee..8c9b22c786 100644 --- a/apps/minifront/src/components/tx-details/tx-viewer.tsx +++ b/apps/minifront/src/components/tx-details/tx-viewer.tsx @@ -1,5 +1,5 @@ import { JsonViewer } from '@penumbra-zone/ui/components/ui/json-viewer'; -import { TransactionViewComponent } from '@penumbra-zone/ui/components/ui/tx/view/transaction'; +import { TransactionViewComponent } from '@penumbra-zone/ui/components/ui/tx'; import { TransactionInfo } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/view/v1/view_pb'; import type { Jsonified } from '@penumbra-zone/types/jsonified'; import { useState } from 'react'; diff --git a/packages/ui/components/ui/address-view/address-view.stories.tsx b/packages/ui/components/ui/address-view/address-view.stories.tsx new file mode 100644 index 0000000000..c6a21394b0 --- /dev/null +++ b/packages/ui/components/ui/address-view/address-view.stories.tsx @@ -0,0 +1,63 @@ +import type { Meta, StoryObj } from '@storybook/react'; + +import { AddressViewComponent } from '.'; +import { + Address, + AddressIndex, + AddressView, + AddressView_Decoded, +} from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/keys/v1/keys_pb'; +import { addressFromBech32m } from '@penumbra-zone/bech32m/penumbra'; + +const meta: Meta = { + component: AddressViewComponent, + title: 'AddressViewComponent', + tags: ['autodocs'], +}; +export default meta; + +type Story = StoryObj; + +const EXAMPLE_VIEW = new AddressView({ + addressView: { + case: 'decoded', + + value: new AddressView_Decoded({ + address: new Address({ inner: new Uint8Array(80) }), + index: new AddressIndex({ + account: 0, + randomizer: new Uint8Array([0, 0, 0]), + }), + }), + }, +}); + +const EXAMPLE_VIEW_OPAQUE = new AddressView({ + addressView: { + case: 'opaque', + value: { + address: addressFromBech32m( + 'penumbra1e8k5cyds484dxvapeamwveh5khqv4jsvyvaf5wwxaaccgfghm229qw03pcar3ryy8smptevstycch0qk3uu0rgkvtjpxy3cu3rjd0agawqtlz6erev28a6sg69u7cxy0t02nd4', + ), + }, + }, +}); + +export const Decoded: Story = { + args: { + view: EXAMPLE_VIEW, + }, +}; + +export const Copiable: Story = { + args: { + view: EXAMPLE_VIEW, + copyable: true, + }, +}; + +export const Opaque: Story = { + args: { + view: EXAMPLE_VIEW_OPAQUE, + }, +}; diff --git a/packages/ui/components/ui/tx/view/address-view.test.tsx b/packages/ui/components/ui/address-view/address-view.test.tsx similarity index 97% rename from packages/ui/components/ui/tx/view/address-view.test.tsx rename to packages/ui/components/ui/address-view/address-view.test.tsx index 536d65ece2..21ea592299 100644 --- a/packages/ui/components/ui/tx/view/address-view.test.tsx +++ b/packages/ui/components/ui/address-view/address-view.test.tsx @@ -4,7 +4,7 @@ import { AddressView, AddressView_Decoded, } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/keys/v1/keys_pb'; -import { AddressViewComponent } from './address-view'; +import { AddressViewComponent } from '.'; import { describe, expect, test } from 'vitest'; import { render } from '@testing-library/react'; diff --git a/packages/ui/components/ui/tx/view/address-view.tsx b/packages/ui/components/ui/address-view/index.tsx similarity index 88% rename from packages/ui/components/ui/tx/view/address-view.tsx rename to packages/ui/components/ui/address-view/index.tsx index d04c678f92..d6a36dd2b2 100644 --- a/packages/ui/components/ui/tx/view/address-view.tsx +++ b/packages/ui/components/ui/address-view/index.tsx @@ -1,7 +1,7 @@ -import { AddressIcon } from '../../address/address-icon'; +import { AddressIcon } from '../address/address-icon'; import { AddressView } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/keys/v1/keys_pb'; -import { CopyToClipboardIconButton } from '../../copy-to-clipboard-icon-button'; -import { AddressComponent } from '../../address/address-component'; +import { CopyToClipboardIconButton } from '../copy-to-clipboard/copy-to-clipboard-icon-button'; +import { AddressComponent } from '../address/address-component'; import { bech32mAddress } from '@penumbra-zone/bech32m/penumbra'; interface AddressViewProps { diff --git a/packages/ui/components/ui/address/index.ts b/packages/ui/components/ui/address/index.tsx similarity index 100% rename from packages/ui/components/ui/address/index.ts rename to packages/ui/components/ui/address/index.tsx diff --git a/packages/ui/components/ui/asset-icon/asset-icon.stories.tsx b/packages/ui/components/ui/asset-icon/asset-icon.stories.tsx new file mode 100644 index 0000000000..f97205a4a0 --- /dev/null +++ b/packages/ui/components/ui/asset-icon/asset-icon.stories.tsx @@ -0,0 +1,44 @@ +import type { Meta, StoryObj } from '@storybook/react'; + +import { AssetIcon } from '.'; +import { Metadata } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; + +const meta: Meta = { + component: AssetIcon, + title: 'AssetIcon', + tags: ['autodocs'], +}; +export default meta; + +type Story = StoryObj; + +const EXAMPLE_METADATA = new Metadata({ + base: 'upenumbra', + display: 'penumbra', + symbol: 'UM', + images: [ + { + svg: 'https://raw.githubusercontent.com/prax-wallet/registry/main/images/um.svg', + }, + ], +}); + +export const Small: Story = { + args: { + metadata: EXAMPLE_METADATA, + }, +}; + +export const ExtraSmall: Story = { + args: { + metadata: EXAMPLE_METADATA, + size: 'xs', + }, +}; + +export const Large: Story = { + args: { + metadata: EXAMPLE_METADATA, + size: 'lg', + }, +}; diff --git a/packages/ui/components/ui/tx/view/asset-icon/delegation-token-icon.tsx b/packages/ui/components/ui/asset-icon/delegation-token-icon.tsx similarity index 100% rename from packages/ui/components/ui/tx/view/asset-icon/delegation-token-icon.tsx rename to packages/ui/components/ui/asset-icon/delegation-token-icon.tsx diff --git a/packages/ui/components/ui/tx/view/asset-icon/index.tsx b/packages/ui/components/ui/asset-icon/index.tsx similarity index 94% rename from packages/ui/components/ui/tx/view/asset-icon/index.tsx rename to packages/ui/components/ui/asset-icon/index.tsx index 79bfb363a2..0d524c2c13 100644 --- a/packages/ui/components/ui/tx/view/asset-icon/index.tsx +++ b/packages/ui/components/ui/asset-icon/index.tsx @@ -1,6 +1,6 @@ import { Metadata } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; -import { Identicon } from '../../../identicon'; -import { cn } from '../../../../../lib/utils'; +import { Identicon } from '../identicon'; +import { cn } from '../../../lib/utils'; import { DelegationTokenIcon } from './delegation-token-icon'; import { getDisplay } from '@penumbra-zone/getters/metadata'; import { assetPatterns } from '@penumbra-zone/types/assets'; diff --git a/packages/ui/components/ui/tx/view/asset-icon/unbonding-token-icon.tsx b/packages/ui/components/ui/asset-icon/unbonding-token-icon.tsx similarity index 100% rename from packages/ui/components/ui/tx/view/asset-icon/unbonding-token-icon.tsx rename to packages/ui/components/ui/asset-icon/unbonding-token-icon.tsx diff --git a/packages/ui/components/ui/auction-id-component.tsx b/packages/ui/components/ui/auction-id-component/index.tsx similarity index 91% rename from packages/ui/components/ui/auction-id-component.tsx rename to packages/ui/components/ui/auction-id-component/index.tsx index 17234655bc..c0fddd3f52 100644 --- a/packages/ui/components/ui/auction-id-component.tsx +++ b/packages/ui/components/ui/auction-id-component/index.tsx @@ -1,4 +1,4 @@ -import { CopyToClipboardIconButton } from './copy-to-clipboard-icon-button'; +import { CopyToClipboardIconButton } from '../copy-to-clipboard/copy-to-clipboard-icon-button'; import { useMemo } from 'react'; import { AuctionId } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/auction/v1/auction_pb'; import { bech32mAuctionId, PENUMBRA_BECH32M_AUCTION_PREFIX } from '@penumbra-zone/bech32m/pauctid'; diff --git a/packages/ui/components/ui/balance-value-view.test.tsx b/packages/ui/components/ui/balance-value-view/balance-value-view.test.tsx similarity index 97% rename from packages/ui/components/ui/balance-value-view.test.tsx rename to packages/ui/components/ui/balance-value-view/balance-value-view.test.tsx index 6ea5ff57d7..11e831330e 100644 --- a/packages/ui/components/ui/balance-value-view.test.tsx +++ b/packages/ui/components/ui/balance-value-view/balance-value-view.test.tsx @@ -4,7 +4,7 @@ import { Metadata, ValueView, } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; -import { BalanceValueView } from './balance-value-view'; +import { BalanceValueView } from './index'; import { base64ToUint8Array } from '@penumbra-zone/types/base64'; // Mocking the WalletIcon component diff --git a/packages/ui/components/ui/balance-value-view.tsx b/packages/ui/components/ui/balance-value-view/index.tsx similarity index 93% rename from packages/ui/components/ui/balance-value-view.tsx rename to packages/ui/components/ui/balance-value-view/index.tsx index f8c8ea8c56..1d27e49405 100644 --- a/packages/ui/components/ui/balance-value-view.tsx +++ b/packages/ui/components/ui/balance-value-view/index.tsx @@ -1,9 +1,9 @@ import { ValueView } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; -import { WalletIcon } from './icons/wallet'; +import { WalletIcon } from '../icons/wallet'; import { getAmount, getDisplayDenomExponentFromValueView } from '@penumbra-zone/getters/value-view'; import { formatAmount } from '@penumbra-zone/types/amount'; import { Amount } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/num/v1/num_pb'; -import { cn } from '../../lib/utils'; +import { cn } from '../../../lib/utils'; /** * Renders a `ValueView` as a balance with a wallet icon. diff --git a/packages/ui/components/ui/block-sync-status/condensed.tsx b/packages/ui/components/ui/block-sync-status/index.tsx similarity index 100% rename from packages/ui/components/ui/block-sync-status/condensed.tsx rename to packages/ui/components/ui/block-sync-status/index.tsx diff --git a/packages/ui/components/ui/candlestick-plot.tsx b/packages/ui/components/ui/candlestick-plot/index.tsx similarity index 100% rename from packages/ui/components/ui/candlestick-plot.tsx rename to packages/ui/components/ui/candlestick-plot/index.tsx diff --git a/packages/ui/components/ui/command.tsx b/packages/ui/components/ui/command/index.tsx similarity index 98% rename from packages/ui/components/ui/command.tsx rename to packages/ui/components/ui/command/index.tsx index d5bb1c872a..18361801e3 100644 --- a/packages/ui/components/ui/command.tsx +++ b/packages/ui/components/ui/command/index.tsx @@ -4,8 +4,8 @@ import * as React from 'react'; import { type DialogProps } from '@radix-ui/react-dialog'; import { Command as CommandPrimitive } from 'cmdk'; import { Search } from 'lucide-react'; -import { cn } from '../../lib/utils'; -import { Dialog, DialogContent } from './dialog'; +import { cn } from '../../../lib/utils'; +import { Dialog, DialogContent } from '../dialog'; const Command = React.forwardRef< React.ElementRef, diff --git a/packages/ui/components/ui/conditional-wrap.tsx b/packages/ui/components/ui/conditional-wrap.tsx deleted file mode 100644 index 66fbb0ef73..0000000000 --- a/packages/ui/components/ui/conditional-wrap.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import { ReactNode } from 'react'; - -/** - * Little utility component to optionally wrap a React component with another - * React component, depending on a condition. - * - * @example - * ```tsx - * ( - * - * {children} - * Here is the tooltip text. - * - * )} - * > - * Here is the content that may or may not need a tooltip. - * - * ``` - * - * @see https://stackoverflow.com/a/56870316/974981 - */ -export const ConditionalWrap = ({ - condition, - wrap, - children, -}: { - condition: boolean; - wrap: (children: ReactNode) => ReactNode; - children: ReactNode; -}) => (condition ? wrap(children) : children); diff --git a/packages/ui/components/ui/copy-to-clipboard-icon-button.tsx b/packages/ui/components/ui/copy-to-clipboard/copy-to-clipboard-icon-button.tsx similarity index 100% rename from packages/ui/components/ui/copy-to-clipboard-icon-button.tsx rename to packages/ui/components/ui/copy-to-clipboard/copy-to-clipboard-icon-button.tsx diff --git a/packages/ui/components/ui/copy-to-clipboard.tsx b/packages/ui/components/ui/copy-to-clipboard/copy-to-clipboard.tsx similarity index 94% rename from packages/ui/components/ui/copy-to-clipboard.tsx rename to packages/ui/components/ui/copy-to-clipboard/copy-to-clipboard.tsx index 554eaf688b..b0c8524b80 100644 --- a/packages/ui/components/ui/copy-to-clipboard.tsx +++ b/packages/ui/components/ui/copy-to-clipboard/copy-to-clipboard.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import { useState } from 'react'; import { CheckCircledIcon } from '@radix-ui/react-icons'; -import { Button } from './button'; -import { cn } from '../../lib/utils'; +import { Button } from '../button'; +import { cn } from '../../../lib/utils'; export interface CopyToClipboardProps extends React.ButtonHTMLAttributes { text: string; diff --git a/packages/ui/components/ui/copy-to-clipboard/index.ts b/packages/ui/components/ui/copy-to-clipboard/index.ts new file mode 100644 index 0000000000..2f63825b33 --- /dev/null +++ b/packages/ui/components/ui/copy-to-clipboard/index.ts @@ -0,0 +1,2 @@ +export { CopyToClipboardIconButton } from './copy-to-clipboard-icon-button'; +export { CopyToClipboard, type CopyToClipboardProps } from './copy-to-clipboard'; diff --git a/packages/ui/components/ui/dutch-auction-component/progress-bar/index.tsx b/packages/ui/components/ui/dutch-auction-component/progress-bar/index.tsx index e0495602f2..4b2a64b56c 100644 --- a/packages/ui/components/ui/dutch-auction-component/progress-bar/index.tsx +++ b/packages/ui/components/ui/dutch-auction-component/progress-bar/index.tsx @@ -1,5 +1,5 @@ import { Metadata } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; -import { ValueViewComponent } from '../../tx/view/value'; +import { ValueViewComponent } from '../../value'; import { DutchAuction } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/auction/v1/auction_pb'; import { Separator } from '../../separator'; import { Indicator } from './indicator'; diff --git a/packages/ui/components/ui/fade-transition.tsx b/packages/ui/components/ui/fade-transition/index.tsx similarity index 93% rename from packages/ui/components/ui/fade-transition.tsx rename to packages/ui/components/ui/fade-transition/index.tsx index a96867931a..b6890d054f 100644 --- a/packages/ui/components/ui/fade-transition.tsx +++ b/packages/ui/components/ui/fade-transition/index.tsx @@ -2,7 +2,7 @@ import { motion } from 'framer-motion'; import React from 'react'; -import { cn } from '../../lib/utils'; +import { cn } from '../../../lib/utils'; const FadeTransition = ({ children, diff --git a/packages/ui/components/ui/gradient-header.tsx b/packages/ui/components/ui/gradient-header/index.tsx similarity index 100% rename from packages/ui/components/ui/gradient-header.tsx rename to packages/ui/components/ui/gradient-header/index.tsx diff --git a/packages/ui/components/ui/icon-input.tsx b/packages/ui/components/ui/icon-input/index.tsx similarity index 94% rename from packages/ui/components/ui/icon-input.tsx rename to packages/ui/components/ui/icon-input/index.tsx index d70838a17a..0a4fa5b60c 100644 --- a/packages/ui/components/ui/icon-input.tsx +++ b/packages/ui/components/ui/icon-input/index.tsx @@ -1,5 +1,5 @@ import { ReactNode } from 'react'; -import { Input } from './input'; +import { Input } from '../input'; /** * Use this to render an input with an icon to its left, such as a search field diff --git a/packages/ui/components/ui/back-icon.tsx b/packages/ui/components/ui/icons/back-icon.tsx similarity index 93% rename from packages/ui/components/ui/back-icon.tsx rename to packages/ui/components/ui/icons/back-icon.tsx index ed37834a80..8958ffae1c 100644 --- a/packages/ui/components/ui/back-icon.tsx +++ b/packages/ui/components/ui/icons/back-icon.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { ArrowLeftIcon } from '@radix-ui/react-icons'; import { IconProps } from '@radix-ui/react-icons/dist/types'; -import { cn } from '../../lib/utils'; +import { cn } from '../../../lib/utils'; export type BackIconProps = IconProps & React.RefAttributes; diff --git a/packages/ui/components/ui/identity-key-component.tsx b/packages/ui/components/ui/identity-key-component/index.tsx similarity index 92% rename from packages/ui/components/ui/identity-key-component.tsx rename to packages/ui/components/ui/identity-key-component/index.tsx index fe525633c7..bf9def4e87 100644 --- a/packages/ui/components/ui/identity-key-component.tsx +++ b/packages/ui/components/ui/identity-key-component/index.tsx @@ -1,5 +1,5 @@ import { IdentityKey } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/keys/v1/keys_pb'; -import { CopyToClipboardIconButton } from './copy-to-clipboard-icon-button'; +import { CopyToClipboardIconButton } from '../copy-to-clipboard/copy-to-clipboard-icon-button'; import { bech32mIdentityKey, PENUMBRA_BECH32M_IDENTITYKEY_PREFIX, diff --git a/packages/ui/components/ui/input.tsx b/packages/ui/components/ui/input/index.tsx similarity index 97% rename from packages/ui/components/ui/input.tsx rename to packages/ui/components/ui/input/index.tsx index 99df8010d1..6cf28ceecf 100644 --- a/packages/ui/components/ui/input.tsx +++ b/packages/ui/components/ui/input/index.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { cva, VariantProps } from 'class-variance-authority'; -import { cn } from '../../lib/utils'; +import { cn } from '../../../lib/utils'; const inputVariants = cva( 'flex h-11 w-full rounded-lg border bg-background px-3 py-2 ring-offset-background [appearance:textfield] file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none', diff --git a/packages/ui/components/ui/json-viewer.tsx b/packages/ui/components/ui/json-viewer/index.tsx similarity index 100% rename from packages/ui/components/ui/json-viewer.tsx rename to packages/ui/components/ui/json-viewer/index.tsx diff --git a/packages/ui/components/ui/network.stories.tsx b/packages/ui/components/ui/network.stories.tsx deleted file mode 100644 index b11d5ae748..0000000000 --- a/packages/ui/components/ui/network.stories.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react'; -import { Network } from './network'; - -const meta: Meta = { - component: Network, - title: 'Network', - tags: ['autodocs'], -}; -export default meta; - -type Story = StoryObj; - -export const Basic: Story = { - args: { - name: 'penumbra-testnet-deimos-6', - href: 'https://app.testnet.penumbra.zone', - }, -}; diff --git a/packages/ui/components/ui/network.tsx b/packages/ui/components/ui/network.tsx deleted file mode 100644 index 702b2b29de..0000000000 --- a/packages/ui/components/ui/network.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { ExternalLink } from 'lucide-react'; -import { ConditionalWrap } from './conditional-wrap'; - -export interface NetworkProps { - name: string; - href?: string; -} - -/** - * Displays the network (chain ID) we're connected to, as well as an optional - * connection indicator and a link to the frontend. - */ -export const Network = ({ name, href }: NetworkProps) => { - return ( - ( - - {children} - - )} - > -
-

{name}

- - {href && } -
-
- ); -}; diff --git a/packages/ui/components/ui/popover/index.tsx b/packages/ui/components/ui/popover/index.tsx new file mode 100644 index 0000000000..561ba18e60 --- /dev/null +++ b/packages/ui/components/ui/popover/index.tsx @@ -0,0 +1,2 @@ +export { Popover, PopoverClose, PopoverContent, PopoverTrigger } from './popover'; +export { PopoverMenu, type PopoverMenuItem } from './popover-menu'; diff --git a/packages/ui/components/ui/popover-menu.stories.tsx b/packages/ui/components/ui/popover/popover-menu.stories.tsx similarity index 96% rename from packages/ui/components/ui/popover-menu.stories.tsx rename to packages/ui/components/ui/popover/popover-menu.stories.tsx index d009a86f7b..78df069755 100644 --- a/packages/ui/components/ui/popover-menu.stories.tsx +++ b/packages/ui/components/ui/popover/popover-menu.stories.tsx @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react'; import { useArgs } from '@storybook/preview-api'; import { PopoverMenu, PopoverMenuItem } from './popover-menu'; -import { Button } from './button'; +import { Button } from '../button'; const meta: Meta = { component: PopoverMenu, diff --git a/packages/ui/components/ui/popover-menu.tsx b/packages/ui/components/ui/popover/popover-menu.tsx similarity index 100% rename from packages/ui/components/ui/popover-menu.tsx rename to packages/ui/components/ui/popover/popover-menu.tsx diff --git a/packages/ui/components/ui/popover.tsx b/packages/ui/components/ui/popover/popover.tsx similarity index 96% rename from packages/ui/components/ui/popover.tsx rename to packages/ui/components/ui/popover/popover.tsx index 8f63724371..d55faaf59a 100644 --- a/packages/ui/components/ui/popover.tsx +++ b/packages/ui/components/ui/popover/popover.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import * as PopoverPrimitive from '@radix-ui/react-popover'; -import { cn } from '../../lib/utils'; +import { cn } from '../../../lib/utils'; const Popover = PopoverPrimitive.Root; diff --git a/packages/ui/components/ui/progress.tsx b/packages/ui/components/ui/progress/index.tsx similarity index 97% rename from packages/ui/components/ui/progress.tsx rename to packages/ui/components/ui/progress/index.tsx index 50da053c5c..6fa3346b14 100644 --- a/packages/ui/components/ui/progress.tsx +++ b/packages/ui/components/ui/progress/index.tsx @@ -1,7 +1,7 @@ 'use client'; import * as ProgressPrimitive from '@radix-ui/react-progress'; -import { cn } from '../../lib/utils'; +import { cn } from '../../../lib/utils'; import { cva, VariantProps } from 'class-variance-authority'; const progressVariants = cva('', { diff --git a/packages/ui/components/ui/segmented-picker.tsx b/packages/ui/components/ui/segmented-picker/index.tsx similarity index 98% rename from packages/ui/components/ui/segmented-picker.tsx rename to packages/ui/components/ui/segmented-picker/index.tsx index 6cd622b028..8eb87cd935 100644 --- a/packages/ui/components/ui/segmented-picker.tsx +++ b/packages/ui/components/ui/segmented-picker/index.tsx @@ -1,5 +1,5 @@ import { useId } from 'react'; -import { cn } from '../../lib/utils'; +import { cn } from '../../../lib/utils'; import { motion } from 'framer-motion'; export interface SegmentedPickerOption { diff --git a/packages/ui/components/ui/segmented-picker.stories.tsx b/packages/ui/components/ui/segmented-picker/segmented-picker.stories.tsx similarity index 93% rename from packages/ui/components/ui/segmented-picker.stories.tsx rename to packages/ui/components/ui/segmented-picker/segmented-picker.stories.tsx index c12cc04d4d..53e5606b6c 100644 --- a/packages/ui/components/ui/segmented-picker.stories.tsx +++ b/packages/ui/components/ui/segmented-picker/segmented-picker.stories.tsx @@ -1,7 +1,7 @@ import type { Meta, StoryObj } from '@storybook/react'; import { useArgs } from '@storybook/preview-api'; -import { SegmentedPicker } from './segmented-picker'; +import { SegmentedPicker } from './index'; const meta: Meta = { component: SegmentedPicker, diff --git a/packages/ui/components/ui/segmented-picker.test.tsx b/packages/ui/components/ui/segmented-picker/segmented-picker.test.tsx similarity index 96% rename from packages/ui/components/ui/segmented-picker.test.tsx rename to packages/ui/components/ui/segmented-picker/segmented-picker.test.tsx index 4cf7ceff8c..3653ee92f9 100644 --- a/packages/ui/components/ui/segmented-picker.test.tsx +++ b/packages/ui/components/ui/segmented-picker/segmented-picker.test.tsx @@ -1,6 +1,6 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; import { fireEvent, render } from '@testing-library/react'; -import { SegmentedPicker } from './segmented-picker'; +import { SegmentedPicker } from './index'; describe('', () => { const onChange = vi.fn(); diff --git a/packages/ui/components/ui/select/index.tsx b/packages/ui/components/ui/select/index.tsx new file mode 100644 index 0000000000..3764d02b78 --- /dev/null +++ b/packages/ui/components/ui/select/index.tsx @@ -0,0 +1,13 @@ +export { + Select, + SelectItem, + SelectContent, + SelectGroup, + SelectLabel, + SelectSeparator, + SelectTrigger, + SelectValue, + type SelectTriggerProps, +} from './select'; +export { SelectAccount, type SelectAccountProps } from './select-account'; +export { SelectList } from './select-list'; diff --git a/packages/ui/components/ui/select-account.tsx b/packages/ui/components/ui/select/select-account.tsx similarity index 86% rename from packages/ui/components/ui/select-account.tsx rename to packages/ui/components/ui/select/select-account.tsx index b2d7a33968..69cb59c5da 100644 --- a/packages/ui/components/ui/select-account.tsx +++ b/packages/ui/components/ui/select/select-account.tsx @@ -1,17 +1,17 @@ -import { AddressIcon } from './address/address-icon'; +import { AddressIcon } from '../address/address-icon'; import { InfoIcon } from 'lucide-react'; -import { CopyToClipboardIconButton } from './copy-to-clipboard-icon-button'; -import { IncognitoIcon } from './icons/incognito'; -import { Switch } from './switch'; -import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './tooltip'; +import { CopyToClipboardIconButton } from '../copy-to-clipboard/copy-to-clipboard-icon-button'; +import { IncognitoIcon } from '../icons/incognito'; +import { Switch } from '../switch'; +import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../tooltip'; import { useEffect, useState } from 'react'; -import { AddressComponent } from './address/address-component'; +import { AddressComponent } from '../address/address-component'; import { Address } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/keys/v1/keys_pb'; -import { AccountSwitcher } from './account-switcher'; +import { AccountSwitcher } from '../account-switcher'; import { bech32mAddress } from '@penumbra-zone/bech32m/penumbra'; -import { Box } from './box'; +import { Box } from '../box'; -interface SelectAccountProps { +export interface SelectAccountProps { getAddrByIndex: (index: number, ephemeral: boolean) => Promise
| Address; } diff --git a/packages/ui/components/ui/select-list.stories.tsx b/packages/ui/components/ui/select/select-list.stories.tsx similarity index 100% rename from packages/ui/components/ui/select-list.stories.tsx rename to packages/ui/components/ui/select/select-list.stories.tsx diff --git a/packages/ui/components/ui/select-list.tsx b/packages/ui/components/ui/select/select-list.tsx similarity index 98% rename from packages/ui/components/ui/select-list.tsx rename to packages/ui/components/ui/select/select-list.tsx index 1f88a68515..ca12f3e779 100644 --- a/packages/ui/components/ui/select-list.tsx +++ b/packages/ui/components/ui/select/select-list.tsx @@ -1,5 +1,5 @@ import { ReactNode } from 'react'; -import { cn } from '../../lib/utils'; +import { cn } from '../../../lib/utils'; /** * A select list is a nicely formatted vertical list of options for a user to diff --git a/packages/ui/components/ui/select.tsx b/packages/ui/components/ui/select/select.tsx similarity index 99% rename from packages/ui/components/ui/select.tsx rename to packages/ui/components/ui/select/select.tsx index 00c4297b85..6c2120efb4 100644 --- a/packages/ui/components/ui/select.tsx +++ b/packages/ui/components/ui/select/select.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import * as SelectPrimitive from '@radix-ui/react-select'; -import { cn } from '../../lib/utils'; +import { cn } from '../../../lib/utils'; import { ChevronDownIcon } from '@radix-ui/react-icons'; import { cva, type VariantProps } from 'class-variance-authority'; diff --git a/packages/ui/components/ui/separator.tsx b/packages/ui/components/ui/separator/index.tsx similarity index 100% rename from packages/ui/components/ui/separator.tsx rename to packages/ui/components/ui/separator/index.tsx diff --git a/packages/ui/components/ui/sheet.tsx b/packages/ui/components/ui/sheet/index.tsx similarity index 99% rename from packages/ui/components/ui/sheet.tsx rename to packages/ui/components/ui/sheet/index.tsx index 8f9e37a22a..2ef10d226c 100644 --- a/packages/ui/components/ui/sheet.tsx +++ b/packages/ui/components/ui/sheet/index.tsx @@ -3,7 +3,7 @@ import * as React from 'react'; import * as SheetPrimitive from '@radix-ui/react-dialog'; import { cva, type VariantProps } from 'class-variance-authority'; -import { cn } from '../../lib/utils'; +import { cn } from '../../../lib/utils'; import { Cross1Icon } from '@radix-ui/react-icons'; const Sheet = SheetPrimitive.Root; diff --git a/packages/ui/components/ui/splash-page.tsx b/packages/ui/components/ui/splash-page/index.tsx similarity index 86% rename from packages/ui/components/ui/splash-page.tsx rename to packages/ui/components/ui/splash-page/index.tsx index 95b858c0c5..0d211b440c 100644 --- a/packages/ui/components/ui/splash-page.tsx +++ b/packages/ui/components/ui/splash-page/index.tsx @@ -1,7 +1,7 @@ import { ReactNode } from 'react'; -import { Card, CardContent, CardDescription, CardHeader, CardTitle } from './card'; -import { FadeTransition } from './fade-transition'; -import { AnimatedPenumbra } from './logo/animated-penumbra'; +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '../card'; +import { FadeTransition } from '../fade-transition'; +import { AnimatedPenumbra } from '../logo/animated-penumbra'; export const SplashPage = ({ title, diff --git a/packages/ui/components/ui/switch.tsx b/packages/ui/components/ui/switch/index.tsx similarity index 96% rename from packages/ui/components/ui/switch.tsx rename to packages/ui/components/ui/switch/index.tsx index 90163c7586..75dd904ce9 100644 --- a/packages/ui/components/ui/switch.tsx +++ b/packages/ui/components/ui/switch/index.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import * as SwitchPrimitives from '@radix-ui/react-switch'; -import { cn } from '../../lib/utils'; +import { cn } from '../../../lib/utils'; const Switch = React.forwardRef< React.ElementRef, diff --git a/packages/ui/components/ui/testnet-banner.tsx b/packages/ui/components/ui/testnet-banner/index.tsx similarity index 100% rename from packages/ui/components/ui/testnet-banner.tsx rename to packages/ui/components/ui/testnet-banner/index.tsx diff --git a/packages/ui/components/ui/testnet-banner.test.tsx b/packages/ui/components/ui/testnet-banner/testnet-banner.test.tsx similarity index 95% rename from packages/ui/components/ui/testnet-banner.test.tsx rename to packages/ui/components/ui/testnet-banner/testnet-banner.test.tsx index 5fb8fdccda..5e910feb42 100644 --- a/packages/ui/components/ui/testnet-banner.test.tsx +++ b/packages/ui/components/ui/testnet-banner/testnet-banner.test.tsx @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; import { render } from '@testing-library/react'; -import { TestnetBanner } from './testnet-banner'; +import { TestnetBanner } from './index'; describe('', () => { it('renders banner if chainId is a testnet', () => { diff --git a/packages/ui/components/ui/toaster.tsx b/packages/ui/components/ui/toaster/index.tsx similarity index 100% rename from packages/ui/components/ui/toaster.tsx rename to packages/ui/components/ui/toaster/index.tsx diff --git a/packages/ui/components/ui/toaster.css b/packages/ui/components/ui/toaster/toaster.css similarity index 100% rename from packages/ui/components/ui/toaster.css rename to packages/ui/components/ui/toaster/toaster.css diff --git a/packages/ui/components/ui/toaster.stories.tsx b/packages/ui/components/ui/toaster/toaster.stories.tsx similarity index 88% rename from packages/ui/components/ui/toaster.stories.tsx rename to packages/ui/components/ui/toaster/toaster.stories.tsx index cec73c0be3..66602b1b7c 100644 --- a/packages/ui/components/ui/toaster.stories.tsx +++ b/packages/ui/components/ui/toaster/toaster.stories.tsx @@ -1,8 +1,8 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { Toaster } from './toaster'; +import { Toaster } from './index'; import { toast } from 'sonner'; -import { Button } from './button'; +import { Button } from '../button'; const meta: Meta = { component: Toaster, diff --git a/packages/ui/components/ui/toggle.tsx b/packages/ui/components/ui/toggle/index.tsx similarity index 97% rename from packages/ui/components/ui/toggle.tsx rename to packages/ui/components/ui/toggle/index.tsx index 7b4e7f1303..cfa7d61d3c 100644 --- a/packages/ui/components/ui/toggle.tsx +++ b/packages/ui/components/ui/toggle/index.tsx @@ -4,7 +4,7 @@ import * as React from 'react'; import * as TogglePrimitive from '@radix-ui/react-toggle'; import { ToggleProps as RadixToggleProps } from '@radix-ui/react-toggle'; import { cva, type VariantProps } from 'class-variance-authority'; -import { cn } from '../../lib/utils'; +import { cn } from '../../../lib/utils'; const toggleVariants = cva( 'inline-flex items-center justify-center rounded-lg font-bold ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50', diff --git a/packages/ui/components/ui/tooltip.tsx b/packages/ui/components/ui/tooltip/index.tsx similarity index 97% rename from packages/ui/components/ui/tooltip.tsx rename to packages/ui/components/ui/tooltip/index.tsx index 74fe4195e8..1c7c851dcf 100644 --- a/packages/ui/components/ui/tooltip.tsx +++ b/packages/ui/components/ui/tooltip/index.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import * as TooltipPrimitive from '@radix-ui/react-tooltip'; -import { cn } from '../../lib/utils'; +import { cn } from '../../../lib/utils'; const TooltipProvider = (props: React.ComponentProps) => ( diff --git a/packages/ui/components/ui/tx/view/action-view.tsx b/packages/ui/components/ui/tx/action-view.tsx similarity index 82% rename from packages/ui/components/ui/tx/view/action-view.tsx rename to packages/ui/components/ui/tx/action-view.tsx index 889beadb31..4d005b4984 100644 --- a/packages/ui/components/ui/tx/view/action-view.tsx +++ b/packages/ui/components/ui/tx/action-view.tsx @@ -1,16 +1,16 @@ -import { SpendViewComponent } from './spend'; -import { OutputViewComponent } from './output'; +import { SpendViewComponent } from './actions-views/spend'; +import { OutputViewComponent } from './actions-views/output'; import { ActionView } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/transaction/v1/transaction_pb'; -import { SwapClaimViewComponent } from './swap-claim'; -import { DelegateComponent } from './delegate'; -import { UndelegateComponent } from './undelegate'; -import { UndelegateClaimComponent } from './undelegate-claim'; -import { Ics20WithdrawalComponent } from './isc20-withdrawal'; -import { UnimplementedView } from './unimplemented-view'; -import { SwapViewComponent } from './swap'; -import { ActionDutchAuctionScheduleViewComponent } from './action-dutch-auction-schedule-view'; -import { ActionDutchAuctionEndComponent } from './action-dutch-auction-end'; -import { ActionDutchAuctionWithdrawViewComponent } from './action-dutch-auction-withdraw-view'; +import { SwapClaimViewComponent } from './actions-views/swap/swap-claim'; +import { DelegateComponent } from './actions-views/delegate'; +import { UndelegateComponent } from './actions-views/undelegate'; +import { UndelegateClaimComponent } from './actions-views/undelegate-claim'; +import { Ics20WithdrawalComponent } from './actions-views/isc20-withdrawal'; +import { UnimplementedView } from './actions-views/unimplemented-view'; +import { SwapViewComponent } from './actions-views/swap'; +import { ActionDutchAuctionScheduleViewComponent } from './actions-views/action-dutch-auction-schedule-view'; +import { ActionDutchAuctionEndComponent } from './actions-views/action-dutch-auction-end'; +import { ActionDutchAuctionWithdrawViewComponent } from './actions-views/action-dutch-auction-withdraw-view'; const CASE_TO_LABEL: Record = { daoDeposit: 'DAO Deposit', diff --git a/packages/ui/components/ui/tx/view/action-details.tsx b/packages/ui/components/ui/tx/actions-views/action-details.tsx similarity index 100% rename from packages/ui/components/ui/tx/view/action-details.tsx rename to packages/ui/components/ui/tx/actions-views/action-details.tsx diff --git a/packages/ui/components/ui/tx/view/action-dutch-auction-end.tsx b/packages/ui/components/ui/tx/actions-views/action-dutch-auction-end.tsx similarity index 94% rename from packages/ui/components/ui/tx/view/action-dutch-auction-end.tsx rename to packages/ui/components/ui/tx/actions-views/action-dutch-auction-end.tsx index 5d76e429ea..817882adad 100644 --- a/packages/ui/components/ui/tx/view/action-dutch-auction-end.tsx +++ b/packages/ui/components/ui/tx/actions-views/action-dutch-auction-end.tsx @@ -1,5 +1,5 @@ import { ActionDutchAuctionEnd } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/auction/v1/auction_pb'; -import { ViewBox } from './viewbox'; +import { ViewBox } from '../viewbox'; import { AuctionIdComponent } from '../../auction-id-component'; import { ActionDetails } from './action-details'; diff --git a/packages/ui/components/ui/tx/view/action-dutch-auction-schedule-view.tsx b/packages/ui/components/ui/tx/actions-views/action-dutch-auction-schedule-view.tsx similarity index 94% rename from packages/ui/components/ui/tx/view/action-dutch-auction-schedule-view.tsx rename to packages/ui/components/ui/tx/actions-views/action-dutch-auction-schedule-view.tsx index 966daebfc3..732d10a6f3 100644 --- a/packages/ui/components/ui/tx/view/action-dutch-auction-schedule-view.tsx +++ b/packages/ui/components/ui/tx/actions-views/action-dutch-auction-schedule-view.tsx @@ -3,7 +3,7 @@ import { DutchAuction, } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/auction/v1/auction_pb'; import { DutchAuctionComponent } from '../../dutch-auction-component'; -import { ViewBox } from './viewbox'; +import { ViewBox } from '../viewbox'; export const ActionDutchAuctionScheduleViewComponent = ({ value, diff --git a/packages/ui/components/ui/tx/view/action-dutch-auction-withdraw-view.tsx b/packages/ui/components/ui/tx/actions-views/action-dutch-auction-withdraw-view.tsx similarity index 92% rename from packages/ui/components/ui/tx/view/action-dutch-auction-withdraw-view.tsx rename to packages/ui/components/ui/tx/actions-views/action-dutch-auction-withdraw-view.tsx index d5f63c812b..a8d5ee11ce 100644 --- a/packages/ui/components/ui/tx/view/action-dutch-auction-withdraw-view.tsx +++ b/packages/ui/components/ui/tx/actions-views/action-dutch-auction-withdraw-view.tsx @@ -1,8 +1,8 @@ import { ActionDutchAuctionWithdrawView } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/auction/v1/auction_pb'; -import { ViewBox } from './viewbox'; +import { ViewBox } from '../viewbox'; import { ActionDetails } from './action-details'; import { AuctionIdComponent } from '../../auction-id-component'; -import { ValueViewComponent } from './value'; +import { ValueViewComponent } from '../../value'; import { getDisplayDenomFromView } from '@penumbra-zone/getters/value-view'; export const ActionDutchAuctionWithdrawViewComponent = ({ diff --git a/packages/ui/components/ui/tx/view/delegate.tsx b/packages/ui/components/ui/tx/actions-views/delegate.tsx similarity index 97% rename from packages/ui/components/ui/tx/view/delegate.tsx rename to packages/ui/components/ui/tx/actions-views/delegate.tsx index 4037b1fcd7..558ce093f9 100644 --- a/packages/ui/components/ui/tx/view/delegate.tsx +++ b/packages/ui/components/ui/tx/actions-views/delegate.tsx @@ -1,5 +1,5 @@ import { Delegate } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/stake/v1/stake_pb'; -import { ViewBox } from './viewbox'; +import { ViewBox } from '../viewbox'; import { joinLoHiAmount } from '@penumbra-zone/types/amount'; import { bech32mIdentityKey } from '@penumbra-zone/bech32m/penumbravalid'; import { ActionDetails } from './action-details'; diff --git a/packages/ui/components/ui/tx/view/isc20-withdrawal.tsx b/packages/ui/components/ui/tx/actions-views/isc20-withdrawal.tsx similarity index 97% rename from packages/ui/components/ui/tx/view/isc20-withdrawal.tsx rename to packages/ui/components/ui/tx/actions-views/isc20-withdrawal.tsx index cd9d5a043a..02c3afc4c5 100644 --- a/packages/ui/components/ui/tx/view/isc20-withdrawal.tsx +++ b/packages/ui/components/ui/tx/actions-views/isc20-withdrawal.tsx @@ -1,5 +1,5 @@ import { Ics20Withdrawal } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/ibc/v1/ibc_pb'; -import { ViewBox } from './viewbox'; +import { ViewBox } from '../viewbox'; import { ActionDetails } from './action-details'; import { joinLoHiAmount } from '@penumbra-zone/types/amount'; import { bech32mAddress } from '@penumbra-zone/bech32m/penumbra'; diff --git a/packages/ui/components/ui/tx/view/output.tsx b/packages/ui/components/ui/tx/actions-views/output.tsx similarity index 90% rename from packages/ui/components/ui/tx/view/output.tsx rename to packages/ui/components/ui/tx/actions-views/output.tsx index 62ba2bf5d4..1dc4223dde 100644 --- a/packages/ui/components/ui/tx/view/output.tsx +++ b/packages/ui/components/ui/tx/actions-views/output.tsx @@ -1,6 +1,6 @@ import { OutputView } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/shielded_pool/v1/shielded_pool_pb'; -import { ViewBox } from './viewbox'; -import { ValueViewComponent } from './value'; +import { ViewBox } from '../viewbox'; +import { ValueViewComponent } from '../../value'; import { ValueWithAddress } from './value-with-address'; import { getNote } from '@penumbra-zone/getters/output-view'; import { getAddress } from '@penumbra-zone/getters/note-view'; diff --git a/packages/ui/components/ui/tx/view/spend.tsx b/packages/ui/components/ui/tx/actions-views/spend.tsx similarity index 90% rename from packages/ui/components/ui/tx/view/spend.tsx rename to packages/ui/components/ui/tx/actions-views/spend.tsx index b6c20cf2d1..0231dfabfd 100644 --- a/packages/ui/components/ui/tx/view/spend.tsx +++ b/packages/ui/components/ui/tx/actions-views/spend.tsx @@ -1,6 +1,6 @@ import { SpendView } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/shielded_pool/v1/shielded_pool_pb'; -import { ViewBox } from './viewbox'; -import { ValueViewComponent } from './value'; +import { ViewBox } from '../viewbox'; +import { ValueViewComponent } from '../../value'; import { ValueWithAddress } from './value-with-address'; import { getNote } from '@penumbra-zone/getters/spend-view'; import { getAddress } from '@penumbra-zone/getters/note-view'; diff --git a/packages/ui/components/ui/tx/view/swap/index.test.tsx b/packages/ui/components/ui/tx/actions-views/swap/index.test.tsx similarity index 96% rename from packages/ui/components/ui/tx/view/swap/index.test.tsx rename to packages/ui/components/ui/tx/actions-views/swap/index.test.tsx index c9524e08cc..3e946aa544 100644 --- a/packages/ui/components/ui/tx/view/swap/index.test.tsx +++ b/packages/ui/components/ui/tx/actions-views/swap/index.test.tsx @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest'; -import { SwapViewComponent } from '.'; +import { SwapViewComponent } from './index'; import { SwapView } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/dex/v1/dex_pb'; import { render } from '@testing-library/react'; diff --git a/packages/ui/components/ui/tx/view/swap/index.tsx b/packages/ui/components/ui/tx/actions-views/swap/index.tsx similarity index 94% rename from packages/ui/components/ui/tx/view/swap/index.tsx rename to packages/ui/components/ui/tx/actions-views/swap/index.tsx index 44acb6850b..ba8db597f7 100644 --- a/packages/ui/components/ui/tx/view/swap/index.tsx +++ b/packages/ui/components/ui/tx/actions-views/swap/index.tsx @@ -1,6 +1,6 @@ -import { ViewBox } from '../viewbox'; +import { ViewBox } from '../../viewbox'; import { SwapView } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/dex/v1/dex_pb'; -import { TransactionIdComponent } from '../transaction-id'; +import { TransactionIdComponent } from './transaction-id'; import { getOneWaySwapValues, isOneWaySwap } from '@penumbra-zone/types/swap'; import { OneWaySwap } from './one-way-swap'; import { ValueWithAddress } from '../value-with-address'; @@ -9,7 +9,7 @@ import { getClaimFeeFromSwapView, getClaimTx, } from '@penumbra-zone/getters/swap-view'; -import { ValueViewComponent } from '../value'; +import { ValueViewComponent } from '../../../value'; import { ActionDetails } from '../action-details'; import { joinLoHiAmount } from '@penumbra-zone/types/amount'; import { getAmount } from '@penumbra-zone/getters/fee'; diff --git a/packages/ui/components/ui/tx/view/swap/one-way-swap.tsx b/packages/ui/components/ui/tx/actions-views/swap/one-way-swap.tsx similarity index 92% rename from packages/ui/components/ui/tx/view/swap/one-way-swap.tsx rename to packages/ui/components/ui/tx/actions-views/swap/one-way-swap.tsx index 124439b430..1b48a229bd 100644 --- a/packages/ui/components/ui/tx/view/swap/one-way-swap.tsx +++ b/packages/ui/components/ui/tx/actions-views/swap/one-way-swap.tsx @@ -1,4 +1,4 @@ -import { ValueViewComponent } from '../value'; +import { ValueViewComponent } from '../../../value'; import { ArrowRight } from 'lucide-react'; import { ValueView } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; import { getAmount } from '@penumbra-zone/getters/value-view'; diff --git a/packages/ui/components/ui/tx/view/swap-claim.tsx b/packages/ui/components/ui/tx/actions-views/swap/swap-claim.tsx similarity index 95% rename from packages/ui/components/ui/tx/view/swap-claim.tsx rename to packages/ui/components/ui/tx/actions-views/swap/swap-claim.tsx index 803e75a1eb..a939cd58ae 100644 --- a/packages/ui/components/ui/tx/view/swap-claim.tsx +++ b/packages/ui/components/ui/tx/actions-views/swap/swap-claim.tsx @@ -1,7 +1,7 @@ -import { ViewBox } from './viewbox'; +import { ViewBox } from '../../viewbox'; import { SwapClaimView } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/dex/v1/dex_pb'; import { TransactionIdComponent } from './transaction-id'; -import { ActionDetails } from './action-details'; +import { ActionDetails } from '../action-details'; import { getOutput1ValueOptional, getOutput2ValueOptional, @@ -10,7 +10,7 @@ import { import { getAmount } from '@penumbra-zone/getters/value-view'; import { getAmount as getAmountFee } from '@penumbra-zone/getters/fee'; import { isZero, joinLoHiAmount } from '@penumbra-zone/types/amount'; -import { ValueViewComponent } from './value'; +import { ValueViewComponent } from '../../../value'; import { Amount } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/num/v1/num_pb'; const getClaimLabel = ( diff --git a/packages/ui/components/ui/tx/view/transaction-id.tsx b/packages/ui/components/ui/tx/actions-views/swap/transaction-id.tsx similarity index 93% rename from packages/ui/components/ui/tx/view/transaction-id.tsx rename to packages/ui/components/ui/tx/actions-views/swap/transaction-id.tsx index ffffc82d32..f3d3a3fff7 100644 --- a/packages/ui/components/ui/tx/view/transaction-id.tsx +++ b/packages/ui/components/ui/tx/actions-views/swap/transaction-id.tsx @@ -1,5 +1,5 @@ import { TransactionId } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/txhash/v1/txhash_pb'; -import { Pill } from '../../pill'; +import { Pill } from '../../../pill'; import { uint8ArrayToHex } from '@penumbra-zone/types/hex'; import { shorten } from '@penumbra-zone/types/string'; diff --git a/packages/ui/components/ui/tx/view/undelegate-claim.tsx b/packages/ui/components/ui/tx/actions-views/undelegate-claim.tsx similarity index 96% rename from packages/ui/components/ui/tx/view/undelegate-claim.tsx rename to packages/ui/components/ui/tx/actions-views/undelegate-claim.tsx index 841ed7ff6f..a635cf6fe7 100644 --- a/packages/ui/components/ui/tx/view/undelegate-claim.tsx +++ b/packages/ui/components/ui/tx/actions-views/undelegate-claim.tsx @@ -1,5 +1,5 @@ import { UndelegateClaim } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/stake/v1/stake_pb'; -import { ViewBox } from './viewbox'; +import { ViewBox } from '../viewbox'; import { IdentityKeyComponent } from '../../identity-key-component'; import { ActionDetails } from './action-details'; import { diff --git a/packages/ui/components/ui/tx/view/undelegate.tsx b/packages/ui/components/ui/tx/actions-views/undelegate.tsx similarity index 97% rename from packages/ui/components/ui/tx/view/undelegate.tsx rename to packages/ui/components/ui/tx/actions-views/undelegate.tsx index 5df4a81815..bb7c2078f8 100644 --- a/packages/ui/components/ui/tx/view/undelegate.tsx +++ b/packages/ui/components/ui/tx/actions-views/undelegate.tsx @@ -1,5 +1,5 @@ import { Undelegate } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/stake/v1/stake_pb'; -import { ViewBox } from './viewbox'; +import { ViewBox } from '../viewbox'; import { joinLoHiAmount } from '@penumbra-zone/types/amount'; import { bech32mIdentityKey } from '@penumbra-zone/bech32m/penumbravalid'; import { ActionDetails } from './action-details'; diff --git a/packages/ui/components/ui/tx/view/unimplemented-view.tsx b/packages/ui/components/ui/tx/actions-views/unimplemented-view.tsx similarity index 91% rename from packages/ui/components/ui/tx/view/unimplemented-view.tsx rename to packages/ui/components/ui/tx/actions-views/unimplemented-view.tsx index 06e4ad43c1..9eb2c6d394 100644 --- a/packages/ui/components/ui/tx/view/unimplemented-view.tsx +++ b/packages/ui/components/ui/tx/actions-views/unimplemented-view.tsx @@ -1,5 +1,5 @@ import { TriangleAlert } from 'lucide-react'; -import { ViewBox } from './viewbox'; +import { ViewBox } from '../viewbox'; export const UnimplementedView = ({ label }: { label: string }) => { return ( diff --git a/packages/ui/components/ui/tx/view/value-with-address.tsx b/packages/ui/components/ui/tx/actions-views/value-with-address.tsx similarity index 93% rename from packages/ui/components/ui/tx/view/value-with-address.tsx rename to packages/ui/components/ui/tx/actions-views/value-with-address.tsx index 5535f7dd91..eee2b78ece 100644 --- a/packages/ui/components/ui/tx/view/value-with-address.tsx +++ b/packages/ui/components/ui/tx/actions-views/value-with-address.tsx @@ -1,6 +1,6 @@ import { AddressView } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/keys/v1/keys_pb'; import { ReactNode } from 'react'; -import { AddressViewComponent } from './address-view'; +import { AddressViewComponent } from '../../address-view'; /** * Displays "from" or "to" and an address. Useful for spends, outputs, swaps, diff --git a/packages/ui/components/ui/tx/view/transaction.tsx b/packages/ui/components/ui/tx/index.tsx similarity index 97% rename from packages/ui/components/ui/tx/view/transaction.tsx rename to packages/ui/components/ui/tx/index.tsx index 78cb6b1944..977975a73c 100644 --- a/packages/ui/components/ui/tx/view/transaction.tsx +++ b/packages/ui/components/ui/tx/index.tsx @@ -4,7 +4,7 @@ import { ActionViewComponent } from './action-view'; import { ViewBox, ViewSection } from './viewbox'; import { getStakingTokenMetaData } from './registry'; import { ValueView } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; -import { ValueViewComponent } from './value'; +import { ValueViewComponent } from '../value'; export const TransactionViewComponent = ({ txv }: { txv: TransactionView }) => { if (!txv.bodyView) throw new Error('transaction view missing body view'); diff --git a/packages/ui/components/ui/tx/view/memo-view.tsx b/packages/ui/components/ui/tx/memo-view.tsx similarity index 90% rename from packages/ui/components/ui/tx/view/memo-view.tsx rename to packages/ui/components/ui/tx/memo-view.tsx index dc7297d580..9a6c99c2bc 100644 --- a/packages/ui/components/ui/tx/view/memo-view.tsx +++ b/packages/ui/components/ui/tx/memo-view.tsx @@ -1,7 +1,7 @@ import { MemoView } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/transaction/v1/transaction_pb'; -import { AddressViewComponent } from './address-view'; +import { AddressViewComponent } from '../address-view'; import { ViewBox } from './viewbox'; -import { ActionDetails } from './action-details'; +import { ActionDetails } from './actions-views/action-details'; export const MemoViewComponent = ({ memo: { memoView } }: { memo: MemoView }) => { switch (memoView.case) { diff --git a/packages/ui/components/ui/tx/view/registry.tsx b/packages/ui/components/ui/tx/registry.tsx similarity index 100% rename from packages/ui/components/ui/tx/view/registry.tsx rename to packages/ui/components/ui/tx/registry.tsx diff --git a/packages/ui/components/ui/tx/transaction.stories.tsx b/packages/ui/components/ui/tx/transaction.stories.tsx new file mode 100644 index 0000000000..1244122518 --- /dev/null +++ b/packages/ui/components/ui/tx/transaction.stories.tsx @@ -0,0 +1,78 @@ +import type { Meta, StoryObj } from '@storybook/react'; + +import { TransactionViewComponent } from '.'; +import { TransactionView } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/transaction/v1/transaction_pb'; + +const meta: Meta = { + component: TransactionViewComponent, + title: 'TransactionViewComponent', + tags: ['autodocs'], +}; +export default meta; + +type Story = StoryObj; + +// TODO: construct a working transaction – right now it throws an error in Storybook +const EXAMPLE_TRANSACTION = new TransactionView({ + bodyView: { + actionViews: [ + { + actionView: { + case: 'spend', + value: { + spendView: { + case: 'visible', + value: {}, + }, + }, + }, + }, + { + actionView: { + case: 'output', + value: { + outputView: { + case: 'visible', + value: { + note: { + address: { + addressView: { + case: 'decoded', + value: {}, + }, + }, + }, + }, + }, + }, + }, + }, + { + actionView: { + case: 'output', + value: { + outputView: { + case: 'visible', + value: { + note: { + address: { + addressView: { + case: 'decoded', + value: {}, + }, + }, + }, + }, + }, + }, + }, + }, + ], + }, +}); + +export const Basic: Story = { + args: { + txv: EXAMPLE_TRANSACTION, + }, +}; diff --git a/packages/ui/components/ui/tx/view/viewbox.tsx b/packages/ui/components/ui/tx/viewbox.tsx similarity index 91% rename from packages/ui/components/ui/tx/view/viewbox.tsx rename to packages/ui/components/ui/tx/viewbox.tsx index 0dfa6d6f9c..feaf2865a8 100644 --- a/packages/ui/components/ui/tx/view/viewbox.tsx +++ b/packages/ui/components/ui/tx/viewbox.tsx @@ -1,9 +1,9 @@ 'use client'; import * as React from 'react'; -import { cn } from '../../../../lib/utils'; -import { IncognitoIcon } from '../../icons/incognito'; -import { Box } from '../../box'; +import { cn } from '../../../lib/utils'; +import { IncognitoIcon } from '../icons/incognito'; +import { Box } from '../box'; export interface ViewBoxProps { label: string; diff --git a/packages/ui/components/ui/tx/view/value/index.test.tsx b/packages/ui/components/ui/value/index.test.tsx similarity index 97% rename from packages/ui/components/ui/tx/view/value/index.test.tsx rename to packages/ui/components/ui/value/index.test.tsx index 00a2874ee3..f814a4fc7d 100644 --- a/packages/ui/components/ui/tx/view/value/index.test.tsx +++ b/packages/ui/components/ui/value/index.test.tsx @@ -1,5 +1,5 @@ import { describe, expect, test } from 'vitest'; -import { ValueViewComponent } from '.'; +import { ValueViewComponent } from './index'; import { render } from '@testing-library/react'; import { Metadata, diff --git a/packages/ui/components/ui/tx/view/value/index.tsx b/packages/ui/components/ui/value/index.tsx similarity index 100% rename from packages/ui/components/ui/tx/view/value/index.tsx rename to packages/ui/components/ui/value/index.tsx diff --git a/packages/ui/components/ui/value/value.stories.tsx b/packages/ui/components/ui/value/value.stories.tsx new file mode 100644 index 0000000000..f4f4bba28c --- /dev/null +++ b/packages/ui/components/ui/value/value.stories.tsx @@ -0,0 +1,67 @@ +import type { Meta, StoryObj } from '@storybook/react'; + +import { ValueViewComponent } from '.'; +import { + Metadata, + ValueView, +} from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; +import { Amount } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/num/v1/num_pb'; + +const meta: Meta = { + component: ValueViewComponent, + title: 'ValueViewComponent', + tags: ['autodocs'], +}; +export default meta; + +type Story = StoryObj; + +const EXAMPLE_METADATA = new Metadata({ + base: 'upenumbra', + display: 'penumbra', + symbol: 'UM', + images: [ + { + svg: 'https://raw.githubusercontent.com/prax-wallet/registry/main/images/um.svg', + }, + ], +}); + +const EXAMPLE_VALUE = new ValueView({ + valueView: { + case: 'knownAssetId', + value: { + amount: new Amount({ + lo: 17000000n, + }), + metadata: EXAMPLE_METADATA, + }, + }, +}); + +export const Basic: Story = { + args: { + view: EXAMPLE_VALUE, + }, +}; + +export const NoValue: Story = { + args: { + view: EXAMPLE_VALUE, + showValue: false, + }, +}; + +export const NoIcon: Story = { + args: { + view: EXAMPLE_VALUE, + showIcon: false, + }, +}; + +export const NoDenom: Story = { + args: { + view: EXAMPLE_VALUE, + showDenom: false, + }, +}; diff --git a/packages/ui/components/ui/tx/view/value/value.tsx b/packages/ui/components/ui/value/value.tsx similarity index 93% rename from packages/ui/components/ui/tx/view/value/value.tsx rename to packages/ui/components/ui/value/value.tsx index 86ace11789..78917687f3 100644 --- a/packages/ui/components/ui/tx/view/value/value.tsx +++ b/packages/ui/components/ui/value/value.tsx @@ -1,7 +1,7 @@ import { Metadata } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; import { AssetIcon } from '../asset-icon'; -import { Pill } from '../../../pill'; -import { cn } from '../../../../../lib/utils'; +import { Pill } from '../pill'; +import { cn } from '../../../lib/utils'; interface ValueComponentProps { formattedAmount: string; diff --git a/packages/ui/package.json b/packages/ui/package.json index 7bc30730e4..83dcebbfe9 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -20,12 +20,8 @@ "styles" ], "exports": { - "./components/*": "./components/*.tsx", - "./components/ui/dutch-auction-component": "./components/ui/dutch-auction-component/index.tsx", - "./components/ui/identicon": "./components/ui/identicon/index.tsx", - "./components/ui/slider": "./components/ui/slider/index.tsx", - "./components/ui/tx/view/asset-icon": "./components/ui/tx/view/asset-icon/index.tsx", - "./components/ui/tx/view/value": "./components/ui/tx/view/value/index.tsx", + "./components/ui/icons/*": "./components/ui/icons/*.tsx", + "./components/ui/*": "./components/ui/*/index.tsx", "./lib/toast/*": "./lib/toast/*.ts", "./lib/toast/transaction-toast": "./lib/toast/transaction-toast.tsx", "./lib/utils": "./lib/utils.ts", @@ -34,29 +30,13 @@ }, "publishConfig": { "exports": { - "./components/*": { - "default": "./dist/components/*.js", - "types": "./dist/components/*.d.ts" + "./components/ui/icons/*": { + "default": "./dist/components/ui/icons/*.js", + "types": "./dist/components/ui/icons/*.d.ts" }, - "./components/ui/dutch-auction-component": { - "default": "./dist/components/ui/dutch-auction-component/index.js", - "types": "./dist/components/ui/dutch-auction-component/index.d.ts" - }, - "./components/ui/identicon": { - "default": "./dist/components/ui/identicon/index.js", - "types": "./dist/components/ui/identicon/index.d.ts" - }, - "./components/ui/slider": { - "default": "./dist/components/ui/slider/index.js", - "types": "./dist/components/ui/slider/index.d.ts" - }, - "./components/ui/tx/view/asset-icon": { - "default": "./dist/components/ui/tx/view/asset-icon/index.js", - "types": "./dist/components/ui/tx/view/asset-icon/index.d.ts" - }, - "./components/ui/tx/view/value": { - "default": "./dist/components/ui/tx/view/value/index.js", - "types": "./dist/components/ui/tx/view/value/index.d.ts" + "./components/ui/*": { + "default": "./dist/components/ui/*/index.js", + "types": "./dist/components/ui/*/index.d.ts" }, "./lib/toast/*": { "default": "./dist/lib/toast/*.js", diff --git a/packages/ui/tsconfig.json b/packages/ui/tsconfig.json index 05c1ed2982..1e3a1135a6 100644 --- a/packages/ui/tsconfig.json +++ b/packages/ui/tsconfig.json @@ -1,9 +1,11 @@ { "extends": "@repo/tsconfig/vite.json", "include": ["components", "lib", "tests-setup.ts"], + "exclude": ["node_modules", "dist"], "compilerOptions": { "outDir": "dist", - "declarationMap": false, - "sourceMap": false + "noEmit": false, + "sourceMap": false, + "declarationMap": false } } From c0f849aa6255e31e052cadbb63e74fd45fed613d Mon Sep 17 00:00:00 2001 From: Max Korsunov Date: Thu, 20 Jun 2024 20:56:23 +0200 Subject: [PATCH 6/9] fix(ui): linting and tests --- .../ui/balance-value-view/balance-value-view.test.tsx | 4 ++-- packages/ui/components/ui/button/button.stories.tsx | 2 +- .../ui/segmented-picker/segmented-picker.stories.tsx | 2 +- .../ui/segmented-picker/segmented-picker.test.tsx | 2 +- .../ui/components/ui/testnet-banner/testnet-banner.test.tsx | 2 +- packages/ui/components/ui/toaster/toaster.stories.tsx | 2 +- .../ui/components/ui/tx/actions-views/swap/index.test.tsx | 2 +- packages/ui/components/ui/value/index.test.tsx | 2 +- packages/ui/readme.md | 6 +++--- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/ui/components/ui/balance-value-view/balance-value-view.test.tsx b/packages/ui/components/ui/balance-value-view/balance-value-view.test.tsx index 11e831330e..ca335472e0 100644 --- a/packages/ui/components/ui/balance-value-view/balance-value-view.test.tsx +++ b/packages/ui/components/ui/balance-value-view/balance-value-view.test.tsx @@ -4,11 +4,11 @@ import { Metadata, ValueView, } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; -import { BalanceValueView } from './index'; +import { BalanceValueView } from '.'; import { base64ToUint8Array } from '@penumbra-zone/types/base64'; // Mocking the WalletIcon component -vi.mock('./icons/wallet', () => ({ +vi.mock('../icons/wallet', () => ({ WalletIcon: ({ className }: { className: string }) => (
), diff --git a/packages/ui/components/ui/button/button.stories.tsx b/packages/ui/components/ui/button/button.stories.tsx index 3ab8f87b8e..092663f523 100644 --- a/packages/ui/components/ui/button/button.stories.tsx +++ b/packages/ui/components/ui/button/button.stories.tsx @@ -1,6 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { Button } from './index'; +import { Button } from '.'; const meta: Meta = { component: Button, diff --git a/packages/ui/components/ui/segmented-picker/segmented-picker.stories.tsx b/packages/ui/components/ui/segmented-picker/segmented-picker.stories.tsx index 53e5606b6c..7779db584b 100644 --- a/packages/ui/components/ui/segmented-picker/segmented-picker.stories.tsx +++ b/packages/ui/components/ui/segmented-picker/segmented-picker.stories.tsx @@ -1,7 +1,7 @@ import type { Meta, StoryObj } from '@storybook/react'; import { useArgs } from '@storybook/preview-api'; -import { SegmentedPicker } from './index'; +import { SegmentedPicker } from '.'; const meta: Meta = { component: SegmentedPicker, diff --git a/packages/ui/components/ui/segmented-picker/segmented-picker.test.tsx b/packages/ui/components/ui/segmented-picker/segmented-picker.test.tsx index 3653ee92f9..7c7af699a0 100644 --- a/packages/ui/components/ui/segmented-picker/segmented-picker.test.tsx +++ b/packages/ui/components/ui/segmented-picker/segmented-picker.test.tsx @@ -1,6 +1,6 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; import { fireEvent, render } from '@testing-library/react'; -import { SegmentedPicker } from './index'; +import { SegmentedPicker } from '.'; describe('', () => { const onChange = vi.fn(); diff --git a/packages/ui/components/ui/testnet-banner/testnet-banner.test.tsx b/packages/ui/components/ui/testnet-banner/testnet-banner.test.tsx index 5e910feb42..01bb17b0b4 100644 --- a/packages/ui/components/ui/testnet-banner/testnet-banner.test.tsx +++ b/packages/ui/components/ui/testnet-banner/testnet-banner.test.tsx @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; import { render } from '@testing-library/react'; -import { TestnetBanner } from './index'; +import { TestnetBanner } from '.'; describe('', () => { it('renders banner if chainId is a testnet', () => { diff --git a/packages/ui/components/ui/toaster/toaster.stories.tsx b/packages/ui/components/ui/toaster/toaster.stories.tsx index 66602b1b7c..856c48ee87 100644 --- a/packages/ui/components/ui/toaster/toaster.stories.tsx +++ b/packages/ui/components/ui/toaster/toaster.stories.tsx @@ -1,6 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { Toaster } from './index'; +import { Toaster } from '.'; import { toast } from 'sonner'; import { Button } from '../button'; diff --git a/packages/ui/components/ui/tx/actions-views/swap/index.test.tsx b/packages/ui/components/ui/tx/actions-views/swap/index.test.tsx index 3e946aa544..c9524e08cc 100644 --- a/packages/ui/components/ui/tx/actions-views/swap/index.test.tsx +++ b/packages/ui/components/ui/tx/actions-views/swap/index.test.tsx @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest'; -import { SwapViewComponent } from './index'; +import { SwapViewComponent } from '.'; import { SwapView } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/dex/v1/dex_pb'; import { render } from '@testing-library/react'; diff --git a/packages/ui/components/ui/value/index.test.tsx b/packages/ui/components/ui/value/index.test.tsx index f814a4fc7d..00a2874ee3 100644 --- a/packages/ui/components/ui/value/index.test.tsx +++ b/packages/ui/components/ui/value/index.test.tsx @@ -1,5 +1,5 @@ import { describe, expect, test } from 'vitest'; -import { ValueViewComponent } from './index'; +import { ValueViewComponent } from '.'; import { render } from '@testing-library/react'; import { Metadata, diff --git a/packages/ui/readme.md b/packages/ui/readme.md index a428260a7a..ac4d9216a2 100644 --- a/packages/ui/readme.md +++ b/packages/ui/readme.md @@ -15,10 +15,10 @@ Then, configure the Tailwind in your project. Edit `tailwind.config.js`: ```js export default { content: [ - // Parses the classes of the UI components - './node_modules/@penumbra-zone/ui/**/*.js' + // Parses the classes of the UI components + './node_modules/@penumbra-zone/ui/**/*.js', ], -} +}; ``` Finally, import the library CSS to the entry point of your app: From 26b4fe1bbc3f27a8615e4c9c5f4cf0d535560eb8 Mon Sep 17 00:00:00 2001 From: Max Korsunov Date: Thu, 20 Jun 2024 20:58:50 +0200 Subject: [PATCH 7/9] chore: add changesets --- .changeset/rude-taxis-raise.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changeset/rude-taxis-raise.md diff --git a/.changeset/rude-taxis-raise.md b/.changeset/rude-taxis-raise.md new file mode 100644 index 0000000000..9452d47621 --- /dev/null +++ b/.changeset/rude-taxis-raise.md @@ -0,0 +1,7 @@ +--- +'@penumbra-zone/ui': major +'node-status': patch +'minifront': patch +--- + +UI: refactor the package to provide better and more clear exports. Includes a readme with setting up the UI package and more storybook stories. From c4eee52d1425246192dbb47c7e411ceab45a0776 Mon Sep 17 00:00:00 2001 From: Max Korsunov Date: Mon, 24 Jun 2024 11:37:41 +0200 Subject: [PATCH 8/9] fix: put the repo/ui package name back --- apps/minifront/package.json | 2 +- apps/minifront/postcss.config.js | 2 +- .../dashboard/assets-table/equivalent-values.tsx | 2 +- .../components/dashboard/assets-table/index.tsx | 6 +++--- .../minifront/src/components/dashboard/layout.tsx | 2 +- .../components/dashboard/transaction-table.tsx | 2 +- .../src/components/extension-not-connected.tsx | 8 ++++---- .../src/components/extension-not-installed.tsx | 4 ++-- .../extension-transport-disconnected.tsx | 4 ++-- apps/minifront/src/components/header/header.tsx | 4 ++-- .../src/components/header/menu/desktop-nav.tsx | 2 +- .../minifront/src/components/header/menu/menu.tsx | 2 +- .../src/components/header/menu/mobile-nav.tsx | 7 +------ .../src/components/header/menu/provider.tsx | 2 +- .../src/components/header/menu/tablet-nav.tsx | 2 +- .../src/components/ibc/ibc-in/assets-table.tsx | 6 +++--- .../src/components/ibc/ibc-in/chain-dropdown.tsx | 10 +++++----- .../components/ibc/ibc-in/destination-addr.tsx | 2 +- .../src/components/ibc/ibc-in/ibc-in-request.tsx | 10 +++++----- .../components/ibc/ibc-in/wallet-addr-card.tsx | 2 +- .../ibc/ibc-in/wallet-connect-button.tsx | 4 ++-- .../src/components/ibc/ibc-out/chain-selector.tsx | 4 ++-- .../src/components/ibc/ibc-out/ibc-out-form.tsx | 4 ++-- apps/minifront/src/components/ibc/layout.tsx | 2 +- apps/minifront/src/components/layout.tsx | 4 ++-- apps/minifront/src/components/not-found.tsx | 2 +- apps/minifront/src/components/send/layout.tsx | 2 +- apps/minifront/src/components/send/receive.tsx | 2 +- .../src/components/send/send-form/index.tsx | 4 ++-- .../src/components/shared/asset-selector.tsx | 15 +++++---------- .../src/components/shared/balance-selector.tsx | 15 +++++---------- .../shared/edu-panels/edu-info-card.tsx | 6 +++--- .../src/components/shared/error-boundary.tsx | 2 +- apps/minifront/src/components/shared/gas-fee.tsx | 7 ++----- .../src/components/shared/input-block.tsx | 4 ++-- .../src/components/shared/input-token.tsx | 6 +++--- apps/minifront/src/components/shared/tabs.tsx | 2 +- .../account/delegation-value-view/index.tsx | 2 +- .../staking-actions/form-dialog.tsx | 10 +++++----- .../staking-actions/index.tsx | 2 +- .../validator-info-component.tsx | 6 +++--- .../components/staking/account/header/index.tsx | 8 ++++---- .../staking/account/header/unbonding-tokens.tsx | 4 ++-- apps/minifront/src/components/staking/layout.tsx | 2 +- .../src/components/staking/validator-info-row.tsx | 2 +- .../src/components/staking/validators-table.tsx | 2 +- .../src/components/swap/auction-list/filters.tsx | 2 +- .../src/components/swap/auction-list/index.tsx | 6 +++--- .../auction-list/query-latest-state-button.tsx | 4 ++-- .../src/components/swap/duration-slider.tsx | 2 +- .../components/swap/swap-form/estimate-button.tsx | 6 +++--- .../src/components/swap/swap-form/index.tsx | 4 ++-- .../components/swap/swap-form/output/index.tsx | 4 ++-- .../swap/swap-form/simulate-swap-result/index.tsx | 2 +- .../simulate-swap-result/price-impact.tsx | 4 ++-- .../simulate-swap-result/traces/index.tsx | 2 +- .../simulate-swap-result/traces/trace/index.tsx | 2 +- .../components/swap/swap-form/simulate-swap.tsx | 2 +- .../swap/swap-form/token-swap-input.tsx | 8 ++++---- .../src/components/swap/unclaimed-swaps.tsx | 8 ++++---- .../minifront/src/components/tx-details/index.tsx | 4 ++-- .../src/components/tx-details/tx-viewer.tsx | 6 +++--- apps/minifront/src/icons/box.tsx | 2 +- apps/minifront/src/icons/drag-handle-dots.tsx | 2 +- apps/minifront/src/icons/swap.tsx | 2 +- apps/minifront/src/state/helpers.ts | 2 +- apps/minifront/src/state/ibc-in/index.tsx | 2 +- apps/minifront/src/state/ibc-out.ts | 2 +- .../src/state/swap/dutch-auction/index.ts | 2 +- apps/minifront/src/state/swap/instant-swap.ts | 2 +- apps/node-status/package.json | 2 +- apps/node-status/postcss.config.js | 2 +- .../node-status/src/components/error-boundary.tsx | 2 +- .../src/components/frontend-referral.tsx | 2 +- apps/node-status/src/components/header.tsx | 2 +- apps/node-status/src/components/node-info.tsx | 4 ++-- apps/node-status/src/components/sync-info.tsx | 2 +- .../node-status/src/components/validator-info.tsx | 2 +- apps/node-status/src/main.tsx | 2 +- packages/ui/package.json | 2 +- packages/ui/readme.md | 2 +- pnpm-lock.yaml | 8 ++++---- 82 files changed, 150 insertions(+), 168 deletions(-) diff --git a/apps/minifront/package.json b/apps/minifront/package.json index b02f09f7b4..7e5aae1fa5 100644 --- a/apps/minifront/package.json +++ b/apps/minifront/package.json @@ -28,7 +28,6 @@ "@penumbra-zone/protobuf": "workspace:*", "@penumbra-zone/transport-dom": "workspace:*", "@penumbra-zone/types": "workspace:*", - "@penumbra-zone/ui": "workspace:*", "@penumbra-zone/zquery": "workspace:*", "@radix-ui/react-dialog": "1.0.5", "@radix-ui/react-icons": "^1.3.0", @@ -36,6 +35,7 @@ "@radix-ui/react-navigation-menu": "^1.1.4", "@radix-ui/react-portal": "^1.0.4", "@remix-run/router": "^1.16.1", + "@repo/ui": "workspace:*", "@tanstack/react-query": "4.36.1", "bech32": "^2.0.0", "bignumber.js": "^9.1.2", diff --git a/apps/minifront/postcss.config.js b/apps/minifront/postcss.config.js index 8e18cdcb77..a2051ffd15 100644 --- a/apps/minifront/postcss.config.js +++ b/apps/minifront/postcss.config.js @@ -1 +1 @@ -export { default } from '@penumbra-zone/ui/postcss.config.js'; +export { default } from '@repo/ui/postcss.config.js'; diff --git a/apps/minifront/src/components/dashboard/assets-table/equivalent-values.tsx b/apps/minifront/src/components/dashboard/assets-table/equivalent-values.tsx index c980b56110..ae9a935b70 100644 --- a/apps/minifront/src/components/dashboard/assets-table/equivalent-values.tsx +++ b/apps/minifront/src/components/dashboard/assets-table/equivalent-values.tsx @@ -1,7 +1,7 @@ import { ValueView } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; import { asValueView } from '@penumbra-zone/getters/equivalent-value'; import { getDisplayDenomFromView, getEquivalentValues } from '@penumbra-zone/getters/value-view'; -import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/value'; +import { ValueViewComponent } from '@repo/ui/components/ui/value'; export const EquivalentValues = ({ valueView }: { valueView?: ValueView }) => { const equivalentValuesAsValueViews = (getEquivalentValues.optional()(valueView) ?? []).map( diff --git a/apps/minifront/src/components/dashboard/assets-table/index.tsx b/apps/minifront/src/components/dashboard/assets-table/index.tsx index 1a4af57b97..20254de5d9 100644 --- a/apps/minifront/src/components/dashboard/assets-table/index.tsx +++ b/apps/minifront/src/components/dashboard/assets-table/index.tsx @@ -1,4 +1,4 @@ -import { AddressComponent, AddressIcon } from '@penumbra-zone/ui/components/ui/address'; +import { AddressComponent, AddressIcon } from '@repo/ui/components/ui/address'; import { Table, TableBody, @@ -6,8 +6,8 @@ import { TableHead, TableHeader, TableRow, -} from '@penumbra-zone/ui/components/ui/table'; -import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/value'; +} from '@repo/ui/components/ui/table'; +import { ValueViewComponent } from '@repo/ui/components/ui/value'; import { EquivalentValues } from './equivalent-values'; import { Fragment } from 'react'; import { shouldDisplay } from './helpers'; diff --git a/apps/minifront/src/components/dashboard/layout.tsx b/apps/minifront/src/components/dashboard/layout.tsx index 75be0a7667..e19268058a 100644 --- a/apps/minifront/src/components/dashboard/layout.tsx +++ b/apps/minifront/src/components/dashboard/layout.tsx @@ -1,4 +1,4 @@ -import { Card } from '@penumbra-zone/ui/components/ui/card'; +import { Card } from '@repo/ui/components/ui/card'; import { dashboardTabs, dashboardTabsHelper } from './constants'; import { Outlet } from 'react-router-dom'; import { EduInfoCard } from '../shared/edu-panels/edu-info-card'; diff --git a/apps/minifront/src/components/dashboard/transaction-table.tsx b/apps/minifront/src/components/dashboard/transaction-table.tsx index 2853129fc2..e88b7a5a67 100644 --- a/apps/minifront/src/components/dashboard/transaction-table.tsx +++ b/apps/minifront/src/components/dashboard/transaction-table.tsx @@ -5,7 +5,7 @@ import { TableHead, TableHeader, TableRow, -} from '@penumbra-zone/ui/components/ui/table'; +} from '@repo/ui/components/ui/table'; import { Link } from 'react-router-dom'; import { shorten } from '@penumbra-zone/types/string'; import { memo } from 'react'; diff --git a/apps/minifront/src/components/extension-not-connected.tsx b/apps/minifront/src/components/extension-not-connected.tsx index 5c7cfd4864..196a3f935b 100644 --- a/apps/minifront/src/components/extension-not-connected.tsx +++ b/apps/minifront/src/components/extension-not-connected.tsx @@ -1,7 +1,7 @@ -import { Button } from '@penumbra-zone/ui/components/ui/button'; -import { Toaster } from '@penumbra-zone/ui/components/ui/toaster'; -import { SplashPage } from '@penumbra-zone/ui/components/ui/splash-page'; -import { errorToast, warningToast } from '@penumbra-zone/ui/lib/toast/presets'; +import { Button } from '@repo/ui/components/ui/button'; +import { Toaster } from '@repo/ui/components/ui/toaster'; +import { SplashPage } from '@repo/ui/components/ui/splash-page'; +import { errorToast, warningToast } from '@repo/ui/lib/toast/presets'; import { HeadTag } from './metadata/head-tag'; import { useState } from 'react'; diff --git a/apps/minifront/src/components/extension-not-installed.tsx b/apps/minifront/src/components/extension-not-installed.tsx index 5944e6fd92..aa2a33e400 100644 --- a/apps/minifront/src/components/extension-not-installed.tsx +++ b/apps/minifront/src/components/extension-not-installed.tsx @@ -1,5 +1,5 @@ -import { Button } from '@penumbra-zone/ui/components/ui/button'; -import { SplashPage } from '@penumbra-zone/ui/components/ui/splash-page'; +import { Button } from '@repo/ui/components/ui/button'; +import { SplashPage } from '@repo/ui/components/ui/splash-page'; import { HeadTag } from './metadata/head-tag'; const CHROME_EXTENSION_ID = 'lkpmkhpnhknhmibgnmmhdhgdilepfghe'; diff --git a/apps/minifront/src/components/extension-transport-disconnected.tsx b/apps/minifront/src/components/extension-transport-disconnected.tsx index 62abfab944..1db1922b5a 100644 --- a/apps/minifront/src/components/extension-transport-disconnected.tsx +++ b/apps/minifront/src/components/extension-transport-disconnected.tsx @@ -1,6 +1,6 @@ -import { SplashPage } from '@penumbra-zone/ui/components/ui/splash-page'; +import { SplashPage } from '@repo/ui/components/ui/splash-page'; import { HeadTag } from './metadata/head-tag'; -import { Button } from '@penumbra-zone/ui/components/ui/button'; +import { Button } from '@repo/ui/components/ui/button'; export const ExtensionTransportDisconnected = () => { return ( diff --git a/apps/minifront/src/components/header/header.tsx b/apps/minifront/src/components/header/header.tsx index 361438747b..e1eb23bcca 100644 --- a/apps/minifront/src/components/header/header.tsx +++ b/apps/minifront/src/components/header/header.tsx @@ -1,5 +1,5 @@ -import { CondensedBlockSyncStatus } from '@penumbra-zone/ui/components/ui/block-sync-status'; -import { TestnetBanner } from '@penumbra-zone/ui/components/ui/testnet-banner'; +import { CondensedBlockSyncStatus } from '@repo/ui/components/ui/block-sync-status'; +import { TestnetBanner } from '@repo/ui/components/ui/testnet-banner'; import { useEffect, useState } from 'react'; import { Link } from 'react-router-dom'; import { getChainId } from '../../fetchers/chain-id'; diff --git a/apps/minifront/src/components/header/menu/desktop-nav.tsx b/apps/minifront/src/components/header/menu/desktop-nav.tsx index 546bdc607d..b7592a47a4 100644 --- a/apps/minifront/src/components/header/menu/desktop-nav.tsx +++ b/apps/minifront/src/components/header/menu/desktop-nav.tsx @@ -1,4 +1,4 @@ -import { cn } from '@penumbra-zone/ui/lib/utils'; +import { cn } from '@repo/ui/lib/utils'; import * as NavigationMenu from '@radix-ui/react-navigation-menu'; import { usePagePath } from '../../../fetchers/page-path'; import { dashboardLink, headerLinks } from '../constants'; diff --git a/apps/minifront/src/components/header/menu/menu.tsx b/apps/minifront/src/components/header/menu/menu.tsx index 9099cba7f7..3d4423e795 100644 --- a/apps/minifront/src/components/header/menu/menu.tsx +++ b/apps/minifront/src/components/header/menu/menu.tsx @@ -1,4 +1,4 @@ -import { cn } from '@penumbra-zone/ui/lib/utils'; +import { cn } from '@repo/ui/lib/utils'; import { DesktopNav } from './desktop-nav'; import { MobileNav } from './mobile-nav'; import { ProviderMenu } from './provider'; diff --git a/apps/minifront/src/components/header/menu/mobile-nav.tsx b/apps/minifront/src/components/header/menu/mobile-nav.tsx index 4f41ce40f2..178a62b72d 100644 --- a/apps/minifront/src/components/header/menu/mobile-nav.tsx +++ b/apps/minifront/src/components/header/menu/mobile-nav.tsx @@ -1,9 +1,4 @@ -import { - Sheet, - SheetContent, - SheetHeader, - SheetTrigger, -} from '@penumbra-zone/ui/components/ui/sheet'; +import { Sheet, SheetContent, SheetHeader, SheetTrigger } from '@repo/ui/components/ui/sheet'; import { HamburgerMenuIcon } from '@radix-ui/react-icons'; import { headerLinks } from '../constants'; import { Link } from 'react-router-dom'; diff --git a/apps/minifront/src/components/header/menu/provider.tsx b/apps/minifront/src/components/header/menu/provider.tsx index b6ff4edfae..1a7d621496 100644 --- a/apps/minifront/src/components/header/menu/provider.tsx +++ b/apps/minifront/src/components/header/menu/provider.tsx @@ -1,4 +1,4 @@ -import { cn } from '@penumbra-zone/ui/lib/utils'; +import { cn } from '@repo/ui/lib/utils'; import * as NavigationMenu from '@radix-ui/react-navigation-menu'; import { getChainId } from '../../../fetchers/chain-id'; import { useCallback, useEffect, useState } from 'react'; diff --git a/apps/minifront/src/components/header/menu/tablet-nav.tsx b/apps/minifront/src/components/header/menu/tablet-nav.tsx index 319da0403a..d3ef809a17 100644 --- a/apps/minifront/src/components/header/menu/tablet-nav.tsx +++ b/apps/minifront/src/components/header/menu/tablet-nav.tsx @@ -1,4 +1,4 @@ -import { cn } from '@penumbra-zone/ui/lib/utils'; +import { cn } from '@repo/ui/lib/utils'; import * as NavigationMenu from '@radix-ui/react-navigation-menu'; import { usePagePath } from '../../../fetchers/page-path'; import { dashboardLink, headerLinks } from '../constants'; diff --git a/apps/minifront/src/components/ibc/ibc-in/assets-table.tsx b/apps/minifront/src/components/ibc/ibc-in/assets-table.tsx index 4a2d0c11a6..50de9d4ae6 100644 --- a/apps/minifront/src/components/ibc/ibc-in/assets-table.tsx +++ b/apps/minifront/src/components/ibc/ibc-in/assets-table.tsx @@ -8,9 +8,9 @@ import { TableHead, TableHeader, TableRow, -} from '@penumbra-zone/ui/components/ui/table'; -import { Avatar, AvatarImage } from '@penumbra-zone/ui/components/ui/avatar'; -import { Identicon } from '@penumbra-zone/ui/components/ui/identicon'; +} from '@repo/ui/components/ui/table'; +import { Avatar, AvatarImage } from '@repo/ui/components/ui/avatar'; +import { Identicon } from '@repo/ui/components/ui/identicon'; import { LineWave } from 'react-loader-spinner'; export const AssetsTable = () => { diff --git a/apps/minifront/src/components/ibc/ibc-in/chain-dropdown.tsx b/apps/minifront/src/components/ibc/ibc-in/chain-dropdown.tsx index 767591c5e7..e1e3d7919e 100644 --- a/apps/minifront/src/components/ibc/ibc-in/chain-dropdown.tsx +++ b/apps/minifront/src/components/ibc/ibc-in/chain-dropdown.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { useMemo } from 'react'; import { useManager } from '@cosmos-kit/react'; -import { Popover, PopoverContent, PopoverTrigger } from '@penumbra-zone/ui/components/ui/popover'; +import { Popover, PopoverContent, PopoverTrigger } from '@repo/ui/components/ui/popover'; import { ChevronsUpDown } from 'lucide-react'; import { Command, @@ -9,12 +9,12 @@ import { CommandGroup, CommandInput, CommandItem, -} from '@penumbra-zone/ui/components/ui/command'; -import { Button } from '@penumbra-zone/ui/components/ui/button'; +} from '@repo/ui/components/ui/command'; +import { Button } from '@repo/ui/components/ui/button'; import { ibcInSelector } from '../../../state/ibc-in'; import { useStore } from '../../../state'; -import { Avatar, AvatarImage } from '@penumbra-zone/ui/components/ui/avatar'; -import { Identicon } from '@penumbra-zone/ui/components/ui/identicon'; +import { Avatar, AvatarImage } from '@repo/ui/components/ui/avatar'; +import { Identicon } from '@repo/ui/components/ui/identicon'; export interface ChainInfo { chainName: string; diff --git a/apps/minifront/src/components/ibc/ibc-in/destination-addr.tsx b/apps/minifront/src/components/ibc/ibc-in/destination-addr.tsx index 339184ebf7..ad04f087f6 100644 --- a/apps/minifront/src/components/ibc/ibc-in/destination-addr.tsx +++ b/apps/minifront/src/components/ibc/ibc-in/destination-addr.tsx @@ -1,6 +1,6 @@ import { AllSlices } from '../../../state'; import { useStoreShallow } from '../../../utils/use-store-shallow'; -import { AccountSwitcher } from '@penumbra-zone/ui/components/ui/account-switcher'; +import { AccountSwitcher } from '@repo/ui/components/ui/account-switcher'; const addrsSelector = ({ ibcIn }: AllSlices) => ({ account: ibcIn.account, diff --git a/apps/minifront/src/components/ibc/ibc-in/ibc-in-request.tsx b/apps/minifront/src/components/ibc/ibc-in/ibc-in-request.tsx index a5a227a431..f48f6b71c2 100644 --- a/apps/minifront/src/components/ibc/ibc-in/ibc-in-request.tsx +++ b/apps/minifront/src/components/ibc/ibc-in/ibc-in-request.tsx @@ -7,12 +7,12 @@ import { SelectItem, SelectTrigger, SelectValue, -} from '@penumbra-zone/ui/components/ui/select'; -import { Avatar, AvatarImage } from '@penumbra-zone/ui/components/ui/avatar'; -import { Identicon } from '@penumbra-zone/ui/components/ui/identicon'; -import { Input } from '@penumbra-zone/ui/components/ui/input'; +} from '@repo/ui/components/ui/select'; +import { Avatar, AvatarImage } from '@repo/ui/components/ui/avatar'; +import { Identicon } from '@repo/ui/components/ui/identicon'; +import { Input } from '@repo/ui/components/ui/input'; import { DestinationAddr } from './destination-addr'; -import { Button } from '@penumbra-zone/ui/components/ui/button'; +import { Button } from '@repo/ui/components/ui/button'; import { LockClosedIcon } from '@radix-ui/react-icons'; const isReadySelector = (state: AllSlices) => { diff --git a/apps/minifront/src/components/ibc/ibc-in/wallet-addr-card.tsx b/apps/minifront/src/components/ibc/ibc-in/wallet-addr-card.tsx index 3c34414c6e..3379a92b1d 100644 --- a/apps/minifront/src/components/ibc/ibc-in/wallet-addr-card.tsx +++ b/apps/minifront/src/components/ibc/ibc-in/wallet-addr-card.tsx @@ -1,4 +1,4 @@ -import { Identicon } from '@penumbra-zone/ui/components/ui/identicon'; +import { Identicon } from '@repo/ui/components/ui/identicon'; interface UserInfoProps { address: string; diff --git a/apps/minifront/src/components/ibc/ibc-in/wallet-connect-button.tsx b/apps/minifront/src/components/ibc/ibc-in/wallet-connect-button.tsx index 89b0b1fb26..f022f7ad4f 100644 --- a/apps/minifront/src/components/ibc/ibc-in/wallet-connect-button.tsx +++ b/apps/minifront/src/components/ibc/ibc-in/wallet-connect-button.tsx @@ -1,11 +1,11 @@ import { WalletStatus } from 'cosmos-kit'; -import { WalletIcon } from '@penumbra-zone/ui/components/ui/icons/wallet'; +import { WalletIcon } from '@repo/ui/components/ui/icons/wallet'; import { MouseEventHandler } from 'react'; import { useStore } from '../../../state'; import { ibcInSelector } from '../../../state/ibc-in'; import { useChainConnector } from './hooks'; -import { cn } from '@penumbra-zone/ui/lib/utils'; +import { cn } from '@repo/ui/lib/utils'; export const ConnectWalletButton = () => { const { connect, openView, status } = useChainConnector(); diff --git a/apps/minifront/src/components/ibc/ibc-out/chain-selector.tsx b/apps/minifront/src/components/ibc/ibc-out/chain-selector.tsx index ef137ab3e7..21f9241596 100644 --- a/apps/minifront/src/components/ibc/ibc-out/chain-selector.tsx +++ b/apps/minifront/src/components/ibc/ibc-out/chain-selector.tsx @@ -4,8 +4,8 @@ import { SelectItem, SelectTrigger, SelectValue, -} from '@penumbra-zone/ui/components/ui/select'; -import { cn } from '@penumbra-zone/ui/lib/utils'; +} from '@repo/ui/components/ui/select'; +import { cn } from '@repo/ui/lib/utils'; import { useState } from 'react'; import { useStore } from '../../../state'; import { ibcOutSelector } from '../../../state/ibc-out'; diff --git a/apps/minifront/src/components/ibc/ibc-out/ibc-out-form.tsx b/apps/minifront/src/components/ibc/ibc-out/ibc-out-form.tsx index 8750f6a751..7df458ffb7 100644 --- a/apps/minifront/src/components/ibc/ibc-out/ibc-out-form.tsx +++ b/apps/minifront/src/components/ibc/ibc-out/ibc-out-form.tsx @@ -1,5 +1,5 @@ -import { Button } from '@penumbra-zone/ui/components/ui/button'; -import { Input } from '@penumbra-zone/ui/components/ui/input'; +import { Button } from '@repo/ui/components/ui/button'; +import { Input } from '@repo/ui/components/ui/input'; import { ChainSelector } from './chain-selector'; import { useLoaderData } from 'react-router-dom'; import { useStore } from '../../../state'; diff --git a/apps/minifront/src/components/ibc/layout.tsx b/apps/minifront/src/components/ibc/layout.tsx index 06c0bfb385..6f627f049b 100644 --- a/apps/minifront/src/components/ibc/layout.tsx +++ b/apps/minifront/src/components/ibc/layout.tsx @@ -1,4 +1,4 @@ -import { Card } from '@penumbra-zone/ui/components/ui/card'; +import { Card } from '@repo/ui/components/ui/card'; import { IbcOutForm } from './ibc-out/ibc-out-form'; import { InterchainUi } from './ibc-in/interchain-ui'; import { LongArrowIcon } from './long-arrow'; diff --git a/apps/minifront/src/components/layout.tsx b/apps/minifront/src/components/layout.tsx index 86087aabe4..d126cf8ca9 100644 --- a/apps/minifront/src/components/layout.tsx +++ b/apps/minifront/src/components/layout.tsx @@ -1,9 +1,9 @@ import { Outlet } from 'react-router-dom'; import { HeadTag } from './metadata/head-tag'; import { Header } from './header/header'; -import { Toaster } from '@penumbra-zone/ui/components/ui/toaster'; +import { Toaster } from '@repo/ui/components/ui/toaster'; import { Footer } from './footer/footer'; -import '@penumbra-zone/ui/styles/globals.css'; +import '@repo/ui/styles/globals.css'; import { MotionConfig } from 'framer-motion'; export const Layout = () => { diff --git a/apps/minifront/src/components/not-found.tsx b/apps/minifront/src/components/not-found.tsx index e15f3e3e57..2c8a9b6a66 100644 --- a/apps/minifront/src/components/not-found.tsx +++ b/apps/minifront/src/components/not-found.tsx @@ -1,4 +1,4 @@ -import { SplashPage } from '@penumbra-zone/ui/components/ui/splash-page'; +import { SplashPage } from '@repo/ui/components/ui/splash-page'; export const NotFound = () => { return That page could not be found. ; diff --git a/apps/minifront/src/components/send/layout.tsx b/apps/minifront/src/components/send/layout.tsx index 56f99ef69a..a35368214a 100644 --- a/apps/minifront/src/components/send/layout.tsx +++ b/apps/minifront/src/components/send/layout.tsx @@ -1,4 +1,4 @@ -import { Card } from '@penumbra-zone/ui/components/ui/card'; +import { Card } from '@repo/ui/components/ui/card'; import { sendTabs, sendTabsHelper } from './constants'; import { SendTab } from './types'; import { usePagePath } from '../../fetchers/page-path'; diff --git a/apps/minifront/src/components/send/receive.tsx b/apps/minifront/src/components/send/receive.tsx index f4723d8dce..f44f24df33 100644 --- a/apps/minifront/src/components/send/receive.tsx +++ b/apps/minifront/src/components/send/receive.tsx @@ -1,4 +1,4 @@ -import { SelectAccount } from '@penumbra-zone/ui/components/ui/select'; +import { SelectAccount } from '@repo/ui/components/ui/select'; import { getAddrByIndex } from '../../fetchers/address'; export const Receive = () => { diff --git a/apps/minifront/src/components/send/send-form/index.tsx b/apps/minifront/src/components/send/send-form/index.tsx index 4182bf4326..8f4901b40f 100644 --- a/apps/minifront/src/components/send/send-form/index.tsx +++ b/apps/minifront/src/components/send/send-form/index.tsx @@ -1,5 +1,5 @@ -import { Button } from '@penumbra-zone/ui/components/ui/button'; -import { Input } from '@penumbra-zone/ui/components/ui/input'; +import { Button } from '@repo/ui/components/ui/button'; +import { Input } from '@repo/ui/components/ui/input'; import { useStore } from '../../../state'; import { sendSelector, diff --git a/apps/minifront/src/components/shared/asset-selector.tsx b/apps/minifront/src/components/shared/asset-selector.tsx index 0e551e2484..44d2a05468 100644 --- a/apps/minifront/src/components/shared/asset-selector.tsx +++ b/apps/minifront/src/components/shared/asset-selector.tsx @@ -1,19 +1,14 @@ -import { - Dialog, - DialogClose, - DialogContent, - DialogHeader, -} from '@penumbra-zone/ui/components/ui/dialog'; -import { AssetIcon } from '@penumbra-zone/ui/components/ui/asset-icon'; +import { Dialog, DialogClose, DialogContent, DialogHeader } from '@repo/ui/components/ui/dialog'; +import { AssetIcon } from '@repo/ui/components/ui/asset-icon'; import { Metadata, ValueView, } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; -import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/value'; +import { ValueViewComponent } from '@repo/ui/components/ui/value'; import { useEffect, useId, useMemo, useState } from 'react'; -import { IconInput } from '@penumbra-zone/ui/components/ui/icon-input'; +import { IconInput } from '@repo/ui/components/ui/icon-input'; import { MagnifyingGlassIcon } from '@radix-ui/react-icons'; -import { Box } from '@penumbra-zone/ui/components/ui/box'; +import { Box } from '@repo/ui/components/ui/box'; import { motion } from 'framer-motion'; interface AssetSelectorProps { diff --git a/apps/minifront/src/components/shared/balance-selector.tsx b/apps/minifront/src/components/shared/balance-selector.tsx index 3f5d5a1392..4bdc831a0b 100644 --- a/apps/minifront/src/components/shared/balance-selector.tsx +++ b/apps/minifront/src/components/shared/balance-selector.tsx @@ -1,18 +1,13 @@ import { MagnifyingGlassIcon } from '@radix-ui/react-icons'; import { useId, useState } from 'react'; -import { IconInput } from '@penumbra-zone/ui/components/ui/icon-input'; -import { - Dialog, - DialogClose, - DialogContent, - DialogHeader, -} from '@penumbra-zone/ui/components/ui/dialog'; -import { cn } from '@penumbra-zone/ui/lib/utils'; -import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/value'; +import { IconInput } from '@repo/ui/components/ui/icon-input'; +import { Dialog, DialogClose, DialogContent, DialogHeader } from '@repo/ui/components/ui/dialog'; +import { cn } from '@repo/ui/lib/utils'; +import { ValueViewComponent } from '@repo/ui/components/ui/value'; import { BalancesResponse } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/view/v1/view_pb'; import { getAddressIndex } from '@penumbra-zone/getters/address-view'; import { getDisplayDenomFromView, getSymbolFromValueView } from '@penumbra-zone/getters/value-view'; -import { Box } from '@penumbra-zone/ui/components/ui/box'; +import { Box } from '@repo/ui/components/ui/box'; import { motion } from 'framer-motion'; const bySearch = (search: string) => (balancesResponse: BalancesResponse) => diff --git a/apps/minifront/src/components/shared/edu-panels/edu-info-card.tsx b/apps/minifront/src/components/shared/edu-panels/edu-info-card.tsx index 74204548fc..5f2e1f2528 100644 --- a/apps/minifront/src/components/shared/edu-panels/edu-info-card.tsx +++ b/apps/minifront/src/components/shared/edu-panels/edu-info-card.tsx @@ -1,6 +1,6 @@ -import { Card } from '@penumbra-zone/ui/components/ui/card'; -import { cn } from '@penumbra-zone/ui/lib/utils'; -import { GradientHeader } from '@penumbra-zone/ui/components/ui/gradient-header'; +import { Card } from '@repo/ui/components/ui/card'; +import { cn } from '@repo/ui/lib/utils'; +import { GradientHeader } from '@repo/ui/components/ui/gradient-header'; import { EduPanel, eduPanelContent } from './content'; import { motion } from 'framer-motion'; diff --git a/apps/minifront/src/components/shared/error-boundary.tsx b/apps/minifront/src/components/shared/error-boundary.tsx index f7a7d9f707..eb9e4e77d4 100644 --- a/apps/minifront/src/components/shared/error-boundary.tsx +++ b/apps/minifront/src/components/shared/error-boundary.tsx @@ -5,7 +5,7 @@ import { NotFound } from '../not-found'; import { ExtensionTransportDisconnected } from '../extension-transport-disconnected'; import { ExtensionNotInstalled } from '../extension-not-installed'; import { Code, ConnectError } from '@connectrpc/connect'; -import { SplashPage } from '@penumbra-zone/ui/components/ui/splash-page'; +import { SplashPage } from '@repo/ui/components/ui/splash-page'; export const ErrorBoundary = () => { const error = useRouteError(); diff --git a/apps/minifront/src/components/shared/gas-fee.tsx b/apps/minifront/src/components/shared/gas-fee.tsx index 8422e6430d..becb4fdbb9 100644 --- a/apps/minifront/src/components/shared/gas-fee.tsx +++ b/apps/minifront/src/components/shared/gas-fee.tsx @@ -2,12 +2,9 @@ import { Fee, FeeTier_Tier, } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/fee/v1/fee_pb'; -import { - SegmentedPicker, - SegmentedPickerOption, -} from '@penumbra-zone/ui/components/ui/segmented-picker'; +import { SegmentedPicker, SegmentedPickerOption } from '@repo/ui/components/ui/segmented-picker'; import { InputBlock } from './input-block'; -import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/value'; +import { ValueViewComponent } from '@repo/ui/components/ui/value'; import { Metadata, ValueView, diff --git a/apps/minifront/src/components/shared/input-block.tsx b/apps/minifront/src/components/shared/input-block.tsx index 2061f7add5..4d58d46e61 100644 --- a/apps/minifront/src/components/shared/input-block.tsx +++ b/apps/minifront/src/components/shared/input-block.tsx @@ -1,7 +1,7 @@ -import { cn } from '@penumbra-zone/ui/lib/utils'; +import { cn } from '@repo/ui/lib/utils'; import { Validation, validationResult } from './validation-result'; import { ReactNode } from 'react'; -import { Box } from '@penumbra-zone/ui/components/ui/box'; +import { Box } from '@repo/ui/components/ui/box'; interface InputBlockProps { label: string; diff --git a/apps/minifront/src/components/shared/input-token.tsx b/apps/minifront/src/components/shared/input-token.tsx index a6837dc721..851cde1feb 100644 --- a/apps/minifront/src/components/shared/input-token.tsx +++ b/apps/minifront/src/components/shared/input-token.tsx @@ -1,10 +1,10 @@ -import { Input } from '@penumbra-zone/ui/components/ui/input'; -import { cn } from '@penumbra-zone/ui/lib/utils'; +import { Input } from '@repo/ui/components/ui/input'; +import { cn } from '@repo/ui/lib/utils'; import BalanceSelector from './balance-selector'; import { Validation } from './validation-result'; import { InputBlock } from './input-block'; import { BalancesResponse } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/view/v1/view_pb'; -import { BalanceValueView } from '@penumbra-zone/ui/components/ui/balance-value-view'; +import { BalanceValueView } from '@repo/ui/components/ui/balance-value-view'; import { getFormattedAmtFromValueView } from '@penumbra-zone/types/value-view'; interface InputTokenProps { diff --git a/apps/minifront/src/components/shared/tabs.tsx b/apps/minifront/src/components/shared/tabs.tsx index 2a0488bf2f..b772708277 100644 --- a/apps/minifront/src/components/shared/tabs.tsx +++ b/apps/minifront/src/components/shared/tabs.tsx @@ -1,6 +1,6 @@ import { PagePath } from '../metadata/paths'; import { useNavigate } from 'react-router-dom'; -import { SegmentedPicker } from '@penumbra-zone/ui/components/ui/segmented-picker'; +import { SegmentedPicker } from '@repo/ui/components/ui/segmented-picker'; import { ComponentProps } from 'react'; export interface Tab { diff --git a/apps/minifront/src/components/staking/account/delegation-value-view/index.tsx b/apps/minifront/src/components/staking/account/delegation-value-view/index.tsx index 3597f61da9..26bb6b3134 100644 --- a/apps/minifront/src/components/staking/account/delegation-value-view/index.tsx +++ b/apps/minifront/src/components/staking/account/delegation-value-view/index.tsx @@ -1,6 +1,6 @@ import { ValueView } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; import { ValidatorInfoComponent } from './validator-info-component'; -import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/value'; +import { ValueViewComponent } from '@repo/ui/components/ui/value'; import { StakingActions } from './staking-actions'; import { memo, useMemo } from 'react'; import { diff --git a/apps/minifront/src/components/staking/account/delegation-value-view/staking-actions/form-dialog.tsx b/apps/minifront/src/components/staking/account/delegation-value-view/staking-actions/form-dialog.tsx index 95a5b3412a..49e7c3f94e 100644 --- a/apps/minifront/src/components/staking/account/delegation-value-view/staking-actions/form-dialog.tsx +++ b/apps/minifront/src/components/staking/account/delegation-value-view/staking-actions/form-dialog.tsx @@ -1,14 +1,14 @@ -import { Button } from '@penumbra-zone/ui/components/ui/button'; -import { Dialog, DialogContent, DialogHeader } from '@penumbra-zone/ui/components/ui/dialog'; -import { IdentityKeyComponent } from '@penumbra-zone/ui/components/ui/identity-key-component'; -import { Input } from '@penumbra-zone/ui/components/ui/input'; +import { Button } from '@repo/ui/components/ui/button'; +import { Dialog, DialogContent, DialogHeader } from '@repo/ui/components/ui/dialog'; +import { IdentityKeyComponent } from '@repo/ui/components/ui/identity-key-component'; +import { Input } from '@repo/ui/components/ui/input'; import { InputBlock } from '../../../../shared/input-block'; import { Validator } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/stake/v1/stake_pb'; import { ValueView } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; import { FormEvent } from 'react'; import { getIdentityKey } from '@penumbra-zone/getters/validator'; import { getFormattedAmtFromValueView } from '@penumbra-zone/types/value-view'; -import { BalanceValueView } from '@penumbra-zone/ui/components/ui/balance-value-view'; +import { BalanceValueView } from '@repo/ui/components/ui/balance-value-view'; const getCapitalizedAction = (action: 'delegate' | 'undelegate') => action.replace(/^./, firstCharacter => firstCharacter.toLocaleUpperCase()); diff --git a/apps/minifront/src/components/staking/account/delegation-value-view/staking-actions/index.tsx b/apps/minifront/src/components/staking/account/delegation-value-view/staking-actions/index.tsx index 0456131e86..8868a039ca 100644 --- a/apps/minifront/src/components/staking/account/delegation-value-view/staking-actions/index.tsx +++ b/apps/minifront/src/components/staking/account/delegation-value-view/staking-actions/index.tsx @@ -1,4 +1,4 @@ -import { Button } from '@penumbra-zone/ui/components/ui/button'; +import { Button } from '@repo/ui/components/ui/button'; import { ValidatorInfo } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/stake/v1/stake_pb'; import { ValueView } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; import { FormDialog } from './form-dialog'; diff --git a/apps/minifront/src/components/staking/account/delegation-value-view/validator-info-component.tsx b/apps/minifront/src/components/staking/account/delegation-value-view/validator-info-component.tsx index 9e0a164c33..72abc0192c 100644 --- a/apps/minifront/src/components/staking/account/delegation-value-view/validator-info-component.tsx +++ b/apps/minifront/src/components/staking/account/delegation-value-view/validator-info-component.tsx @@ -1,11 +1,11 @@ import { ValidatorInfo } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/stake/v1/stake_pb'; -import { IdentityKeyComponent } from '@penumbra-zone/ui/components/ui/identity-key-component'; +import { IdentityKeyComponent } from '@repo/ui/components/ui/identity-key-component'; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, -} from '@penumbra-zone/ui/components/ui/tooltip'; +} from '@repo/ui/components/ui/tooltip'; import { useStore } from '../../../../state'; import { getIdentityKeyFromValidatorInfo, @@ -13,7 +13,7 @@ import { } from '@penumbra-zone/getters/validator-info'; import { calculateCommissionAsPercentage } from '@penumbra-zone/types/staking'; import { Metadata } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; -import { AssetIcon } from '@penumbra-zone/ui/components/ui/asset-icon'; +import { AssetIcon } from '@repo/ui/components/ui/asset-icon'; /** * Renders a single `ValidatorInfo`: its name and identity key, diff --git a/apps/minifront/src/components/staking/account/header/index.tsx b/apps/minifront/src/components/staking/account/header/index.tsx index 7296f7e4fb..17bf347e09 100644 --- a/apps/minifront/src/components/staking/account/header/index.tsx +++ b/apps/minifront/src/components/staking/account/header/index.tsx @@ -1,7 +1,7 @@ -import { Button } from '@penumbra-zone/ui/components/ui/button'; -import { Card, CardContent } from '@penumbra-zone/ui/components/ui/card'; -import { AccountSwitcher } from '@penumbra-zone/ui/components/ui/account-switcher'; -import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/value'; +import { Button } from '@repo/ui/components/ui/button'; +import { Card, CardContent } from '@repo/ui/components/ui/card'; +import { AccountSwitcher } from '@repo/ui/components/ui/account-switcher'; +import { ValueViewComponent } from '@repo/ui/components/ui/value'; import { Stat } from './stat'; import { AllSlices } from '../../../../state'; import { UnbondingTokens } from './unbonding-tokens'; diff --git a/apps/minifront/src/components/staking/account/header/unbonding-tokens.tsx b/apps/minifront/src/components/staking/account/header/unbonding-tokens.tsx index a2cbaa0eee..672df1ca97 100644 --- a/apps/minifront/src/components/staking/account/header/unbonding-tokens.tsx +++ b/apps/minifront/src/components/staking/account/header/unbonding-tokens.tsx @@ -8,8 +8,8 @@ import { Tooltip, TooltipTrigger, TooltipContent, -} from '@penumbra-zone/ui/components/ui/tooltip'; -import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/value'; +} from '@repo/ui/components/ui/tooltip'; +import { ValueViewComponent } from '@repo/ui/components/ui/value'; import { ReactNode } from 'react'; import { zeroValueView } from '../../../../utils/zero-value-view'; diff --git a/apps/minifront/src/components/staking/layout.tsx b/apps/minifront/src/components/staking/layout.tsx index 90ca2c5c85..d9727d13d4 100644 --- a/apps/minifront/src/components/staking/layout.tsx +++ b/apps/minifront/src/components/staking/layout.tsx @@ -1,6 +1,6 @@ import { useEffect } from 'react'; import { AllSlices } from '../../state'; -import { Card, CardContent, CardHeader, CardTitle } from '@penumbra-zone/ui/components/ui/card'; +import { Card, CardContent, CardHeader, CardTitle } from '@repo/ui/components/ui/card'; import { Header } from './account/header'; import { Delegations } from './account/delegations'; import { useStoreShallow } from '../../utils/use-store-shallow'; diff --git a/apps/minifront/src/components/staking/validator-info-row.tsx b/apps/minifront/src/components/staking/validator-info-row.tsx index c53271b87d..3643e7dc20 100644 --- a/apps/minifront/src/components/staking/validator-info-row.tsx +++ b/apps/minifront/src/components/staking/validator-info-row.tsx @@ -1,5 +1,5 @@ import { ValidatorInfo } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/stake/v1/stake_pb'; -import { TableCell, TableRow } from '@penumbra-zone/ui/components/ui/table'; +import { TableCell, TableRow } from '@repo/ui/components/ui/table'; import { ReactNode } from 'react'; import { Oval } from 'react-loader-spinner'; import { getValidator } from '@penumbra-zone/getters/validator-info'; diff --git a/apps/minifront/src/components/staking/validators-table.tsx b/apps/minifront/src/components/staking/validators-table.tsx index 2c7f731eb3..6d732c7a8c 100644 --- a/apps/minifront/src/components/staking/validators-table.tsx +++ b/apps/minifront/src/components/staking/validators-table.tsx @@ -5,7 +5,7 @@ import { TableHead, TableHeader, TableRow, -} from '@penumbra-zone/ui/components/ui/table'; +} from '@repo/ui/components/ui/table'; import { Oval } from 'react-loader-spinner'; import { ValidatorInfoRow } from './validator-info-row'; import { ValidatorInfo } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/stake/v1/stake_pb'; diff --git a/apps/minifront/src/components/swap/auction-list/filters.tsx b/apps/minifront/src/components/swap/auction-list/filters.tsx index 0852aee80e..3f1a613e5e 100644 --- a/apps/minifront/src/components/swap/auction-list/filters.tsx +++ b/apps/minifront/src/components/swap/auction-list/filters.tsx @@ -1,7 +1,7 @@ import { ListFilter } from 'lucide-react'; import { AllSlices } from '../../../state'; import { useStoreShallow } from '../../../utils/use-store-shallow'; -import { PopoverMenu, PopoverMenuItem } from '@penumbra-zone/ui/components/ui/popover'; +import { PopoverMenu, PopoverMenuItem } from '@repo/ui/components/ui/popover'; import type { Filter as TFilter } from '../../../state/swap/dutch-auction'; const filtersSelector = (state: AllSlices) => ({ diff --git a/apps/minifront/src/components/swap/auction-list/index.tsx b/apps/minifront/src/components/swap/auction-list/index.tsx index 06c2099d53..8603dee38b 100644 --- a/apps/minifront/src/components/swap/auction-list/index.tsx +++ b/apps/minifront/src/components/swap/auction-list/index.tsx @@ -1,10 +1,10 @@ import { AllSlices } from '../../../state'; -import { DutchAuctionComponent } from '@penumbra-zone/ui/components/ui/dutch-auction-component'; +import { DutchAuctionComponent } from '@repo/ui/components/ui/dutch-auction-component'; import { useStoreShallow } from '../../../utils/use-store-shallow'; import { AuctionId } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/auction/v1/auction_pb'; -import { GradientHeader } from '@penumbra-zone/ui/components/ui/gradient-header'; +import { GradientHeader } from '@repo/ui/components/ui/gradient-header'; import { QueryLatestStateButton } from './query-latest-state-button'; -import { Card } from '@penumbra-zone/ui/components/ui/card'; +import { Card } from '@repo/ui/components/ui/card'; import { bech32mAuctionId } from '@penumbra-zone/bech32m/pauctid'; import { useMemo } from 'react'; import { getFilteredAuctionInfos } from './get-filtered-auction-infos'; diff --git a/apps/minifront/src/components/swap/auction-list/query-latest-state-button.tsx b/apps/minifront/src/components/swap/auction-list/query-latest-state-button.tsx index 868e764293..ac15fc271d 100644 --- a/apps/minifront/src/components/swap/auction-list/query-latest-state-button.tsx +++ b/apps/minifront/src/components/swap/auction-list/query-latest-state-button.tsx @@ -3,10 +3,10 @@ import { TooltipContent, TooltipProvider, TooltipTrigger, -} from '@penumbra-zone/ui/components/ui/tooltip'; +} from '@repo/ui/components/ui/tooltip'; import { ReloadIcon } from '@radix-ui/react-icons'; import { useAuctionInfos, useRevalidateAuctionInfos } from '../../../state/swap/dutch-auction'; -import { cn } from '@penumbra-zone/ui/lib/utils'; +import { cn } from '@repo/ui/lib/utils'; export const QueryLatestStateButton = () => { const { loading } = useAuctionInfos(); diff --git a/apps/minifront/src/components/swap/duration-slider.tsx b/apps/minifront/src/components/swap/duration-slider.tsx index 4e9cd564a5..fd63be04fa 100644 --- a/apps/minifront/src/components/swap/duration-slider.tsx +++ b/apps/minifront/src/components/swap/duration-slider.tsx @@ -1,4 +1,4 @@ -import { Slider } from '@penumbra-zone/ui/components/ui/slider'; +import { Slider } from '@repo/ui/components/ui/slider'; import { DURATION_OPTIONS, GDA_RECIPES } from '../../state/swap/constants'; import { useStoreShallow } from '../../utils/use-store-shallow'; import { AllSlices } from '../../state'; diff --git a/apps/minifront/src/components/swap/swap-form/estimate-button.tsx b/apps/minifront/src/components/swap/swap-form/estimate-button.tsx index 602852bc9b..023c1283b3 100644 --- a/apps/minifront/src/components/swap/swap-form/estimate-button.tsx +++ b/apps/minifront/src/components/swap/swap-form/estimate-button.tsx @@ -1,11 +1,11 @@ -import { buttonVariants } from '@penumbra-zone/ui/components/ui/button'; +import { buttonVariants } from '@repo/ui/components/ui/button'; import { Tooltip, TooltipProvider, TooltipTrigger, TooltipContent, -} from '@penumbra-zone/ui/components/ui/tooltip'; -import { cn } from '@penumbra-zone/ui/lib/utils'; +} from '@repo/ui/components/ui/tooltip'; +import { cn } from '@repo/ui/lib/utils'; export const EstimateButton = ({ disabled, diff --git a/apps/minifront/src/components/swap/swap-form/index.tsx b/apps/minifront/src/components/swap/swap-form/index.tsx index b3351beecf..d97dc76d07 100644 --- a/apps/minifront/src/components/swap/swap-form/index.tsx +++ b/apps/minifront/src/components/swap/swap-form/index.tsx @@ -1,11 +1,11 @@ -import { Button } from '@penumbra-zone/ui/components/ui/button'; +import { Button } from '@repo/ui/components/ui/button'; import { AllSlices } from '../../../state'; import { TokenSwapInput } from './token-swap-input'; import { useStoreShallow } from '../../../utils/use-store-shallow'; import { DurationSlider } from '../duration-slider'; import { InputBlock } from '../../shared/input-block'; import { Output } from './output'; -import { Card } from '@penumbra-zone/ui/components/ui/card'; +import { Card } from '@repo/ui/components/ui/card'; import { SimulateSwap } from './simulate-swap'; import { LayoutGroup } from 'framer-motion'; import { useId } from 'react'; diff --git a/apps/minifront/src/components/swap/swap-form/output/index.tsx b/apps/minifront/src/components/swap/swap-form/output/index.tsx index 67dfc25ae5..27f31de1e9 100644 --- a/apps/minifront/src/components/swap/swap-form/output/index.tsx +++ b/apps/minifront/src/components/swap/swap-form/output/index.tsx @@ -1,7 +1,7 @@ -import { Box } from '@penumbra-zone/ui/components/ui/box'; +import { Box } from '@repo/ui/components/ui/box'; import { AllSlices } from '../../../../state'; import { useStoreShallow } from '../../../../utils/use-store-shallow'; -import { Input } from '@penumbra-zone/ui/components/ui/input'; +import { Input } from '@repo/ui/components/ui/input'; import { EstimateButton } from '../estimate-button'; import { EstimatedOutputExplanation } from './estimated-output-explanation'; import { motion } from 'framer-motion'; diff --git a/apps/minifront/src/components/swap/swap-form/simulate-swap-result/index.tsx b/apps/minifront/src/components/swap/swap-form/simulate-swap-result/index.tsx index 44866a98cc..73a0b82cca 100644 --- a/apps/minifront/src/components/swap/swap-form/simulate-swap-result/index.tsx +++ b/apps/minifront/src/components/swap/swap-form/simulate-swap-result/index.tsx @@ -1,4 +1,4 @@ -import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/value'; +import { ValueViewComponent } from '@repo/ui/components/ui/value'; import { PriceImpact } from './price-impact'; import { motion } from 'framer-motion'; import { SimulateSwapResult as TSimulateSwapResult } from '../../../../state/swap'; diff --git a/apps/minifront/src/components/swap/swap-form/simulate-swap-result/price-impact.tsx b/apps/minifront/src/components/swap/swap-form/simulate-swap-result/price-impact.tsx index 5d7790c250..8637345f7a 100644 --- a/apps/minifront/src/components/swap/swap-form/simulate-swap-result/price-impact.tsx +++ b/apps/minifront/src/components/swap/swap-form/simulate-swap-result/price-impact.tsx @@ -1,6 +1,6 @@ import { formatNumber } from '@penumbra-zone/types/amount'; -import { Pill } from '@penumbra-zone/ui/components/ui/pill'; -import { cn } from '@penumbra-zone/ui/lib/utils'; +import { Pill } from '@repo/ui/components/ui/pill'; +import { cn } from '@repo/ui/lib/utils'; // The price hit the user takes as a consequence of moving the market with the size of their trade export const PriceImpact = ({ amount = 0 }: { amount?: number }) => { diff --git a/apps/minifront/src/components/swap/swap-form/simulate-swap-result/traces/index.tsx b/apps/minifront/src/components/swap/swap-form/simulate-swap-result/traces/index.tsx index 7dfe61ee85..3733a5c331 100644 --- a/apps/minifront/src/components/swap/swap-form/simulate-swap-result/traces/index.tsx +++ b/apps/minifront/src/components/swap/swap-form/simulate-swap-result/traces/index.tsx @@ -4,7 +4,7 @@ import { Metadata, ValueView, } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; -import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/value'; +import { ValueViewComponent } from '@repo/ui/components/ui/value'; import { ArrowDown, ArrowUp } from 'lucide-react'; export const Traces = ({ diff --git a/apps/minifront/src/components/swap/swap-form/simulate-swap-result/traces/trace/index.tsx b/apps/minifront/src/components/swap/swap-form/simulate-swap-result/traces/trace/index.tsx index 68ce5d60b2..14e5bc5ade 100644 --- a/apps/minifront/src/components/swap/swap-form/simulate-swap-result/traces/trace/index.tsx +++ b/apps/minifront/src/components/swap/swap-form/simulate-swap-result/traces/trace/index.tsx @@ -5,7 +5,7 @@ import { } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; import { SwapExecution_Trace } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/dex/v1/dex_pb'; import { bech32mAssetId } from '@penumbra-zone/bech32m/passet'; -import { ValueViewComponent } from '@penumbra-zone/ui/components/ui/value'; +import { ValueViewComponent } from '@repo/ui/components/ui/value'; import { Price } from './price'; const getValueView = (metadataByAssetId: Record, { amount, assetId }: Value) => diff --git a/apps/minifront/src/components/swap/swap-form/simulate-swap.tsx b/apps/minifront/src/components/swap/swap-form/simulate-swap.tsx index e37f476fea..f96ad56e8f 100644 --- a/apps/minifront/src/components/swap/swap-form/simulate-swap.tsx +++ b/apps/minifront/src/components/swap/swap-form/simulate-swap.tsx @@ -1,4 +1,4 @@ -import { Box } from '@penumbra-zone/ui/components/ui/box'; +import { Box } from '@repo/ui/components/ui/box'; import { SimulateSwapResult } from './simulate-swap-result'; import { AllSlices } from '../../../state'; import { useStoreShallow } from '../../../utils/use-store-shallow'; diff --git a/apps/minifront/src/components/swap/swap-form/token-swap-input.tsx b/apps/minifront/src/components/swap/swap-form/token-swap-input.tsx index b40f58bff7..f0606759d4 100644 --- a/apps/minifront/src/components/swap/swap-form/token-swap-input.tsx +++ b/apps/minifront/src/components/swap/swap-form/token-swap-input.tsx @@ -1,8 +1,8 @@ import { BalancesResponse } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/view/v1/view_pb'; -import { BalanceValueView } from '@penumbra-zone/ui/components/ui/balance-value-view'; -import { Box } from '@penumbra-zone/ui/components/ui/box'; -import { CandlestickPlot } from '@penumbra-zone/ui/components/ui/candlestick-plot'; -import { Input } from '@penumbra-zone/ui/components/ui/input'; +import { BalanceValueView } from '@repo/ui/components/ui/balance-value-view'; +import { Box } from '@repo/ui/components/ui/box'; +import { CandlestickPlot } from '@repo/ui/components/ui/candlestick-plot'; +import { Input } from '@repo/ui/components/ui/input'; import { joinLoHiAmount } from '@penumbra-zone/types/amount'; import { getAmount, diff --git a/apps/minifront/src/components/swap/unclaimed-swaps.tsx b/apps/minifront/src/components/swap/unclaimed-swaps.tsx index 8a7d4a730c..4fed62091e 100644 --- a/apps/minifront/src/components/swap/unclaimed-swaps.tsx +++ b/apps/minifront/src/components/swap/unclaimed-swaps.tsx @@ -1,11 +1,11 @@ -import { Button } from '@penumbra-zone/ui/components/ui/button'; -import { Card } from '@penumbra-zone/ui/components/ui/card'; -import { AssetIcon } from '@penumbra-zone/ui/components/ui/asset-icon'; +import { Button } from '@repo/ui/components/ui/button'; +import { Card } from '@repo/ui/components/ui/card'; +import { AssetIcon } from '@repo/ui/components/ui/asset-icon'; import { AllSlices } from '../../state'; import { useUnclaimedSwaps } from '../../state/unclaimed-swaps'; import { getSwapRecordCommitment } from '@penumbra-zone/getters/swap-record'; import { uint8ArrayToBase64 } from '@penumbra-zone/types/base64'; -import { GradientHeader } from '@penumbra-zone/ui/components/ui/gradient-header'; +import { GradientHeader } from '@repo/ui/components/ui/gradient-header'; import { useStoreShallow } from '../../utils/use-store-shallow'; const unclaimedSwapsSelector = (state: AllSlices) => ({ diff --git a/apps/minifront/src/components/tx-details/index.tsx b/apps/minifront/src/components/tx-details/index.tsx index cb332aa19f..4bef010067 100644 --- a/apps/minifront/src/components/tx-details/index.tsx +++ b/apps/minifront/src/components/tx-details/index.tsx @@ -1,5 +1,5 @@ -import { Card } from '@penumbra-zone/ui/components/ui/card'; -import { FadeTransition } from '@penumbra-zone/ui/components/ui/fade-transition'; +import { Card } from '@repo/ui/components/ui/card'; +import { FadeTransition } from '@repo/ui/components/ui/fade-transition'; import { TxViewer } from './tx-viewer'; import { EduInfoCard } from '../shared/edu-panels/edu-info-card'; import { EduPanel } from '../shared/edu-panels/content'; diff --git a/apps/minifront/src/components/tx-details/tx-viewer.tsx b/apps/minifront/src/components/tx-details/tx-viewer.tsx index 8c9b22c786..113c0e69e0 100644 --- a/apps/minifront/src/components/tx-details/tx-viewer.tsx +++ b/apps/minifront/src/components/tx-details/tx-viewer.tsx @@ -1,9 +1,9 @@ -import { JsonViewer } from '@penumbra-zone/ui/components/ui/json-viewer'; -import { TransactionViewComponent } from '@penumbra-zone/ui/components/ui/tx'; +import { JsonViewer } from '@repo/ui/components/ui/json-viewer'; +import { TransactionViewComponent } from '@repo/ui/components/ui/tx'; import { TransactionInfo } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/view/v1/view_pb'; import type { Jsonified } from '@penumbra-zone/types/jsonified'; import { useState } from 'react'; -import { SegmentedPicker } from '@penumbra-zone/ui/components/ui/segmented-picker'; +import { SegmentedPicker } from '@repo/ui/components/ui/segmented-picker'; import { asPublicTransactionView } from '@penumbra-zone/perspective/translators/transaction-view'; import { typeRegistry } from '@penumbra-zone/protobuf'; import { useQuery } from '@tanstack/react-query'; diff --git a/apps/minifront/src/icons/box.tsx b/apps/minifront/src/icons/box.tsx index e4422bc14f..4c4bc56df1 100644 --- a/apps/minifront/src/icons/box.tsx +++ b/apps/minifront/src/icons/box.tsx @@ -1,4 +1,4 @@ -import { cn } from '@penumbra-zone/ui/lib/utils'; +import { cn } from '@repo/ui/lib/utils'; export const BoxIcon = ({ stroke = '#BDB8B8', diff --git a/apps/minifront/src/icons/drag-handle-dots.tsx b/apps/minifront/src/icons/drag-handle-dots.tsx index f5c45a3bf3..192c20ad1a 100644 --- a/apps/minifront/src/icons/drag-handle-dots.tsx +++ b/apps/minifront/src/icons/drag-handle-dots.tsx @@ -1,4 +1,4 @@ -import { cn } from '@penumbra-zone/ui/lib/utils'; +import { cn } from '@repo/ui/lib/utils'; export const DragHandleDotsIcon = ({ stroke = '#BDB8B8', diff --git a/apps/minifront/src/icons/swap.tsx b/apps/minifront/src/icons/swap.tsx index f8564e0179..33eac1849c 100644 --- a/apps/minifront/src/icons/swap.tsx +++ b/apps/minifront/src/icons/swap.tsx @@ -1,4 +1,4 @@ -import { cn } from '@penumbra-zone/ui/lib/utils'; +import { cn } from '@repo/ui/lib/utils'; export const SwapIcon = ({ stroke = '#BDB8B8', diff --git a/apps/minifront/src/state/helpers.ts b/apps/minifront/src/state/helpers.ts index c3928c16f0..ed36b76bab 100644 --- a/apps/minifront/src/state/helpers.ts +++ b/apps/minifront/src/state/helpers.ts @@ -15,7 +15,7 @@ import { } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/transaction/v1/transaction_pb'; import { TransactionId } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/txhash/v1/txhash_pb'; import { PartialMessage } from '@bufbuild/protobuf'; -import { TransactionToast } from '@penumbra-zone/ui/lib/toast/transaction-toast'; +import { TransactionToast } from '@repo/ui/lib/toast/transaction-toast'; import { TransactionClassification } from '@penumbra-zone/perspective/transaction/classification'; import { uint8ArrayToHex } from '@penumbra-zone/types/hex'; diff --git a/apps/minifront/src/state/ibc-in/index.tsx b/apps/minifront/src/state/ibc-in/index.tsx index 659c247e33..9a71643faf 100644 --- a/apps/minifront/src/state/ibc-in/index.tsx +++ b/apps/minifront/src/state/ibc-in/index.tsx @@ -4,7 +4,7 @@ import { ChainWalletContext } from '@cosmos-kit/core'; import { AllSlices, SliceCreator } from '..'; import { getAddrByIndex } from '../../fetchers/address'; import { bech32mAddress } from '@penumbra-zone/bech32m/penumbra'; -import { Toast } from '@penumbra-zone/ui/lib/toast/toast'; +import { Toast } from '@repo/ui/lib/toast/toast'; import { shorten } from '@penumbra-zone/types/string'; import { Address } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/keys/v1/keys_pb'; import { bech32CompatAddress } from '@penumbra-zone/bech32m/penumbracompat1'; diff --git a/apps/minifront/src/state/ibc-out.ts b/apps/minifront/src/state/ibc-out.ts index ad7c32a668..ff76528616 100644 --- a/apps/minifront/src/state/ibc-out.ts +++ b/apps/minifront/src/state/ibc-out.ts @@ -19,7 +19,7 @@ import { amountMoreThanBalance } from './send'; import { getAssetId } from '@penumbra-zone/getters/metadata'; import { assetPatterns } from '@penumbra-zone/types/assets'; import { bech32, bech32m } from 'bech32'; -import { errorToast } from '@penumbra-zone/ui/lib/toast/presets'; +import { errorToast } from '@repo/ui/lib/toast/presets'; import { Chain } from '@penumbra-labs/registry'; import { Metadata } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; import { Channel } from '@buf/cosmos_ibc.bufbuild_es/ibc/core/channel/v1/channel_pb'; diff --git a/apps/minifront/src/state/swap/dutch-auction/index.ts b/apps/minifront/src/state/swap/dutch-auction/index.ts index bc0e2c4e66..ac01a821f9 100644 --- a/apps/minifront/src/state/swap/dutch-auction/index.ts +++ b/apps/minifront/src/state/swap/dutch-auction/index.ts @@ -7,7 +7,7 @@ import { sendSimulateTradeRequest } from '../helpers'; import { fromBaseUnitAmount, isZero, multiplyAmountByNumber } from '@penumbra-zone/types/amount'; import { getDisplayDenomExponent } from '@penumbra-zone/getters/metadata'; import { Amount } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/num/v1/num_pb'; -import { errorToast } from '@penumbra-zone/ui/lib/toast/presets'; +import { errorToast } from '@repo/ui/lib/toast/presets'; import { ZQueryState, createZQuery } from '@penumbra-zone/zquery'; import { AuctionInfo, getAuctionInfos } from '../../../fetchers/auction-infos'; import { Metadata } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb'; diff --git a/apps/minifront/src/state/swap/instant-swap.ts b/apps/minifront/src/state/swap/instant-swap.ts index 70afdb5668..f37bf96864 100644 --- a/apps/minifront/src/state/swap/instant-swap.ts +++ b/apps/minifront/src/state/swap/instant-swap.ts @@ -10,7 +10,7 @@ import { import { BigNumber } from 'bignumber.js'; import { getAddressByIndex } from '../../fetchers/address'; import { StateCommitment } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/crypto/tct/v1/tct_pb'; -import { errorToast } from '@penumbra-zone/ui/lib/toast/presets'; +import { errorToast } from '@repo/ui/lib/toast/presets'; import { SwapExecution, SwapExecution_Trace, diff --git a/apps/node-status/package.json b/apps/node-status/package.json index 068a10d97b..6d51617c2c 100644 --- a/apps/node-status/package.json +++ b/apps/node-status/package.json @@ -14,7 +14,7 @@ "dependencies": { "@connectrpc/connect-web": "^1.4.0", "@penumbra-zone/protobuf": "workspace:*", - "@penumbra-zone/ui": "workspace:*", + "@repo/ui": "workspace:*", "date-fns": "^3.6.0", "react": "^18.3.1", "react-dom": "^18.3.1", diff --git a/apps/node-status/postcss.config.js b/apps/node-status/postcss.config.js index 8e18cdcb77..a2051ffd15 100644 --- a/apps/node-status/postcss.config.js +++ b/apps/node-status/postcss.config.js @@ -1 +1 @@ -export { default } from '@penumbra-zone/ui/postcss.config.js'; +export { default } from '@repo/ui/postcss.config.js'; diff --git a/apps/node-status/src/components/error-boundary.tsx b/apps/node-status/src/components/error-boundary.tsx index 3110463191..e22f665d07 100644 --- a/apps/node-status/src/components/error-boundary.tsx +++ b/apps/node-status/src/components/error-boundary.tsx @@ -1,4 +1,4 @@ -import { SplashPage } from '@penumbra-zone/ui/components/ui/splash-page'; +import { SplashPage } from '@repo/ui/components/ui/splash-page'; import { useRouteError } from 'react-router-dom'; export const ErrorBoundary = () => { diff --git a/apps/node-status/src/components/frontend-referral.tsx b/apps/node-status/src/components/frontend-referral.tsx index cffca9789a..d3e9465002 100644 --- a/apps/node-status/src/components/frontend-referral.tsx +++ b/apps/node-status/src/components/frontend-referral.tsx @@ -1,4 +1,4 @@ -import { Button } from '@penumbra-zone/ui/components/ui/button'; +import { Button } from '@repo/ui/components/ui/button'; import { devFrontend, prodFrontend } from '../constants'; export const FrontendReferral = () => { diff --git a/apps/node-status/src/components/header.tsx b/apps/node-status/src/components/header.tsx index 7581827bac..72459311d8 100644 --- a/apps/node-status/src/components/header.tsx +++ b/apps/node-status/src/components/header.tsx @@ -1,6 +1,6 @@ import { Link } from 'react-router-dom'; import { LineWave } from 'react-loader-spinner'; -import { cn } from '@penumbra-zone/ui/lib/utils'; +import { cn } from '@repo/ui/lib/utils'; import { useDelayedIsLoading } from '../fetching/refetch-hook'; export const Header = () => { diff --git a/apps/node-status/src/components/node-info.tsx b/apps/node-status/src/components/node-info.tsx index c6b7c31c4e..db4660aa9c 100644 --- a/apps/node-status/src/components/node-info.tsx +++ b/apps/node-status/src/components/node-info.tsx @@ -1,6 +1,6 @@ import { useLoaderData } from 'react-router-dom'; -import { Card } from '@penumbra-zone/ui/components/ui/card'; -import { Identicon } from '@penumbra-zone/ui/components/ui/identicon'; +import { Card } from '@repo/ui/components/ui/card'; +import { Identicon } from '@repo/ui/components/ui/identicon'; import { IndexLoaderResponse } from '../fetching/loader'; import { uint8ArrayToString } from '@penumbra-zone/types/string'; diff --git a/apps/node-status/src/components/sync-info.tsx b/apps/node-status/src/components/sync-info.tsx index db6d6309b6..cb9ae6ab95 100644 --- a/apps/node-status/src/components/sync-info.tsx +++ b/apps/node-status/src/components/sync-info.tsx @@ -1,6 +1,6 @@ import { useLoaderData } from 'react-router-dom'; import { IndexLoaderResponse } from '../fetching/loader'; -import { Card } from '@penumbra-zone/ui/components/ui/card'; +import { Card } from '@repo/ui/components/ui/card'; import { format } from 'date-fns'; import { SyncInfo as SyncInfoProto } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/util/tendermint_proxy/v1/tendermint_proxy_pb'; diff --git a/apps/node-status/src/components/validator-info.tsx b/apps/node-status/src/components/validator-info.tsx index 7baaf8b33d..a86f5bc9e6 100644 --- a/apps/node-status/src/components/validator-info.tsx +++ b/apps/node-status/src/components/validator-info.tsx @@ -1,5 +1,5 @@ import { useLoaderData } from 'react-router-dom'; -import { Card } from '@penumbra-zone/ui/components/ui/card'; +import { Card } from '@repo/ui/components/ui/card'; import { IndexLoaderResponse } from '../fetching/loader'; import { PublicKey } from '@buf/tendermint_tendermint.bufbuild_es/tendermint/crypto/keys_pb'; import { uint8ArrayToHex } from '@penumbra-zone/types/hex'; diff --git a/apps/node-status/src/main.tsx b/apps/node-status/src/main.tsx index df941faf75..bdd8ec53e7 100644 --- a/apps/node-status/src/main.tsx +++ b/apps/node-status/src/main.tsx @@ -3,7 +3,7 @@ import { createRoot } from 'react-dom/client'; import { RouterProvider } from 'react-router-dom'; import { router } from './components/router'; -import '@penumbra-zone/ui/styles/globals.css'; +import '@repo/ui/styles/globals.css'; const Main = () => ( diff --git a/packages/ui/package.json b/packages/ui/package.json index 83dcebbfe9..68375e45b3 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,5 +1,5 @@ { - "name": "@penumbra-zone/ui", + "name": "@repo/ui", "version": "5.0.0", "license": "(MIT OR Apache-2.0)", "type": "module", diff --git a/packages/ui/readme.md b/packages/ui/readme.md index ac4d9216a2..a070677792 100644 --- a/packages/ui/readme.md +++ b/packages/ui/readme.md @@ -24,5 +24,5 @@ export default { Finally, import the library CSS to the entry point of your app: ```js -import '@penumbra-zone/ui/styles/globals.css'; +import '@repo/ui/styles/globals.css'; ``` diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a76e46613b..f7c89b1480 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -165,9 +165,6 @@ importers: '@penumbra-zone/types': specifier: workspace:* version: link:../../packages/types - '@penumbra-zone/ui': - specifier: workspace:* - version: link:../../packages/ui '@penumbra-zone/zquery': specifier: workspace:* version: link:../../packages/zquery @@ -189,6 +186,9 @@ importers: '@remix-run/router': specifier: ^1.16.1 version: 1.16.1 + '@repo/ui': + specifier: workspace:* + version: link:../../packages/ui '@tanstack/react-query': specifier: 4.36.1 version: 4.36.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -277,7 +277,7 @@ importers: '@penumbra-zone/protobuf': specifier: workspace:* version: link:../../packages/protobuf - '@penumbra-zone/ui': + '@repo/ui': specifier: workspace:* version: link:../../packages/ui date-fns: From e9f30c572bfd516542a595f73bf7de65bc312c60 Mon Sep 17 00:00:00 2001 From: Max Korsunov Date: Mon, 24 Jun 2024 11:43:23 +0200 Subject: [PATCH 9/9] fix: after the merge --- .../src/components/shared/selectors/balance-item.tsx | 4 ++-- packages/ui/components/ui/{fade-in.tsx => fade-in/index.tsx} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename packages/ui/components/ui/{fade-in.tsx => fade-in/index.tsx} (100%) diff --git a/apps/minifront/src/components/shared/selectors/balance-item.tsx b/apps/minifront/src/components/shared/selectors/balance-item.tsx index 0aad0c58a2..7d77869f1b 100644 --- a/apps/minifront/src/components/shared/selectors/balance-item.tsx +++ b/apps/minifront/src/components/shared/selectors/balance-item.tsx @@ -4,8 +4,8 @@ import { getMetadataFromBalancesResponseOptional } from '@penumbra-zone/getters/ import { useMemo } from 'react'; import { DialogClose } from '@repo/ui/components/ui/dialog'; import { cn } from '@repo/ui/lib/utils'; -import { AssetIcon } from '@repo/ui/components/ui/tx/view/asset-icon'; -import { ValueViewComponent } from '@repo/ui/components/ui/tx/view/value'; +import { AssetIcon } from '@repo/ui/components/ui/asset-icon'; +import { ValueViewComponent } from '@repo/ui/components/ui/value'; interface BalanceItemProps { asset: BalanceOrMetadata; diff --git a/packages/ui/components/ui/fade-in.tsx b/packages/ui/components/ui/fade-in/index.tsx similarity index 100% rename from packages/ui/components/ui/fade-in.tsx rename to packages/ui/components/ui/fade-in/index.tsx