From bf53fd9363c9cd1f5b5ff48251f644b2876e3408 Mon Sep 17 00:00:00 2001 From: Jamie Henson Date: Thu, 10 Oct 2024 15:56:11 +0100 Subject: [PATCH] 14.6.8 - pricing card title tooltips, support for multiple tooltip orientations --- package.json | 2 +- src/core/Pricing/PricingCards.tsx | 23 +++++-- src/core/Pricing/data.tsx | 19 ++++++ src/core/Pricing/types.ts | 1 + .../__snapshots__/Table.stories.tsx.snap | 60 ++++++++--------- src/core/Tooltip.tsx | 66 ++++++++++++++----- .../__snapshots__/Tooltip.stories.tsx.snap | 24 +++---- 7 files changed, 128 insertions(+), 67 deletions(-) diff --git a/package.json b/package.json index 76b7bc97..34643177 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ably/ui", - "version": "14.6.7", + "version": "14.6.8", "description": "Home of the Ably design system library ([design.ably.com](https://design.ably.com)). It provides a showcase, development/test environment and a publishing pipeline for different distributables.", "repository": { "type": "git", diff --git a/src/core/Pricing/PricingCards.tsx b/src/core/Pricing/PricingCards.tsx index 0a9b6fe2..2c3768f1 100644 --- a/src/core/Pricing/PricingCards.tsx +++ b/src/core/Pricing/PricingCards.tsx @@ -1,11 +1,12 @@ import React, { Fragment, useEffect, useRef, useState } from "react"; +import throttle from "lodash.throttle"; import type { PricingDataFeature } from "./types"; import { determineThemeColor } from "../styles/colors/utils"; import { ColorClass, Theme } from "../styles/colors/types"; import Icon from "../Icon"; import FeaturedLink from "../FeaturedLink"; import { IconName } from "../Icon/types"; -import throttle from "lodash.throttle"; +import Tooltip from "../Tooltip"; export type PricingCardsProps = { data: PricingDataFeature[]; @@ -105,11 +106,21 @@ const PricingCards = ({ className={`relative z-10 flex flex-col gap-24 ${delimiter ? "@[520px]:flex-1 @[920px]:flex-none" : ""}`} >
-

- {title.content} -

+
+

+ {title.content} +

+ {title.tooltip ? ( + + {title.tooltip} + + ) : null} +

+ Ably aggregates all its data into named units of distribution, + referred to as “channels”. These are used to transmit from one device + to another.{" "} + + Find out more. + +

+ ), }, description: { content: @@ -255,6 +265,15 @@ export const consumptionData: PricingDataFeature[] = [ content: "Connections", className: "ui-text-h3", color: "text-neutral-000", + tooltip: ( +

+ Clients establish and maintain a connection to the Ably service using + the most efficient transport available, typically WebSockets.{" "} + + Find out more. + +

+ ), }, description: { content: diff --git a/src/core/Pricing/types.ts b/src/core/Pricing/types.ts index f0f56907..028970fb 100644 --- a/src/core/Pricing/types.ts +++ b/src/core/Pricing/types.ts @@ -5,6 +5,7 @@ type PricingDataHeader = { content: string; className?: string; color?: ColorClass; + tooltip?: string | ReactNode; }; type PricingDataFeatureCta = { diff --git a/src/core/Table/__snapshots__/Table.stories.tsx.snap b/src/core/Table/__snapshots__/Table.stories.tsx.snap index 0cdb2b5a..37894cec 100644 --- a/src/core/Table/__snapshots__/Table.stories.tsx.snap +++ b/src/core/Table/__snapshots__/Table.stories.tsx.snap @@ -63,10 +63,10 @@ exports[`JS Components/Table PricingPage smoke-test 1`] = ` > Label 1 -
+
-
+
-
+
-
+