@apolitical/component-library 5.2.2 → 5.3.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.
- package/form/components/rich-text-editor/components/context/context.d.ts +5 -0
- package/form/components/rich-text-editor/helpers/handle-text/handle-text.d.ts +1 -0
- package/form/components/rich-text-editor/helpers/transform/transform.d.ts +1 -1
- package/form/components/rich-text-editor/plugins/index.d.ts +1 -0
- package/form/components/rich-text-editor/plugins/with-link-removal-listener/index.d.ts +1 -0
- package/form/components/rich-text-editor/plugins/with-link-removal-listener/with-link-removal-listener.d.ts +6 -0
- package/form/components/rich-text-editor/rich-text-editor.d.ts +2 -42
- package/form/components/rich-text-editor/rich-text-editor.types.d.ts +65 -2
- package/helpers/intl.d.ts +3 -0
- package/index.js +47 -47
- package/index.mjs +4538 -4448
- package/navigation/enriched-url/enriched-url.d.ts +26 -20
- package/navigation/enriched-url/index.d.ts +1 -1
- package/package.json +1 -1
- package/sections/full-width-section/full-width-section.d.ts +0 -2
- package/style.css +1 -1
- package/styles/mixins/_styles.scss +0 -3
- package/styles/variables/colors/_colors.scss +0 -2
- package/styles/variables/colors/theme/_base.scss +1 -2
- package/styles/variables/colors/theme/_layout.scss +2 -2
- package/styles/variables/colors/theme/_navigation.scss +2 -0
|
@@ -1,26 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface IEnrichedUrlData {
|
|
3
|
+
/** An image to show */
|
|
4
|
+
image?: {
|
|
5
|
+
/** The image file */
|
|
6
|
+
src: string;
|
|
7
|
+
/** The width of the image */
|
|
8
|
+
width?: number;
|
|
9
|
+
/** The height of the image */
|
|
10
|
+
height?: number;
|
|
11
|
+
/** The alt text for the image */
|
|
12
|
+
alt?: string;
|
|
13
|
+
};
|
|
14
|
+
/** The url to link to */
|
|
15
|
+
url: string;
|
|
16
|
+
/** The title text to show on the link */
|
|
17
|
+
title: string;
|
|
18
|
+
/** Paragraph text to show on the link; this is only shown on extra-large and large sizes */
|
|
19
|
+
description?: string;
|
|
20
|
+
}
|
|
1
21
|
interface Props {
|
|
2
22
|
/** The style of the link. Defaults to 'default', which shows all of the details. */
|
|
3
23
|
variant?: 'default' | 'condensed';
|
|
4
24
|
/** The data to render in the link */
|
|
5
|
-
data:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
/** The width of the image */
|
|
11
|
-
width?: number;
|
|
12
|
-
/** The height of the image */
|
|
13
|
-
height?: number;
|
|
14
|
-
/** The alt text for the image */
|
|
15
|
-
alt?: string;
|
|
16
|
-
};
|
|
17
|
-
/** The url to link to */
|
|
18
|
-
url: string;
|
|
19
|
-
/** The title text to show on the link */
|
|
20
|
-
title: string;
|
|
21
|
-
/** Paragraph text to show on the link; this is only shown on extra-large and large sizes */
|
|
22
|
-
description?: string;
|
|
23
|
-
};
|
|
25
|
+
data: IEnrichedUrlData;
|
|
26
|
+
/** An optional function to call when the link is clicked, instead of opening the link */
|
|
27
|
+
onClick?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
28
|
+
/** An optional aria-label, so we can explain to screen readers what the onClick will do */
|
|
29
|
+
'aria-label'?: string;
|
|
24
30
|
/** The Google Tag Manager data to be passed to the link */
|
|
25
31
|
gtm?: {
|
|
26
32
|
/** The context of the event for GTM */
|
|
@@ -29,5 +35,5 @@ interface Props {
|
|
|
29
35
|
event?: string;
|
|
30
36
|
};
|
|
31
37
|
}
|
|
32
|
-
declare const EnrichedUrl: ({ variant, data: { image, url, title, description }, gtm, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
declare const EnrichedUrl: ({ variant, data: { image, url, title, description }, onClick, gtm, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
33
39
|
export default EnrichedUrl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as EnrichedUrl } from './enriched-url';
|
|
1
|
+
export { default as EnrichedUrl, type IEnrichedUrlData } from './enriched-url';
|
package/package.json
CHANGED
|
@@ -4,8 +4,6 @@ interface Props {
|
|
|
4
4
|
styling?: {
|
|
5
5
|
/** The background of the section. Defaults to `default` */
|
|
6
6
|
background?: 'default' | 'light' | 'dark';
|
|
7
|
-
/** The size of the padding. Defaults to `none` */
|
|
8
|
-
padding?: 'none' | 'medium' | 'large';
|
|
9
7
|
};
|
|
10
8
|
/** Additional classes */
|
|
11
9
|
className?: string;
|