adeshboudh16 commited on
Commit
cd7e224
·
1 Parent(s): 521eda0

style: apply interaction polish and mobile spacing

Browse files
frontend/src/components/ChatThread.tsx CHANGED
@@ -43,7 +43,7 @@ export function ChatThread({ messages, isLoading, onExampleClick }: Props) {
43
  key={query}
44
  type="button"
45
  onClick={() => onExampleClick(query)}
46
- className="rounded-[10px] bg-[#1a1a1a] px-3.5 py-3 text-left text-[13px] leading-5 text-white/60 transition-colors hover:bg-[#222222] hover:text-white/80"
47
  >
48
  {query}
49
  </button>
 
43
  key={query}
44
  type="button"
45
  onClick={() => onExampleClick(query)}
46
+ className="rounded-[10px] bg-[#1a1a1a] px-3.5 py-3 text-left text-[13px] leading-5 text-white/60 transition-[background-color,color,transform] duration-150 ease-out hover:bg-[#222222] hover:text-white/80 active:scale-[0.97]"
47
  >
48
  {query}
49
  </button>
frontend/src/components/Header.tsx CHANGED
@@ -25,7 +25,7 @@ export function Header({ onNewConversation: _onNewConversation, onMenuClick }: P
25
  type="button"
26
  onClick={onMenuClick}
27
  aria-label="Open menu"
28
- className="grid h-8 w-8 place-items-center rounded-[6px] text-zinc-400 transition-[background-color,color,transform] duration-150 ease-out hover:bg-white/5 hover:text-white/70 active:scale-95 lg:hidden"
29
  >
30
  <MenuIcon />
31
  </button>
 
25
  type="button"
26
  onClick={onMenuClick}
27
  aria-label="Open menu"
28
+ className="grid h-8 w-8 place-items-center rounded-[6px] text-zinc-400 transition-[background-color,color,transform] duration-150 ease-out hover:bg-white/5 hover:text-white/70 active:scale-[0.97] lg:hidden"
29
  >
30
  <MenuIcon />
31
  </button>
frontend/src/components/MessageBubble.tsx CHANGED
@@ -77,7 +77,7 @@ export function MessageBubble({ message }: Props) {
77
  href={href}
78
  target="_blank"
79
  rel="noreferrer"
80
- className="font-medium text-[#4f98a3] underline decoration-[#4f98a3]/40 underline-offset-4 hover:text-[#72bdc6]"
81
  >
82
  {children}
83
  </a>
 
77
  href={href}
78
  target="_blank"
79
  rel="noreferrer"
80
+ className="inline-block font-medium text-[#4f98a3] underline decoration-[#4f98a3]/40 underline-offset-4 transition-[color,transform] duration-150 ease-out hover:text-[#72bdc6] active:scale-[0.97]"
81
  >
82
  {children}
83
  </a>
frontend/src/components/MobileDrawer.tsx CHANGED
@@ -19,13 +19,7 @@ export function MobileDrawer({ isOpen, onClose, onNewConversation }: Props) {
19
  className={`fixed inset-y-0 left-0 z-[70] w-[280px] bg-[#141414] shadow-2xl transition-transform duration-300 ease-out ${isOpen ? 'translate-x-0' : '-translate-x-full'}`}
20
  >
21
  <div className="flex h-16 items-center border-b border-white/5 px-6">
22
- <img
23
- src={logo.src}
24
- alt="CivicSetu Logo"
25
- width={28}
26
- height={28}
27
- className="rounded-sm"
28
- />
29
  </div>
30
 
31
  <div className="flex h-[calc(100%-4rem)] flex-col p-4">
 
19
  className={`fixed inset-y-0 left-0 z-[70] w-[280px] bg-[#141414] shadow-2xl transition-transform duration-300 ease-out ${isOpen ? 'translate-x-0' : '-translate-x-full'}`}
20
  >
21
  <div className="flex h-16 items-center border-b border-white/5 px-6">
22
+ <img src={logo.src} alt="CivicSetu Logo" width={28} height={28} className="rounded-sm" />
 
 
 
 
 
 
23
  </div>
24
 
25
  <div className="flex h-[calc(100%-4rem)] flex-col p-4">
frontend/src/components/graph/ContextPill.tsx CHANGED
@@ -15,7 +15,7 @@ export function ContextPill({ sectionId, docName, jurisdiction, onRemove }: Prop
15
  </span>
16
  <button
17
  onClick={onRemove}
18
- className="text-white/30 transition-colors hover:text-white/70 active:scale-95"
19
  aria-label="Remove section context"
20
  type="button"
21
  >
 
15
  </span>
16
  <button
17
  onClick={onRemove}
18
+ className="text-white/30 transition-[color,transform] duration-150 ease-out hover:text-white/70 active:scale-[0.97]"
19
  aria-label="Remove section context"
20
  type="button"
21
  >
frontend/src/components/graph/NodeInfoCard.tsx CHANGED
@@ -47,7 +47,7 @@ export function NodeInfoCard({
47
  </div>
48
  <button
49
  onClick={onClose}
50
- className="text-white/30 transition-colors hover:text-white/70 active:scale-95"
51
  aria-label="Close section summary"
52
  type="button"
53
  >
@@ -92,7 +92,7 @@ export function NodeInfoCard({
92
  <div className="border-t border-white/[0.05] px-3 py-3">
93
  <button
94
  onClick={() => onChatAboutSection(node.section_id, node.title, node.doc_name, node.jurisdiction)}
95
- className="w-full border border-white/[0.09] bg-white/[0.03] px-3 py-2 text-[11px] font-medium text-white/70 transition-[background-color,border-color,transform] duration-150 ease-out hover:border-[#4f98a3]/50 hover:bg-white/[0.06] hover:text-white active:scale-[0.98]"
96
  type="button"
97
  >
98
  Chat about this section
 
47
  </div>
48
  <button
49
  onClick={onClose}
50
+ className="text-white/30 transition-[color,transform] duration-150 ease-out hover:text-white/70 active:scale-[0.97]"
51
  aria-label="Close section summary"
52
  type="button"
53
  >
 
92
  <div className="border-t border-white/[0.05] px-3 py-3">
93
  <button
94
  onClick={() => onChatAboutSection(node.section_id, node.title, node.doc_name, node.jurisdiction)}
95
+ className="w-full border border-white/[0.09] bg-white/[0.03] px-3 py-2 text-[11px] font-medium text-white/70 transition-[background-color,border-color,transform] duration-150 ease-out hover:border-[#4f98a3]/50 hover:bg-white/[0.06] hover:text-white active:scale-[0.97]"
96
  type="button"
97
  >
98
  Chat about this section
frontend/src/components/graph/SectionDrawer.tsx CHANGED
@@ -32,7 +32,7 @@ export function SectionDrawer({
32
  `}
33
  aria-hidden={!isOpen}
34
  >
35
- <div className="h-1.5 w-12 shrink-0 self-center rounded-full bg-zinc-800 my-3 lg:hidden" />
36
  {content ? (
37
  <header className="flex shrink-0 items-start justify-between gap-3 border-b border-white/[0.06] px-4 py-3">
38
  <div className="min-w-0 flex-1">
@@ -85,7 +85,7 @@ export function SectionDrawer({
85
  {[0, 1, 2].map(i => (
86
  <span
87
  key={i}
88
- className="h-1.5 w-1.5 rounded-full bg-white/20 animate-pulse"
89
  style={{ animationDelay: `${i * 150}ms` }}
90
  />
91
  ))}
@@ -132,7 +132,7 @@ export function SectionDrawer({
132
  </div>
133
 
134
  <footer className="flex shrink-0 flex-col gap-4 border-t border-white/[0.06] px-4 py-3 max-lg:pb-24 lg:flex-row lg:items-center lg:gap-3 lg:py-2.5">
135
- <div className="flex items-center gap-3 min-w-0 flex-1">
136
  <span className="shrink-0 font-mono text-[9px] uppercase tracking-[0.14em] text-white/25 lg:hidden">Related</span>
137
  <div className="ledger-scroll flex min-w-0 flex-1 gap-1.5 overflow-x-auto">
138
  {content.connected_sections.slice(0, 10).map((section, index) => (
@@ -152,14 +152,13 @@ export function SectionDrawer({
152
  </div>
153
 
154
  <button
155
- onClick={() =>
156
- onChatAboutSection(content.section_id, content.title, content.doc_name, content.jurisdiction)
157
- }
158
  className="flex w-full items-center justify-between border border-[#4f98a3]/35 bg-[#4f98a3]/10 px-4 py-3 text-[13px] font-medium text-[#9ed4dc] transition-[background-color,border-color,transform] duration-150 ease-out hover:border-[#4f98a3]/70 hover:bg-[#4f98a3]/16 active:scale-[0.97] lg:w-auto lg:px-3 lg:py-1.5 lg:text-[11px]"
159
  type="button"
160
  >
161
  <span>Chat about this section</span>
162
- <svg suppressHydrationWarning xmlns="http://www.w3.org/2000/svg" height="18px" viewBox="0 -960 960 960" width="18px" fill="#e3e3e3"><path d="M630-444H192v-72h438L429-717l51-51 288 288-288 288-51-51 201-201Z"/></svg> </button>
 
163
  </footer>
164
  </>
165
  ) : null}
 
32
  `}
33
  aria-hidden={!isOpen}
34
  >
35
+ <div className="my-3 h-1.5 w-12 shrink-0 self-center rounded-full bg-zinc-800 lg:hidden" />
36
  {content ? (
37
  <header className="flex shrink-0 items-start justify-between gap-3 border-b border-white/[0.06] px-4 py-3">
38
  <div className="min-w-0 flex-1">
 
85
  {[0, 1, 2].map(i => (
86
  <span
87
  key={i}
88
+ className="h-1.5 w-1.5 animate-pulse rounded-full bg-white/20"
89
  style={{ animationDelay: `${i * 150}ms` }}
90
  />
91
  ))}
 
132
  </div>
133
 
134
  <footer className="flex shrink-0 flex-col gap-4 border-t border-white/[0.06] px-4 py-3 max-lg:pb-24 lg:flex-row lg:items-center lg:gap-3 lg:py-2.5">
135
+ <div className="flex min-w-0 flex-1 items-center gap-3">
136
  <span className="shrink-0 font-mono text-[9px] uppercase tracking-[0.14em] text-white/25 lg:hidden">Related</span>
137
  <div className="ledger-scroll flex min-w-0 flex-1 gap-1.5 overflow-x-auto">
138
  {content.connected_sections.slice(0, 10).map((section, index) => (
 
152
  </div>
153
 
154
  <button
155
+ onClick={() => onChatAboutSection(content.section_id, content.title, content.doc_name, content.jurisdiction)}
 
 
156
  className="flex w-full items-center justify-between border border-[#4f98a3]/35 bg-[#4f98a3]/10 px-4 py-3 text-[13px] font-medium text-[#9ed4dc] transition-[background-color,border-color,transform] duration-150 ease-out hover:border-[#4f98a3]/70 hover:bg-[#4f98a3]/16 active:scale-[0.97] lg:w-auto lg:px-3 lg:py-1.5 lg:text-[11px]"
157
  type="button"
158
  >
159
  <span>Chat about this section</span>
160
+ <svg suppressHydrationWarning xmlns="http://www.w3.org/2000/svg" height="18px" viewBox="0 -960 960 960" width="18px" fill="#e3e3e3"><path d="M630-444H192v-72h438L429-717l51-51 288 288-288 288-51-51 201-201Z"/></svg>
161
+ </button>
162
  </footer>
163
  </>
164
  ) : null}