@uktrade/react-component-library 0.22.7 → 0.22.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.
Files changed (46) hide show
  1. package/Readme.md +11 -1
  2. package/dist/components/ApiBoundary/ApiBoundary.d.ts +1 -1
  3. package/dist/components/ApiBoundary/ApiBoundary.d.ts.map +1 -1
  4. package/dist/components/ApiQuery/ApiProvider.d.ts +1 -1
  5. package/dist/components/ApiQuery/ApiProvider.d.ts.map +1 -1
  6. package/dist/components/Arrow/Arrow.d.ts +1 -1
  7. package/dist/components/Arrow/Arrow.d.ts.map +1 -1
  8. package/dist/components/Arrows/Arrows.d.ts +1 -1
  9. package/dist/components/Arrows/Arrows.d.ts.map +1 -1
  10. package/dist/components/BackLink.d.ts +1 -1
  11. package/dist/components/BackLink.d.ts.map +1 -1
  12. package/dist/components/Button.d.ts +1 -1
  13. package/dist/components/Button.d.ts.map +1 -1
  14. package/dist/components/Inputs/CheckBoxesInput/CheckBoxGroupInput.d.ts +1 -1
  15. package/dist/components/Inputs/CheckBoxesInput/CheckBoxGroupInput.d.ts.map +1 -1
  16. package/dist/components/Inputs/RadioInput/RadioInput.d.ts +1 -1
  17. package/dist/components/Inputs/RadioInput/RadioInput.d.ts.map +1 -1
  18. package/dist/components/Inputs/SelectInput/SelectInput.d.ts +1 -1
  19. package/dist/components/Inputs/SelectInput/SelectInput.d.ts.map +1 -1
  20. package/dist/components/Inputs/TextAreaInput/TextAreaInput.d.ts +1 -1
  21. package/dist/components/Inputs/TextAreaInput/TextAreaInput.d.ts.map +1 -1
  22. package/dist/components/Inputs/TextInput/TextInput.d.ts +1 -1
  23. package/dist/components/Inputs/TextInput/TextInput.d.ts.map +1 -1
  24. package/dist/components/NotificationBanner/NotificationBanner.d.ts +4 -2
  25. package/dist/components/NotificationBanner/NotificationBanner.d.ts.map +1 -1
  26. package/dist/components/NotificationBanner/NotificationBanner.js +13 -3
  27. package/dist/components/NotificationBanner/NotificationBanner.module.css +26 -0
  28. package/dist/components/SummaryList/SummaryList.d.ts +2 -2
  29. package/dist/components/SummaryList/SummaryList.d.ts.map +1 -1
  30. package/dist/components/Table/Table.d.ts +21 -0
  31. package/dist/components/Table/Table.d.ts.map +1 -0
  32. package/dist/components/Table/Table.js +6 -0
  33. package/dist/components/Tooltip/Tooltip.d.ts +1 -1
  34. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  35. package/dist/components/Tooltip/TooltipInfoIcon.d.ts +1 -1
  36. package/dist/components/Tooltip/TooltipInfoIcon.d.ts.map +1 -1
  37. package/dist/components/ViewFormItem/ViewFormItem.d.ts +1 -1
  38. package/dist/components/ViewFormItem/ViewFormItem.d.ts.map +1 -1
  39. package/dist/index.d.ts +1 -0
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +1 -0
  42. package/package.json +2 -2
  43. package/src/components/NotificationBanner/NotificationBanner.module.css +26 -0
  44. package/src/components/NotificationBanner/NotificationBanner.tsx +37 -8
  45. package/src/components/Table/Table.tsx +78 -0
  46. package/src/index.ts +1 -0
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/jsx-runtime").JSX.Element;
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,2CAalB"}
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/jsx-runtime").JSX.Element;
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,2CAMhE;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"}
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) => import("react/jsx-runtime").JSX.Element;
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,4CAqBZ,CAAC"}
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) => import("react/jsx-runtime").JSX.Element;
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,4CAarE,CAAC"}
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/jsx-runtime").JSX.Element;
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,2CAUf"}
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) => import("react/jsx-runtime").JSX.Element;
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,4CAOzE,CAAC"}
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/jsx-runtime").JSX.Element;
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,4CAqFpB,CAAC"}
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) => import("react/jsx-runtime").JSX.Element;
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,4CAwGjB,CAAC"}
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) => import("react/jsx-runtime").JSX.Element;
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,4CA2ElB,CAAC"}
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) => import("react/jsx-runtime").JSX.Element;
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,4CA6DpB,CAAC"}
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) => import("react/jsx-runtime").JSX.Element;
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,4CA8EhB,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?: "success";
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/jsx-runtime").JSX.Element;
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;AAEvC,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,4DAOhC,KAAK,4CA0CP,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
- export const NotificationBanner = ({ title, heading, children, variant, className, onClose, }) => {
5
- const bannerClass = clsx("govuk-notification-banner", variant === "success" && "govuk-notification-banner--success", className);
6
- return (_jsxs("div", { className: bannerClass, role: "alert", "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: "govuk-notification-banner__content", children: [heading && (_jsx("h3", { className: "govuk-notification-banner__heading", children: heading })), _jsx("p", { className: "govuk-body", children: children }), onClose && (_jsx("button", { className: "govuk-link govuk-body-s govuk-!-margin-0", style: { background: "none", border: "none", padding: 0, cursor: "pointer", color: "#1d70b8" }, onClick: onClose, "aria-label": "Close notification", children: "Close" }))] })] }));
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,26 @@
1
+ :root {
2
+ --error-colour: #d4351c;
3
+ --neutral-color: #1d70b8;
4
+ }
5
+
6
+ .error {
7
+ border-color: var(--error-colour);
8
+ background-color: var(--error-colour);
9
+ }
10
+
11
+ .error .govuk-notification-banner__title {
12
+ color: var(--error-colour);
13
+ }
14
+
15
+ .fullWidthContent > p {
16
+ max-width: none !important;
17
+ width: 100%;
18
+ }
19
+
20
+ .closeButton {
21
+ background: none;
22
+ border: none;
23
+ padding: 0;
24
+ cursor: pointer;
25
+ color: var(--neutral-color);
26
+ }
@@ -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) => import("react/jsx-runtime").JSX.Element;
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) => import("react/jsx-runtime").JSX.Element;
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,4CAOrF,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,4CAkDlB,CAAC"}
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"}
@@ -0,0 +1,21 @@
1
+ import type React from "react";
2
+ export type TableHeader = {
3
+ content: React.ReactNode;
4
+ className?: string;
5
+ };
6
+ export type TableCell = {
7
+ content: React.ReactNode;
8
+ className?: string;
9
+ isHeader?: boolean;
10
+ };
11
+ export type TableRow = {
12
+ cells: TableCell[];
13
+ };
14
+ export type TableProps = {
15
+ headers: TableHeader[];
16
+ rows: TableRow[];
17
+ caption?: string;
18
+ className?: string;
19
+ };
20
+ export declare const Table: ({ headers, rows, caption, className, }: TableProps) => React.JSX.Element;
21
+ //# sourceMappingURL=Table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../src/components/Table/Table.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,SAAS,EAAE,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,wCAKnB,UAAU,KAAG,KAAK,CAAC,GAAG,CAAC,OA6CzB,CAAC"}
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import clsx from "clsx";
4
+ export const Table = ({ headers, rows, caption, className, }) => {
5
+ return (_jsxs("table", { className: clsx("govuk-table", className), children: [caption && _jsx("caption", { className: "govuk-table__caption", children: caption }), _jsx("thead", { className: "govuk-table__head", children: _jsx("tr", { className: "govuk-table__row", children: headers.map((header, index) => (_jsx("th", { scope: "col", className: clsx("govuk-table__header", header.className), children: header.content }, index))) }) }), _jsx("tbody", { className: "govuk-table__body", children: rows.map((row, rowIndex) => (_jsx("tr", { className: "govuk-table__row", children: row.cells.map((cell, cellIndex) => cell.isHeader ? (_jsx("th", { scope: "row", className: clsx("govuk-table__header", cell.className), children: cell.content }, cellIndex)) : (_jsx("td", { className: clsx("govuk-table__cell", cell.className), children: cell.content }, cellIndex))) }, rowIndex))) })] }));
6
+ };
@@ -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/jsx-runtime").JSX.Element;
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,4CAuDd,CAAC"}
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/jsx-runtime").JSX.Element;
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,4CAiBjC,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/jsx-runtime").JSX.Element;
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,4CAmBrB,CAAC"}
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/dist/index.d.ts CHANGED
@@ -16,4 +16,5 @@ export * from "./components/NotificationBanner/NotificationBanner";
16
16
  export * from "./components/Details/Details";
17
17
  export * from "./components/Tooltip/Tooltip";
18
18
  export * from "./components/Tabs/Tabs";
19
+ export * from "./components/Table/Table";
19
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,wCAAwC,CAAC;AACvD,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4CAA4C,CAAC;AAC3D,cAAc,sCAAsC,CAAC;AACrD,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oDAAoD,CAAC;AACnE,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,wCAAwC,CAAC;AACvD,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4CAA4C,CAAC;AAC3D,cAAc,sCAAsC,CAAC;AACrD,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oDAAoD,CAAC;AACnE,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC"}
package/dist/index.js CHANGED
@@ -16,3 +16,4 @@ export * from "./components/NotificationBanner/NotificationBanner";
16
16
  export * from "./components/Details/Details";
17
17
  export * from "./components/Tooltip/Tooltip";
18
18
  export * from "./components/Tabs/Tabs";
19
+ export * from "./components/Table/Table";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uktrade/react-component-library",
3
- "version": "0.22.7",
3
+ "version": "0.22.10",
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.15.0"
77
+ "openapi-fetch": "^0.17.0"
78
78
  }
79
79
  }
@@ -0,0 +1,26 @@
1
+ :root {
2
+ --error-colour: #d4351c;
3
+ --neutral-color: #1d70b8;
4
+ }
5
+
6
+ .error {
7
+ border-color: var(--error-colour);
8
+ background-color: var(--error-colour);
9
+ }
10
+
11
+ .error .govuk-notification-banner__title {
12
+ color: var(--error-colour);
13
+ }
14
+
15
+ .fullWidthContent > p {
16
+ max-width: none !important;
17
+ width: 100%;
18
+ }
19
+
20
+ .closeButton {
21
+ background: none;
22
+ border: none;
23
+ padding: 0;
24
+ cursor: pointer;
25
+ color: var(--neutral-color);
26
+ }
@@ -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?: "success"; // only supported 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 === "success" && "govuk-notification-banner--success",
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="alert"
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
- <div className="govuk-notification-banner__content">
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="govuk-link govuk-body-s govuk-!-margin-0"
54
- style={{ background: "none", border: "none", padding: 0, cursor: "pointer", color: "#1d70b8" }}
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
+ };
@@ -0,0 +1,78 @@
1
+ "use client";
2
+
3
+ import clsx from "clsx";
4
+ import type React from "react";
5
+
6
+ export type TableHeader = {
7
+ content: React.ReactNode;
8
+ className?: string;
9
+ };
10
+
11
+ export type TableCell = {
12
+ content: React.ReactNode;
13
+ className?: string;
14
+ isHeader?: boolean;
15
+ };
16
+
17
+ export type TableRow = {
18
+ cells: TableCell[];
19
+ };
20
+
21
+ export type TableProps = {
22
+ headers: TableHeader[];
23
+ rows: TableRow[];
24
+ caption?: string;
25
+ className?: string;
26
+ };
27
+
28
+ export const Table = ({
29
+ headers,
30
+ rows,
31
+ caption,
32
+ className,
33
+ }: TableProps): React.JSX.Element => {
34
+ return (
35
+ <table className={clsx("govuk-table", className)}>
36
+ {caption && <caption className="govuk-table__caption">{caption}</caption>}
37
+
38
+ <thead className="govuk-table__head">
39
+ <tr className="govuk-table__row">
40
+ {headers.map((header, index) => (
41
+ <th
42
+ key={index}
43
+ scope="col"
44
+ className={clsx("govuk-table__header", header.className)}
45
+ >
46
+ {header.content}
47
+ </th>
48
+ ))}
49
+ </tr>
50
+ </thead>
51
+
52
+ <tbody className="govuk-table__body">
53
+ {rows.map((row, rowIndex) => (
54
+ <tr key={rowIndex} className="govuk-table__row">
55
+ {row.cells.map((cell, cellIndex) =>
56
+ cell.isHeader ? (
57
+ <th
58
+ key={cellIndex}
59
+ scope="row"
60
+ className={clsx("govuk-table__header", cell.className)}
61
+ >
62
+ {cell.content}
63
+ </th>
64
+ ) : (
65
+ <td
66
+ key={cellIndex}
67
+ className={clsx("govuk-table__cell", cell.className)}
68
+ >
69
+ {cell.content}
70
+ </td>
71
+ ),
72
+ )}
73
+ </tr>
74
+ ))}
75
+ </tbody>
76
+ </table>
77
+ );
78
+ };
package/src/index.ts CHANGED
@@ -16,3 +16,4 @@ export * from "./components/NotificationBanner/NotificationBanner";
16
16
  export * from "./components/Details/Details";
17
17
  export * from "./components/Tooltip/Tooltip";
18
18
  export * from "./components/Tabs/Tabs";
19
+ export * from "./components/Table/Table";