@scottish-government/designsystem-react 1.0.0 → 1.1.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.
Files changed (109) hide show
  1. package/.storybook/sgdsArgTypes.ts +19 -3
  2. package/CHANGELOG.md +19 -0
  3. package/README.md +1 -5
  4. package/dist/common/AbstractNotificationMessage/AbstractNotificationMessage.d.ts +6 -0
  5. package/dist/common/AbstractNotificationMessage/AbstractNotificationMessage.jsx +34 -0
  6. package/dist/common/AbstractNotificationMessage/index.d.ts +1 -0
  7. package/dist/common/AbstractNotificationMessage/index.js +8 -0
  8. package/dist/common/AbstractNotificationMessage/types.d.ts +9 -0
  9. package/dist/common/AbstractNotificationMessage/types.js +2 -0
  10. package/dist/common/WrapperTag/WrapperTag.d.ts +11 -11
  11. package/dist/components/ConfirmationMessage/ConfirmationMessage.d.ts +18 -2
  12. package/dist/components/ConfirmationMessage/ConfirmationMessage.jsx +21 -17
  13. package/dist/components/ConfirmationNotification/ConfirmationNotification.d.ts +6 -0
  14. package/dist/components/ConfirmationNotification/ConfirmationNotification.jsx +26 -0
  15. package/dist/components/ConfirmationNotification/index.d.ts +1 -0
  16. package/dist/components/ConfirmationNotification/index.js +8 -0
  17. package/dist/components/CookieBanner/CookieBanner.jsx +2 -2
  18. package/dist/components/ErrorNotification/ErrorNotification.d.ts +6 -0
  19. package/dist/components/ErrorNotification/ErrorNotification.jsx +26 -0
  20. package/dist/components/ErrorNotification/index.d.ts +1 -0
  21. package/dist/components/ErrorNotification/index.js +8 -0
  22. package/dist/components/FileUpload/FileUpload.d.ts +6 -0
  23. package/dist/components/FileUpload/FileUpload.jsx +55 -0
  24. package/dist/components/FileUpload/index.d.ts +1 -0
  25. package/dist/components/FileUpload/index.js +8 -0
  26. package/dist/components/FileUpload/types.d.ts +24 -0
  27. package/dist/components/FileUpload/types.js +2 -0
  28. package/dist/components/InfoNotification/InfoNotification.d.ts +6 -0
  29. package/dist/components/InfoNotification/InfoNotification.jsx +26 -0
  30. package/dist/components/InfoNotification/index.d.ts +1 -0
  31. package/dist/components/InfoNotification/index.js +8 -0
  32. package/dist/components/NotificationBanner/NotificationBanner.jsx +1 -1
  33. package/dist/components/SummaryList/SummaryList.d.ts +1 -1
  34. package/dist/components/WarningNotification/WarningNotification.d.ts +6 -0
  35. package/dist/components/WarningNotification/WarningNotification.jsx +26 -0
  36. package/dist/components/WarningNotification/index.d.ts +1 -0
  37. package/dist/components/WarningNotification/index.js +8 -0
  38. package/dist/components/WarningText/WarningText.jsx +4 -1
  39. package/dist/images/icons/index.d.ts +2 -0
  40. package/dist/images/icons/index.js +5 -1
  41. package/dist/images/icons/info.d.ts +4 -0
  42. package/dist/images/icons/info.jsx +40 -0
  43. package/dist/images/icons/warning.d.ts +4 -0
  44. package/dist/images/icons/warning.jsx +40 -0
  45. package/dist/index.d.ts +4 -0
  46. package/dist/index.js +40 -0
  47. package/dist/shared-types.d.ts +35 -0
  48. package/dist/shared-types.js +2 -0
  49. package/dist/tsconfig.tsbuildinfo +1 -0
  50. package/package.json +22 -16
  51. package/src/common/AbstractNotificationMessage/AbstractNotificationMessage.test.tsx +101 -0
  52. package/src/common/AbstractNotificationMessage/AbstractNotificationMessage.tsx +56 -0
  53. package/src/common/AbstractNotificationMessage/index.ts +1 -0
  54. package/src/common/AbstractNotificationMessage/types.ts +10 -0
  55. package/src/components/Button/Button.stories.tsx +1 -1
  56. package/src/components/Card/Card.tsx +2 -2
  57. package/src/components/ConfirmationMessage/ConfirmationMessage.stories.tsx +11 -3
  58. package/src/components/ConfirmationMessage/ConfirmationMessage.test.tsx +58 -23
  59. package/src/components/ConfirmationMessage/ConfirmationMessage.tsx +32 -25
  60. package/src/components/ConfirmationMessage/confirmationmessage.mdx +17 -0
  61. package/src/components/ConfirmationNotification/ConfirmationNotification.stories.tsx +47 -0
  62. package/src/components/ConfirmationNotification/ConfirmationNotification.test.tsx +101 -0
  63. package/src/components/ConfirmationNotification/ConfirmationNotification.tsx +46 -0
  64. package/src/components/ConfirmationNotification/index.ts +1 -0
  65. package/src/components/CookieBanner/CookieBanner.tsx +1 -1
  66. package/src/components/ErrorNotification/ErrorNotification.stories.tsx +47 -0
  67. package/src/components/ErrorNotification/ErrorNotification.test.tsx +101 -0
  68. package/src/components/ErrorNotification/ErrorNotification.tsx +46 -0
  69. package/src/components/ErrorNotification/index.ts +1 -0
  70. package/src/components/FileDownload/FileDownload.test.tsx +1 -1
  71. package/src/components/FileUpload/FileUpload.stories.tsx +77 -0
  72. package/src/components/FileUpload/FileUpload.test.tsx +185 -0
  73. package/src/components/FileUpload/FileUpload.tsx +87 -0
  74. package/src/components/FileUpload/index.ts +1 -0
  75. package/src/components/FileUpload/types.ts +25 -0
  76. package/src/components/InfoNotification/InfoNotification.stories.tsx +47 -0
  77. package/src/components/InfoNotification/InfoNotification.test.tsx +101 -0
  78. package/src/components/InfoNotification/InfoNotification.tsx +46 -0
  79. package/src/components/InfoNotification/index.ts +1 -0
  80. package/src/components/NotificationBanner/NotificationBanner.tsx +1 -1
  81. package/src/components/SummaryList/SummaryList.tsx +1 -1
  82. package/src/components/TextInput/TextInput.stories.tsx +1 -1
  83. package/src/components/WarningNotification/WarningNotification.stories.tsx +47 -0
  84. package/src/components/WarningNotification/WarningNotification.test.tsx +101 -0
  85. package/src/components/WarningNotification/WarningNotification.tsx +46 -0
  86. package/src/components/WarningNotification/index.ts +1 -0
  87. package/src/components/WarningText/WarningText.tsx +4 -1
  88. package/src/images/icons/arrow_upward.tsx +10 -10
  89. package/src/images/icons/calendar_today.tsx +10 -10
  90. package/src/images/icons/cancel.tsx +8 -8
  91. package/src/images/icons/check_circle.tsx +10 -10
  92. package/src/images/icons/chevron_left.tsx +10 -10
  93. package/src/images/icons/chevron_right.tsx +10 -10
  94. package/src/images/icons/close.tsx +10 -10
  95. package/src/images/icons/description.tsx +10 -10
  96. package/src/images/icons/double_chevron_left.tsx +8 -8
  97. package/src/images/icons/double_chevron_right.tsx +8 -8
  98. package/src/images/icons/error.tsx +10 -10
  99. package/src/images/icons/expand_less.tsx +10 -10
  100. package/src/images/icons/expand_more.tsx +10 -10
  101. package/src/images/icons/index.ts +2 -0
  102. package/src/images/icons/info.tsx +14 -0
  103. package/src/images/icons/list.tsx +13 -13
  104. package/src/images/icons/menu.tsx +10 -10
  105. package/src/images/icons/priority_high.tsx +11 -11
  106. package/src/images/icons/search.tsx +10 -10
  107. package/src/images/icons/warning.tsx +14 -0
  108. package/src/shared-types.ts +1 -1
  109. package/src/components/ConfirmationMessage/types.ts +0 -7
@@ -0,0 +1,14 @@
1
+ import * as React from "react";
2
+ import type { SVGProps } from "react";
3
+ const SvgInfo = (props: SVGProps<SVGSVGElement>) => (
4
+ <svg
5
+ xmlns="http://www.w3.org/2000/svg"
6
+ viewBox="0 -960 960 960"
7
+ fill="#000000"
8
+ role="img"
9
+ {...props}
10
+ >
11
+ <path d="M440-280h80v-240h-80v240Zm68.5-331.5Q520-623 520-640t-11.5-28.5Q497-680 480-680t-28.5 11.5Q440-657 440-640t11.5 28.5Q463-600 480-600t28.5-11.5ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z" />
12
+ </svg>
13
+ );
14
+ export default SvgInfo;
@@ -1,18 +1,18 @@
1
1
  import * as React from "react";
2
2
  import type { SVGProps } from "react";
3
3
  const SvgList = (props: SVGProps<SVGSVGElement>) => (
4
- <svg
5
- xmlns="http://www.w3.org/2000/svg"
6
- viewBox="0 0 24 24"
7
- fill="#000000"
8
- role="img"
9
- {...props}
10
- >
11
- <g fill="none">
12
- <path d="M0 0h24v24H0V0z" />
13
- <path d="M0 0h24v24H0V0z" opacity={0.87} />
14
- </g>
15
- <path d="M3 13h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7zm-4 6h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7z" />
16
- </svg>
4
+ <svg
5
+ xmlns="http://www.w3.org/2000/svg"
6
+ viewBox="0 0 24 24"
7
+ fill="#000000"
8
+ role="img"
9
+ {...props}
10
+ >
11
+ <g fill="none">
12
+ <path d="M0 0h24v24H0V0z" />
13
+ <path d="M0 0h24v24H0V0z" opacity={0.87} />
14
+ </g>
15
+ <path d="M3 13h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7zm-4 6h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7z" />
16
+ </svg>
17
17
  );
18
18
  export default SvgList;
@@ -1,15 +1,15 @@
1
1
  import * as React from "react";
2
2
  import type { SVGProps } from "react";
3
3
  const SvgMenu = (props: SVGProps<SVGSVGElement>) => (
4
- <svg
5
- xmlns="http://www.w3.org/2000/svg"
6
- viewBox="0 0 24 24"
7
- fill="#000000"
8
- role="img"
9
- {...props}
10
- >
11
- <path d="M0 0h24v24H0z" fill="none" />
12
- <path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" />
13
- </svg>
4
+ <svg
5
+ xmlns="http://www.w3.org/2000/svg"
6
+ viewBox="0 0 24 24"
7
+ fill="#000000"
8
+ role="img"
9
+ {...props}
10
+ >
11
+ <path d="M0 0h24v24H0z" fill="none" />
12
+ <path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" />
13
+ </svg>
14
14
  );
15
15
  export default SvgMenu;
@@ -1,16 +1,16 @@
1
1
  import * as React from "react";
2
2
  import type { SVGProps } from "react";
3
3
  const SvgPriorityHigh = (props: SVGProps<SVGSVGElement>) => (
4
- <svg
5
- xmlns="http://www.w3.org/2000/svg"
6
- viewBox="0 0 24 24"
7
- fill="#000000"
8
- role="img"
9
- {...props}
10
- >
11
- <path d="M0 0h24v24H0z" fill="none" />
12
- <circle cx={12} cy={19} r={2} />
13
- <path d="M10 3h4v12h-4z" />
14
- </svg>
4
+ <svg
5
+ xmlns="http://www.w3.org/2000/svg"
6
+ viewBox="0 0 24 24"
7
+ fill="#000000"
8
+ role="img"
9
+ {...props}
10
+ >
11
+ <path d="M0 0h24v24H0z" fill="none" />
12
+ <circle cx={12} cy={19} r={2} />
13
+ <path d="M10 3h4v12h-4z" />
14
+ </svg>
15
15
  );
16
16
  export default SvgPriorityHigh;
@@ -1,15 +1,15 @@
1
1
  import * as React from "react";
2
2
  import type { SVGProps } from "react";
3
3
  const SvgSearch = (props: SVGProps<SVGSVGElement>) => (
4
- <svg
5
- xmlns="http://www.w3.org/2000/svg"
6
- viewBox="0 0 24 24"
7
- fill="#000000"
8
- role="img"
9
- {...props}
10
- >
11
- <path d="M0 0h24v24H0z" fill="none" />
12
- <path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z" />
13
- </svg>
4
+ <svg
5
+ xmlns="http://www.w3.org/2000/svg"
6
+ viewBox="0 0 24 24"
7
+ fill="#000000"
8
+ role="img"
9
+ {...props}
10
+ >
11
+ <path d="M0 0h24v24H0z" fill="none" />
12
+ <path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z" />
13
+ </svg>
14
14
  );
15
15
  export default SvgSearch;
@@ -0,0 +1,14 @@
1
+ import * as React from "react";
2
+ import type { SVGProps } from "react";
3
+ const SvgWarning = (props: SVGProps<SVGSVGElement>) => (
4
+ <svg
5
+ xmlns="http://www.w3.org/2000/svg"
6
+ viewBox="0 -960 960 960"
7
+ fill="#000000"
8
+ role="img"
9
+ {...props}
10
+ >
11
+ <path d="m40-120 440-760 440 760H40Zm468.5-131.5Q520-263 520-280t-11.5-28.5Q497-320 480-320t-28.5 11.5Q440-297 440-280t11.5 28.5Q463-240 480-240t28.5-11.5ZM440-360h80v-200h-80v200Z" />
12
+ </svg>
13
+ );
14
+ export default SvgWarning;
@@ -1,5 +1,5 @@
1
1
  export type HeadingLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
2
- export type IconName = 'ArrowUpward' | 'CalendarToday' | 'Cancel' | 'CheckCircle' | 'ChevronLeft' | 'ChevronRight' | 'Close' | 'Description' | 'DoubleChevronLeft' | 'DoubleChevronRight' | 'Error' | 'ExpandLess' | 'ExpandMore' | 'List' | 'Menu' | 'PriorityHigh' | 'Search';
2
+ export type IconName = 'ArrowUpward' | 'CalendarToday' | 'Cancel' | 'CheckCircle' | 'ChevronLeft' | 'ChevronRight' | 'Close' | 'Description' | 'DoubleChevronLeft' | 'DoubleChevronRight' | 'Error' | 'ExpandLess' | 'ExpandMore' | 'Info' | 'List' | 'Menu' | 'PriorityHigh' | 'Search' | 'Warning';
3
3
  export type DocumentIconName = 'Audio' | 'Csv' | 'Excel' | 'File' | 'Generic' | 'Geodata' | 'Ical' | 'Ico' | 'Image' | 'Odf' | 'Odg' | 'Odp' | 'Ods' | 'Odt' | 'Pdf' | 'Ppt' | 'Rtf' | 'Text' | 'Video' | 'Word' | 'Xml' | 'Zip';
4
4
  export type InputWidth = 'fixed-20' | 'fixed-10' | 'fixed-5' | 'fixed-4' | 'fixed-3' | 'fixed-2' | 'fluid-three-quarters' | 'fluid-two-thirds' | 'fluid-half' | 'fluid-one-third' | 'fluid-one-quarter';
5
5
  export type TagColour = 'grey' | 'green' | 'teal' | 'blue' | 'purple' | 'pink' | 'red' | 'orange' | 'yellow';
@@ -1,7 +0,0 @@
1
- import { HeadingLevel } from '../../shared-types';
2
-
3
- export interface ConfirmationMessageProps extends React.AllHTMLAttributes<HTMLElement> {
4
- ariaLive: React.AriaAttributes['aria-live'];
5
- headingLevel: HeadingLevel;
6
- title: string;
7
- }