Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
fix: a11y models page
Browse files
src/lib/components/ExpandNavigation.svelte
CHANGED
@@ -8,6 +8,8 @@
|
|
8 |
class="{classNames} group flex h-16 w-6 flex-col items-center justify-center -space-y-1 outline-none *:h-3 *:w-1 *:rounded-full *:hover:bg-gray-300 dark:*:hover:bg-gray-600 max-md:hidden {!isCollapsed
|
9 |
? '*:bg-gray-200/70 dark:*:bg-gray-800'
|
10 |
: '*:bg-gray-200 dark:*:bg-gray-700'}"
|
|
|
|
|
11 |
>
|
12 |
<div class={!isCollapsed ? "group-hover:rotate-[20deg]" : "group-hover:-rotate-[20deg]"} />
|
13 |
<div class={!isCollapsed ? "group-hover:-rotate-[20deg]" : "group-hover:rotate-[20deg]"} />
|
|
|
8 |
class="{classNames} group flex h-16 w-6 flex-col items-center justify-center -space-y-1 outline-none *:h-3 *:w-1 *:rounded-full *:hover:bg-gray-300 dark:*:hover:bg-gray-600 max-md:hidden {!isCollapsed
|
9 |
? '*:bg-gray-200/70 dark:*:bg-gray-800'
|
10 |
: '*:bg-gray-200 dark:*:bg-gray-700'}"
|
11 |
+
name="sidebar-toggle"
|
12 |
+
aria-label="Toggle sidebar navigation"
|
13 |
>
|
14 |
<div class={!isCollapsed ? "group-hover:rotate-[20deg]" : "group-hover:-rotate-[20deg]"} />
|
15 |
<div class={!isCollapsed ? "group-hover:-rotate-[20deg]" : "group-hover:rotate-[20deg]"} />
|
src/routes/models/+page.svelte
CHANGED
@@ -32,59 +32,74 @@
|
|
32 |
href="https://huggingface.co/spaces/huggingchat/chat-ui/discussions/372"
|
33 |
class="ml-auto dark:text-gray-400 dark:hover:text-gray-300"
|
34 |
target="_blank"
|
|
|
35 |
>
|
36 |
<CarbonHelpFilled />
|
37 |
</a>
|
38 |
{/if}
|
39 |
</div>
|
40 |
-
<
|
41 |
-
<
|
42 |
{#each data.models.filter((el) => !el.unlisted) as model, index (model.id)}
|
43 |
-
<
|
44 |
-
|
|
|
45 |
class="relative flex flex-col gap-2 overflow-hidden rounded-xl border bg-gray-50/50 px-6 py-5 shadow hover:bg-gray-50 hover:shadow-inner dark:border-gray-800/70 dark:bg-gray-950/20 dark:hover:bg-gray-950/40"
|
46 |
>
|
|
|
|
|
|
|
|
|
|
|
47 |
<div class="flex items-center justify-between gap-1">
|
48 |
{#if model.logoUrl}
|
49 |
<img
|
50 |
-
class="
|
51 |
src={model.logoUrl}
|
52 |
-
alt=""
|
53 |
/>
|
54 |
{:else}
|
55 |
-
<div
|
|
|
|
|
|
|
56 |
{/if}
|
57 |
{#if model.tools}
|
58 |
-
<
|
|
|
59 |
class="ml-auto grid size-[21px] place-items-center rounded-lg border border-purple-300 dark:border-purple-700"
|
|
|
|
|
60 |
>
|
61 |
<CarbonTools class="text-xxs text-purple-700 dark:text-purple-500" />
|
62 |
-
</
|
63 |
{/if}
|
64 |
{#if model.multimodal}
|
65 |
-
<
|
66 |
title="This model is multimodal and supports image inputs natively."
|
67 |
class="ml-auto flex size-[21px] items-center justify-center rounded-lg border border-blue-700 dark:border-blue-500"
|
|
|
|
|
68 |
>
|
69 |
<CarbonImage class="text-xxs text-blue-700 dark:text-blue-500" />
|
70 |
-
</
|
71 |
{/if}
|
72 |
{#if index === 0}
|
73 |
-
<
|
74 |
class="rounded-full border border-gray-300 px-2 py-0.5 text-xs text-gray-500 dark:border-gray-500 dark:text-gray-400"
|
75 |
>
|
76 |
Default
|
77 |
-
</
|
78 |
{/if}
|
79 |
</div>
|
80 |
-
<
|
81 |
{model.displayName}
|
82 |
-
</
|
83 |
-
<
|
84 |
{model.description || "-"}
|
85 |
-
</
|
86 |
-
</
|
87 |
{/each}
|
88 |
-
</
|
89 |
</div>
|
90 |
</div>
|
|
|
32 |
href="https://huggingface.co/spaces/huggingchat/chat-ui/discussions/372"
|
33 |
class="ml-auto dark:text-gray-400 dark:hover:text-gray-300"
|
34 |
target="_blank"
|
35 |
+
aria-label="Hub discussion about models"
|
36 |
>
|
37 |
<CarbonHelpFilled />
|
38 |
</a>
|
39 |
{/if}
|
40 |
</div>
|
41 |
+
<h2 class="text-gray-500">All models available on {envPublic.PUBLIC_APP_NAME}</h2>
|
42 |
+
<div class="mt-8 grid grid-cols-1 gap-3 sm:gap-5 xl:grid-cols-2">
|
43 |
{#each data.models.filter((el) => !el.unlisted) as model, index (model.id)}
|
44 |
+
<div
|
45 |
+
aria-label="Model card"
|
46 |
+
role="region"
|
47 |
class="relative flex flex-col gap-2 overflow-hidden rounded-xl border bg-gray-50/50 px-6 py-5 shadow hover:bg-gray-50 hover:shadow-inner dark:border-gray-800/70 dark:bg-gray-950/20 dark:hover:bg-gray-950/40"
|
48 |
>
|
49 |
+
<a
|
50 |
+
href="{base}/models/{model.id}"
|
51 |
+
class="absolute inset-0 z-10"
|
52 |
+
aria-label="View details for {model.displayName}"
|
53 |
+
/>
|
54 |
<div class="flex items-center justify-between gap-1">
|
55 |
{#if model.logoUrl}
|
56 |
<img
|
57 |
+
class="overflown aspect-square size-6 rounded border dark:border-gray-700"
|
58 |
src={model.logoUrl}
|
59 |
+
alt="{model.displayName} logo"
|
60 |
/>
|
61 |
{:else}
|
62 |
+
<div
|
63 |
+
class="size-6 rounded border border-transparent bg-gray-300 dark:bg-gray-800"
|
64 |
+
aria-hidden="true"
|
65 |
+
/>
|
66 |
{/if}
|
67 |
{#if model.tools}
|
68 |
+
<span
|
69 |
+
title="This model supports tools."
|
70 |
class="ml-auto grid size-[21px] place-items-center rounded-lg border border-purple-300 dark:border-purple-700"
|
71 |
+
aria-label="Model supports tools"
|
72 |
+
role="img"
|
73 |
>
|
74 |
<CarbonTools class="text-xxs text-purple-700 dark:text-purple-500" />
|
75 |
+
</span>
|
76 |
{/if}
|
77 |
{#if model.multimodal}
|
78 |
+
<span
|
79 |
title="This model is multimodal and supports image inputs natively."
|
80 |
class="ml-auto flex size-[21px] items-center justify-center rounded-lg border border-blue-700 dark:border-blue-500"
|
81 |
+
aria-label="Model is multimodal"
|
82 |
+
role="img"
|
83 |
>
|
84 |
<CarbonImage class="text-xxs text-blue-700 dark:text-blue-500" />
|
85 |
+
</span>
|
86 |
{/if}
|
87 |
{#if index === 0}
|
88 |
+
<span
|
89 |
class="rounded-full border border-gray-300 px-2 py-0.5 text-xs text-gray-500 dark:border-gray-500 dark:text-gray-400"
|
90 |
>
|
91 |
Default
|
92 |
+
</span>
|
93 |
{/if}
|
94 |
</div>
|
95 |
+
<span class="flex items-center gap-2 font-semibold">
|
96 |
{model.displayName}
|
97 |
+
</span>
|
98 |
+
<span class="whitespace-pre-wrap text-sm text-gray-500 dark:text-gray-400">
|
99 |
{model.description || "-"}
|
100 |
+
</span>
|
101 |
+
</div>
|
102 |
{/each}
|
103 |
+
</div>
|
104 |
</div>
|
105 |
</div>
|