Skip to content

Commit

Permalink
feat(docs): migrate abbr to tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
Sporiff committed Oct 25, 2023
1 parent 4798e42 commit bafaa77
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/components/Abbr.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
import BuildTooltip from "./atlas/BuildTooltip";
let content = "";
const regex = /(^.*?(?=\())\(([^\)]+)\)/;
Expand All @@ -11,4 +13,7 @@ const body = match[1].trim()
const title = match[2]
---

<abbr title={title}>{body}</abbr>
<BuildTooltip client:only="react">
<Fragment set:html={body} name="children" />
<Fragment set:html={title} slot="content" />
</BuildTooltip>
2 changes: 1 addition & 1 deletion src/content/docs/en/kitchen-sink/typography.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Select <MenuSelection>File --> My Profile --> Billing</MenuSelection>

## Abbreviations

Abbreviations can be written using the `<Abbr>` component. This component transforms content written as `${Abbreviation} (${expanded version})` into native HTML [`<abbr>` tags](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/abbr).
Abbreviations can be written using the `<Abbr>` component. This component transforms content written as `${Abbreviation} (${expanded version})` into an [Atlas `Tooltip` component](https://atlas.adeven.com/docs/components/Tooltip).

```mdx
<Abbr>RTBF (Right to be forgotten)</Abbr>
Expand Down

0 comments on commit bafaa77

Please sign in to comment.