@uktrade/react-component-library 0.22.8 → 0.22.11
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/Readme.md +11 -1
- package/dist/components/ApiBoundary/ApiBoundary.d.ts +1 -1
- package/dist/components/ApiBoundary/ApiBoundary.d.ts.map +1 -1
- package/dist/components/ApiQuery/ApiProvider.d.ts +1 -1
- package/dist/components/ApiQuery/ApiProvider.d.ts.map +1 -1
- package/dist/components/Arrow/Arrow.d.ts +1 -1
- package/dist/components/Arrow/Arrow.d.ts.map +1 -1
- package/dist/components/Arrows/Arrows.d.ts +1 -1
- package/dist/components/Arrows/Arrows.d.ts.map +1 -1
- package/dist/components/BackLink.d.ts +1 -1
- package/dist/components/BackLink.d.ts.map +1 -1
- package/dist/components/Button.d.ts +1 -1
- package/dist/components/Button.d.ts.map +1 -1
- package/dist/components/Inputs/CheckBoxesInput/CheckBoxGroupInput.d.ts +1 -1
- package/dist/components/Inputs/CheckBoxesInput/CheckBoxGroupInput.d.ts.map +1 -1
- package/dist/components/Inputs/RadioInput/RadioInput.d.ts +1 -1
- package/dist/components/Inputs/RadioInput/RadioInput.d.ts.map +1 -1
- package/dist/components/Inputs/SelectInput/SelectInput.d.ts +1 -1
- package/dist/components/Inputs/SelectInput/SelectInput.d.ts.map +1 -1
- package/dist/components/Inputs/TextAreaInput/TextAreaInput.d.ts +1 -1
- package/dist/components/Inputs/TextAreaInput/TextAreaInput.d.ts.map +1 -1
- package/dist/components/Inputs/TextInput/TextInput.d.ts +1 -1
- package/dist/components/Inputs/TextInput/TextInput.d.ts.map +1 -1
- package/dist/components/NotificationBanner/NotificationBanner.d.ts +4 -2
- package/dist/components/NotificationBanner/NotificationBanner.d.ts.map +1 -1
- package/dist/components/NotificationBanner/NotificationBanner.js +13 -3
- package/dist/components/NotificationBanner/NotificationBanner.module.css +21 -0
- package/dist/components/SummaryList/SummaryList.d.ts +2 -2
- package/dist/components/SummaryList/SummaryList.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip/TooltipInfoIcon.d.ts +1 -1
- package/dist/components/Tooltip/TooltipInfoIcon.d.ts.map +1 -1
- package/dist/components/ViewFormItem/ViewFormItem.d.ts +1 -1
- package/dist/components/ViewFormItem/ViewFormItem.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/components/NotificationBanner/NotificationBanner.module.css +21 -0
- package/src/components/NotificationBanner/NotificationBanner.tsx +37 -8
package/Readme.md
CHANGED
|
@@ -59,8 +59,18 @@ This opens a Vite dev server with the playground for testing components.
|
|
|
59
59
|
|
|
60
60
|
To publish a new version to NPM [@uktrade/react-component-library](https://www.npmjs.com/package/@uktrade/react-component-library):
|
|
61
61
|
|
|
62
|
-
1. **Update the version** in `package.json` following semantic versioning (don’t forget to sync the lockfile as well).
|
|
62
|
+
1. **Update the version** in `package.json` following semantic versioning (don’t forget to sync the lockfile as well (npm install)).
|
|
63
63
|
2. **Commit your changes** on a feature or working branch.
|
|
64
64
|
3. **Open a pull request** and **merge it into `main`**.
|
|
65
65
|
4. **Create a new GitHub Release** from the `main` branch and tag it with the same version (for example, `v0.10.1`).
|
|
66
66
|
5. Once the release is published, the [GitHub Actions workflow](./.github/workflows/release.yml) will automatically build and publish the package to NPM.
|
|
67
|
+
|
|
68
|
+
### Testing
|
|
69
|
+
```bash
|
|
70
|
+
npm run test
|
|
71
|
+
```
|
|
72
|
+
For more commands see package.json.
|
|
73
|
+
|
|
74
|
+
### FAQs
|
|
75
|
+
- Locally testing without publish: simplest way is to build the react-component-library (npm run build) and then copy the dist and src folders from the react-component-library into your react apps node_modules folder, not the cleanest but works for now.
|
|
76
|
+
|
|
@@ -4,6 +4,6 @@ interface ApiBoundaryProps {
|
|
|
4
4
|
error?: React.ReactNode | Error | null;
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
}
|
|
7
|
-
export declare function ApiBoundary({ isLoading, isError, error, children }: ApiBoundaryProps): import("react
|
|
7
|
+
export declare function ApiBoundary({ isLoading, isError, error, children }: ApiBoundaryProps): import("react").JSX.Element;
|
|
8
8
|
export {};
|
|
9
9
|
//# sourceMappingURL=ApiBoundary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiBoundary.d.ts","sourceRoot":"","sources":["../../../src/components/ApiBoundary/ApiBoundary.tsx"],"names":[],"mappings":"AAIA,UAAU,gBAAgB;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,GAAG,IAAI,CAAC;IACvC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,wBAAgB,WAAW,CAAC,EAC1B,SAAS,EACT,OAAe,EACf,KAAK,EACL,QAAQ,EACT,EAAE,gBAAgB
|
|
1
|
+
{"version":3,"file":"ApiBoundary.d.ts","sourceRoot":"","sources":["../../../src/components/ApiBoundary/ApiBoundary.tsx"],"names":[],"mappings":"AAIA,UAAU,gBAAgB;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,GAAG,IAAI,CAAC;IACvC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,wBAAgB,WAAW,CAAC,EAC1B,SAAS,EACT,OAAe,EACf,KAAK,EACL,QAAQ,EACT,EAAE,gBAAgB,+BAalB"}
|
|
@@ -3,7 +3,7 @@ import type { ReactNode } from "react";
|
|
|
3
3
|
export declare function getQueryClient(): QueryClient;
|
|
4
4
|
export declare function ApiProvider({ children }: {
|
|
5
5
|
children: ReactNode;
|
|
6
|
-
}): import("react
|
|
6
|
+
}): import("react").JSX.Element;
|
|
7
7
|
export type ApiQueryState<T> = {
|
|
8
8
|
data?: T;
|
|
9
9
|
isLoading: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiProvider.d.ts","sourceRoot":"","sources":["../../../src/components/ApiQuery/ApiProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EAIX,KAAK,QAAQ,EACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASvC,wBAAgB,cAAc,gBAa7B;AAMD,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE
|
|
1
|
+
{"version":3,"file":"ApiProvider.d.ts","sourceRoot":"","sources":["../../../src/components/ApiQuery/ApiProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EAIX,KAAK,QAAQ,EACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASvC,wBAAgB,cAAc,gBAa7B;AAMD,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,+BAMhE;AAED,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI;IAC7B,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAYF,wBAAgB,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC;;;;;;;;;EAgBjE;AAYD,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,EACrD,UAAU,EAAE,CAAC,SAAS,EAAE,UAAU,KAAK,OAAO,CAAC,KAAK,CAAC;;;;;;;;;EAgBtD"}
|
|
@@ -4,5 +4,5 @@ export type ArrowProps = React.JSX.IntrinsicElements["div"] & {
|
|
|
4
4
|
height?: number;
|
|
5
5
|
active?: boolean;
|
|
6
6
|
};
|
|
7
|
-
export declare const Arrow: ({ className, variant, active, height, children, ...props }: ArrowProps) =>
|
|
7
|
+
export declare const Arrow: ({ className, variant, active, height, children, ...props }: ArrowProps) => React.JSX.Element;
|
|
8
8
|
//# sourceMappingURL=Arrow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Arrow.d.ts","sourceRoot":"","sources":["../../../src/components/Arrow/Arrow.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,GAAG;IAC5D,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,4DAOnB,UAAU,
|
|
1
|
+
{"version":3,"file":"Arrow.d.ts","sourceRoot":"","sources":["../../../src/components/Arrow/Arrow.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,GAAG;IAC5D,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,4DAOnB,UAAU,sBAqBZ,CAAC"}
|
|
@@ -3,5 +3,5 @@ export type ArrowsProps = React.JSX.IntrinsicElements["div"] & {
|
|
|
3
3
|
arrows: string[];
|
|
4
4
|
activeIndex: number;
|
|
5
5
|
};
|
|
6
|
-
export declare const Arrows: ({ className, arrows, activeIndex }: ArrowsProps) =>
|
|
6
|
+
export declare const Arrows: ({ className, arrows, activeIndex }: ArrowsProps) => React.JSX.Element;
|
|
7
7
|
//# sourceMappingURL=Arrows.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Arrows.d.ts","sourceRoot":"","sources":["../../../src/components/Arrows/Arrows.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,GAAG;IAC7D,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,oCAAoC,WAAW,
|
|
1
|
+
{"version":3,"file":"Arrows.d.ts","sourceRoot":"","sources":["../../../src/components/Arrows/Arrows.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,GAAG;IAC7D,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,oCAAoC,WAAW,sBAarE,CAAC"}
|
|
@@ -5,5 +5,5 @@ export interface BackLinkProps {
|
|
|
5
5
|
onClick?: MouseEventHandler<HTMLAnchorElement>;
|
|
6
6
|
className?: string;
|
|
7
7
|
}
|
|
8
|
-
export declare function BackLink({ text, href, onClick, className, }: BackLinkProps): import("react
|
|
8
|
+
export declare function BackLink({ text, href, onClick, className, }: BackLinkProps): import("react").JSX.Element;
|
|
9
9
|
//# sourceMappingURL=BackLink.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackLink.d.ts","sourceRoot":"","sources":["../../src/components/BackLink.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG1D,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,QAAQ,CAAC,EACvB,IAAa,EACb,IAAU,EACV,OAAO,EACP,SAAS,GACV,EAAE,aAAa
|
|
1
|
+
{"version":3,"file":"BackLink.d.ts","sourceRoot":"","sources":["../../src/components/BackLink.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG1D,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,QAAQ,CAAC,EACvB,IAAa,EACb,IAAU,EACV,OAAO,EACP,SAAS,GACV,EAAE,aAAa,+BAUf"}
|
|
@@ -3,6 +3,6 @@ type Props = JSX.IntrinsicElements["button"] & {
|
|
|
3
3
|
children: ReactNode;
|
|
4
4
|
variant?: "primary" | "secondary" | "warning";
|
|
5
5
|
};
|
|
6
|
-
export declare const Button: ({ variant, className, ...props }: Props) =>
|
|
6
|
+
export declare const Button: ({ variant, className, ...props }: Props) => JSX.Element;
|
|
7
7
|
export {};
|
|
8
8
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5C,KAAK,KAAK,GAAG,GAAG,CAAC,iBAAiB,CAAC,QAAQ,CAAC,GAAG;IAC7C,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;CAC/C,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,kCAA8C,KAAK,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5C,KAAK,KAAK,GAAG,GAAG,CAAC,iBAAiB,CAAC,QAAQ,CAAC,GAAG;IAC7C,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;CAC/C,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,kCAA8C,KAAK,gBAOzE,CAAC"}
|
|
@@ -22,6 +22,6 @@ interface CheckboxGroupProps {
|
|
|
22
22
|
onChange?: (values: string[]) => void;
|
|
23
23
|
values: string[];
|
|
24
24
|
}
|
|
25
|
-
export declare const CheckboxGroup: ({ legend, hint, error, options, name, values, legendAs, legendSize, checkboxSize, onChange, }: CheckboxGroupProps) => import("react
|
|
25
|
+
export declare const CheckboxGroup: ({ legend, hint, error, options, name, values, legendAs, legendSize, checkboxSize, onChange, }: CheckboxGroupProps) => import("react").JSX.Element;
|
|
26
26
|
export {};
|
|
27
27
|
//# sourceMappingURL=CheckBoxGroupInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckBoxGroupInput.d.ts","sourceRoot":"","sources":["../../../../src/components/Inputs/CheckBoxesInput/CheckBoxGroupInput.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,KAAK,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC1C,KAAK,UAAU,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;AAEzC,UAAU,cAAc;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,kBAAkB;IACxB,MAAM,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACnC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACtC,MAAM,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,eAAO,MAAM,aAAa,GAAI,+FAW3B,kBAAkB,
|
|
1
|
+
{"version":3,"file":"CheckBoxGroupInput.d.ts","sourceRoot":"","sources":["../../../../src/components/Inputs/CheckBoxesInput/CheckBoxGroupInput.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,KAAK,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC1C,KAAK,UAAU,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;AAEzC,UAAU,cAAc;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,kBAAkB;IACxB,MAAM,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACnC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACtC,MAAM,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,eAAO,MAAM,aAAa,GAAI,+FAW3B,kBAAkB,gCAqFpB,CAAC"}
|
|
@@ -18,6 +18,6 @@ interface RadioGroupProps extends Omit<JSX.IntrinsicElements["input"], "id" | "t
|
|
|
18
18
|
className?: string;
|
|
19
19
|
inline?: boolean;
|
|
20
20
|
}
|
|
21
|
-
export declare const RadioGroup: ({ id, name, label, hint, error, items, labelAs, labelSize, className, inline, ...props }: RadioGroupProps) =>
|
|
21
|
+
export declare const RadioGroup: ({ id, name, label, hint, error, items, labelAs, labelSize, className, inline, ...props }: RadioGroupProps) => JSX.Element;
|
|
22
22
|
export {};
|
|
23
23
|
//# sourceMappingURL=RadioInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioInput.d.ts","sourceRoot":"","sources":["../../../../src/components/Inputs/RadioInput/RadioInput.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5C,KAAK,OAAO,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACzC,KAAK,SAAS,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;AAExC,UAAU,SAAS;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;CACpB;AAED,UAAU,eACN,SAAQ,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC3D,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,UAAU,GAAI,0FAYxB,eAAe,
|
|
1
|
+
{"version":3,"file":"RadioInput.d.ts","sourceRoot":"","sources":["../../../../src/components/Inputs/RadioInput/RadioInput.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5C,KAAK,OAAO,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACzC,KAAK,SAAS,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;AAExC,UAAU,SAAS;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;CACpB;AAED,UAAU,eACN,SAAQ,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC3D,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,UAAU,GAAI,0FAYxB,eAAe,gBAwGjB,CAAC"}
|
|
@@ -17,6 +17,6 @@ interface SelectInputProps extends SelectProps {
|
|
|
17
17
|
className?: string;
|
|
18
18
|
tooltip?: string;
|
|
19
19
|
}
|
|
20
|
-
export declare const SelectInput: ({ id, label, hint, error, options, placeholder, labelAs, labelSize, className, tooltip, ...props }: SelectInputProps) =>
|
|
20
|
+
export declare const SelectInput: ({ id, label, hint, error, options, placeholder, labelAs, labelSize, className, tooltip, ...props }: SelectInputProps) => JSX.Element;
|
|
21
21
|
export {};
|
|
22
22
|
//# sourceMappingURL=SelectInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInput.d.ts","sourceRoot":"","sources":["../../../../src/components/Inputs/SelectInput/SelectInput.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAI5C,KAAK,OAAO,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACzC,KAAK,SAAS,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;AACxC,KAAK,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,CAAC;AAE/D,UAAU,gBAAiB,SAAQ,WAAW;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,WAAW,GAAI,oGAYzB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"SelectInput.d.ts","sourceRoot":"","sources":["../../../../src/components/Inputs/SelectInput/SelectInput.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAI5C,KAAK,OAAO,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACzC,KAAK,SAAS,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;AACxC,KAAK,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,CAAC;AAE/D,UAAU,gBAAiB,SAAQ,WAAW;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,WAAW,GAAI,oGAYzB,gBAAgB,gBA2ElB,CAAC"}
|
|
@@ -11,6 +11,6 @@ interface TextareaInputProps extends Omit<JSX.IntrinsicElements["textarea"], "id
|
|
|
11
11
|
rows?: number;
|
|
12
12
|
className?: string;
|
|
13
13
|
}
|
|
14
|
-
export declare const TextAreaInput: ({ id, label, hint, error, labelAs, labelSize, rows, className, ...props }: TextareaInputProps) =>
|
|
14
|
+
export declare const TextAreaInput: ({ id, label, hint, error, labelAs, labelSize, rows, className, ...props }: TextareaInputProps) => JSX.Element;
|
|
15
15
|
export {};
|
|
16
16
|
//# sourceMappingURL=TextAreaInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextAreaInput.d.ts","sourceRoot":"","sources":["../../../../src/components/Inputs/TextAreaInput/TextAreaInput.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAG5C,KAAK,OAAO,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACzC,KAAK,SAAS,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;AAExC,UAAU,kBACN,SAAQ,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC;IACrD,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,aAAa,GAAI,2EAU3B,kBAAkB,
|
|
1
|
+
{"version":3,"file":"TextAreaInput.d.ts","sourceRoot":"","sources":["../../../../src/components/Inputs/TextAreaInput/TextAreaInput.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAG5C,KAAK,OAAO,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACzC,KAAK,SAAS,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;AAExC,UAAU,kBACN,SAAQ,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC;IACrD,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,aAAa,GAAI,2EAU3B,kBAAkB,gBA6DpB,CAAC"}
|
|
@@ -13,6 +13,6 @@ interface TextInputProps extends InputProps {
|
|
|
13
13
|
suffix?: ReactNode;
|
|
14
14
|
tooltip?: string;
|
|
15
15
|
}
|
|
16
|
-
export declare const TextInput: ({ id, label, hint, error, width, labelSize, labelAs, className, placeholder, suffix, tooltip, ...props }: TextInputProps) =>
|
|
16
|
+
export declare const TextInput: ({ id, label, hint, error, width, labelSize, labelAs, className, placeholder, suffix, tooltip, ...props }: TextInputProps) => JSX.Element;
|
|
17
17
|
export {};
|
|
18
18
|
//# sourceMappingURL=TextInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../../../src/components/Inputs/TextInput/TextInput.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAI5C,KAAK,OAAO,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACzC,KAAK,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC;AAE7D,UAAU,cAAe,SAAQ,UAAU;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC3B,SAAS,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,GAAI,0GAavB,cAAc,
|
|
1
|
+
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../../../src/components/Inputs/TextInput/TextInput.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAI5C,KAAK,OAAO,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACzC,KAAK,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC;AAE7D,UAAU,cAAe,SAAQ,UAAU;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC3B,SAAS,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,GAAI,0GAavB,cAAc,gBA8EhB,CAAC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
+
type NotificationVariant = "neutral" | "success" | "error";
|
|
2
3
|
type Props = {
|
|
3
4
|
title: string;
|
|
4
5
|
heading?: string;
|
|
5
6
|
children: ReactNode;
|
|
6
|
-
variant?:
|
|
7
|
+
variant?: NotificationVariant;
|
|
7
8
|
className?: string;
|
|
9
|
+
fullWidth?: boolean;
|
|
8
10
|
onClose?: () => void;
|
|
9
11
|
};
|
|
10
|
-
export declare const NotificationBanner: ({ title, heading, children, variant, className, onClose, }: Props) => import("react
|
|
12
|
+
export declare const NotificationBanner: ({ title, heading, children, variant, className, fullWidth, onClose, }: Props) => import("react").JSX.Element;
|
|
11
13
|
export {};
|
|
12
14
|
//# sourceMappingURL=NotificationBanner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationBanner.d.ts","sourceRoot":"","sources":["../../../src/components/NotificationBanner/NotificationBanner.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"NotificationBanner.d.ts","sourceRoot":"","sources":["../../../src/components/NotificationBanner/NotificationBanner.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,KAAK,mBAAmB,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAE3D,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAQF,eAAO,MAAM,kBAAkB,GAAI,uEAQhC,KAAK,gCA4DP,CAAC"}
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import clsx from "clsx";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import styles from "./NotificationBanner.module.css";
|
|
5
|
+
const variantClassMap = {
|
|
6
|
+
neutral: null, // GOV.UK default (blue)
|
|
7
|
+
success: "govuk-notification-banner--success",
|
|
8
|
+
error: styles.error, // custom error class
|
|
9
|
+
};
|
|
10
|
+
export const NotificationBanner = ({ title, heading, children, variant = "neutral", className, fullWidth, onClose, }) => {
|
|
11
|
+
const bannerClass = clsx("govuk-notification-banner", variantClassMap[variant], className);
|
|
12
|
+
// Neutral and success banners use role="region" because they're informational.
|
|
13
|
+
// Errors use role="alert" so screen readers announce them immediately.
|
|
14
|
+
// GDS Design: https://design-system.service.gov.uk/components/notification-banner/
|
|
15
|
+
const ariaRole = variant === "error" ? "alert" : "region";
|
|
16
|
+
return (_jsxs("div", { className: bannerClass, role: ariaRole, "aria-labelledby": "govuk-notification-banner-title", "data-module": "govuk-notification-banner", children: [_jsx("div", { className: "govuk-notification-banner__header", children: _jsx("h2", { className: "govuk-notification-banner__title", id: "govuk-notification-banner-title", children: title }) }), _jsxs("div", { className: clsx("govuk-notification-banner__content", fullWidth && styles.fullWidthContent), children: [heading && (_jsx("h3", { className: "govuk-notification-banner__heading", children: heading })), _jsx("p", { className: "govuk-body", children: children }), onClose && (_jsx("button", { className: clsx("govuk-link", "govuk-body-s", "govuk-!-margin-0", styles.closeButton), onClick: onClose, "aria-label": "Close notification", children: "Close" }))] })] }));
|
|
7
17
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.error {
|
|
2
|
+
border-color: #d4351c;
|
|
3
|
+
background-color: #d4351c;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.error .govuk-notification-banner__title {
|
|
7
|
+
color: #d4351c;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.fullWidthContent > p {
|
|
11
|
+
max-width: none !important;
|
|
12
|
+
width: 100%;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.closeButton {
|
|
16
|
+
background: none;
|
|
17
|
+
border: none;
|
|
18
|
+
padding: 0;
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
color: #1d70b8;
|
|
21
|
+
}
|
|
@@ -6,7 +6,7 @@ export interface SummaryListProps extends React.HTMLAttributes<HTMLDListElement>
|
|
|
6
6
|
actions?: SummaryListAction[];
|
|
7
7
|
className?: string;
|
|
8
8
|
}
|
|
9
|
-
export declare const SummaryList: ({ title, children, className, ...props }: SummaryListProps) =>
|
|
9
|
+
export declare const SummaryList: ({ title, children, className, ...props }: SummaryListProps) => React.JSX.Element;
|
|
10
10
|
export interface SummaryCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
11
11
|
title: string;
|
|
12
12
|
titleTag?: React.ReactNode;
|
|
@@ -16,5 +16,5 @@ export interface SummaryCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
16
16
|
titleBackground?: string;
|
|
17
17
|
subSectionNode?: React.ReactNode;
|
|
18
18
|
}
|
|
19
|
-
export declare const SummaryCard: ({ title, titleTag, children, actions, className, titleBackground, subSectionNode, ...props }: SummaryCardProps) =>
|
|
19
|
+
export declare const SummaryCard: ({ title, titleTag, children, actions, className, titleBackground, subSectionNode, ...props }: SummaryCardProps) => React.JSX.Element;
|
|
20
20
|
//# sourceMappingURL=SummaryList.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SummaryList.d.ts","sourceRoot":"","sources":["../../../src/components/SummaryList/SummaryList.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAG/D,MAAM,WAAW,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC;IAC9E,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,WAAW,GAAI,0CAA0C,gBAAgB,
|
|
1
|
+
{"version":3,"file":"SummaryList.d.ts","sourceRoot":"","sources":["../../../src/components/SummaryList/SummaryList.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAG/D,MAAM,WAAW,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC;IAC9E,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,WAAW,GAAI,0CAA0C,gBAAgB,sBAOrF,CAAC;AAEF,MAAM,WAAW,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5E,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAClC;AAED,eAAO,MAAM,WAAW,GAAI,8FASzB,gBAAgB,sBAkDlB,CAAC"}
|
|
@@ -3,6 +3,6 @@ interface TooltipProps {
|
|
|
3
3
|
label?: string;
|
|
4
4
|
className?: string;
|
|
5
5
|
}
|
|
6
|
-
export declare const Tooltip: ({ text, label, className, }: TooltipProps) => import("react
|
|
6
|
+
export declare const Tooltip: ({ text, label, className, }: TooltipProps) => import("react").JSX.Element;
|
|
7
7
|
export {};
|
|
8
8
|
//# sourceMappingURL=Tooltip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAOA,UAAU,YAAY;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,OAAO,GAAI,6BAIrB,YAAY,
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAOA,UAAU,YAAY;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,OAAO,GAAI,6BAIrB,YAAY,gCAuDd,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { SVGProps } from "react";
|
|
2
|
-
export declare const TooltipInfoIcon: (props: SVGProps<SVGSVGElement>) => import("react
|
|
2
|
+
export declare const TooltipInfoIcon: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=TooltipInfoIcon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TooltipInfoIcon.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/TooltipInfoIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtC,eAAO,MAAM,eAAe,GACxB,OAAO,QAAQ,CAAC,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"TooltipInfoIcon.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/TooltipInfoIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtC,eAAO,MAAM,eAAe,GACxB,OAAO,QAAQ,CAAC,aAAa,CAAC,gCAiBjC,CAAC"}
|
|
@@ -6,6 +6,6 @@ interface LinkAndTagItemProps {
|
|
|
6
6
|
children?: ReactNode;
|
|
7
7
|
tags?: TagProps[];
|
|
8
8
|
}
|
|
9
|
-
export declare const ViewFormItem: ({ name, href, children, tags, }: LinkAndTagItemProps) => import("react
|
|
9
|
+
export declare const ViewFormItem: ({ name, href, children, tags, }: LinkAndTagItemProps) => import("react").JSX.Element;
|
|
10
10
|
export {};
|
|
11
11
|
//# sourceMappingURL=ViewFormItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewFormItem.d.ts","sourceRoot":"","sources":["../../../src/components/ViewFormItem/ViewFormItem.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAY,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAIvD,UAAU,mBAAmB;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC;CACnB;AAED,eAAO,MAAM,YAAY,GAAI,iCAK1B,mBAAmB,
|
|
1
|
+
{"version":3,"file":"ViewFormItem.d.ts","sourceRoot":"","sources":["../../../src/components/ViewFormItem/ViewFormItem.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAY,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAIvD,UAAU,mBAAmB;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC;CACnB;AAED,eAAO,MAAM,YAAY,GAAI,iCAK1B,mBAAmB,gCAmBrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uktrade/react-component-library",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.11",
|
|
4
4
|
"description": "A collection of reusable React components following GOV.UK design patterns.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -74,6 +74,6 @@
|
|
|
74
74
|
"dependencies": {
|
|
75
75
|
"@tanstack/react-query": "^5.90.20",
|
|
76
76
|
"clsx": "^2.1.0",
|
|
77
|
-
"openapi-fetch": "^0.
|
|
77
|
+
"openapi-fetch": "^0.17.0"
|
|
78
78
|
}
|
|
79
79
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.error {
|
|
2
|
+
border-color: #d4351c;
|
|
3
|
+
background-color: #d4351c;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.error .govuk-notification-banner__title {
|
|
7
|
+
color: #d4351c;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.fullWidthContent > p {
|
|
11
|
+
max-width: none !important;
|
|
12
|
+
width: 100%;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.closeButton {
|
|
16
|
+
background: none;
|
|
17
|
+
border: none;
|
|
18
|
+
padding: 0;
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
color: #1d70b8;
|
|
21
|
+
}
|
|
@@ -2,34 +2,50 @@
|
|
|
2
2
|
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import type { ReactNode } from "react";
|
|
5
|
+
import styles from "./NotificationBanner.module.css";
|
|
6
|
+
|
|
7
|
+
type NotificationVariant = "neutral" | "success" | "error";
|
|
5
8
|
|
|
6
9
|
type Props = {
|
|
7
10
|
title: string;
|
|
8
11
|
heading?: string;
|
|
9
12
|
children: ReactNode;
|
|
10
|
-
variant?:
|
|
13
|
+
variant?: NotificationVariant;
|
|
11
14
|
className?: string;
|
|
15
|
+
fullWidth?: boolean;
|
|
12
16
|
onClose?: () => void;
|
|
13
17
|
};
|
|
14
18
|
|
|
19
|
+
const variantClassMap: Record<NotificationVariant, string | null> = {
|
|
20
|
+
neutral: null, // GOV.UK default (blue)
|
|
21
|
+
success: "govuk-notification-banner--success",
|
|
22
|
+
error: styles.error, // custom error class
|
|
23
|
+
};
|
|
24
|
+
|
|
15
25
|
export const NotificationBanner = ({
|
|
16
26
|
title,
|
|
17
27
|
heading,
|
|
18
28
|
children,
|
|
19
|
-
variant,
|
|
29
|
+
variant = "neutral",
|
|
20
30
|
className,
|
|
31
|
+
fullWidth,
|
|
21
32
|
onClose,
|
|
22
33
|
}: Props) => {
|
|
23
34
|
const bannerClass = clsx(
|
|
24
35
|
"govuk-notification-banner",
|
|
25
|
-
variant
|
|
36
|
+
variantClassMap[variant],
|
|
26
37
|
className
|
|
27
38
|
);
|
|
28
39
|
|
|
40
|
+
// Neutral and success banners use role="region" because they're informational.
|
|
41
|
+
// Errors use role="alert" so screen readers announce them immediately.
|
|
42
|
+
// GDS Design: https://design-system.service.gov.uk/components/notification-banner/
|
|
43
|
+
const ariaRole = variant === "error" ? "alert" : "region";
|
|
44
|
+
|
|
29
45
|
return (
|
|
30
46
|
<div
|
|
31
47
|
className={bannerClass}
|
|
32
|
-
role=
|
|
48
|
+
role={ariaRole}
|
|
33
49
|
aria-labelledby="govuk-notification-banner-title"
|
|
34
50
|
data-module="govuk-notification-banner"
|
|
35
51
|
>
|
|
@@ -41,17 +57,30 @@ export const NotificationBanner = ({
|
|
|
41
57
|
{title}
|
|
42
58
|
</h2>
|
|
43
59
|
</div>
|
|
44
|
-
|
|
60
|
+
|
|
61
|
+
<div
|
|
62
|
+
className={clsx(
|
|
63
|
+
"govuk-notification-banner__content",
|
|
64
|
+
fullWidth && styles.fullWidthContent
|
|
65
|
+
)}
|
|
66
|
+
>
|
|
67
|
+
|
|
45
68
|
{heading && (
|
|
46
69
|
<h3 className="govuk-notification-banner__heading">
|
|
47
70
|
{heading}
|
|
48
71
|
</h3>
|
|
49
72
|
)}
|
|
73
|
+
|
|
50
74
|
<p className="govuk-body">{children}</p>
|
|
75
|
+
|
|
51
76
|
{onClose && (
|
|
52
77
|
<button
|
|
53
|
-
className=
|
|
54
|
-
|
|
78
|
+
className={clsx(
|
|
79
|
+
"govuk-link",
|
|
80
|
+
"govuk-body-s",
|
|
81
|
+
"govuk-!-margin-0",
|
|
82
|
+
styles.closeButton
|
|
83
|
+
)}
|
|
55
84
|
onClick={onClose}
|
|
56
85
|
aria-label="Close notification"
|
|
57
86
|
>
|
|
@@ -61,4 +90,4 @@ export const NotificationBanner = ({
|
|
|
61
90
|
</div>
|
|
62
91
|
</div>
|
|
63
92
|
);
|
|
64
|
-
};
|
|
93
|
+
};
|