@i-dot-ai-npm/component-library-react 0.0.9 → 0.0.10
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/package.json +2 -2
- package/src/footer/Footer.tsx +3 -3
- package/src/modal/Modal.tsx +4 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@i-dot-ai-npm/component-library-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"description": "React components for i.AI GOV.UK.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"repository": {
|
|
30
30
|
"type": "git",
|
|
31
|
-
"url": "git+https://github.com/i-dot-ai/
|
|
31
|
+
"url": "git+https://github.com/i-dot-ai/design-kit.git",
|
|
32
32
|
"directory": "packages/react"
|
|
33
33
|
},
|
|
34
34
|
"publishConfig": {
|
package/src/footer/Footer.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
|
2
2
|
|
|
3
3
|
type FooterLink = { href?: string; text?: string; attributes?: Record<string, string> };
|
|
4
4
|
|
|
5
|
-
type FooterProps = ComponentPropsWithoutRef<'
|
|
5
|
+
type FooterProps = ComponentPropsWithoutRef<'footer'> & {
|
|
6
6
|
/** Support links shown in the inline list (e.g. Accessibility statement, Cookies, Privacy). */
|
|
7
7
|
links?: FooterLink[];
|
|
8
8
|
/** Visually-hidden heading above the support links. */
|
|
@@ -26,7 +26,7 @@ export default function Footer({
|
|
|
26
26
|
.join(' ');
|
|
27
27
|
|
|
28
28
|
return (
|
|
29
|
-
<
|
|
29
|
+
<footer className={classes} {...rest}>
|
|
30
30
|
<div className={containerClass}>
|
|
31
31
|
<div className="govuk-footer__meta">
|
|
32
32
|
<div className="govuk-footer__meta-item govuk-footer__meta-item--grow">
|
|
@@ -58,6 +58,6 @@ export default function Footer({
|
|
|
58
58
|
<div className="govuk-footer__meta-item">{children}</div>
|
|
59
59
|
</div>
|
|
60
60
|
</div>
|
|
61
|
-
</
|
|
61
|
+
</footer>
|
|
62
62
|
);
|
|
63
63
|
}
|
package/src/modal/Modal.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useEffect, useRef } from "react";
|
|
2
2
|
import type { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
3
|
+
import { initModal, openModal, closeModal } from "@i-dot-ai-npm/component-library-frontend";
|
|
3
4
|
|
|
4
5
|
type ModalProps = Omit<ComponentPropsWithoutRef<"dialog">, "onClose"> & {
|
|
5
6
|
class?: string;
|
|
@@ -27,14 +28,9 @@ export default function Modal({
|
|
|
27
28
|
useEffect(() => {
|
|
28
29
|
const dialog = ref.current;
|
|
29
30
|
if (!dialog) return;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
initModal(dialog);
|
|
34
|
-
if (open) openModal(dialog);
|
|
35
|
-
else closeModal(dialog);
|
|
36
|
-
},
|
|
37
|
-
);
|
|
31
|
+
initModal(dialog);
|
|
32
|
+
if (open) openModal(dialog);
|
|
33
|
+
else closeModal(dialog);
|
|
38
34
|
}, [open]);
|
|
39
35
|
|
|
40
36
|
useEffect(() => {
|