Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion src/components/Layout/mdx/Admonition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Aside from '../../blocks/dividers/Aside';

const LEGACY_ADMONITION_TYPES = ['new', 'updated', 'experimental', 'public-preview'];

type AdmonitionVariant = 'neutral' | 'note' | 'further-reading' | 'important' | 'warning';
type AdmonitionVariant = 'neutral' | 'note' | 'further-reading' | 'important' | 'warning' | 'usp';

interface AdmonitionProps extends React.HTMLAttributes<HTMLElement> {
'data-type'?: AdmonitionVariant;
Expand Down Expand Up @@ -44,6 +44,11 @@ const admonitionConfig: Record<
backgroundColor: 'bg-yellow-100 dark:bg-yellow-800',
title: 'Warning',
},
usp: {
borderColor: 'border-l-orange-600 dark:border-l-orange-600',
backgroundColor: '',
title: '', // USP callouts don't use a title prefix - the content includes the headline
},
};

const Admonition: React.FC<AdmonitionProps> = ({ 'data-type': dataType = 'note', children, className, ...rest }) => {
Expand All @@ -54,6 +59,26 @@ const Admonition: React.FC<AdmonitionProps> = ({ 'data-type': dataType = 'note',

const { borderColor, backgroundColor, title } = admonitionConfig[dataType];

// USP callouts have a different structure - no title prefix, content includes the headline
if (dataType === 'usp') {
return (
<aside
{...rest}
data-type={dataType}
className={cn(
'border-l px-6 py-3.5 my-4 rounded-r-lg text-neutral-1000 dark:text-neutral-300',
borderColor,
backgroundColor,
className,
)}
>
<div className="ui-text-p3 [&>p:first-child]:ui-text-p1 [&>p:first-child]:font-bold [&>p:first-child]:text-neutral-1300 [&>p:first-child]:mb-2 [&>*:last-child]:mb-0">
{children}
</div>
</aside>
);
}

return (
<aside
{...rest}
Expand Down
5 changes: 5 additions & 0 deletions src/pages/docs/platform/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ title: About Ably
meta_description: "An introduction to Ably and its highly-available, scalable platform."
---

<Aside data-type="usp">
<p>Make data loss a mathematical impossibility.</p>
<p>That's 8-nines durability. Once acknowledged, messages replicate instantly across multiple physical locations—a 99.9999999% statistical guarantee that survives entire data center failures. [See evidence](#)</p>
</Aside>

Ably is a highly-scalable serverless WebSocket platform used to power realtime digital experiences.

At its core, Ably is a cloud-based Pub/Sub (publish/subscribe) platform-as-a-service (PaaS). It ensures that any messages published to Ably by any device will be received, in realtime, by any number of subscribing devices.
Expand Down