@windstream/react-shared-components 0.2.22 → 0.2.23

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.
@@ -18,7 +18,7 @@ import { toDocument } from "@shared/utils/contentful/to-document";
18
18
 
19
19
  const defaultOptions: Options = {
20
20
  renderMark: {
21
- [MARKS.BOLD]: text => <strong className="label3">{text}</strong>,
21
+ [MARKS.BOLD]: text => <strong>{text}</strong>,
22
22
  [MARKS.ITALIC]: text => <em>{text}</em>,
23
23
  [MARKS.UNDERLINE]: text => <u>{text}</u>,
24
24
  [MARKS.CODE]: text => <code>{text}</code>,
@@ -35,27 +35,27 @@ const defaultOptions: Options = {
35
35
  );
36
36
  },
37
37
  [BLOCKS.HEADING_2]: (node, children) => (
38
- <Text as="h2" className={"heading6 md:heading5"}>
38
+ <Text as="h2" className={"heading3 md:heading2"}>
39
39
  {children}
40
40
  </Text>
41
41
  ),
42
42
  [BLOCKS.HEADING_3]: (node, children) => (
43
- <Text as="h3" className={"heading6 md:heading5"}>
43
+ <Text as="h3" className={"heading4 md:heading3"}>
44
44
  {children}
45
45
  </Text>
46
46
  ),
47
47
  [BLOCKS.HEADING_4]: (node, children) => (
48
- <Text as="h3" className={"headingClass"}>
48
+ <Text as="h4" className={"heading5 md:heading4"}>
49
49
  {children}
50
50
  </Text>
51
51
  ),
52
52
  [BLOCKS.HEADING_5]: (node, children) => (
53
- <Text as="h3" className={"heading6 md:heading5"}>
53
+ <Text as="h5" className={"heading6 md:heading5"}>
54
54
  {children}
55
55
  </Text>
56
56
  ),
57
57
  [BLOCKS.HEADING_6]: (node, children) => (
58
- <Text as="h3" className={"heading6"}>
58
+ <Text as="h6" className={"heading6"}>
59
59
  {children}
60
60
  </Text>
61
61
  ),
@@ -187,17 +187,28 @@ export function renderContentfulRichText(
187
187
 
188
188
  export function useContentfulRichText(
189
189
  doc: Document | null | undefined,
190
- options?: Options
190
+ options?: Options,
191
+ config?: { boldClassName?: string }
191
192
  ): ReactNode | null {
192
193
  return useMemo(() => {
193
194
  if (!doc || !Array.isArray(doc.content)) return null;
194
195
  const merged: Options = {
195
196
  ...defaultOptions,
196
- renderMark: { ...defaultOptions.renderMark, ...options?.renderMark },
197
+ renderMark: {
198
+ ...defaultOptions.renderMark,
199
+ ...(config?.boldClassName
200
+ ? {
201
+ [MARKS.BOLD]: text => (
202
+ <strong className={config.boldClassName}>{text}</strong>
203
+ ),
204
+ }
205
+ : {}),
206
+ ...options?.renderMark,
207
+ },
197
208
  renderNode: { ...defaultOptions.renderNode, ...options?.renderNode },
198
209
  };
199
210
  return documentToReactComponents(doc, merged);
200
- }, [doc, options]);
211
+ }, [doc, options, config?.boldClassName]);
201
212
  }
202
213
  // 1. Remove useMemo and React Hook imports from this specific function's logic
203
214
  export function renderContentfulRichTextTable(
@@ -7,3 +7,8 @@ declare module "*.css" {
7
7
  const content: string;
8
8
  export default content;
9
9
  }
10
+
11
+ declare module "*.svg" {
12
+ const src: string;
13
+ export default src;
14
+ }