@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.
- package/.storybook/sgdsArgTypes.ts +19 -3
- package/CHANGELOG.md +19 -0
- package/README.md +1 -5
- package/dist/common/AbstractNotificationMessage/AbstractNotificationMessage.d.ts +6 -0
- package/dist/common/AbstractNotificationMessage/AbstractNotificationMessage.jsx +34 -0
- package/dist/common/AbstractNotificationMessage/index.d.ts +1 -0
- package/dist/common/AbstractNotificationMessage/index.js +8 -0
- package/dist/common/AbstractNotificationMessage/types.d.ts +9 -0
- package/dist/common/AbstractNotificationMessage/types.js +2 -0
- package/dist/common/WrapperTag/WrapperTag.d.ts +11 -11
- package/dist/components/ConfirmationMessage/ConfirmationMessage.d.ts +18 -2
- package/dist/components/ConfirmationMessage/ConfirmationMessage.jsx +21 -17
- package/dist/components/ConfirmationNotification/ConfirmationNotification.d.ts +6 -0
- package/dist/components/ConfirmationNotification/ConfirmationNotification.jsx +26 -0
- package/dist/components/ConfirmationNotification/index.d.ts +1 -0
- package/dist/components/ConfirmationNotification/index.js +8 -0
- package/dist/components/CookieBanner/CookieBanner.jsx +2 -2
- package/dist/components/ErrorNotification/ErrorNotification.d.ts +6 -0
- package/dist/components/ErrorNotification/ErrorNotification.jsx +26 -0
- package/dist/components/ErrorNotification/index.d.ts +1 -0
- package/dist/components/ErrorNotification/index.js +8 -0
- package/dist/components/FileUpload/FileUpload.d.ts +6 -0
- package/dist/components/FileUpload/FileUpload.jsx +55 -0
- package/dist/components/FileUpload/index.d.ts +1 -0
- package/dist/components/FileUpload/index.js +8 -0
- package/dist/components/FileUpload/types.d.ts +24 -0
- package/dist/components/FileUpload/types.js +2 -0
- package/dist/components/InfoNotification/InfoNotification.d.ts +6 -0
- package/dist/components/InfoNotification/InfoNotification.jsx +26 -0
- package/dist/components/InfoNotification/index.d.ts +1 -0
- package/dist/components/InfoNotification/index.js +8 -0
- package/dist/components/NotificationBanner/NotificationBanner.jsx +1 -1
- package/dist/components/SummaryList/SummaryList.d.ts +1 -1
- package/dist/components/WarningNotification/WarningNotification.d.ts +6 -0
- package/dist/components/WarningNotification/WarningNotification.jsx +26 -0
- package/dist/components/WarningNotification/index.d.ts +1 -0
- package/dist/components/WarningNotification/index.js +8 -0
- package/dist/components/WarningText/WarningText.jsx +4 -1
- package/dist/images/icons/index.d.ts +2 -0
- package/dist/images/icons/index.js +5 -1
- package/dist/images/icons/info.d.ts +4 -0
- package/dist/images/icons/info.jsx +40 -0
- package/dist/images/icons/warning.d.ts +4 -0
- package/dist/images/icons/warning.jsx +40 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +40 -0
- package/dist/shared-types.d.ts +35 -0
- package/dist/shared-types.js +2 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +22 -16
- package/src/common/AbstractNotificationMessage/AbstractNotificationMessage.test.tsx +101 -0
- package/src/common/AbstractNotificationMessage/AbstractNotificationMessage.tsx +56 -0
- package/src/common/AbstractNotificationMessage/index.ts +1 -0
- package/src/common/AbstractNotificationMessage/types.ts +10 -0
- package/src/components/Button/Button.stories.tsx +1 -1
- package/src/components/Card/Card.tsx +2 -2
- package/src/components/ConfirmationMessage/ConfirmationMessage.stories.tsx +11 -3
- package/src/components/ConfirmationMessage/ConfirmationMessage.test.tsx +58 -23
- package/src/components/ConfirmationMessage/ConfirmationMessage.tsx +32 -25
- package/src/components/ConfirmationMessage/confirmationmessage.mdx +17 -0
- package/src/components/ConfirmationNotification/ConfirmationNotification.stories.tsx +47 -0
- package/src/components/ConfirmationNotification/ConfirmationNotification.test.tsx +101 -0
- package/src/components/ConfirmationNotification/ConfirmationNotification.tsx +46 -0
- package/src/components/ConfirmationNotification/index.ts +1 -0
- package/src/components/CookieBanner/CookieBanner.tsx +1 -1
- package/src/components/ErrorNotification/ErrorNotification.stories.tsx +47 -0
- package/src/components/ErrorNotification/ErrorNotification.test.tsx +101 -0
- package/src/components/ErrorNotification/ErrorNotification.tsx +46 -0
- package/src/components/ErrorNotification/index.ts +1 -0
- package/src/components/FileDownload/FileDownload.test.tsx +1 -1
- package/src/components/FileUpload/FileUpload.stories.tsx +77 -0
- package/src/components/FileUpload/FileUpload.test.tsx +185 -0
- package/src/components/FileUpload/FileUpload.tsx +87 -0
- package/src/components/FileUpload/index.ts +1 -0
- package/src/components/FileUpload/types.ts +25 -0
- package/src/components/InfoNotification/InfoNotification.stories.tsx +47 -0
- package/src/components/InfoNotification/InfoNotification.test.tsx +101 -0
- package/src/components/InfoNotification/InfoNotification.tsx +46 -0
- package/src/components/InfoNotification/index.ts +1 -0
- package/src/components/NotificationBanner/NotificationBanner.tsx +1 -1
- package/src/components/SummaryList/SummaryList.tsx +1 -1
- package/src/components/TextInput/TextInput.stories.tsx +1 -1
- package/src/components/WarningNotification/WarningNotification.stories.tsx +47 -0
- package/src/components/WarningNotification/WarningNotification.test.tsx +101 -0
- package/src/components/WarningNotification/WarningNotification.tsx +46 -0
- package/src/components/WarningNotification/index.ts +1 -0
- package/src/components/WarningText/WarningText.tsx +4 -1
- package/src/images/icons/arrow_upward.tsx +10 -10
- package/src/images/icons/calendar_today.tsx +10 -10
- package/src/images/icons/cancel.tsx +8 -8
- package/src/images/icons/check_circle.tsx +10 -10
- package/src/images/icons/chevron_left.tsx +10 -10
- package/src/images/icons/chevron_right.tsx +10 -10
- package/src/images/icons/close.tsx +10 -10
- package/src/images/icons/description.tsx +10 -10
- package/src/images/icons/double_chevron_left.tsx +8 -8
- package/src/images/icons/double_chevron_right.tsx +8 -8
- package/src/images/icons/error.tsx +10 -10
- package/src/images/icons/expand_less.tsx +10 -10
- package/src/images/icons/expand_more.tsx +10 -10
- package/src/images/icons/index.ts +2 -0
- package/src/images/icons/info.tsx +14 -0
- package/src/images/icons/list.tsx +13 -13
- package/src/images/icons/menu.tsx +10 -10
- package/src/images/icons/priority_high.tsx +11 -11
- package/src/images/icons/search.tsx +10 -10
- package/src/images/icons/warning.tsx +14 -0
- package/src/shared-types.ts +1 -1
- 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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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;
|
package/src/shared-types.ts
CHANGED
|
@@ -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';
|