@scottish-government/designsystem-react 0.0.2 → 0.1.1

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 (98) hide show
  1. package/@types/components/InsetText.d.ts +5 -0
  2. package/@types/components/WarningText.d.ts +5 -0
  3. package/dist/common/conditional-wrapper.jsx +8 -0
  4. package/dist/common/hint-text.jsx +9 -0
  5. package/dist/common/icon.jsx +14 -0
  6. package/dist/common/screen-reader-text.jsx +9 -0
  7. package/dist/common/wrapper-tag.jsx +11 -0
  8. package/dist/components/accordion/accordion.jsx +103 -0
  9. package/dist/components/aspect-box/aspect-box.jsx +79 -0
  10. package/dist/components/back-to-top/back-to-top.jsx +27 -0
  11. package/dist/components/breadcrumbs/breadcrumbs.jsx +28 -0
  12. package/dist/components/button/button.jsx +30 -0
  13. package/dist/components/checkbox/checkbox.jsx +62 -0
  14. package/dist/components/confirmation-message/confirmation-message.jsx +24 -0
  15. package/dist/components/contents-nav/contents-nav.jsx +33 -0
  16. package/dist/components/date-picker/date-picker.jsx +50 -0
  17. package/dist/components/details/details.jsx +17 -0
  18. package/dist/components/error-message/error-message.jsx +12 -0
  19. package/dist/components/inset-text/inset-text.jsx +14 -0
  20. package/dist/components/notification-banner/notification-banner.jsx +54 -0
  21. package/dist/components/notification-panel/notification-panel.jsx +21 -0
  22. package/dist/components/page-header/page-header.jsx +15 -0
  23. package/dist/components/page-metadata/page-metadata.jsx +27 -0
  24. package/dist/components/phase-banner/phase-banner.jsx +23 -0
  25. package/dist/components/question/question.jsx +22 -0
  26. package/dist/components/radio-button/radio-button.jsx +43 -0
  27. package/dist/components/select/select.jsx +52 -0
  28. package/dist/components/sequential-navigation/sequential-navigation.jsx +31 -0
  29. package/dist/components/side-navigation/side-navigation.jsx +52 -0
  30. package/dist/components/site-navigation/site-navigation.jsx +22 -0
  31. package/dist/components/site-search/site-search.jsx +55 -0
  32. package/dist/components/skip-links/skip-links.jsx +21 -0
  33. package/dist/components/tag/tag.jsx +13 -0
  34. package/dist/components/task-list/task-list.jsx +96 -0
  35. package/dist/components/text-input/text-input.jsx +58 -0
  36. package/dist/components/textarea/textarea.jsx +54 -0
  37. package/dist/components/warning-text/warning-text.jsx +16 -0
  38. package/dist/tsconfig.tsbuildinfo +1 -0
  39. package/package.json +1 -1
  40. package/src/common/icon.test.tsx +1 -1
  41. package/src/components/accordion/accordion.test.tsx +25 -1
  42. package/src/components/accordion/accordion.tsx +10 -2
  43. package/src/components/aspect-box/aspect-box.test.tsx +12 -0
  44. package/src/components/aspect-box/aspect-box.tsx +3 -1
  45. package/src/components/back-to-top/back-to-top.test.tsx +10 -0
  46. package/src/components/back-to-top/back-to-top.tsx +5 -1
  47. package/src/components/breadcrumbs/breadcrumbs.test.tsx +12 -0
  48. package/src/components/breadcrumbs/breadcrumbs.tsx +2 -0
  49. package/src/components/button/button.test.tsx +9 -0
  50. package/src/components/button/button.tsx +4 -2
  51. package/src/components/checkbox/checkbox.test.tsx +13 -0
  52. package/src/components/checkbox/checkbox.tsx +6 -1
  53. package/src/components/confirmation-message/confirmation-message.test.tsx +22 -0
  54. package/src/components/confirmation-message/confirmation-message.tsx +8 -2
  55. package/src/components/contents-nav/contents-nav.test.tsx +13 -0
  56. package/src/components/contents-nav/contents-nav.tsx +8 -4
  57. package/src/components/date-picker/date-picker.test.tsx +13 -0
  58. package/src/components/date-picker/date-picker.tsx +4 -2
  59. package/src/components/details/details.test.tsx +12 -0
  60. package/src/components/details/details.tsx +2 -0
  61. package/src/components/error-message/error-message.test.tsx +9 -0
  62. package/src/components/error-message/error-message.tsx +2 -0
  63. package/src/components/inset-text/inset-text.test.tsx +11 -0
  64. package/src/components/inset-text/inset-text.tsx +6 -2
  65. package/src/components/notification-banner/notification-banner.test.tsx +11 -0
  66. package/src/components/notification-banner/notification-banner.tsx +6 -1
  67. package/src/components/notification-panel/notification-panel.test.tsx +12 -0
  68. package/src/components/notification-panel/notification-panel.tsx +5 -1
  69. package/src/components/page-header/page-header.test.tsx +9 -0
  70. package/src/components/page-header/page-header.tsx +5 -1
  71. package/src/components/page-metadata/page-metadata.test.tsx +15 -0
  72. package/src/components/page-metadata/page-metadata.tsx +7 -1
  73. package/src/components/phase-banner/phase-banner.test.tsx +11 -0
  74. package/src/components/phase-banner/phase-banner.tsx +5 -1
  75. package/src/components/question/question.test.tsx +10 -0
  76. package/src/components/question/question.tsx +3 -1
  77. package/src/components/radio-button/radio-button.test.tsx +13 -0
  78. package/src/components/radio-button/radio-button.tsx +3 -1
  79. package/src/components/select/select.test.tsx +15 -0
  80. package/src/components/select/select.tsx +2 -0
  81. package/src/components/sequential-navigation/sequential-navigation.test.tsx +13 -0
  82. package/src/components/sequential-navigation/sequential-navigation.tsx +5 -1
  83. package/src/components/side-navigation/side-navigation.test.tsx +18 -0
  84. package/src/components/side-navigation/side-navigation.tsx +5 -1
  85. package/src/components/site-navigation/site-navigation.test.tsx +9 -0
  86. package/src/components/site-navigation/site-navigation.tsx +5 -1
  87. package/src/components/site-search/site-search.test.tsx +10 -0
  88. package/src/components/site-search/site-search.tsx +3 -1
  89. package/src/components/tag/tag.test.tsx +7 -7
  90. package/src/components/task-list/task-list.test.tsx +46 -0
  91. package/src/components/task-list/task-list.tsx +18 -5
  92. package/src/components/text-input/text-input.test.tsx +13 -0
  93. package/src/components/textarea/textarea.test.tsx +13 -0
  94. package/src/components/textarea/textarea.tsx +2 -0
  95. package/src/components/warning-text/warning-text.test.tsx +11 -0
  96. package/src/components/warning-text/warning-text.tsx +6 -2
  97. package/.editorconfig +0 -12
  98. package/.github/workflows/release-package.yml +0 -96
@@ -0,0 +1 @@
1
+ {"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.es2021.d.ts","../node_modules/typescript/lib/lib.es2022.d.ts","../node_modules/typescript/lib/lib.es2023.d.ts","../node_modules/typescript/lib/lib.es2024.d.ts","../node_modules/typescript/lib/lib.esnext.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2016.intl.d.ts","../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.es2021.promise.d.ts","../node_modules/typescript/lib/lib.es2021.string.d.ts","../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../node_modules/typescript/lib/lib.es2021.intl.d.ts","../node_modules/typescript/lib/lib.es2022.array.d.ts","../node_modules/typescript/lib/lib.es2022.error.d.ts","../node_modules/typescript/lib/lib.es2022.intl.d.ts","../node_modules/typescript/lib/lib.es2022.object.d.ts","../node_modules/typescript/lib/lib.es2022.string.d.ts","../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../node_modules/typescript/lib/lib.es2023.array.d.ts","../node_modules/typescript/lib/lib.es2023.collection.d.ts","../node_modules/typescript/lib/lib.es2023.intl.d.ts","../node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../node_modules/typescript/lib/lib.es2024.collection.d.ts","../node_modules/typescript/lib/lib.es2024.object.d.ts","../node_modules/typescript/lib/lib.es2024.promise.d.ts","../node_modules/typescript/lib/lib.es2024.regexp.d.ts","../node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2024.string.d.ts","../node_modules/typescript/lib/lib.esnext.array.d.ts","../node_modules/typescript/lib/lib.esnext.collection.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../node_modules/typescript/lib/lib.esnext.promise.d.ts","../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../node_modules/typescript/lib/lib.esnext.iterator.d.ts","../node_modules/typescript/lib/lib.esnext.float16.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../node_modules/@types/react/global.d.ts","../node_modules/csstype/index.d.ts","../node_modules/@types/react/index.d.ts","../@types/global.d.ts","../@types/sgds.d.ts","../@types/common/ConditionalWrapper.d.ts","../@types/common/HintText.d.ts","../@types/common/Icon.d.ts","../@types/common/ScreenReaderText.d.ts","../@types/common/WrapperTag.d.ts","../@types/components/Accordion.d.ts","../@types/components/AspectBox.d.ts","../@types/components/BackToTop.d.ts","../@types/components/Breadcrumbs.d.ts","../@types/components/Button.d.ts","../@types/components/Checkbox.d.ts","../@types/components/ConfirmationMessage.d.ts","../@types/components/ContentsNav.d.ts","../@types/components/DatePicker.d.ts","../@types/components/Details.d.ts","../@types/components/ErrorMessage.d.ts","../@types/components/InsetText.d.ts","../@types/components/Metadata.d.ts","../@types/components/NotificationBanner.d.ts","../@types/components/NotificationPanel.d.ts","../@types/components/PageHeader.d.ts","../@types/components/PhaseBanner.d.ts","../@types/components/Question.d.ts","../@types/components/RadioButton.d.ts","../@types/components/Select.d.ts","../@types/components/SequentialNavigation.d.ts","../@types/components/SideNavigation.d.ts","../@types/components/SiteNavigation.d.ts","../@types/components/SiteSearch.d.ts","../@types/components/SkipLinks.d.ts","../@types/components/Tag.d.ts","../@types/components/TaskList.d.ts","../@types/components/TextInput.d.ts","../@types/components/Textarea.d.ts","../@types/components/WarningText.d.ts","../src/common/conditional-wrapper.tsx","../src/common/hint-text.tsx","../src/common/icon.tsx","../src/common/screen-reader-text.tsx","../src/common/wrapper-tag.tsx","../src/components/accordion/accordion.tsx","../src/components/aspect-box/aspect-box.tsx","../src/components/back-to-top/back-to-top.tsx","../src/components/breadcrumbs/breadcrumbs.tsx","../src/components/button/button.tsx","../src/components/checkbox/checkbox.tsx","../src/components/confirmation-message/confirmation-message.tsx","../src/components/contents-nav/contents-nav.tsx","../src/components/error-message/error-message.tsx","../src/components/text-input/text-input.tsx","../src/components/date-picker/date-picker.tsx","../src/components/details/details.tsx","../src/components/inset-text/inset-text.tsx","../src/components/notification-banner/notification-banner.tsx","../src/components/notification-panel/notification-panel.tsx","../src/components/page-header/page-header.tsx","../src/components/page-metadata/page-metadata.tsx","../src/components/tag/tag.tsx","../src/components/phase-banner/phase-banner.tsx","../src/components/question/question.tsx","../src/components/radio-button/radio-button.tsx","../src/components/select/select.tsx","../src/components/sequential-navigation/sequential-navigation.tsx","../src/components/side-navigation/side-navigation.tsx","../src/components/site-navigation/site-navigation.tsx","../src/components/site-search/site-search.tsx","../src/components/skip-links/skip-links.tsx","../src/components/task-list/task-list.tsx","../src/components/textarea/textarea.tsx","../src/components/warning-text/warning-text.tsx"],"fileIdsList":[[83],[81,82],[83,125],[83,123],[123,124,125],[83,122],[123,125],[125],[83,135],[83,123,124,130],[143],[122,125,134],[122],[122,134],[83,130],[83,121,122,124,143],[83,121,122,130,134],[83,121,122,134]],"fileInfos":[{"version":"69684132aeb9b5642cbcd9e22dff7818ff0ee1aa831728af0ecf97d3364d5546","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","impliedFormat":1},{"version":"8fd575e12870e9944c7e1d62e1f5a73fcf23dd8d3a321f2a2c74c20d022283fe","impliedFormat":1},{"version":"8bf8b5e44e3c9c36f98e1007e8b7018c0f38d8adc07aecef42f5200114547c70","impliedFormat":1},{"version":"092c2bfe125ce69dbb1223c85d68d4d2397d7d8411867b5cc03cec902c233763","affectsGlobalScope":true,"impliedFormat":1},{"version":"07f073f19d67f74d732b1adea08e1dc66b1b58d77cb5b43931dee3d798a2fd53","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"b5ce7a470bc3628408429040c4e3a53a27755022a32fd05e2cb694e7015386c7","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"df83c2a6c73228b625b0beb6669c7ee2a09c914637e2d35170723ad49c0f5cd4","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true,"impliedFormat":1},{"version":"87dc0f382502f5bbce5129bdc0aea21e19a3abbc19259e0b43ae038a9fc4e326","affectsGlobalScope":true,"impliedFormat":1},{"version":"b1cb28af0c891c8c96b2d6b7be76bd394fddcfdb4709a20ba05a7c1605eea0f9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true,"impliedFormat":1},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ece9f17b3866cc077099c73f4983bddbcb1dc7ddb943227f1ec070f529dedd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true,"impliedFormat":1},{"version":"1c9319a09485199c1f7b0498f2988d6d2249793ef67edda49d1e584746be9032","affectsGlobalScope":true,"impliedFormat":1},{"version":"e3a2a0cee0f03ffdde24d89660eba2685bfbdeae955a6c67e8c4c9fd28928eeb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"51ad4c928303041605b4d7ae32e0c1ee387d43a24cd6f1ebf4a2699e1076d4fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"60037901da1a425516449b9a20073aa03386cce92f7a1fd902d7602be3a7c2e9","affectsGlobalScope":true,"impliedFormat":1},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true,"impliedFormat":1},{"version":"22adec94ef7047a6c9d1af3cb96be87a335908bf9ef386ae9fd50eeb37f44c47","affectsGlobalScope":true,"impliedFormat":1},{"version":"4245fee526a7d1754529d19227ecbf3be066ff79ebb6a380d78e41648f2f224d","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"170d4db14678c68178ee8a3d5a990d5afb759ecb6ec44dbd885c50f6da6204f6","affectsGlobalScope":true,"impliedFormat":1},{"version":"8a8eb4ebffd85e589a1cc7c178e291626c359543403d58c9cd22b81fab5b1fb9","impliedFormat":1},{"version":"9e83685e23baf56b50eab5f89bcc46c66ccd709c4a44d32e635040196ad96603","impliedFormat":1},{"version":"19539467bf78201a93c2a00eeb99c728f52b4e623f14a7f20a691137e784c334","impliedFormat":1},{"version":"f9b9dc393258bafa22767d901343c7a0721d4cdf4273c1b4ee2ea59c4a9d8aee","affectsGlobalScope":true,"impliedFormat":1},{"version":"098d9d86ccf5d87f66dd1aba5edc7a79ac3c743252d0fcfc165f0842bbbbc03d","affectsGlobalScope":true,"impliedFormat":1},{"version":"5c64ea2259c2aca1681436a2c3515bbb8ae5961c9e3b7586599b9ea93d5126bc","affectsGlobalScope":true,"impliedFormat":1},{"version":"527e5c92e78b41a24d5cab110a753a84bdcf5ee366d50438d02340143ad4046c","affectsGlobalScope":true,"impliedFormat":1},{"version":"a2e5bd2aad7954b25979f0365662427432b417fee161a0143f4b57df59a77bee","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e4b84a1a0cf7e4beddc9fd133eeb16f57be77a743ed54a22a16f2573dd1049c","affectsGlobalScope":true,"impliedFormat":1},{"version":"501194205e656e49eda24bc4cb2991153086ce84f5de2cc6298958780baf5dc0","affectsGlobalScope":true,"impliedFormat":1},{"version":"7d9f663a357c9604e121dbb84c3197397d4cf0a70c632a7bb8ab52ecffb47fe9","affectsGlobalScope":true,"impliedFormat":1},{"version":"795a3344a3c1b9b23670d059e1d787d9b19bf4f5ba95a2bf1bf6d45f68edf879","affectsGlobalScope":true,"impliedFormat":1},{"version":"7a44882e64a6d02f9a1f7a5df840527c880f521f8391b34139bc3e0bc1a01071","affectsGlobalScope":true,"impliedFormat":1},{"version":"148729bac4e2f326c6d433a8cc8f6220354232b3b8d0c186d6d49c0baace62a5","affectsGlobalScope":true,"impliedFormat":1},{"version":"0cbae2256b8da5fa94a91e4588aacdeb0a76fdc4b95f130fd2a52ce14bae56ae","affectsGlobalScope":true,"impliedFormat":1},{"version":"d4b53d63911fa086cb2fe8dd1fd9fa37db0b0461fee2130174948fefab42b615","affectsGlobalScope":true,"impliedFormat":1},{"version":"0d1bbfc37f476714da448da21f0149cb29764dc28cc293860cd869b433bb4faa","affectsGlobalScope":true,"impliedFormat":1},{"version":"ddd452d2f677bf5eb95e1672bc1376a0745531d256f7cceca0d0bdfedabfefa7","affectsGlobalScope":true,"impliedFormat":1},{"version":"2308590a9d9174ba57f30d6cfe8e07756948759df448de60f3f2efd31615c49b","affectsGlobalScope":true,"impliedFormat":1},{"version":"6f933631f0519bd773d97948188b592717de588ecd462f11345d7a37c5df5176","affectsGlobalScope":true,"impliedFormat":1},{"version":"c206b97d5374757c38f36fb1b6c356b4af822ab252d21a3e90c1b467df41ba13","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4a7a40fb52c0bebeeeed3e67e40d02c576daf6d0c568433b1004fbdc281826b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d2bbe44e8ca142c128f00c20f9fe339ae169d7a1ea7cb04c15b9741788663d5a","affectsGlobalScope":true,"impliedFormat":1},{"version":"d8db02e37668444307cf5df8a0acc6c6a7439b51666c97c345abfa4b82bc21bc","affectsGlobalScope":true,"impliedFormat":1},{"version":"98ca85bc6fcc9b784ae5e74a4645a079ea54f01f8ccce536d08d69bf35bee782","affectsGlobalScope":true,"impliedFormat":1},{"version":"6e1bd61a56720b4adb5bb5fca7a7f91ed91cb5afc70860cd652f10cb390a9321","affectsGlobalScope":true,"impliedFormat":1},{"version":"4d00e31abec9e0f86cf5930cb318852dfbdb7249e86a3135cb80d38a9872b142","affectsGlobalScope":true,"impliedFormat":1},{"version":"6e9bd4fd9758ed505ae41d33753a0cdf46e1549c7809f50bcac83a698905b7e7","affectsGlobalScope":true,"impliedFormat":1},{"version":"fe4b9f17452cbf2eb5723458db431366666f7a49547e309b6215cf81abd30e1f","affectsGlobalScope":true,"impliedFormat":1},{"version":"3e4e533ab1cd3bb55d1a4e87645737eb9b1697a0f203d8f87ea749d33e069d44","affectsGlobalScope":true,"impliedFormat":1},{"version":"d26f2ab557b364856451c4b6fe7a13f7bb259502decf8f3c4d05df5ee9e8a495","affectsGlobalScope":true,"impliedFormat":1},{"version":"5dbaaa54ab4b7a06488588a23fad4fb1e29c6698120846421e0748cae042caf5","affectsGlobalScope":true,"impliedFormat":1},{"version":"6fba9b8227813f40a4b1da3b0621a6875ac3a60fb03f716bad5ba35ae31200e7","affectsGlobalScope":true,"impliedFormat":1},{"version":"f79373f20bb8b8a2268e13516a67c003b5f87edd088d49478028031299567fce","affectsGlobalScope":true,"impliedFormat":1},{"version":"f320fba72ee15fdba35a7e57744f432f12d200d4cf4ff8ddfdfe7faee84a8cae","affectsGlobalScope":true,"impliedFormat":1},{"version":"b229c3f876810314bd63b09c469d69aeb2e02c22ca6342dfdccb5202c7874d0d","affectsGlobalScope":true,"impliedFormat":1},{"version":"210791dd24c88a8eb27a91a11c1cd0299d62efa8e0eb030de154d5b30b52decd","affectsGlobalScope":true,"impliedFormat":1},{"version":"cc670c5cfaeed3b2362c9addc3b2037c2633f284f6d5d2679d9bcf043a8f21e5","affectsGlobalScope":true,"impliedFormat":1},{"version":"02e9eac7ab6147b04f14766548bdfea780b3e8b662ae95d2f6c855b34bc2de50","affectsGlobalScope":true,"impliedFormat":1},{"version":"68fe33fa82c2dd40de4f5e62d46ff7712a55e5ff11c5a00f45d46e3f4736dd32","impliedFormat":1},{"version":"81196068f2e4f59cc70e5a595b073a5798eef50054ed3807a43e457f78c84c55","impliedFormat":1},{"version":"7fafd4ed1ea648d24187ee52b5b6996c16560b7e76b88577325787236d22c126","impliedFormat":1},{"version":"71658a25bc2c1c615459d63c9e1ecc230822572c06112d570f63b2a6352333b1","impliedFormat":1},{"version":"1c1d08289fee4149d7a9b6a71f2d8f622312c642ba23ca6c67dbc182a34a90e6","impliedFormat":1},{"version":"e1773f8ac220dbf2d375272db9402d66c2d1da29587c0247ac9f52751134d8fb","impliedFormat":1},{"version":"68ed7411ba50ebf08ff30d1adb3907f4760f0426fe150d0499ee735a7fb421c3","impliedFormat":1},{"version":"9e3c61724b84a8b7b887ad6376c44a8eefbe0963983ee3d7e809d3b08c20a642","impliedFormat":1},{"version":"a4b009a721caedee5187f0ba1b9bba106e76238727de2f915730607fa22f0df3","impliedFormat":1},{"version":"6a243a02400cfe956a2921089defaac4e24add269cdbd02d34bd89b00e8f33ed","impliedFormat":1},{"version":"ee6fac5b0e386e8d8c31dcaf02b1ebf8e5b19eaa7d36f29f5f1491a139fdb0a3","impliedFormat":1},{"version":"2feef6501da659e89a5f922e7499dfe091e91cea147571c41afb927254e1a17f","impliedFormat":1},{"version":"70287ac8ab96b9601995d6325dca0543dd1a650a7f85db613efb5c14be6eb839","impliedFormat":1},{"version":"0416a5fe878ebedc02e06bfe19bd663ecc9c04509dea0e5e3f4bbfc62de890b8","impliedFormat":1},{"version":"1aed7739f295a3d38ce16d0991c0ed16241bd050ec2770020e41b8cdd6405b56","impliedFormat":1},{"version":"6556c70090b19daef64f71407fc02e7b9b53d32f55542034a32e871326b248b1","impliedFormat":1},{"version":"d63b732a10871586e4e10603788a3b4beedd0e4dfcf96e3f9a62e3024d605953","impliedFormat":1},{"version":"bb075edab757fa79c11ea29b67ff72f5bf9714314f03959aca0ba98b3b9aec4c","impliedFormat":1},{"version":"e15019c72f47712fd0b3139c33ec26a64727dcf497c861dbf2f7bcd0e7771a2d","impliedFormat":1},{"version":"ce42cccbdd55dbfea43e32448bd29252b778bba1e1a4857a3612525f37275185","impliedFormat":1},{"version":"9afd7adbfef5e5cb2c7bf1bc4699e770e3a5322860a681c413b76518f212a8a7","impliedFormat":1},{"version":"72f00bc306c9515ec674649012078c7d282b4eff1e3d5958fa3bce27d8661e6f","impliedFormat":1},{"version":"19ac84ce5462c741d67e99fb788a5f7766bb392f938a9ea6f94534a71d4a7b7a","impliedFormat":1},{"version":"9b1eea31953c44c52a024e203a10763f2477740e6beaff8ae2e57cbad50d8512","impliedFormat":1},{"version":"1d9498d7d5307bd7d44e931893a5024d0f50d13ca16afce3917690603b063744","impliedFormat":1},{"version":"f197bb05cc35c9d3d553ef4db6255c66537928cb1767b35177829e3180224826","impliedFormat":1},{"version":"b8b1cd09c051f7d36e789b1f59918a01f714588d20139acfcd833bdbea39e86e","impliedFormat":1},{"version":"ca9fbca3a40eb55e3566e6b5c67a535faf6c0d50654f0c3d49b9b62cd84650fb","impliedFormat":1},{"version":"5b50fb0a2b3e7d124e4b7547cc1670fa3a6b0430abafa488ec82a45605917b66","impliedFormat":1},{"version":"823be4a3cafb660e571baa2a82240a584304192e83e9d473b34f154235cb9870","impliedFormat":1},{"version":"3e9cd53a17b0c84abcf45b36d37e0c01df1badede590a1efff82b6fd0203d28a","impliedFormat":1},{"version":"d8a8326bd7f6c4ec38d06566169e7ad954a8e9cca2faadd1996e9fa6e89653ce","impliedFormat":1},{"version":"6f17fe396319d1eff09115d2c2729a1a42303547d441c6ef4a896396f5d70fdf","impliedFormat":1},{"version":"f3fb1b11081d594d9b103dd8fbebe977be8031b80507462a2f337707c868a214","impliedFormat":1},{"version":"651fdffc4aca1129ae4a70228d3171e8acb637307bb6a85b791cd68f33416aaf","impliedFormat":1}],"root":[[84,155]],"options":{"allowJs":false,"esModuleInterop":true,"jsx":1,"module":199,"noFallthroughCasesInSwitch":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","strict":true,"target":99},"referencedMap":[[84,1],[83,2],[126,3],[127,1],[128,4],[130,5],[131,6],[132,7],[133,8],[136,9],[139,10],[140,8],[144,11],[145,12],[146,13],[147,14],[149,1],[151,15],[153,16],[135,17],[154,18]],"version":"5.8.3"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scottish-government/designsystem-react",
3
3
  "description": "A React/JSX implementation of the Scottish Government Design System",
4
- "version": "0.0.2",
4
+ "version": "0.1.1",
5
5
  "license": "MIT",
6
6
  "author": {
7
7
  "name": "Scottish Government Digital Design System team",
@@ -36,7 +36,7 @@ test('icon with class name', () => {
36
36
 
37
37
  const icon = screen.getByRole('img', {hidden: true});
38
38
 
39
- expect(icon).toHaveClass('foo');
39
+ expect(icon).toHaveClass('foo', 'ds_icon');
40
40
  });
41
41
 
42
42
  test('icon with fill', () => {
@@ -101,7 +101,7 @@ test('accordion with custom header level', () => {
101
101
  );
102
102
 
103
103
  const firstAccordionTitle = document.querySelector('.ds_accordion-item__title');
104
- expect(firstAccordionTitle.tagName).toEqual(headerLevel.toUpperCase());
104
+ expect(firstAccordionTitle?.tagName).toEqual(headerLevel.toUpperCase());
105
105
  });
106
106
 
107
107
  test('passing additional props to accordion', () => {
@@ -114,6 +114,16 @@ test('passing additional props to accordion', () => {
114
114
  expect(accordion?.dataset.test).toEqual('foo');
115
115
  });
116
116
 
117
+ test('passing additional CSS classes', () => {
118
+ render(
119
+ <Accordion id={id} data-testid={id} className="foo">
120
+ </Accordion>
121
+ );
122
+
123
+ const accordion = screen.getByTestId(id);
124
+ expect(accordion).toHaveClass('foo', 'ds_accordion');
125
+ });
126
+
117
127
  test('accordion item renders correctly', () => {
118
128
  render(
119
129
  <AccordionItem id={itemId} data-testid={itemId} title={titleText}>
@@ -210,3 +220,17 @@ test('passing additional props to accordion item', () => {
210
220
  const accordionItem = screen.getByTestId(itemId);
211
221
  expect(accordionItem?.dataset.test).toEqual('foo');
212
222
  });
223
+
224
+ test('passing additional CSS classes', () => {
225
+ render(
226
+ <AccordionItem id={itemId} data-testid={itemId} title="Healthcare for veterans" className="foo">
227
+ <p>Veterans are entitled to the same healthcare as any citizen. And there
228
+ are health care options and support available specifically for veterans.</p>
229
+ <p>If you have a health condition that’s related to your service, you’re
230
+ entitled to priority treatment based on clinical need.</p>
231
+ </AccordionItem>
232
+ );
233
+
234
+ const accordionItem = screen.getByTestId(itemId);
235
+ expect(accordionItem).toHaveClass('foo', 'ds_accordion-item');
236
+ });
@@ -7,6 +7,7 @@ let accordionItemCounter = 0;
7
7
 
8
8
  export const AccordionItem: React.FC<SGDS.Component.Accordion.Item> = ({
9
9
  children,
10
+ className,
10
11
  headerLevel = 'h3',
11
12
  id: rawId,
12
13
  open = false,
@@ -17,7 +18,10 @@ export const AccordionItem: React.FC<SGDS.Component.Accordion.Item> = ({
17
18
  const processedId = rawId || `accordion-item-${accordionItemCounter}`;
18
19
  return (
19
20
  <div
20
- className="ds_accordion-item"
21
+ className={[
22
+ 'ds_accordion-item',
23
+ className
24
+ ].join(' ')}
21
25
  id={processedId}
22
26
  {...props}
23
27
  >
@@ -56,6 +60,7 @@ export const AccordionItem: React.FC<SGDS.Component.Accordion.Item> = ({
56
60
 
57
61
  const Accordion: React.FC<SGDS.Component.Accordion> = ({
58
62
  children,
63
+ className,
59
64
  headerLevel = 'h3',
60
65
  hideOpenAll,
61
66
  ...props
@@ -78,7 +83,10 @@ const Accordion: React.FC<SGDS.Component.Accordion> = ({
78
83
 
79
84
  return (
80
85
  <div
81
- className='ds_accordion'
86
+ className={[
87
+ 'ds_accordion',
88
+ className
89
+ ].join(' ')}
82
90
  ref={ref}
83
91
  {...props}
84
92
  >
@@ -79,3 +79,15 @@ test('passing additional props', () => {
79
79
  const imageContainer = image?.parentNode;
80
80
  expect(imageContainer?.dataset.test).toEqual('foo');
81
81
  });
82
+
83
+ test('passing additional CSS classes', () => {
84
+ render(
85
+ <AspectBox className="foo">
86
+ <img src="./highland-cow.jpg" alt="" />
87
+ </AspectBox>
88
+ );
89
+
90
+ const image = document.querySelector('img');
91
+ const imageContainer = image?.parentNode;
92
+ expect(imageContainer).toHaveClass('foo', 'ds_aspect-box');
93
+ });
@@ -4,6 +4,7 @@ import DSAspectBox from '@scottish-government/design-system/src/components/aspec
4
4
 
5
5
  const AspectBox: React.FC<SGDS.Component.AspectBox> = ({
6
6
  children,
7
+ className,
7
8
  ratio,
8
9
  ...props
9
10
  }) => {
@@ -42,7 +43,8 @@ const AspectBox: React.FC<SGDS.Component.AspectBox> = ({
42
43
  <div
43
44
  className={[
44
45
  'ds_aspect-box',
45
- `${ratioClassName}`
46
+ ratioClassName,
47
+ className
46
48
  ].join(' ')}
47
49
  ref={ref}
48
50
  {...props}
@@ -43,3 +43,13 @@ test('passing additional props', () => {
43
43
  const container = button.parentElement;
44
44
  expect(container?.dataset.test).toEqual('foo');
45
45
  });
46
+
47
+ test('passing additional CSS classes', () => {
48
+ render(
49
+ <BackToTop className="foo" />
50
+ );
51
+
52
+ const button = screen.getByRole('link');
53
+ const container = button.parentElement;
54
+ expect(container).toHaveClass('foo');
55
+ });
@@ -4,6 +4,7 @@ import DSBackToTop from '@scottish-government/design-system/src/components/back-
4
4
  import Icon from '../../common/icon';
5
5
 
6
6
  const BackToTop: React.FC<SGDS.Component.BackToTop> = ({
7
+ className,
7
8
  href = '#page-top',
8
9
  ...props
9
10
  }) => {
@@ -17,7 +18,10 @@ const BackToTop: React.FC<SGDS.Component.BackToTop> = ({
17
18
 
18
19
  return (
19
20
  <div
20
- className='ds_back-to-top'
21
+ className={[
22
+ 'ds_back-to-top',
23
+ className
24
+ ].join(' ')}
21
25
  ref={ref}
22
26
  {...props}
23
27
  >
@@ -75,3 +75,15 @@ test('passing additional props', () => {
75
75
  const nav = screen.getByRole('navigation');
76
76
  expect(nav.dataset.test).toEqual('foo');
77
77
  });
78
+
79
+ test('passing additional CSS classes', () => {
80
+ render(
81
+ <Breadcrumbs
82
+ items={items}
83
+ className="foo"
84
+ />
85
+ );
86
+
87
+ const nav = screen.getByRole('navigation');
88
+ expect(nav).toHaveClass('foo');
89
+ });
@@ -25,6 +25,7 @@ const Breadcrumb: React.FC<SGDS.Component.Breadcrumbs.Item> = ({
25
25
  * @returns {JSX.Element} - The element
26
26
  */
27
27
  const Breadcrumbs: React.FC<SGDS.Component.Breadcrumbs> = ({
28
+ className,
28
29
  hideLastItem,
29
30
  items,
30
31
  ...props
@@ -32,6 +33,7 @@ const Breadcrumbs: React.FC<SGDS.Component.Breadcrumbs> = ({
32
33
  return (
33
34
  <nav
34
35
  aria-label="Breadcrumb"
36
+ className={className}
35
37
  {...props}
36
38
  >
37
39
  <ol className="ds_breadcrumbs">
@@ -123,3 +123,12 @@ test('passing additional props', () => {
123
123
  const button = screen.getByRole('button');
124
124
  expect(button.dataset.test).toEqual('foo');
125
125
  });
126
+
127
+ test('passing additional CSS classes', () => {
128
+ render(
129
+ <Button className="foo">Button text</Button>
130
+ );
131
+
132
+ const button = screen.getByRole('button');
133
+ expect(button).toHaveClass('foo', 'ds_button');
134
+ });
@@ -3,8 +3,9 @@ import ScreenReaderText from '../../common/screen-reader-text';
3
3
  import WrapperTag from '../../common/wrapper-tag';
4
4
 
5
5
  const Button: React.FC<SGDS.Component.Button> = ({
6
- children,
7
6
  buttonStyle,
7
+ children,
8
+ className,
8
9
  icon,
9
10
  iconLeft,
10
11
  iconOnly = false,
@@ -30,7 +31,8 @@ const Button: React.FC<SGDS.Component.Button> = ({
30
31
  buttonStyle && `ds_button--${buttonStyle}`,
31
32
  small && 'ds_button--small',
32
33
  (icon && !iconOnly) ? 'ds_button--has-icon' : undefined,
33
- iconLeft && 'ds_button--has-icon--left'
34
+ iconLeft && 'ds_button--has-icon--left',
35
+ className
34
36
  ].join(' ')}
35
37
  href={href}
36
38
  {...(tagName === 'button' ? { type: type } : {})}
@@ -178,3 +178,16 @@ test('passing additional props', () => {
178
178
  const groupContainer = checkboxes[0]?.parentNode?.parentNode;
179
179
  expect(groupContainer?.dataset.test).toEqual('foo');
180
180
  });
181
+
182
+ test('passing additional CSS classes', () => {
183
+ render(
184
+ <CheckboxGroup className="foo" items={[{
185
+ id: 'universal-credit',
186
+ label: 'Universal Credit'
187
+ }]} />
188
+ );
189
+
190
+ const checkboxes = screen.getAllByRole('checkbox');
191
+ const groupContainer = checkboxes[0]?.parentNode?.parentNode;
192
+ expect(groupContainer).toHaveClass('foo', 'ds_checkboxes');
193
+ });
@@ -65,6 +65,7 @@ export const Checkbox: React.FC<SGDS.Component.Checkbox> = ({
65
65
  * @returns {JSX.Element} - The element
66
66
  */
67
67
  export const CheckboxGroup: React.FC<SGDS.Component.Checkbox.Group> = ({
68
+ className,
68
69
  items,
69
70
  small,
70
71
  ...props
@@ -79,7 +80,11 @@ export const CheckboxGroup: React.FC<SGDS.Component.Checkbox.Group> = ({
79
80
 
80
81
  return (
81
82
  <div
82
- className="ds_checkboxes ds_field-group"
83
+ className={[
84
+ 'ds_checkboxes',
85
+ 'ds_field-group',
86
+ className
87
+ ].join(' ')}
83
88
  data-module="ds-checkboxes"
84
89
  ref={ref}
85
90
  {...props}
@@ -44,3 +44,25 @@ test('renders confirmation message with custom aria live and custom heaer level'
44
44
 
45
45
  expect(header.tagName).toEqual('H2');
46
46
  });
47
+
48
+ test('passing additional props', () => {
49
+ render(
50
+ <ConfirmationMessage data-test="foo" title={titleString}>
51
+ <p>You have added the landlord <strong>John Smith</strong> to the application.</p>
52
+ </ConfirmationMessage>
53
+ );
54
+
55
+ const container = document.querySelector('.ds_confirmation-message');
56
+ expect(container?.dataset.test).toEqual('foo');
57
+ });
58
+
59
+ test('passing additional CSS classes', () => {
60
+ render(
61
+ <ConfirmationMessage className="foo" title={titleString}>
62
+ <p>You have added the landlord <strong>John Smith</strong> to the application.</p>
63
+ </ConfirmationMessage>
64
+ );
65
+
66
+ const container = document.querySelector('.ds_confirmation-message');
67
+ expect(container).toHaveClass('foo', 'ds_confirmation-message');
68
+ })
@@ -4,13 +4,19 @@ import WrapperTag from '../../common/wrapper-tag';
4
4
  const ConfirmationMessage: React.FC<SGDS.Component.ConfirmationMessage> = ({
5
5
  ariaLive = 'polite',
6
6
  children,
7
+ className,
7
8
  headerLevel = 'h3',
8
- title
9
+ title,
10
+ ...props
9
11
  }) => {
10
12
  return (
11
13
  <div
12
14
  aria-live={ariaLive}
13
- className="ds_confirmation-message"
15
+ className={[
16
+ 'ds_confirmation-message',
17
+ className
18
+ ].join(' ')}
19
+ {...props}
14
20
  >
15
21
  <Icon className="ds_confirmation-message__icon" icon="check_circle" iconSize="24" />
16
22
 
@@ -134,3 +134,16 @@ test('passing additional props', () => {
134
134
  const contentsNav = screen.getByRole('navigation');
135
135
  expect(contentsNav?.dataset.test).toEqual('foo');
136
136
  });
137
+
138
+ test('passing additional CSS classes', () => {
139
+ render(
140
+ <ContentsNav className="foo" items={[
141
+ {
142
+ title: 'Apply for Blue Badge',
143
+ }
144
+ ]} />
145
+ )
146
+
147
+ const contentsNav = screen.getByRole('navigation');
148
+ expect(contentsNav).toHaveClass('foo', 'ds_contents-nav');
149
+ });
@@ -1,9 +1,9 @@
1
1
  import WrapperTag from '../../common/wrapper-tag';
2
2
 
3
3
  export const Link: React.FC<SGDS.Component.ContentsNav.Link> = ({
4
- title,
5
4
  current,
6
- href
5
+ href,
6
+ title
7
7
  }) => {
8
8
  // determine which HTML tag to use
9
9
  const tagName = href && !current ? 'a' : 'span';
@@ -27,7 +27,8 @@ export const Link: React.FC<SGDS.Component.ContentsNav.Link> = ({
27
27
  );
28
28
  };
29
29
 
30
- const ContentsNav: React.FC<SGDS.Component.ContentsNav> = function({
30
+ const ContentsNav: React.FC<SGDS.Component.ContentsNav> = function ({
31
+ className,
31
32
  items,
32
33
  label = 'Pages in this section',
33
34
  title = 'Contents',
@@ -36,7 +37,10 @@ const ContentsNav: React.FC<SGDS.Component.ContentsNav> = function({
36
37
  return (
37
38
  <nav
38
39
  aria-label={label}
39
- className="ds_contents-nav"
40
+ className={[
41
+ 'ds_contents-nav',
42
+ className
43
+ ].join(' ')}
40
44
  {...props}
41
45
  >
42
46
  <h2 className="ds_contents-nav__title">{title}</h2>
@@ -207,3 +207,16 @@ test('passing additional props', () => {
207
207
  const datePicker = screen.getAllByRole('generic')[1];
208
208
  expect(datePicker?.dataset.test).toEqual('foo');
209
209
  });
210
+
211
+ test('passing additional CSS classes', () => {
212
+ render(
213
+ <DatePicker
214
+ id={id}
215
+ label={labelText}
216
+ className="foo"
217
+ />
218
+ )
219
+
220
+ const datePicker = screen.getAllByRole('generic')[1];
221
+ expect(datePicker).toHaveClass('foo', 'ds_datepicker');
222
+ });
@@ -4,7 +4,7 @@ import DSDatePicker from '@scottish-government/design-system/src/components/date
4
4
  import TextInput from '../text-input/text-input';
5
5
 
6
6
  const DatePicker: React.FC<SGDS.Component.DatePicker> = ({
7
- width = 'fixed-10',
7
+ className,
8
8
  disabledDates,
9
9
  error,
10
10
  errorMessage,
@@ -19,6 +19,7 @@ const DatePicker: React.FC<SGDS.Component.DatePicker> = ({
19
19
  onBlur,
20
20
  onChange,
21
21
  value,
22
+ width = 'fixed-10',
22
23
  ...props
23
24
  }) => {
24
25
  // todo: dateSelectCallback function
@@ -47,7 +48,8 @@ const DatePicker: React.FC<SGDS.Component.DatePicker> = ({
47
48
  <div
48
49
  className={[
49
50
  "ds_datepicker",
50
- multiple && "ds_datepicker--multiple"
51
+ multiple && "ds_datepicker--multiple",
52
+ className
51
53
  ].join(' ')}
52
54
  data-disableddates={disabledDates}
53
55
  data-maxdate={maxDate}
@@ -36,3 +36,15 @@ test('passing additional props', () => {
36
36
  const detailsElement = summaryElement.parentNode;
37
37
  expect(detailsElement?.dataset.test).toEqual('foo');
38
38
  });
39
+
40
+ test('passing additional CSS classes', () => {
41
+ render(
42
+ <Details className="foo" summary={summaryText}>
43
+ <p>hello</p>
44
+ </Details>
45
+ )
46
+
47
+ const summaryElement = screen.getByText(summaryText);
48
+ const detailsElement = summaryElement.parentNode;
49
+ expect(detailsElement).toHaveClass('foo', 'ds_details');
50
+ });
@@ -1,5 +1,6 @@
1
1
  const Details: React.FC<SGDS.Component.Details> = ({
2
2
  children,
3
+ className,
3
4
  summary,
4
5
  ...props
5
6
  }) => {
@@ -7,6 +8,7 @@ const Details: React.FC<SGDS.Component.Details> = ({
7
8
  <details
8
9
  className={[
9
10
  "ds_details",
11
+ className
10
12
  ].join(' ')}
11
13
  {...props}
12
14
  >
@@ -38,3 +38,12 @@ test('passing additional props', () => {
38
38
  const errorMessageElement = screen.getByRole('paragraph');
39
39
  expect(errorMessageElement?.dataset.test).toEqual('foo');
40
40
  });
41
+
42
+ test('passing additional CSS classes', () => {
43
+ render(
44
+ <ErrorMessage className="foo" text={errorText} id={errorId}/>
45
+ )
46
+
47
+ const errorMessageElement = screen.getByRole('paragraph');
48
+ expect(errorMessageElement).toHaveClass('foo', 'ds_question__error-message');
49
+ });
@@ -1,5 +1,6 @@
1
1
  const ErrorMessage: React.FC<SGDS.Component.ErrorMessage> = ({
2
2
  children,
3
+ className,
3
4
  id,
4
5
  text,
5
6
  ...props
@@ -8,6 +9,7 @@ const ErrorMessage: React.FC<SGDS.Component.ErrorMessage> = ({
8
9
  <p
9
10
  className={[
10
11
  'ds_question__error-message',
12
+ className
11
13
  ].join(' ')}
12
14
  dangerouslySetInnerHTML={text ? { __html: text } : undefined}
13
15
  id={id}
@@ -31,3 +31,14 @@ test('passing additional props', () => {
31
31
  const insetTextOuter = document.querySelector('.ds_inset-text');
32
32
  expect(insetTextOuter?.dataset.test).toEqual('foo');
33
33
  });
34
+
35
+ test('passing additional CSS classes', () => {
36
+ render(
37
+ <InsetText className="foo">
38
+ {text}
39
+ </InsetText>
40
+ )
41
+
42
+ const insetTextOuter = document.querySelector('.ds_inset-text');
43
+ expect(insetTextOuter).toHaveClass('foo', 'ds_inset-text');
44
+ });
@@ -1,10 +1,14 @@
1
- const InsetText: React.FC<React.PropsWithChildren> = ({
1
+ const InsetText: React.FC<SGDS.Component.InsetText> = ({
2
2
  children,
3
+ className,
3
4
  ...props
4
5
  }) => {
5
6
  return (
6
7
  <div
7
- className="ds_inset-text"
8
+ className={[
9
+ 'ds_inset-text',
10
+ className
11
+ ].join(' ')}
8
12
  {...props}
9
13
  >
10
14
  <div className="ds_inset-text__text">
@@ -91,3 +91,14 @@ test('passing additional props', () => {
91
91
  const bannerContainer = document.querySelector('.ds_notification');
92
92
  expect(bannerContainer?.dataset.test).toEqual('foo');
93
93
  });
94
+
95
+ test('passing additional CSS classes', () => {
96
+ render(
97
+ <NotificationBanner className="foo">
98
+ {text}
99
+ </NotificationBanner>
100
+ )
101
+
102
+ const bannerContainer = document.querySelector('.ds_notification');
103
+ expect(bannerContainer).toHaveClass('foo', 'ds_notification');
104
+ });
@@ -7,6 +7,7 @@ import ScreenReaderText from '../../common/screen-reader-text';
7
7
 
8
8
  const NotificationBanner: React.FC<SGDS.Component.NotificationBanner> = ({
9
9
  children,
10
+ className,
10
11
  close,
11
12
  icon,
12
13
  iconColour,
@@ -24,7 +25,11 @@ const NotificationBanner: React.FC<SGDS.Component.NotificationBanner> = ({
24
25
 
25
26
  return (
26
27
  <div
27
- className="ds_notification ds_reversed"
28
+ className={[
29
+ 'ds_notification',
30
+ 'ds_reversed',
31
+ className
32
+ ].join(' ')}
28
33
  data-module="ds-notification"
29
34
  ref={ref}
30
35
  {...props}