@scottish-government/designsystem-react 0.10.2 → 0.12.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 (175) hide show
  1. package/@types/components/Accordion.d.ts +3 -2
  2. package/@types/components/ButtonGroup.d.ts +5 -0
  3. package/@types/components/PageHeader.d.ts +2 -1
  4. package/@types/components/RadioButton.d.ts +2 -2
  5. package/@types/components/SearchFacets.d.ts +18 -0
  6. package/@types/components/SearchFilters.d.ts +14 -0
  7. package/@types/components/SearchResult.d.ts +30 -0
  8. package/@types/components/SearchSort.d.ts +9 -0
  9. package/@types/components/SideNavigation.d.ts +1 -1
  10. package/CHANGELOG.md +39 -5
  11. package/dist/common/AbstractNotificationBanner.d.ts +9 -0
  12. package/dist/common/ActionLink.d.ts +5 -0
  13. package/dist/common/ConditionalWrapper.d.ts +8 -0
  14. package/dist/common/FileIcon.d.ts +6 -0
  15. package/dist/common/HintText.d.ts +5 -0
  16. package/dist/common/Icon.d.ts +6 -0
  17. package/dist/common/ScreenReaderText.d.ts +5 -0
  18. package/dist/common/WrapperTag.d.ts +8 -0
  19. package/dist/components/Accordion/Accordion.d.ts +10 -0
  20. package/dist/components/Accordion/Accordion.jsx +8 -3
  21. package/dist/components/AspectBox/AspectBox.d.ts +6 -0
  22. package/dist/components/BackToTop/BackToTop.d.ts +5 -0
  23. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +9 -0
  24. package/dist/components/Button/Button.d.ts +5 -0
  25. package/dist/components/ButtonGroup/ButtonGroup.d.ts +5 -0
  26. package/dist/components/ButtonGroup/ButtonGroup.jsx +13 -0
  27. package/dist/components/CategoryItem/CategoryItem.d.ts +5 -0
  28. package/dist/components/CategoryList/CategoryList.d.ts +6 -0
  29. package/dist/components/Checkbox/Checkbox.d.ts +5 -0
  30. package/dist/components/Checkbox/CheckboxGroup.d.ts +6 -0
  31. package/dist/components/ConfirmationMessage/ConfirmationMessage.d.ts +5 -0
  32. package/dist/components/ContentsNav/ContentsNav.d.ts +10 -0
  33. package/dist/components/CookieBanner/CookieBanner.d.ts +9 -0
  34. package/dist/components/DatePicker/DatePicker.d.ts +5 -0
  35. package/dist/components/Details/Details.d.ts +5 -0
  36. package/dist/components/ErrorMessage/ErrorMessage.d.ts +5 -0
  37. package/dist/components/ErrorSummary/ErrorSummary.d.ts +9 -0
  38. package/dist/components/FileDownload/FileDownload.d.ts +5 -0
  39. package/dist/components/HideThisPage/HideThisPage.d.ts +6 -0
  40. package/dist/components/InsetText/InsetText.d.ts +5 -0
  41. package/dist/components/NotificationBanner/NotificationBanner.d.ts +9 -0
  42. package/dist/components/NotificationPanel/NotificationPanel.d.ts +5 -0
  43. package/dist/components/PageHeader/PageHeader.d.ts +5 -0
  44. package/dist/components/PageHeader/PageHeader.jsx +2 -2
  45. package/dist/components/PageMetadata/PageMetadata.d.ts +9 -0
  46. package/dist/components/Pagination/Pagination.d.ts +7 -0
  47. package/dist/components/PhaseBanner/PhaseBanner.d.ts +5 -0
  48. package/dist/components/Question/Question.d.ts +5 -0
  49. package/dist/components/RadioButton/RadioButton.d.ts +5 -0
  50. package/dist/components/RadioButton/RadioGroup.d.ts +6 -0
  51. package/dist/components/RadioButton/RadioGroup.jsx +1 -1
  52. package/dist/components/SearchFacets/SearchFacets.d.ts +14 -0
  53. package/dist/components/SearchFacets/SearchFacets.jsx +101 -0
  54. package/dist/components/SearchFilters/SearchFilters.d.ts +16 -0
  55. package/dist/components/SearchFilters/SearchFilters.jsx +63 -0
  56. package/dist/components/SearchResult/SearchResult.d.ts +28 -0
  57. package/dist/components/SearchResult/SearchResult.jsx +93 -0
  58. package/dist/components/SearchSort/SearchSort.d.ts +10 -0
  59. package/dist/components/SearchSort/SearchSort.jsx +28 -0
  60. package/dist/components/Select/Select.d.ts +5 -0
  61. package/dist/components/SequentialNavigation/SequentialNavigation.d.ts +13 -0
  62. package/dist/components/SequentialNavigation/SequentialNavigation.jsx +0 -1
  63. package/dist/components/SideNavigation/SideNavigation.d.ts +13 -0
  64. package/dist/components/SideNavigation/SideNavigation.jsx +2 -2
  65. package/dist/components/SiteFooter/SiteFooter.d.ts +22 -0
  66. package/dist/components/SiteHeader/SiteHeader.d.ts +22 -0
  67. package/dist/components/SiteHeader/SiteHeader.jsx +0 -1
  68. package/dist/components/SiteNavigation/SiteNavigation.d.ts +9 -0
  69. package/dist/components/SiteSearch/SiteSearch.d.ts +5 -0
  70. package/dist/components/SkipLinks/SkipLinks.d.ts +10 -0
  71. package/dist/components/SkipLinks/SkipLinks.jsx +42 -0
  72. package/dist/components/SummaryCard/SummaryCard.d.ts +10 -0
  73. package/dist/components/SummaryList/SummaryList.d.ts +18 -0
  74. package/dist/components/Table/Table.d.ts +5 -0
  75. package/dist/components/Tabs/Tabs.d.ts +10 -0
  76. package/dist/components/Tag/Tag.d.ts +5 -0
  77. package/dist/components/TaskList/TaskList.d.ts +13 -0
  78. package/dist/components/TextInput/TextInput.d.ts +5 -0
  79. package/dist/components/Textarea/Textarea.d.ts +5 -0
  80. package/dist/components/WarningText/WarningText.d.ts +5 -0
  81. package/dist/hooks/useTracking.d.ts +1 -0
  82. package/dist/images/documents/audio.d.ts +4 -0
  83. package/dist/images/documents/csv.d.ts +4 -0
  84. package/dist/images/documents/excel.d.ts +4 -0
  85. package/dist/images/documents/file.d.ts +4 -0
  86. package/dist/images/documents/generic.d.ts +4 -0
  87. package/dist/images/documents/geodata.d.ts +4 -0
  88. package/dist/images/documents/ical.d.ts +4 -0
  89. package/dist/images/documents/ico.d.ts +4 -0
  90. package/dist/images/documents/image.d.ts +4 -0
  91. package/dist/images/documents/index.d.ts +22 -0
  92. package/dist/images/documents/odf.d.ts +4 -0
  93. package/dist/images/documents/odg.d.ts +4 -0
  94. package/dist/images/documents/odp.d.ts +4 -0
  95. package/dist/images/documents/ods.d.ts +4 -0
  96. package/dist/images/documents/odt.d.ts +4 -0
  97. package/dist/images/documents/pdf.d.ts +4 -0
  98. package/dist/images/documents/ppt.d.ts +4 -0
  99. package/dist/images/documents/rtf.d.ts +4 -0
  100. package/dist/images/documents/text.d.ts +4 -0
  101. package/dist/images/documents/video.d.ts +4 -0
  102. package/dist/images/documents/word.d.ts +4 -0
  103. package/dist/images/documents/xml.d.ts +4 -0
  104. package/dist/images/documents/zip.d.ts +4 -0
  105. package/dist/images/icons/arrow_upward.d.ts +4 -0
  106. package/dist/images/icons/calendar_today.d.ts +4 -0
  107. package/dist/images/icons/cancel.d.ts +4 -0
  108. package/dist/images/icons/check_circle.d.ts +4 -0
  109. package/dist/images/icons/chevron_left.d.ts +4 -0
  110. package/dist/images/icons/chevron_right.d.ts +4 -0
  111. package/dist/images/icons/close.d.ts +4 -0
  112. package/dist/images/icons/description.d.ts +4 -0
  113. package/dist/images/icons/double_chevron_left.d.ts +4 -0
  114. package/dist/images/icons/double_chevron_right.d.ts +4 -0
  115. package/dist/images/icons/error.d.ts +4 -0
  116. package/dist/images/icons/expand_less.d.ts +4 -0
  117. package/dist/images/icons/expand_more.d.ts +4 -0
  118. package/dist/images/icons/index.d.ts +17 -0
  119. package/dist/images/icons/list.d.ts +4 -0
  120. package/dist/images/icons/menu.d.ts +4 -0
  121. package/dist/images/icons/priority_high.d.ts +4 -0
  122. package/dist/images/icons/search.d.ts +4 -0
  123. package/dist/tsconfig.tsbuildinfo +1 -1
  124. package/dist/utils/context.d.ts +4 -0
  125. package/package.json +6 -6
  126. package/src/components/Accordion/Accordion.Item.stories.tsx +10 -9
  127. package/src/components/Accordion/Accordion.stories.tsx +4 -4
  128. package/src/components/Accordion/Accordion.test.tsx +48 -14
  129. package/src/components/Accordion/Accordion.tsx +12 -1
  130. package/src/components/Breadcrumbs/Breadcrumbs.Item.stories.tsx +8 -1
  131. package/src/components/Button/Button.stories.tsx +1 -1
  132. package/src/components/ButtonGroup/ButtonGroup.stories.tsx +41 -0
  133. package/src/components/ButtonGroup/ButtonGroup.test.tsx +45 -0
  134. package/src/components/ButtonGroup/ButtonGroup.tsx +20 -0
  135. package/src/components/ContentsNav/ContentsNav.Item.stories.tsx +8 -0
  136. package/src/components/ErrorSummary/ErrorSummary.Item.stories.tsx +7 -0
  137. package/src/components/PageHeader/PageHeader.tsx +2 -1
  138. package/src/components/PageMetadata/PageMetadata.Item.stories.tsx +9 -0
  139. package/src/components/RadioButton/RadioGroup.tsx +2 -2
  140. package/src/components/SearchFacets/SearchFacets.Group.stories.tsx +56 -0
  141. package/src/components/SearchFacets/SearchFacets.Item.stories.tsx +53 -0
  142. package/src/components/SearchFacets/SearchFacets.stories.tsx +38 -0
  143. package/src/components/SearchFacets/SearchFacets.test.tsx +214 -0
  144. package/src/components/SearchFacets/SearchFacets.tsx +99 -0
  145. package/src/components/SearchFilters/SearchFilters.Panel.stories.tsx +201 -0
  146. package/src/components/SearchFilters/SearchFilters.stories.tsx +137 -0
  147. package/src/components/SearchFilters/SearchFilters.test.tsx +161 -0
  148. package/src/components/SearchFilters/SearchFilters.tsx +89 -0
  149. package/src/components/SearchResult/SearchResult.stories.tsx +111 -0
  150. package/src/components/SearchResult/SearchResult.test.tsx +215 -0
  151. package/src/components/SearchResult/SearchResult.tsx +137 -0
  152. package/src/components/SearchSort/SearchSort.stories.tsx +32 -0
  153. package/src/components/SearchSort/SearchSort.test.tsx +129 -0
  154. package/src/components/SearchSort/SearchSort.tsx +45 -0
  155. package/src/components/SequentialNavigation/SequentialNavigation.Next.stories.tsx +1 -1
  156. package/src/components/SequentialNavigation/SequentialNavigation.Previous.stories.tsx +1 -1
  157. package/src/components/SequentialNavigation/SequentialNavigation.tsx +0 -1
  158. package/src/components/SideNavigation/SideNavigation.Item.stories.tsx +9 -0
  159. package/src/components/SideNavigation/SideNavigation.List.stories.tsx +7 -0
  160. package/src/components/SideNavigation/SideNavigation.tsx +2 -1
  161. package/src/components/SiteFooter/SiteFooter.License.stories.tsx +7 -0
  162. package/src/components/SiteFooter/SiteFooter.Link.stories.tsx +9 -0
  163. package/src/components/SiteFooter/SiteFooter.Org.stories.tsx +7 -0
  164. package/src/components/SiteHeader/SiteHeader.tsx +0 -2
  165. package/src/components/SiteNavigation/SiteNavigation.Item.stories.tsx +10 -0
  166. package/src/components/SkipLinks/SkipLinks.Item.stories.tsx +11 -1
  167. package/src/components/SkipLinks/SkipLinks.tsx +10 -0
  168. package/src/components/SummaryCard/SummaryCard.Action.stories.tsx +7 -0
  169. package/src/components/SummaryCard/SummaryCard.stories.tsx +7 -0
  170. package/src/components/SummaryList/SummaryList.Item.stories.tsx +15 -0
  171. package/src/components/SummaryList/SummaryList.Value.stories.tsx +5 -2
  172. package/src/components/Tabs/Tabs.Item.stories.tsx +4 -1
  173. package/src/components/TaskList/TaskList.Group.stories.tsx +9 -0
  174. package/src/components/TaskList/TaskList.Item.stories.tsx +7 -0
  175. package/tsconfig.json +14 -14
@@ -2,13 +2,14 @@ declare namespace SGDS.Component {
2
2
  namespace Accordion {
3
3
  interface Item extends React.AllHTMLAttributes<HTMLElement> {
4
4
  id?: string,
5
+ heading: string | React.ReactNode
5
6
  isOpen?: boolean,
6
- title: string
7
7
  }
8
8
  }
9
9
 
10
10
  interface Accordion extends React.AllHTMLAttributes<HTMLElement> {
11
11
  headingLevel?: SGDS.HeadingLevel,
12
- hideOpenAll?: boolean
12
+ hideOpenAll?: boolean,
13
+ isSmall?: boolean
13
14
  }
14
15
  }
@@ -0,0 +1,5 @@
1
+ declare namespace SGDS.Component {
2
+ interface ButtonGroup extends React.AllHTMLAttributes<HTMLElement> {
3
+ isInline?: boolean
4
+ }
5
+ }
@@ -1,6 +1,7 @@
1
1
  declare namespace SGDS.Component {
2
2
  interface PageHeader extends React.AllHTMLAttributes<HTMLHeadingElement> {
3
3
  label?: string,
4
- title: string
4
+ title: string,
5
+ titleId?: string
5
6
  }
6
7
  }
@@ -2,13 +2,13 @@ declare namespace SGDS.Component {
2
2
  namespace RadioButton {
3
3
  interface Group extends React.AllHTMLAttributes<HTMLElement> {
4
4
  isInline?: boolean,
5
- name: string,
5
+ name?: string,
6
6
  isSmall?: boolean
7
7
  }
8
8
  }
9
9
 
10
10
  interface RadioButton extends CheckboxRadioBase<HTMLInputElement> {
11
11
  id: string,
12
- name: string
12
+ name?: string
13
13
  }
14
14
  }
@@ -0,0 +1,18 @@
1
+ declare namespace SGDS.Component {
2
+ namespace SearchFacets {
3
+ interface Group extends React.AllHTMLAttributes<HTMLElement> {
4
+ joinContent?: string,
5
+ title: string
6
+ }
7
+
8
+ interface Item extends React.AllHTMLAttributes<HTMLElement> {
9
+ accessibleName?: string
10
+ joinContent?: string
11
+ title: string
12
+ }
13
+ }
14
+
15
+ interface SearchFacets extends React.AllHTMLAttributes<HTMLElement> {
16
+ headingId?: string
17
+ }
18
+ }
@@ -0,0 +1,14 @@
1
+ declare namespace SGDS.Component {
2
+ namespace SearchFilters {
3
+ interface Panel extends React.AllHTMLAttributes<HTMLElement> {
4
+ activeFilterCount?: number,
5
+ heading: string | React.ReactNode
6
+ isScrollable?: boolean,
7
+ legend: string,
8
+ }
9
+ }
10
+
11
+ interface SearchFilters extends React.AllHTMLAttributes<HTMLElement> {
12
+ searchResultsContainerId?: string
13
+ }
14
+ }
@@ -0,0 +1,30 @@
1
+ declare namespace SGDS.Component {
2
+ namespace SearchResult {
3
+ interface Content extends React.AllHTMLAttributes<HTMLElement> {
4
+
5
+ }
6
+
7
+ interface Context extends React.AllHTMLAttributes<HTMLDListElement> {
8
+ title: string
9
+ }
10
+
11
+ interface ContextItem extends React.AllHTMLAttributes<HTMLElement> {
12
+
13
+ }
14
+
15
+ interface Media extends React.AllHTMLAttributes<HTMLElement> {
16
+
17
+ }
18
+
19
+ interface Meta extends React.AllHTMLAttributes<HTMLElement> {
20
+ }
21
+ }
22
+
23
+ interface SearchResult extends React.AllHTMLAttributes<HTMLElement> {
24
+ href: string,
25
+ isPromoted?: boolean,
26
+ linkComponent?: SGDS.LinkComponent,
27
+ promotedTitle?: string,
28
+ title: string
29
+ }
30
+ }
@@ -0,0 +1,9 @@
1
+ declare namespace SGDS.Component {
2
+ interface SearchSort extends React.AllHTMLAttributes<HTMLElement> {
3
+ children: React.ReactNode;
4
+ className?: string;
5
+ id?: string;
6
+ label?: string;
7
+ onApply?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
8
+ }
9
+ }
@@ -13,6 +13,6 @@ declare namespace SGDS.Component {
13
13
  }
14
14
 
15
15
  interface SideNavigation extends React.AllHTMLAttributes<HTMLElement> {
16
-
16
+ ariaLabel?: string
17
17
  }
18
18
  }
package/CHANGELOG.md CHANGED
@@ -6,13 +6,45 @@ Changes are grouped under the labels: `Added`, `Changed`, `Deprecated`, `Fixed`,
6
6
  `Removed` and `Security`.
7
7
 
8
8
  ---
9
+ ## [0.12.0] - 2025-11-12
9
10
 
10
- ## [0.9.0] - 2025-09-17
11
- ## Added
11
+ ### Added
12
+ - type definitions included in /dist
13
+ - optional 'titleId' prop added to PageHeader
14
+ ## Fixed
15
+ - include SGDS 'skip-links' script in SkipLinks
16
+
17
+ ## [0.11.0] - 2025-10-22
18
+
19
+ ### Added
20
+ - SearchResult, SearchFilters, SearchFacets, SearchSort components
21
+ - ButtonGroup component
22
+ ### Changed
23
+ - Accordion.Item now uses a new `heading` prop for its heading content, which allows both string and ReactNode
24
+ - add "ariaLabel" property to SideNavigation to make the aria label editable
25
+ ### Deprecated
26
+ - Accordion.Item `title` prop replaced with `heading`
27
+ ### Fixed
28
+ - decorators added to many storybook components for correct rendering
29
+
30
+ ## [0.10.2] - 2025-09-18
31
+ ### Fixed
32
+ - correction to handling of subcomponents in Storybook
33
+
34
+ ## [0.10.1] - 2025-09-18
35
+ ### Fixed
36
+ - correction to white space on PageMetadata
37
+
38
+ ## [0.10.0] - 2025-09-18
39
+ ### Added
12
40
  - Storybook now added for all components. `npm run storybook`
13
41
  - CategoryList component
14
42
  - CategoryItem component
15
- ## Changed
43
+ - useTracking hook, to add DS tracking attributes
44
+ ### Changed
45
+ - Accordion uses useContext instead of cloneElement to pass props (headingLevel) to its children
46
+ - CheckboxGroup uses useContext instead of cloneElement to pass props (isSmall) to its children
47
+ - RadioGroup use useContext instead of cloneElement to pass props (isSmall, name) to its children
16
48
  - 'text' prop removed from ErrorMessage. Use children instead.
17
49
  - Many boolean prop names updated for clarity/consistency
18
50
  - AbstractNotificationBanner (used by NotificationBanner and CookieBanner): close -> isDismissable
@@ -36,13 +68,15 @@ Changes are grouped under the labels: `Added`, `Changed`, `Deprecated`, `Fixed`,
36
68
  - Tabs: bordered -> isBorderless (logic inverted), manual -> isManual
37
69
  - TextInput: currency -> isCurrency
38
70
 
71
+ ## [0.9.0] - skipped due to user error with the CI script
72
+
39
73
  ## [0.8.0] - 2025-08-18
40
- ## Added
74
+ ### Added
41
75
  - ActionLink component, centralising behaviour used in actions in both SummaryCard and SummaryList
42
76
  - SiteFooter component
43
77
  - Add support for the SkipLinks 'static' variant
44
78
 
45
- ## Changed
79
+ ### Changed
46
80
 
47
81
  Two headline changes:
48
82
 
@@ -0,0 +1,9 @@
1
+ declare const AbstractNotificationBanner: {
2
+ ({ children, className, hasColourIcon, hasInverseIcon, icon, isDismissable, title, ...props }: SGDS.Common.AbstractNotificationBanner): import("react").JSX.Element;
3
+ displayName: string;
4
+ Buttons: {
5
+ ({ children }: SGDS.Common.AbstractNotificationBanner.Buttons): import("react").JSX.Element;
6
+ displayName: string;
7
+ };
8
+ };
9
+ export default AbstractNotificationBanner;
@@ -0,0 +1,5 @@
1
+ declare const ActionLink: {
2
+ ({ children, describedby, href, linkComponent, onclick }: SGDS.Common.ActionLink): string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("react").ReactPortal | Iterable<import("react").ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
3
+ displayName: string;
4
+ };
5
+ export default ActionLink;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Wraps all children in a specified HTML tag if a condition is met.
3
+ */
4
+ declare const ConditionalWrapper: {
5
+ ({ condition, wrapper, children }: SGDS.Common.ConditionalWrapper): any;
6
+ displayName: string;
7
+ };
8
+ export default ConditionalWrapper;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ declare const FileIcon: {
3
+ ({ ariaLabel, className, icon }: SGDS.Common.FileIcon): React.JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export default FileIcon;
@@ -0,0 +1,5 @@
1
+ declare const HintText: {
2
+ ({ children, id, text, ...props }: SGDS.Common.HintText): import("react").JSX.Element;
3
+ displayName: string;
4
+ };
5
+ export default HintText;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ declare const Icon: {
3
+ ({ ariaLabel, className, isFilled, icon, iconSize }: SGDS.Common.Icon): React.JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export default Icon;
@@ -0,0 +1,5 @@
1
+ declare const ScreenReaderText: {
2
+ ({ children, ...props }: SGDS.Common.ScreenReaderText): import("react").JSX.Element;
3
+ displayName: string;
4
+ };
5
+ export default ScreenReaderText;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Wraps all children in a specified HTML tag.
3
+ */
4
+ declare const WrapperTag: {
5
+ ({ children, tagName, ...props }: SGDS.Common.WrapperTag): import("react").JSX.Element;
6
+ displayName: string;
7
+ };
8
+ export default WrapperTag;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ declare const Accordion: {
3
+ ({ children, className, headingLevel, hideOpenAll, isSmall, ...props }: SGDS.Component.Accordion): React.JSX.Element;
4
+ displayName: string;
5
+ Item: {
6
+ ({ children, className, id: rawId, isOpen, heading, title, ...props }: SGDS.Component.Accordion.Item): React.JSX.Element;
7
+ displayName: string;
8
+ };
9
+ };
10
+ export default Accordion;
@@ -42,10 +42,14 @@ const WrapperTag_1 = __importDefault(require("../../common/WrapperTag"));
42
42
  const accordion_1 = __importDefault(require("@scottish-government/design-system/src/components/accordion/accordion"));
43
43
  let accordionItemCounter = 0;
44
44
  const AccordionHeadingLevelContext = (0, react_1.createContext)('h3');
45
- const AccordionItem = ({ children, className, id: rawId, isOpen = false, title, ...props }) => {
45
+ const AccordionItem = ({ children, className, id: rawId, isOpen = false, heading, title, ...props }) => {
46
46
  accordionItemCounter = accordionItemCounter + 1;
47
47
  const processedId = rawId || `accordion-item-${(0, react_1.useId)()}`;
48
48
  let headingLevel = (0, react_1.useContext)(AccordionHeadingLevelContext);
49
+ if (title) {
50
+ console.warn('Warning: Using the `title` prop for heading text on an Accordion.Item is deprecated and will be removed in a future release. Please use the `heading` prop instead.');
51
+ heading = heading || title;
52
+ }
49
53
  return (<div className={[
50
54
  'ds_accordion-item',
51
55
  className
@@ -56,7 +60,7 @@ const AccordionItem = ({ children, className, id: rawId, isOpen = false, title,
56
60
  ].join(' ')} defaultChecked={isOpen} id={`${processedId}-control`} type="checkbox"/>
57
61
  <div className="ds_accordion-item__header">
58
62
  <WrapperTag_1.default id={`panel-${processedId}-heading`} className="ds_accordion-item__title" tagName={headingLevel}>
59
- {title}
63
+ {heading}
60
64
  </WrapperTag_1.default>
61
65
  <span className="ds_accordion-item__indicator"/>
62
66
  <label className="ds_accordion-item__label" htmlFor={`${processedId}-control`}>
@@ -68,7 +72,7 @@ const AccordionItem = ({ children, className, id: rawId, isOpen = false, title,
68
72
  </div>
69
73
  </div>);
70
74
  };
71
- const Accordion = ({ children, className, headingLevel = 'h3', hideOpenAll, ...props }) => {
75
+ const Accordion = ({ children, className, headingLevel = 'h3', hideOpenAll, isSmall, ...props }) => {
72
76
  const ref = (0, react_1.useRef)(null);
73
77
  (0, react_1.useEffect)(() => {
74
78
  if (ref.current) {
@@ -80,6 +84,7 @@ const Accordion = ({ children, className, headingLevel = 'h3', hideOpenAll, ...p
80
84
  }
81
85
  return (<div className={[
82
86
  'ds_accordion',
87
+ isSmall ? 'ds_accordion--small' : '',
83
88
  className
84
89
  ].join(' ')} ref={ref} {...props}>
85
90
  {!hideOpenAll && (<button className={[
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ declare const AspectBox: {
3
+ ({ children, className, ratio, ...props }: SGDS.Component.AspectBox): React.JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export default AspectBox;
@@ -0,0 +1,5 @@
1
+ declare const BackToTop: {
2
+ ({ className, href, ...props }: SGDS.Component.BackToTop): import("react").JSX.Element;
3
+ displayName: string;
4
+ };
5
+ export default BackToTop;
@@ -0,0 +1,9 @@
1
+ declare const Breadcrumbs: {
2
+ ({ children, ...props }: SGDS.Component.Breadcrumbs): import("react").JSX.Element;
3
+ displayName: string;
4
+ Item: {
5
+ ({ children, isHidden, href, linkComponent, ...props }: SGDS.Component.Breadcrumbs.Item): import("react").JSX.Element;
6
+ displayName: string;
7
+ };
8
+ };
9
+ export default Breadcrumbs;
@@ -0,0 +1,5 @@
1
+ declare const Button: {
2
+ ({ buttonStyle, children, className, icon, hasLinkStyle, href, isIconLeft, isIconOnly, isSmall, type, width, ...props }: SGDS.Component.Button): import("react").JSX.Element;
3
+ displayName: string;
4
+ };
5
+ export default Button;
@@ -0,0 +1,5 @@
1
+ declare const ButtonGroup: {
2
+ ({ children, className, isInline, ...props }: SGDS.Component.ButtonGroup): import("react").JSX.Element;
3
+ displayName: string;
4
+ };
5
+ export default ButtonGroup;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const ButtonGroup = ({ children, className, isInline, ...props }) => {
4
+ return (<div className={[
5
+ "ds_button-group",
6
+ isInline ? "ds_button-group--inline" : undefined,
7
+ className
8
+ ].join(' ')} {...props}>
9
+ {children}
10
+ </div>);
11
+ };
12
+ ButtonGroup.displayName = 'ButtonGroup';
13
+ exports.default = ButtonGroup;
@@ -0,0 +1,5 @@
1
+ declare const CategoryItem: {
2
+ ({ children, className, headingLevel, href, linkComponent, tagName, title, ...props }: SGDS.Component.CategoryItem): import("react").JSX.Element;
3
+ displayName: string;
4
+ };
5
+ export default CategoryItem;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ declare const CategoryList: {
3
+ ({ children, className, isGrid, isOrdered, ...props }: SGDS.Component.CategoryList): React.JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export default CategoryList;
@@ -0,0 +1,5 @@
1
+ declare const Checkbox: {
2
+ ({ checked, hintText, id, isSmall, isExclusive, label, name, onBlur, onChange }: SGDS.Component.Checkbox): import("react").JSX.Element;
3
+ displayName: string;
4
+ };
5
+ export default Checkbox;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ export declare const CheckboxGroup: {
3
+ ({ children, className, isSmall, ...props }: SGDS.Component.Checkbox.Group): React.JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export default CheckboxGroup;
@@ -0,0 +1,5 @@
1
+ declare const ConfirmationMessage: {
2
+ ({ ariaLive, children, className, headingLevel, title, ...props }: SGDS.Component.ConfirmationMessage): import("react").JSX.Element;
3
+ displayName: string;
4
+ };
5
+ export default ConfirmationMessage;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ declare const ContentsNav: {
3
+ ({ ariaLabel, children, className, title, ...props }: SGDS.Component.ContentsNav): React.JSX.Element;
4
+ displayName: string;
5
+ Item: {
6
+ ({ children, isCurrent, href, linkComponent }: SGDS.Component.ContentsNav.ContentsNavItem): React.JSX.Element;
7
+ displayName: string;
8
+ };
9
+ };
10
+ export default ContentsNav;
@@ -0,0 +1,9 @@
1
+ declare const CookieBanner: {
2
+ ({ children, className, title, ...props }: SGDS.Common.AbstractNotificationBanner): import("react").JSX.Element;
3
+ displayName: string;
4
+ Buttons: {
5
+ ({ children }: SGDS.Common.AbstractNotificationBanner.Buttons): import("react").JSX.Element;
6
+ displayName: string;
7
+ };
8
+ };
9
+ export default CookieBanner;
@@ -0,0 +1,5 @@
1
+ declare const DatePicker: {
2
+ ({ className, dateSelectCallback, disabledDates, errorMessage, hasError, hintText, id, iconPath, label, maxDate, minDate, multiple, name, onBlur, onChange, value, width, ...props }: SGDS.Component.DatePicker): import("react").JSX.Element;
3
+ displayName: string;
4
+ };
5
+ export default DatePicker;
@@ -0,0 +1,5 @@
1
+ declare const Details: {
2
+ ({ children, className, summary, ...props }: SGDS.Component.Details): import("react").JSX.Element;
3
+ displayName: string;
4
+ };
5
+ export default Details;
@@ -0,0 +1,5 @@
1
+ declare const ErrorMessage: {
2
+ ({ children, className, id, ...props }: SGDS.Component.ErrorMessage): import("react").JSX.Element;
3
+ displayName: string;
4
+ };
5
+ export default ErrorMessage;
@@ -0,0 +1,9 @@
1
+ declare const ErrorSummary: {
2
+ ({ children, className, title, ...props }: SGDS.Component.ErrorSummary): import("react").JSX.Element;
3
+ displayName: string;
4
+ Item: {
5
+ ({ children, fragmentId, linkComponent }: SGDS.Component.ErrorSummary.Item): import("react").JSX.Element;
6
+ displayName: string;
7
+ };
8
+ };
9
+ export default ErrorSummary;
@@ -0,0 +1,5 @@
1
+ declare const FileDownload: {
2
+ ({ className, cover, icon, isHighlighted, fileSize, fileType, fileUrl, title, ...props }: SGDS.Component.FileDownload): import("react").JSX.Element;
3
+ displayName: string;
4
+ };
5
+ export default FileDownload;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ declare const HideThisPage: {
3
+ ({ className, escapeUrl, ...props }: SGDS.Component.HideThisPage): React.JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export default HideThisPage;
@@ -0,0 +1,5 @@
1
+ declare const InsetText: {
2
+ ({ children, className, ...props }: SGDS.Component.InsetText): import("react").JSX.Element;
3
+ displayName: string;
4
+ };
5
+ export default InsetText;
@@ -0,0 +1,9 @@
1
+ declare const NotificationBanner: {
2
+ ({ children, className, hasColourIcon, hasIcon, hasInverseIcon, isDismissable, title, ...props }: SGDS.Common.AbstractNotificationBanner): import("react").JSX.Element;
3
+ displayName: string;
4
+ Buttons: {
5
+ ({ children }: SGDS.Common.AbstractNotificationBanner.Buttons): import("react").JSX.Element;
6
+ displayName: string;
7
+ };
8
+ };
9
+ export default NotificationBanner;
@@ -0,0 +1,5 @@
1
+ declare const NotificationPanel: {
2
+ ({ ariaLive, children, className, headingLevel, title, ...props }: SGDS.Component.NotificationPanel): import("react").JSX.Element;
3
+ displayName: string;
4
+ };
5
+ export default NotificationPanel;
@@ -0,0 +1,5 @@
1
+ declare const PageHeader: {
2
+ ({ children, className, label, title, titleId, ...props }: SGDS.Component.PageHeader): import("react").JSX.Element;
3
+ displayName: string;
4
+ };
5
+ export default PageHeader;
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const PageHeader = ({ children, className, label, title, ...props }) => {
3
+ const PageHeader = ({ children, className, label, title, titleId, ...props }) => {
4
4
  return (<header className={[
5
5
  'ds_page-header',
6
6
  className
7
7
  ].join(' ')} {...props}>
8
8
  {label && <span className="ds_page-header__label ds_content-label">{label}</span>}
9
- <h1 className="ds_page-header__title">{title}</h1>
9
+ <h1 id={titleId} className="ds_page-header__title">{title}</h1>
10
10
 
11
11
  {children}
12
12
  </header>);
@@ -0,0 +1,9 @@
1
+ declare const Metadata: {
2
+ ({ children, className, isInline, ...props }: SGDS.Component.Metadata): import("react").JSX.Element;
3
+ displayName: string;
4
+ Item: {
5
+ ({ children, className, name, ...props }: SGDS.Component.Metadata.Item): import("react").JSX.Element;
6
+ displayName: string;
7
+ };
8
+ };
9
+ export default Metadata;
@@ -0,0 +1,7 @@
1
+ export declare const Page: ({ ariaLabel, children, className, href, isCurrent, linkComponent, onClick }: SGDS.Component.Pagination.Page) => import("react").JSX.Element;
2
+ export declare const Ellipsis: () => import("react").JSX.Element;
3
+ declare const Pagination: {
4
+ ({ ariaLabel, className, onClick, padding, page, pattern, totalPages, linkComponent, ...props }: SGDS.Component.Pagination): import("react").JSX.Element;
5
+ displayName: string;
6
+ };
7
+ export default Pagination;
@@ -0,0 +1,5 @@
1
+ declare const PhaseBanner: {
2
+ ({ children, className, phaseName, ...props }: SGDS.Component.PhaseBanner): import("react").JSX.Element;
3
+ displayName: string;
4
+ };
5
+ export default PhaseBanner;
@@ -0,0 +1,5 @@
1
+ declare const Question: {
2
+ ({ children, className, errorMessage, hasError, hintText, legend, tagName, ...props }: SGDS.Component.Question): import("react").JSX.Element;
3
+ displayName: string;
4
+ };
5
+ export default Question;
@@ -0,0 +1,5 @@
1
+ declare const RadioButton: {
2
+ ({ checked, hintText, id, isSmall, label, name, onBlur, onChange }: SGDS.Component.RadioButton): import("react").JSX.Element;
3
+ displayName: string;
4
+ };
5
+ export default RadioButton;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ declare const RadioGroup: {
3
+ ({ children, className, isInline, isSmall, name, ...props }: SGDS.Component.RadioButton.Group): React.JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export default RadioGroup;
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const react_1 = __importDefault(require("react"));
7
7
  const context_1 = require("../../utils/context");
8
- const RadioGroup = ({ children, className, isInline, isSmall, name, ...props }) => {
8
+ const RadioGroup = ({ children, className, isInline, isSmall, name = '', ...props }) => {
9
9
  return (<div className={[
10
10
  'ds_radios',
11
11
  'ds_field-group',
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ declare const Facets: {
3
+ ({ children, className, ...props }: SGDS.Component.SearchFacets): React.JSX.Element;
4
+ displayName: string;
5
+ Item: {
6
+ ({ accessibleName, joinContent, onClick, title, ...props }: SGDS.Component.SearchFacets.Item): React.JSX.Element;
7
+ displayName: string;
8
+ };
9
+ Group: {
10
+ ({ children, joinContent, title, ...props }: SGDS.Component.SearchFacets.Group): React.JSX.Element;
11
+ displayName: string;
12
+ };
13
+ };
14
+ export default Facets;