From 2403a38f8f592a1d9c9daeec209cff4690467faa Mon Sep 17 00:00:00 2001 From: Marcelo Oliveira Date: Tue, 9 Jun 2026 13:33:13 -0300 Subject: [PATCH 1/6] feat: add comprehensive shared UI components library - Button: variants (primary/secondary/ghost/danger), sizes, loading state, icons - Card: interactive (hover effects) and flat variants - Badge: success, warning, error, info semantic variants - Input: label, error, helper text, validation states, forwardRef - Textarea: multi-line input with same features as Input - Select: dropdown with label, error, helper text - Modal: dialog with backdrop blur, ESC key close, size variants - Toast: notification system with types (success/error/warning/info) - ToastProvider: global toast context with auto-dismiss - Skeleton: loading placeholders (text, circular, rectangular) - SkeletonCard: pre-built card skeleton - SkeletonList: pre-built list skeleton - EmptyState: empty content illustration with icon variants - Update AppProvider to include ToastProvider - Create comprehensive demo page showcasing all components All components are: - Fully typed with TypeScript - Theme-aware with CSS variables - Accessible with ARIA attributes - Responsive and mobile-friendly Next: Step 4 - API Layer + Auth Context (mock backend integration) --- src/App.tsx | 374 ++++++++++++++++++++----------- src/components/Badge.tsx | 24 ++ src/components/Button.tsx | 59 +++++ src/components/Card.tsx | 25 +++ src/components/EmptyState.tsx | 35 +++ src/components/Input.tsx | 43 ++++ src/components/Modal.tsx | 71 ++++++ src/components/Select.tsx | 46 ++++ src/components/Skeleton.tsx | 62 +++++ src/components/Textarea.tsx | 43 ++++ src/components/Toast.tsx | 61 +++++ src/components/ToastProvider.tsx | 52 +++++ src/contexts/AppProvider.tsx | 5 +- 13 files changed, 769 insertions(+), 131 deletions(-) create mode 100644 src/components/Badge.tsx create mode 100644 src/components/Button.tsx create mode 100644 src/components/Card.tsx create mode 100644 src/components/EmptyState.tsx create mode 100644 src/components/Input.tsx create mode 100644 src/components/Modal.tsx create mode 100644 src/components/Select.tsx create mode 100644 src/components/Skeleton.tsx create mode 100644 src/components/Textarea.tsx create mode 100644 src/components/Toast.tsx create mode 100644 src/components/ToastProvider.tsx diff --git a/src/App.tsx b/src/App.tsx index e2aa049..4e35ce9 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,147 +1,263 @@ +import { useState } from 'react' import { Routes, Route, Navigate } from 'react-router-dom' -import { PublicHeader } from './components/PublicHeader' -import { PublicFooter } from './components/PublicFooter' -import { AppShell } from './components/AppShell' import { ThemeToggle } from './components/ThemeToggle' -import { Link } from 'react-router-dom' +import { Button } from './components/Button' +import { Card } from './components/Card' +import { Badge } from './components/Badge' +import { Input } from './components/Input' +import { Textarea } from './components/Textarea' +import { Select } from './components/Select' +import { Modal } from './components/Modal' +import { Skeleton, SkeletonCard, SkeletonList } from './components/Skeleton' +import { EmptyState } from './components/EmptyState' +import { useToast } from './components/ToastProvider' -function PublicLayout({ children }: { children: React.ReactNode }) { - return ( -
- -
{children}
- -
- ) -} +function UIComponentsDemo() { + const [modalOpen, setModalOpen] = useState(false) + const [loading, setLoading] = useState(false) + const { showToast } = useToast() -function LandingDemo() { - return ( - -
-

- Every Signature, Forever Verifiable -

-

- Blockchain-anchored e-signatures with independent verification. No vendor lock-in, no expiration. -

-
- - Get Started Free - - - Verify Document - -
+ const handleLoadingClick = () => { + setLoading(true) + setTimeout(() => setLoading(false), 2000) + } -
-
-

Upload

-

Upload any PDF document to get started

-
-
-

Sign

-

Add signers and collect e-signatures

-
-
-

Anchor

-

Proof anchored on Ethereum L2

-
+ return ( +
+
+
+

UI Components Library

+

Step 3: Comprehensive reusable components

+
- - ) -} -function DashboardDemo() { - return ( - -
-
-
-

Total Documents

-

12

-
-
-

Pending Signatures

-

3

-
-
-

Completed

-

8

-
-
-

Anchored On-Chain

-

8

-
-
+
+
+

Buttons

+ +
+
+

Variants

+
+ + + + +
+
-
-

Recent Activity

-
- {[1, 2, 3].map((i) => ( -
-
-

NDA Agreement #{i}

-

Created 2 days ago

+
+

Sizes

+
+ + +
- Completed
- ))} + +
+

States

+
+ + +
+
+ +
+

With Icons

+
+ + + +
+
+
+ +
+ +
+

Cards

+
+ +

Interactive Card

+

This card has hover effects and can be clicked.

+
+ +

Flat Card

+

This card has no hover effects.

+
-
-
-
- ) -} + -function LayoutDemo() { - return ( -
-
-
-
-

Layout Components Demo

-

Step 2: Public and authenticated layouts

+
+

Badges

+ +
+ Success + Warning + Error + Info +
+
+
+ +
+

Form Inputs

+
+ +
+ + + +
+
+ +
+