@srimandir/pitru-paksh-common 2.24.0 → 2.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -14,6 +14,23 @@ export interface ServiceOfferCardProps extends Omit<React.HTMLAttributes<HTMLDiv
|
|
|
14
14
|
* toggling to "Read less". A non-string node (or a short string) renders as-is.
|
|
15
15
|
*/
|
|
16
16
|
description?: React.ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* CMS-authored HTML for the same copy, rendered as markup instead of text.
|
|
19
|
+
* Takes precedence over `description` when both are given, and is forwarded
|
|
20
|
+
* to the `ServiceOfferSheet` so the card and the sheet show the same copy.
|
|
21
|
+
*
|
|
22
|
+
* Markup can't be sliced by character count the way a string can — a cut
|
|
23
|
+
* lands mid-tag — so this collapses to `descriptionClampLines` lines of CSS
|
|
24
|
+
* clamp instead, with the same "Read more" toggle underneath.
|
|
25
|
+
* `descriptionMaxLength` still decides *whether* it needs one, measured
|
|
26
|
+
* against the copy's text content with the tags stripped out.
|
|
27
|
+
*
|
|
28
|
+
* Only pass copy from a source you trust — it goes through
|
|
29
|
+
* `dangerouslySetInnerHTML`.
|
|
30
|
+
*/
|
|
31
|
+
descriptionHtml?: string;
|
|
32
|
+
/** Lines `descriptionHtml` collapses to before "Read more". Defaults to 2. */
|
|
33
|
+
descriptionClampLines?: number;
|
|
17
34
|
/** Character count above which a string `description` is truncated. Defaults to 40. */
|
|
18
35
|
descriptionMaxLength?: number;
|
|
19
36
|
/** Locale used to translate the default `readMoreLabel`/`readLessLabel` below. Defaults to 'en'. */
|
|
@@ -17,6 +17,12 @@ export interface ServiceOfferSheetProps {
|
|
|
17
17
|
title: React.ReactNode;
|
|
18
18
|
/** Full copy under the title — this is the expanded detail view, so it's shown in full (no truncation). */
|
|
19
19
|
description?: React.ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* CMS-authored HTML for the same copy, rendered as markup instead of text.
|
|
22
|
+
* Takes precedence over `description` when both are given. Only pass copy
|
|
23
|
+
* from a source you trust — it goes through `dangerouslySetInnerHTML`.
|
|
24
|
+
*/
|
|
25
|
+
descriptionHtml?: string;
|
|
20
26
|
/** Final price, e.g. 199. Used both to display and to compute the amount saved. */
|
|
21
27
|
price: number;
|
|
22
28
|
/** Original/base price before discount, e.g. 250. Omit (or equal to `price`) to hide the strike-through and saved badge. */
|