diff --git a/ui/package.json b/ui/package.json index df56d51f..822fea62 100644 --- a/ui/package.json +++ b/ui/package.json @@ -49,7 +49,6 @@ "@types/react": "^18.0.25", "@types/react-dom": "^18.0.9", "@vitejs/plugin-react": "2.2.0", - "autoprefixer": "^10.4.13", "babel-loader": "^8.3.0", "buffer": "^6.0.3", "eslint": "^8.28.0", @@ -59,11 +58,9 @@ "eslint-plugin-react": "^7.31.11", "eslint-plugin-react-hooks": "^4.6.0", "ethers": "^5.7.2", - "postcss": "^8.4.21", "prettier": "^2.8.0", "process": "^0.11.10", "react-query": "^3.39.2", - "tailwindcss": "^3.2.4", "ts-loader": "^9.4.1", "typescript": "^4.9.3", "vite": "^3.2.4", diff --git a/ui/src/components/card/card.styles.ts b/ui/src/components/card/card.styles.ts index 9dc6fe80..13ab99ec 100644 --- a/ui/src/components/card/card.styles.ts +++ b/ui/src/components/card/card.styles.ts @@ -3,6 +3,7 @@ import { styled } from '@/theme'; export abstract class CardStyles { static readonly Container = styled('div', { width: '$full', + height: 'fit-content', backgroundColor: '$slate2', borderRadius: '$xlh', padding: '$7', diff --git a/ui/src/components/core/button/icon-button.tsx b/ui/src/components/core/button/icon-button.tsx index 5eda9903..3129627c 100644 --- a/ui/src/components/core/button/icon-button.tsx +++ b/ui/src/components/core/button/icon-button.tsx @@ -75,6 +75,7 @@ export const IconButton = forwardRef( minWidth, fontSize, borderRadius: isRound ? '$full' : undefined, + padding: 0, ...(rest.css ?? {}), }} > diff --git a/ui/src/components/core/color-picker/color-picker.styles.ts b/ui/src/components/core/color-picker/color-picker.styles.ts new file mode 100644 index 00000000..758d570a --- /dev/null +++ b/ui/src/components/core/color-picker/color-picker.styles.ts @@ -0,0 +1,21 @@ +import { Flex } from '@/components'; +import { styled } from '@/theme'; + +export const ColorPickerStyles = { + Container: styled('div', { + position: 'relative', + + [`${Flex}`]: { + gap: '$3h', + alignItems: 'center', + }, + }), + Input: styled('input', { + position: 'absolute', + right: '4rem', + height: '1.25rem', + }), + Image: styled('img', { + display: 'none', + }), +}; diff --git a/ui/src/components/core/color-picker/color-picker.tsx b/ui/src/components/core/color-picker/color-picker.tsx index 7f7eeaf2..af9d454b 100644 --- a/ui/src/components/core/color-picker/color-picker.tsx +++ b/ui/src/components/core/color-picker/color-picker.tsx @@ -3,7 +3,9 @@ import ColorThief from 'colorthief'; import { useRef } from 'react'; -import { Button, Card, Flex, Icon } from '@/components'; +import { Button, Card, Flex, Icon, Text } from '@/components'; + +import { ColorPickerStyles as CS } from './color-picker.styles'; export type ColorPickerProps = { logoColor: string; @@ -38,9 +40,9 @@ export const ColorPicker: React.FC = ({ return ( -
- - Primary Color + + + Primary Color - -
+ - ( <> {file !== '' ? ( - logo + ) : ( )} - void; }; export const Switch: React.FC = ({ checked, onChange }) => ( - - - {checked ? 'Yes' : 'No'} - - + {checked ? 'Yes' : 'No'} + + ); diff --git a/ui/src/components/nfa-card/nfa-card.styles.ts b/ui/src/components/nfa-card/nfa-card.styles.ts index afa733fd..78dc092b 100644 --- a/ui/src/components/nfa-card/nfa-card.styles.ts +++ b/ui/src/components/nfa-card/nfa-card.styles.ts @@ -6,6 +6,7 @@ import { Skeleton } from '../layout'; export const NFACardStyles = { Container: styled(Link, { + all: 'unset', display: 'flex', flexDirection: 'column', minWidth: '12.5rem', diff --git a/ui/src/components/step/step.styles.ts b/ui/src/components/step/step.styles.ts index 1a6ed4fd..30538e07 100644 --- a/ui/src/components/step/step.styles.ts +++ b/ui/src/components/step/step.styles.ts @@ -1,4 +1,4 @@ -import { Flex } from '@/components'; +import { Flex, Text } from '@/components'; import { styled } from '@/theme'; export const StepStyles = { @@ -23,4 +23,7 @@ export const StepStyles = { justifyContent: 'center', maxWidth: '$106', }), + Text: styled(Text, { + fontSize: '$4xl', + }), }; diff --git a/ui/src/components/step/step.tsx b/ui/src/components/step/step.tsx index bfa6beb1..8343f059 100644 --- a/ui/src/components/step/step.tsx +++ b/ui/src/components/step/step.tsx @@ -12,7 +12,7 @@ export const Step: React.FC = ({ children, header }: StepProps) => { -

{header}

+ {header}
{children}
diff --git a/ui/src/components/toast/toast.styles.tsx b/ui/src/components/toast/toast.styles.ts similarity index 53% rename from ui/src/components/toast/toast.styles.tsx rename to ui/src/components/toast/toast.styles.ts index 205da5c2..12087e8e 100644 --- a/ui/src/components/toast/toast.styles.tsx +++ b/ui/src/components/toast/toast.styles.ts @@ -4,26 +4,26 @@ import { keyframes, styled } from '@/theme'; import { Icon, IconButton } from '../core'; import { Flex } from '../layout'; - -export abstract class ToastStyles { - static readonly Provider = ToastLib.Provider; - - static readonly DismissTimeout = 200; - - static readonly ViewportPadding = '$md'; - - static readonly KeyFrames = { - hide: keyframes({ - '0%': { opacity: 1 }, - '100%': { opacity: 0 }, - }), - show: keyframes({ - '0%': { opacity: 0 }, - '100%': { opacity: 1 }, - }), - }; - - static readonly Root = styled(ToastLib.Root, { +import { IconStyles } from '../core/icon/icon.styles'; + +const KeyFrames = { + hide: keyframes({ + '0%': { opacity: 1 }, + '100%': { opacity: 0 }, + }), + show: keyframes({ + '0%': { opacity: 0 }, + '100%': { opacity: 1 }, + }), +}; + +export const ViewportPadding = '$md'; +export const DismissTimeout = 200; + +export const ToastStyles = { + Provider: ToastLib.Provider, + + Root: styled(ToastLib.Root, { padding: '$4 $5', borderRadius: '$lg', borderWidth: '$default', @@ -46,23 +46,20 @@ export abstract class ToastStyles { '@media (prefers-reduced-motion: no-preference)': { '&[data-state="open"]': { - animation: `${this.KeyFrames.show} 750ms `, + animation: `${KeyFrames.show} 750ms `, }, '&[data-state="closed"]': { - animation: `${this.KeyFrames.hide} ${this.DismissTimeout}ms ease-in`, + animation: `${KeyFrames.hide} ${DismissTimeout}ms ease-in`, }, }, - }); - - static readonly Body = styled(ToastLib.Description, { + }), + Body: styled(ToastLib.Description, { fontSize: '$md', fontWeight: '$normal', mr: '$5', - }); - - static readonly Close = styled(ToastLib.Close, {}); - - static readonly CloseButton = styled(IconButton, { + }), + Close: ToastLib.Close, + CloseButton: styled(IconButton, { variants: { colorScheme: { error: { @@ -73,11 +70,10 @@ export abstract class ToastStyles { }, }, }, - }); - - static readonly Viewport = styled(ToastLib.Viewport, { - padding: '$14', - + }), + Viewport: styled(ToastLib.Viewport, { + py: '$14', + listStyleType: 'none', position: 'fixed', bottom: 0, left: '50%', @@ -86,17 +82,16 @@ export abstract class ToastStyles { flexDirection: 'column', gap: '$4', zIndex: '$toast', - }); - - static readonly Layout = styled(Flex, { + minWidth: '250px', + }), + Layout: styled(Flex, { flexDirection: 'row', justifyContent: 'space-between', - }); - - static readonly Icon = styled(Icon, { - fontSize: '$5', + alignItems: 'center', + }), + Icon: styled(Icon, { + fontSize: '1.25rem', marginRight: '$2h', - }); - - static readonly Content = styled(Flex, {}); -} + }), + Content: styled(Flex), +}; diff --git a/ui/src/components/toast/toast.tsx b/ui/src/components/toast/toast.tsx index e6e4cb8a..32ad9cb9 100644 --- a/ui/src/components/toast/toast.tsx +++ b/ui/src/components/toast/toast.tsx @@ -8,7 +8,7 @@ import { } from '@/store'; import { Icon } from '../core'; -import { ToastStyles } from './toast.styles'; +import { DismissTimeout, ToastStyles } from './toast.styles'; type ToastProps = ToastsState.Toast; @@ -29,7 +29,7 @@ const Toast: React.FC = ({ if (onDismiss) onDismiss(); setTimeout(() => { dispatch(toastsActions.dismiss(id)); - }, ToastStyles.DismissTimeout); + }, DismissTimeout); } }, [onDismiss, dispatch, id] @@ -54,6 +54,7 @@ const Toast: React.FC = ({ variant="link" icon={} onClick={onDismiss} + css={{ p: '0' }} /> diff --git a/ui/src/index.tsx b/ui/src/index.tsx index ad6d881b..dff3aa46 100644 --- a/ui/src/index.tsx +++ b/ui/src/index.tsx @@ -1,4 +1,3 @@ -import './styles.css'; import React from 'react'; import ReactDOM from 'react-dom/client'; diff --git a/ui/src/styles.css b/ui/src/styles.css deleted file mode 100644 index b5c61c95..00000000 --- a/ui/src/styles.css +++ /dev/null @@ -1,3 +0,0 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; diff --git a/ui/src/theme/foundations/shadows.ts b/ui/src/theme/foundations/shadows.ts index d81a9276..a9bb6cff 100644 --- a/ui/src/theme/foundations/shadows.ts +++ b/ui/src/theme/foundations/shadows.ts @@ -1,4 +1,3 @@ -//TODO: maybe we can use tailwind for this export const shadows = { none: '0 0 #0000', inner: 'inset 0 2px 4px 0 rgb(0 0 0 / 0.05)', diff --git a/ui/src/theme/globals.ts b/ui/src/theme/globals.ts index 25df9c76..8686a4c6 100644 --- a/ui/src/theme/globals.ts +++ b/ui/src/theme/globals.ts @@ -1,18 +1,25 @@ import { globalCss } from '@stitches/react'; export const themeGlobals = globalCss({ - 'html, body, #root': { + 'html, body': { height: '100%', - padding: 0, + + //TODO add theme colors color: '#ECEDEE', backgroundColor: 'black', fontFamily: 'Manrope', - fontSize: '16px', '@media (max-width: 850px)': { fontSize: '13px', }, }, + + '*': { + margin: '0', + padding: '0', + border: '0', + boxSizing: 'border-box', + }, }); diff --git a/ui/src/theme/themes.ts b/ui/src/theme/themes.ts index b6dfd7d5..29fb5bf5 100644 --- a/ui/src/theme/themes.ts +++ b/ui/src/theme/themes.ts @@ -52,7 +52,7 @@ const createDripStitches = < }; const { createTheme, ...otherStitches } = createStitches({ - prefix: prefix || ('drip' as string), + prefix: prefix || ('nfa' as string), media: { ...libMedia, ...(media || {}), diff --git a/ui/src/views/access-point/ap-form-step/create-ap-form-body.tsx b/ui/src/views/access-point/ap-form-step/create-ap-form-body.tsx index 932e393e..1e9fa88a 100644 --- a/ui/src/views/access-point/ap-form-step/create-ap-form-body.tsx +++ b/ui/src/views/access-point/ap-form-step/create-ap-form-body.tsx @@ -26,7 +26,7 @@ import { useAccessPointFormContext } from './create-ap.form.context'; export const SelectedNFA: React.FC = () => { const { nfa } = CreateAccessPoint.useContext(); - + if (!nfa.logo) return null; return ( { const context = useAccessPointFormContextInit(); return ( - + - +
); }; diff --git a/ui/src/views/components-test/components-test.tsx b/ui/src/views/components-test/components-test.tsx index d20a2c1d..cf7a85ae 100644 --- a/ui/src/views/components-test/components-test.tsx +++ b/ui/src/views/components-test/components-test.tsx @@ -1,4 +1,6 @@ -import { Flex, ResolvedAddress } from '@/components'; +import { useState } from 'react'; + +import { Flex, ResolvedAddress, Switch } from '@/components'; import { ColorPickerTest } from './color-picker'; import { ComboboxTest } from './combobox-test'; @@ -6,9 +8,11 @@ import { SpinnerTest } from './spinner-test'; import { ToastTest } from './toast-test'; export const ComponentsTest: React.FC = () => { + const [checked, setChecked] = useState(false); return ( + {'0x7ed735b7095c05d78df169f991f2b7f1a1f1a049a'} diff --git a/ui/src/views/explore/explore-header/explore-header.styles.ts b/ui/src/views/explore/explore-header/explore-header.styles.ts index 6f2f03e6..ddc9e28d 100644 --- a/ui/src/views/explore/explore-header/explore-header.styles.ts +++ b/ui/src/views/explore/explore-header/explore-header.styles.ts @@ -11,6 +11,7 @@ export abstract class ExploreHeaderStyles { static readonly Text = styled('h2', { fontSize: '$4xl', maxWidth: '46rem', + fontWeight: 400, }); static readonly GrayText = styled('span', { diff --git a/ui/src/views/explore/explore-list/nfa-list/nfa-row.fragment.tsx b/ui/src/views/explore/explore-list/nfa-list/nfa-row.fragment.tsx index 5465b540..5fc18a55 100644 --- a/ui/src/views/explore/explore-list/nfa-list/nfa-row.fragment.tsx +++ b/ui/src/views/explore/explore-list/nfa-list/nfa-row.fragment.tsx @@ -30,8 +30,7 @@ export const NFARow: React.FC = ({ token }: NFARowProps) => { = ({ return ( - + {/* TODO remove for real image */} + {name} diff --git a/ui/src/views/indexed-nfa/fragments/skeleton.fragment.tsx b/ui/src/views/indexed-nfa/fragments/skeleton.fragment.tsx index 930d4518..6b3ed41c 100644 --- a/ui/src/views/indexed-nfa/fragments/skeleton.fragment.tsx +++ b/ui/src/views/indexed-nfa/fragments/skeleton.fragment.tsx @@ -3,9 +3,9 @@ import { SkeletonAccessPointsListFragment } from './main/skeleton.ap-list'; export const IndexedNFASkeletonFragment: React.FC = () => ( - - - + diff --git a/ui/src/views/mint/github-step/steps/github-repository-selection/github-repository-selection.tsx b/ui/src/views/mint/github-step/steps/github-repository-selection/github-repository-selection.tsx index 841aa886..eb0b6604 100644 --- a/ui/src/views/mint/github-step/steps/github-repository-selection/github-repository-selection.tsx +++ b/ui/src/views/mint/github-step/steps/github-repository-selection/github-repository-selection.tsx @@ -6,7 +6,7 @@ import { useGithubStore } from '@/store'; import { Mint } from '@/views/mint/mint.context'; import { GithubRepositorySelectionStyles as S } from './github-repository-selection.styles'; -import { RepositoriesList } from './repositories-list'; +import { RepositoriesListFragment } from './repositories-list'; import { UserOrgsCombobox } from './users-orgs-combobox'; export const Loading: React.FC = () => ( @@ -68,7 +68,7 @@ export const GithubRepositoryConnection: React.FC = () => { queryUserAndOrganizations === 'loading' ? ( ) : ( - + )} diff --git a/ui/src/views/mint/github-step/steps/github-repository-selection/repositories-list/index.ts b/ui/src/views/mint/github-step/steps/github-repository-selection/repositories-list/index.ts new file mode 100644 index 00000000..b57446cd --- /dev/null +++ b/ui/src/views/mint/github-step/steps/github-repository-selection/repositories-list/index.ts @@ -0,0 +1 @@ +export * from './repositories-list.fragment'; diff --git a/ui/src/views/mint/github-step/steps/github-repository-selection/repositories-list.tsx b/ui/src/views/mint/github-step/steps/github-repository-selection/repositories-list/repositories-list.fragment.tsx similarity index 72% rename from ui/src/views/mint/github-step/steps/github-repository-selection/repositories-list.tsx rename to ui/src/views/mint/github-step/steps/github-repository-selection/repositories-list/repositories-list.fragment.tsx index de11b53c..7b01e6da 100644 --- a/ui/src/views/mint/github-step/steps/github-repository-selection/repositories-list.tsx +++ b/ui/src/views/mint/github-step/steps/github-repository-selection/repositories-list/repositories-list.fragment.tsx @@ -1,16 +1,16 @@ import { useEffect, useMemo } from 'react'; -import { Flex } from '@/components'; import { githubActions, useAppDispatch, useGithubStore } from '@/store'; import { Mint } from '@/views/mint/mint.context'; +import { RepositoiresListStyles as S } from './repositories-list.styles'; import { Repository } from './repository'; type RepositoriesListProps = { searchValue: string; }; -export const RepositoriesList: React.FC = ({ +export const RepositoriesListFragment: React.FC = ({ searchValue, }: RepositoriesListProps) => { const { selectedUserOrg } = Mint.useContext(); @@ -37,15 +37,7 @@ export const RepositoriesList: React.FC = ({ } return ( - + {filteredRepositories.length > 0 ? ( filteredRepositories.map((repo, index, { length }) => ( = ({ )) ) : ( // TODO: update this after designs are done -
- Nothing found. -
+ Nothing found. )} -
+ ); }; diff --git a/ui/src/views/mint/github-step/steps/github-repository-selection/repositories-list/repositories-list.styles.ts b/ui/src/views/mint/github-step/steps/github-repository-selection/repositories-list/repositories-list.styles.ts new file mode 100644 index 00000000..e4cf54ea --- /dev/null +++ b/ui/src/views/mint/github-step/steps/github-repository-selection/repositories-list/repositories-list.styles.ts @@ -0,0 +1,20 @@ +import { Flex } from '@/components'; +import { styled } from '@/theme'; + +export const RepositoiresListStyles = { + Container: styled(Flex, { + height: '$60', + overflowX: 'hidden', + overflowY: 'scroll', + flexDirection: 'column', + pr: '$3h', + }), + Message: styled('div', { + position: 'relative', + cursor: 'default', + userSelect: 'none', + p: '$2 $3h $4 $3h', + color: '$slate11', + textAlign: 'center', + }), +}; diff --git a/ui/src/views/mint/github-step/steps/github-repository-selection/repository.tsx b/ui/src/views/mint/github-step/steps/github-repository-selection/repositories-list/repository.tsx similarity index 100% rename from ui/src/views/mint/github-step/steps/github-repository-selection/repository.tsx rename to ui/src/views/mint/github-step/steps/github-repository-selection/repositories-list/repository.tsx diff --git a/ui/src/views/mint/mint.styles.ts b/ui/src/views/mint/mint.styles.ts index f0b0796c..75b7426c 100644 --- a/ui/src/views/mint/mint.styles.ts +++ b/ui/src/views/mint/mint.styles.ts @@ -5,16 +5,11 @@ export const MintStyles = { Container: styled(Flex, { height: '100%', justifyContent: 'center', + minHeight: '85vh', + alignItems: 'flex-start', '@md': { - //to align on center - position: 'absolute', - top: '50%', - transform: 'translateY(-50%)', - }, - - '@lg': { - flexDirection: 'row', + alignItems: 'center', }, }), }; diff --git a/ui/src/views/mint/nfa-step/verify-step/verify-nfa-step.styles.ts b/ui/src/views/mint/nfa-step/verify-step/verify-nfa-step.styles.ts index 056a3f3f..8b553106 100644 --- a/ui/src/views/mint/nfa-step/verify-step/verify-nfa-step.styles.ts +++ b/ui/src/views/mint/nfa-step/verify-step/verify-nfa-step.styles.ts @@ -10,6 +10,7 @@ export const VerifyNfaStepStyles = { Text: styled(Text, { color: '$slate11', fontSize: '$sm', + lineHeight: '1.25rem', }), VerifyContainer: styled(Card.Text, { p: '$4', diff --git a/ui/src/views/mint/nft-card/nft-card.tsx b/ui/src/views/mint/nft-card/nft-card.tsx index 22800765..bf0c5c4b 100644 --- a/ui/src/views/mint/nft-card/nft-card.tsx +++ b/ui/src/views/mint/nft-card/nft-card.tsx @@ -29,7 +29,7 @@ export const NftCard: React.FC = ({ onClick, isLoading, }: NftCardProps) => { - const size = '26.5rem'; + const size = '100%'; const { form: { appName: { @@ -48,7 +48,15 @@ export const NftCard: React.FC = ({ } = useMintFormContext(); return ( - +