help-beta: Add KeyboardTip component.

We also add unplugin types to tsconfig.json. We didn't need them before
since those types were not used in any astro components and were used in
mdx files directly instead.

We have an open PR to the upstream starlight repository to add support
for custom icons in the Aside starlight component. The PR is stalled
due to dependency on some of the custom icons work being done on
starlight. We should replace the code below with the Aside starlight
component along with a custom icon (keyboard in out case).
Not linking it directly to avoid necessary mentions on the original PR
whenever this commit is pushed. The PR number is 2261 in
https://github.com/withastro/starlight.
This commit is contained in:
Shubham Padia
2025-05-15 11:19:29 +00:00
committed by Tim Abbott
parent 231cae594e
commit 9d9b0c01fc
2 changed files with 27 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
---
import ZulipIconsKeyboard from "~icons/zulip-icon/keyboard"
let { title } = Astro.props;
if (!title) {
title = "Keyboard Shortcut";
}
---
<!--
We have an open PR to the upstream starlight repository to add support
for custom icons in the Aside starlight component. The PR is stalled
due to dependency on some of the custom icons work being done on
starlight. We should replace the code below with the Aside starlight
component along with a custom icon (keyboard in out case).
Link: https://github.com/withastro/starlight/pull/2261
-->
<aside aria-label={title} class={`starlight-aside starlight-aside--tip`}>
<p class="starlight-aside__title" aria-hidden="true">
<ZulipIconsKeyboard class="starlight-aside__icon" />{title}
</p>
<div class="starlight-aside__content">
<slot />
</div>
</aside>

View File

@@ -26,5 +26,7 @@
/* Projects */
"composite": true,
"types": ["unplugin-icons/types/astro"],
},
}