noahsettersten commited on
Commit
a8e82ac
1 Parent(s): 5508d5b

feat: Add initial styling from design

Browse files
assets/tailwind.config.js CHANGED
@@ -15,10 +15,11 @@ module.exports = {
15
  theme: {
16
  extend: {
17
  colors: {
18
- brand: "#B8EB86",
19
  "brand-active": "#93BC6B",
20
- link: "#BCBCBC",
21
- "link-active": "#D6D6D6",
 
22
  },
23
  fontFamily: {
24
  sans: ["Poppins", ...defaultTheme.fontFamily.sans],
 
15
  theme: {
16
  extend: {
17
  colors: {
18
+ brand: "#0A8390",
19
  "brand-active": "#93BC6B",
20
+ "type-black-primary": "#202020",
21
+ "type-black-tertiary": "#202020B2",
22
+ "button-deactivated-background": "#010101",
23
  },
24
  fontFamily: {
25
  sans: ["Poppins", ...defaultTheme.fontFamily.sans],
lib/medical_transcription_web/components/components.ex CHANGED
@@ -1,32 +1,46 @@
1
  defmodule MedicalTranscriptionWeb.Components do
2
  use Phoenix.Component
3
  import MedicalTranscriptionWeb.CoreComponents
 
 
4
 
5
- def tag_result_chip(assigns) do
6
  ~H"""
7
- <div
8
- class="group flex flex-col gap-1 px-1.5 py-0.5 rounded text-slate-800 text-sm bg-slate-200 border border-slate-300"
9
- title={"Similarity score: #{trunc(@score * 100) / 100}"}
10
- >
11
- <div class="flex items-start">
12
- <strong><%= @code %>:</strong>&nbsp;<%= @label %>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  </div>
14
 
15
- <div class="w-fit flex items-stretch border border-slate-300 rounded overflow-hidden">
16
- <.feedback_button
17
- code={@code}
18
- text={@text}
19
- response="true"
20
- icon_name="hero-check-circle"
21
- class="border-r border-slate-300"
22
- />
23
- <.feedback_button
24
- code={@code}
25
- text={@text}
26
- response="false"
27
- icon_name="hero-x-circle"
28
- class=""
29
- />
30
  </div>
31
  </div>
32
  """
@@ -40,9 +54,13 @@ defmodule MedicalTranscriptionWeb.Components do
40
  phx-value-text={@text}
41
  phx-value-response={@response}
42
  type="button"
43
- class={"px-1 py-0.5 hover:bg-slate-300 #{@class}"}
44
  >
45
- <.icon name={@icon_name} />
 
 
 
 
46
  </button>
47
  """
48
  end
 
1
  defmodule MedicalTranscriptionWeb.Components do
2
  use Phoenix.Component
3
  import MedicalTranscriptionWeb.CoreComponents
4
+ alias AudioTagger.Classifier.TagResult
5
+ use MedicalTranscriptionWeb, :verified_routes
6
 
7
+ def result_list(assigns) do
8
  ~H"""
9
+ <div class="flex flex-col gap-14">
10
+ <%= for {_dom_id, row} <- @rows do %>
11
+ <div class="flex gap-12 pb-10 border-b border-[#444444]/20">
12
+ <div class="flex-1 flex flex-col gap-4">
13
+ <p class="text-[32px] leading-normal font-semibold">
14
+ <%= row.start_mark %> - <%= row.end_mark %>
15
+ </p>
16
+ <p class="text-[28px] leading-normal text-type-black-tertiary"><%= row.text %></p>
17
+ </div>
18
+
19
+ <div class="flex-1 flex flex-col items-stretch gap-3">
20
+ <%= for %TagResult{code: code, label: label, score: score} <- row.tags do %>
21
+ <.tag_result code={code} label={label} score={score} text={row.text} />
22
+ <% end %>
23
+ </div>
24
+ </div>
25
+ <% end %>
26
+ </div>
27
+ """
28
+ end
29
+
30
+ def tag_result(assigns) do
31
+ ~H"""
32
+ <div class="flex items-center gap-4 px-[14px] py-3 text-sm">
33
+ <div class="flex gap-3">
34
+ <.feedback_button code={@code} text={@text} response="true" />
35
+ <.feedback_button code={@code} text={@text} response="false" class="" />
36
  </div>
37
 
38
+ <div
39
+ class="flex flex-col gap-1 font-secondary text-type-black-primary border-l border-[#444444]/20 pl-4"
40
+ title={"Similarity score: #{trunc(@score * 100) / 100}"}
41
+ >
42
+ <p class="text-lg font-bold leading-[22.97px]"><%= @code %></p>
43
+ <p class="text-base leading-[20.42px]"><%= @label %></p>
 
 
 
 
 
 
 
 
 
44
  </div>
45
  </div>
46
  """
 
54
  phx-value-text={@text}
55
  phx-value-response={@response}
56
  type="button"
57
+ class="p-2 border border-button-deactivated-background rounded-lg hover:bg-slate-200"
58
  >
59
+ <%= if @response == "true" do %>
60
+ <img src={~p"/images/thumbs-up.svg"} width="20" height="20" />
61
+ <% else %>
62
+ <img src={~p"/images/thumbs-down.svg"} width="20" height="20" />
63
+ <% end %>
64
  </button>
65
  """
66
  end
lib/medical_transcription_web/components/layouts/app.html.heex CHANGED
@@ -1,29 +1,23 @@
1
- <header class="px-4 sm:px-6 lg:px-8 border-b border-slate-500">
2
- <div class="flex items-center justify-between py-3 text-sm">
3
- <div class="flex items-center gap-4">
4
  <a href="/">
5
- <img src={~p"/images/logo.svg"} width="36" />
6
  </a>
7
- <p class="bg-brand/5 text-white rounded-full px-2 font-medium leading-6">
8
  Medical Code Transcriber
9
- </p>
10
  </div>
11
- <div class="flex items-center gap-4 font-semibold leading-6 text-link">
12
- <a href="https://twitter.com/headwayio" class="hover:text-link-active">
13
- @headwayio
14
- </a>
15
- <a
16
- href="https://github.com/headwayio/medical_transcription"
17
- class="rounded-lg font-light text-zinc-900 bg-brand px-2 py-1 hover:bg-brand-active"
18
- >
19
- GitHub <span aria-hidden="true">&rarr;</span>
20
- </a>
21
  </div>
22
- </div>
23
- </header>
24
- <main class="px-4 py-20 sm:px-6 lg:px-8">
25
- <div class="mx-auto max-w-5xl">
26
- <.flash_group flash={@flash} />
27
- <%= @inner_content %>
28
- </div>
29
- </main>
 
1
+ <div class="flex gap-5">
2
+ <header class="w-[335px] min-w-[335px] pt-6 border-r border-gray-200 flex flex-col gap-12">
3
+ <div class="flex items-center gap-[10.5px]">
4
  <a href="/">
5
+ <img src={~p"/images/logo.svg"} width="48" />
6
  </a>
7
+ <h1 class="text-lg leading-normal px-2 font-semibold">
8
  Medical Code Transcriber
9
+ </h1>
10
  </div>
11
+
12
+ <div class="px-6">
13
+ <p class="text-xs leading-normal tracking-[0.2em] font-semibold uppercase">Today</p>
14
+ </div>
15
+ </header>
16
+
17
+ <main class="pl-16 pr-16 pt-[25px]">
18
+ <div class="mx-auto max-w-5xl">
19
+ <.flash_group flash={@flash} />
20
+ <%= @inner_content %>
21
  </div>
22
+ </main>
23
+ </div>
 
 
 
 
 
 
lib/medical_transcription_web/components/layouts/root.html.heex CHANGED
@@ -11,7 +11,7 @@
11
  <script defer phx-track-static type="text/javascript" src={~p"/assets/app.js"}>
12
  </script>
13
  </head>
14
- <body class="bg-white antialiased">
15
  <%= @inner_content %>
16
  </body>
17
  </html>
 
11
  <script defer phx-track-static type="text/javascript" src={~p"/assets/app.js"}>
12
  </script>
13
  </head>
14
+ <body class="bg-white antialiased px-5 py-7">
15
  <%= @inner_content %>
16
  </body>
17
  </html>
lib/medical_transcription_web/live/home_live/index.ex CHANGED
@@ -1,6 +1,5 @@
1
  defmodule MedicalTranscriptionWeb.HomeLive.Index do
2
  use MedicalTranscriptionWeb, :live_view
3
- alias AudioTagger.Classifier.TagResult
4
  alias MedicalTranscriptionWeb.HomeLive.Index.SampleResults
5
 
6
  @impl Phoenix.LiveView
@@ -25,18 +24,19 @@ defmodule MedicalTranscriptionWeb.HomeLive.Index do
25
 
26
  ~H"""
27
  <form id="audio-form" phx-submit="save" phx-change="validate">
28
- <div class="flex flex-col space-y-4">
29
- <h1 class="text-lg font-bold">Upload Transcription Audio</h1>
30
- <.live_file_input
31
- class="file:text-sm file:rounded-full file:px-4 file:py-2 file:border-0 file:bg-brand file:hover:bg-brand-active pb-4 border-b border-slate-200"
32
- upload={@uploads.audio}
33
- />
34
- <button
35
- name="submit-btn"
36
- class="rounded-full bg-brand hover:bg-brand-active py-2 px-4 font-light text-black w-fit max-w-48"
37
- >
38
- Transcribe and Tag Audio <span aria-hidden="true">&rarr;</span>
39
- </button>
 
40
 
41
  <%= if @transcription_in_progress do %>
42
  <div class="flex gap-2 items-center p-2 rounded-md text-slate-800 text-sm bg-slate-200 border border-slate-300">
@@ -45,22 +45,7 @@ defmodule MedicalTranscriptionWeb.HomeLive.Index do
45
  </div>
46
  <% end %>
47
 
48
- <.table
49
- id="streamed_result"
50
- rows={@streams.transcription_rows}
51
- row_item={fn {dom_id, row} -> Map.put(row, :dom_id, dom_id) end}
52
- >
53
- <:col :let={row} label="Start"><%= row.start_mark %></:col>
54
- <:col :let={row} label="End"><%= row.end_mark %></:col>
55
- <:col :let={row} label="Text"><%= row.text %></:col>
56
- <:col :let={row} label="Codes">
57
- <div class="min-w-[18rem] max-w-md flex flex-col items-stretch gap-2">
58
- <%= for %TagResult{code: code, label: label, score: score} <- row.tags do %>
59
- <.tag_result_chip code={code} label={label} score={score} text={row.text} />
60
- <% end %>
61
- </div>
62
- </:col>
63
- </.table>
64
  </div>
65
  </form>
66
  """
 
1
  defmodule MedicalTranscriptionWeb.HomeLive.Index do
2
  use MedicalTranscriptionWeb, :live_view
 
3
  alias MedicalTranscriptionWeb.HomeLive.Index.SampleResults
4
 
5
  @impl Phoenix.LiveView
 
24
 
25
  ~H"""
26
  <form id="audio-form" phx-submit="save" phx-change="validate">
27
+ <div class="flex flex-col space-y-6">
28
+ <div class="flex items-center pb-4 border-b border-[#444444]/20">
29
+ <.live_file_input
30
+ class="file:text-sm file:rounded-full file:px-4 file:py-2 file:border-0 file:bg-brand file:hover:bg-brand-active file:text-white"
31
+ upload={@uploads.audio}
32
+ />
33
+ <button
34
+ name="submit-btn"
35
+ class="rounded-full bg-brand hover:bg-brand-active text-white py-2 px-4 font-light text-black"
36
+ >
37
+ Submit <span aria-hidden="true">&rarr;</span>
38
+ </button>
39
+ </div>
40
 
41
  <%= if @transcription_in_progress do %>
42
  <div class="flex gap-2 items-center p-2 rounded-md text-slate-800 text-sm bg-slate-200 border border-slate-300">
 
45
  </div>
46
  <% end %>
47
 
48
+ <.result_list rows={@streams.transcription_rows} />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  </div>
50
  </form>
51
  """
priv/static/images/thumbs-down.svg ADDED
priv/static/images/thumbs-up.svg ADDED