Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New UI #1890

Closed
wants to merge 30 commits into from
Closed

New UI #1890

Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
3d53613
chore(init): add new dev route for components
ororsatti Sep 19, 2024
3731d17
chore(init): add components screen to route
ororsatti Sep 19, 2024
5e27e95
initial typography
17Amir17 Sep 19, 2024
349bcf2
feat(background): add bg pattern and toggle
ororsatti Sep 19, 2024
a5bcb41
get font working
17Amir17 Sep 19, 2024
54382a5
nits
17Amir17 Sep 19, 2024
ab8d253
add hot reload
17Amir17 Sep 20, 2024
0538b3a
add mock ticket
17Amir17 Sep 21, 2024
f5f7f57
live reload
17Amir17 Sep 21, 2024
8885e90
doc live reload
17Amir17 Sep 21, 2024
efb2946
add ticket card
17Amir17 Sep 21, 2024
c950dc7
Update ComponentsScreen.tsx
17Amir17 Sep 21, 2024
8a0dfbf
update ticket card style
17Amir17 Sep 21, 2024
baf3880
add date chip
17Amir17 Sep 21, 2024
bf78404
feat(input): added variants and erorr state
ororsatti Sep 22, 2024
53eabd9
Add floating menu
GuySerfaty Sep 22, 2024
21b5cd1
feat(button): add btn variants: primary secondary danger
ororsatti Sep 22, 2024
c64574d
fix(button): added border to secondary variant
ororsatti Sep 22, 2024
d507c19
feat(font): added Neue Haas Unica font
ororsatti Sep 22, 2024
67793bc
feat(icon): add icon component
ororsatti Sep 22, 2024
f76cb6b
feat(list): added basic list and changed icon component to avatar
ororsatti Sep 22, 2024
b641863
fix(remove icon): remove the icon file and update component screeen
ororsatti Sep 22, 2024
f170f02
Add bottom modal
GuySerfaty Sep 22, 2024
a0d7191
feat(list): add prop to remove last bottom border
ororsatti Sep 22, 2024
a164adf
feat(list): add onclick to list item
ororsatti Sep 22, 2024
03080a3
fix(list): change main file name to index
ororsatti Sep 22, 2024
a050ad4
feat(accordion): add accordion component
ororsatti Sep 22, 2024
fad2ecd
fix(bg): bring all old website to use the right bg
ororsatti Sep 22, 2024
00b2e4a
install heroicons
17Amir17 Sep 23, 2024
b37d0df
chore(lint): fix lint problems
ororsatti Sep 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions apps/passport-client/components/shared/AppContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import { ScreenLoader } from "./ScreenLoader";

// Wrapper for all screens.
export function AppContainer({
children
children,
bg
}: {
bg: "primary" | "gray";
children?: ReactNode;
Expand All @@ -25,7 +26,8 @@ export function AppContainer({
[dispatch]
);

const col = "var(--bg-dark-primary)";
const col =
bg === "gray" ? "var(--dot-pattern-bg)" : "var(--bg-dark-primary)";
return (
<>
<GlobalBackground color={col} />
Expand Down Expand Up @@ -53,7 +55,7 @@ export function AppContainer({

export const GlobalBackground = createGlobalStyle<{ color: string }>`
html {
background-color: ${(p): string => p.color};
background: ${(p): string => p.color};
}
`;

Expand Down
18 changes: 18 additions & 0 deletions apps/passport-client/new-components/ComponentsScreen.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { CenterColumn, TextCenter } from "../components/core";
import { AppContainer } from "../components/shared/AppContainer";
import { BigInput } from "./Input";
import { Typography } from "./Typography";

const ComponentsScreen = (): JSX.Element => {
return (
<AppContainer bg="gray">
<TextCenter>Hello, world!</TextCenter>
<Typography>Typography component</Typography>
<CenterColumn>
<BigInput placeholder="placeholder" />
</CenterColumn>
</AppContainer>
);
};

export default ComponentsScreen;
42 changes: 42 additions & 0 deletions apps/passport-client/new-components/Input.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { InputHTMLAttributes, Ref } from "react";
import styled from "styled-components";

export const BigInput = styled.input`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for reimplementations of existing components, i would prefer their names to not overlap with the existing components, so as to not hinder development on existing UIs. Something like BigInput2 would work for me

width: 100%;
height: 54px;
border-radius: 200px;
padding: 8px 24px;
font-size: 16px;
font-weight: 400;
border: 1px solid rgba(var(--white-rgb), 0.3);
background: white;
color: var(--text-tertiary);
box-shadow: 0px 1px 2px 0px #0000000d;

&::placeholder {
color: var(--white-rgb);
}

&:disabled {
user-select: none;
pointer-events: none;
background: rgba(0, 0, 0, 0.05);
}
`;

interface EmailCodeInputProps extends InputHTMLAttributes<HTMLInputElement> {
ref?: Ref<HTMLInputElement>;
}

export const ConfirmationCodeInput = (
inputProps: EmailCodeInputProps
): JSX.Element => {
return (
<BigInput
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious whether this opens up the digit input UI on mobile

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMG_3374

type="text"
inputMode="numeric"
pattern="[0-9]*"
{...inputProps}
/>
);
};
15 changes: 15 additions & 0 deletions apps/passport-client/new-components/Typography.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from "react";
import styled from "styled-components";

const TypographyText = styled.span`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slightly unclear what this is for - typography is very vague as a name. are you just trying out the font here? if so that's fine but leave a comment

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not only, but also define a set of sizes and styles for our texts,

font-family: "Barlow", sans-serif;
color: rgba(0, 0, 0, 1);
`;
interface TypographyProps {
children?: React.ReactNode;
}
export const Typography: React.FC<TypographyProps> = ({
children
}): JSX.Element => {
return <TypographyText>{children}</TypographyText>;
};
5 changes: 5 additions & 0 deletions apps/passport-client/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ import { loadInitialState } from "../src/loadInitialState";
import { registerServiceWorker } from "../src/registerServiceWorker";
import { AppState, StateEmitter } from "../src/state";
import { useZappServer } from "../src/zapp/useZappServer";
import ComponentsScreen from "../new-components/ComponentsScreen";

function App(): JSX.Element {
useBackgroundJobs();
Expand Down Expand Up @@ -129,6 +130,10 @@ function RouterImpl(): JSX.Element {
<Route path="terms" element={<TermsScreen />} />
<Route index element={<HomeScreen />} />
<Route path="login" element={<LoginScreen />} />

{appConfig.devMode && (
<Route path="components" element={<ComponentsScreen />} />
)}
ororsatti marked this conversation as resolved.
Show resolved Hide resolved
Comment on lines +138 to +140
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{appConfig.devMode && (
<Route path="components" element={<ComponentsScreen />} />
)}
<Route path="components" element={<ComponentsScreen />} />

<Route
path="login-interstitial"
element={<LoginInterstitialScreen />}
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
84 changes: 84 additions & 0 deletions apps/passport-client/public/global-zupass.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,24 @@ html {
--black: #000000;
--black-rgb: 0, 0, 0;

--text-tertiary: #8b94ac;
--dot-bg: #ececec;
--dot-color: #e4e4e4;
--dot-size: 3px;
--dot-space: 22px;
--dot-pattern-bg: linear-gradient(
90deg,
var(--dot-bg) calc(var(--dot-space) - var(--dot-size)),
transparent 1%
)
center / var(--dot-space) var(--dot-space),
linear-gradient(
var(--dot-bg) calc(var(--dot-space) - var(--dot-size)),
transparent 1%
)
center / var(--dot-space) var(--dot-space),
var(--dot-color);

background: var(--bg-dark-primary);
color: var(--white);
font:
Expand All @@ -37,11 +55,56 @@ a:visited {
color: var(--accent-dark);
text-decoration: none;
}

a:hover {
text-decoration: underline;
cursor: pointer;
}

/* Barlow */
@font-face {
font-family: "Barlow";
font-style: normal;
font-weight: 200;
src: url(/fonts/Barlow-ExtraLight.ttf) format("truetype")
url(/fonts/Barlow-ExtraLight.woff) format("woff");
}

@font-face {
font-family: "Barlow";
font-style: normal;
font-weight: 300;
src: url(/fonts/Barlow-Light.ttf) format("truetype");
}

@font-face {
font-family: "Barlow";
font-style: italic;
font-weight: 300;
src: url(/fonts/Barlow-LightItalic.ttf) format("truetype");
}

@font-face {
font-family: "Barlow";
font-style: normal;
font-weight: 400;
src: url(/fonts/Barlow-Regular.ttf) format("truetype");
}

@font-face {
font-family: "Barlow";
font-style: normal;
font-weight: 500;
src: url(/fonts/Barlow-Medium.ttf) format("truetype");
}

@font-face {
font-family: "Barlow";
font-style: normal;
font-weight: 600;
src: url(/fonts/Barlow-SemiBold.ttf) format("truetype");
}

/* IBM Plex Sans */
@font-face {
font-family: "PlexSans";
Expand All @@ -50,45 +113,52 @@ a:hover {
src: url(/fonts/IBMPlexSans-ExtraLight.ttf) format("truetype")
url(/fonts/IBMPlexSans-ExtraLight.woff) format("woff");
}

@font-face {
font-family: "PlexSans";
font-style: normal;
font-weight: 300;
src: url(/fonts/IBMPlexSans-Light.ttf) format("truetype")
url(/fonts/IBMPlexSans-Light.woff) format("woff");
}

@font-face {
font-family: "PlexSans";
font-style: italic;
font-weight: 300;
src: url(/fonts/IBMPlexSans-LightItalic.ttf) format("truetype")
url(/fonts/IBMPlexSans-LightItalic.woff) format("woff");
}

@font-face {
font-family: "PlexSans";
font-style: normal;
font-weight: 400;
src: url(/fonts/IBMPlexSans-Regular.ttf) format("truetype")
url(/fonts/IBMPlexSans-Regular.woff) format("woff");
}

@font-face {
font-family: "PlexSans";
font-style: normal;
font-weight: 500;
src: url(/fonts/IBMPlexSans-Medium.ttf) format("truetype")
url(/fonts/IBMPlexSans-Medium.woff) format("woff");
}

@font-face {
font-family: "PlexSans";
font-style: normal;
font-weight: 600;
src: url(/fonts/IBMPlexSans-SemiBold.ttf) format("truetype")
url(/fonts/IBMPlexSans-SemiBold.woff) format("woff");
}

@font-face {
font-family: "SuperFunky";
src: url(/fonts/SuperFunky.ttf) format("truetype");
}

@font-face {
font-family: "PressStart2P";
src: url(/fonts/PressStart2P.ttf) format("truetype");
Expand Down Expand Up @@ -121,6 +191,7 @@ h6 {
margin: 0;
padding: 0;
}

h1,
h2,
h3,
Expand All @@ -130,34 +201,42 @@ h6 {
font-size: 100%;
font-weight: normal;
}

ul {
list-style: none;
}

button,
input,
select {
margin: 0;
}

html {
box-sizing: border-box;
}

*,
*::before,
*::after {
box-sizing: inherit;
}

img,
video {
height: auto;
max-width: 100%;
}

iframe {
border: 0;
}

table {
border-collapse: collapse;
border-spacing: 0;
}

td,
th {
padding: 0;
Expand Down Expand Up @@ -197,13 +276,15 @@ img {
width: 80px;
height: 80px;
}

.loader > div {
position: absolute;
border: 4px solid var(--accent-dark);
opacity: 1;
border-radius: 50%;
animation: ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

.loader > div:nth-child(2) {
animation-delay: -0.5s;
}
Expand All @@ -216,20 +297,23 @@ img {
height: 0;
opacity: 0;
}

4.9% {
top: 36px;
left: 36px;
width: 0;
height: 0;
opacity: 0;
}

5% {
top: 36px;
left: 36px;
width: 0;
height: 0;
opacity: 1;
}

100% {
top: 0px;
left: 0px;
Expand Down
21 changes: 21 additions & 0 deletions apps/passport-client/public/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,27 @@
type="font/woff"
crossorigin="anonymous"
/>
<link
rel="preload"
href="/fonts/Barlow-Regular.ttf"
as="font"
type="font/ttf"
crossorigin="anonymous"
/>
<link
rel="preload"
href="/fonts/Barlow-Light.ttf"
as="font"
type="font/ttf"
crossorigin="anonymous"
/>
<link
rel="preload"
href="/fonts/Barlow-ExtraLight.ttf"
as="font"
type="font/ttf"
crossorigin="anonymous"
/>
<script defer src="/js/index.js"></script>
{{!-- Lazily load zxcvbn.js since it contains 700KB+ of data --}}
<script async type="text/javascript" src="zxcvbn.js"></script>
Expand Down
6 changes: 6 additions & 0 deletions apps/passport-client/src/worker/service-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ const STABLE_CACHE_RESOURCES = new Set([
"/semaphore-artifacts/16.zkey",
"/artifacts/zk-eddsa-event-ticket-pcd/circuit.wasm",
"/artifacts/zk-eddsa-event-ticket-pcd/circuit.zkey",
"/fonts/Barlow-ExtraLight.ttf",
"/fonts/Barlow-Light.ttf",
"/fonts/Barlow-LightItalic.ttf",
"/fonts/Barlow-Regular.ttf",
"/fonts/Barlow-Medium.ttf",
"/fonts/Barlow-SemiBold.ttf",
"/fonts/IBMPlexSans-ExtraLight.woff",
"/fonts/IBMPlexSans-Light.woff",
"/fonts/IBMPlexSans-LightItalic.woff",
Expand Down
Loading