diff --git a/BrowserKit/Sources/ComponentLibrary/Documentation.docc/ComponentLibrary.md b/BrowserKit/Sources/ComponentLibrary/Documentation.docc/ComponentLibrary.md index eaaf472d0c66..af9b67f2616b 100644 --- a/BrowserKit/Sources/ComponentLibrary/Documentation.docc/ComponentLibrary.md +++ b/BrowserKit/Sources/ComponentLibrary/Documentation.docc/ComponentLibrary.md @@ -31,6 +31,7 @@ Buildings blocks are classes uses by devs to enabled General or Feature componen - ``BottomSheetViewController`` - ``CardView`` +- ``CloseButton`` - ``CollapsibleCardView`` - ``ContextualHintView`` - ``LinkButton`` diff --git a/BrowserKit/Sources/ComponentLibrary/Documentation.docc/General Components/CloseButton.md b/BrowserKit/Sources/ComponentLibrary/Documentation.docc/General Components/CloseButton.md new file mode 100644 index 000000000000..e594df35fb50 --- /dev/null +++ b/BrowserKit/Sources/ComponentLibrary/Documentation.docc/General Components/CloseButton.md @@ -0,0 +1,27 @@ +# ``ComponentLibrary/CloseButton`` + +The button which is used for closing a window. + +## Overview + +The `CloseButton` is a subclass of the `UIButton`. This means properties of the `UIButton` are accessible, but for easy conveniance it's recommended to configure the button title, font and accessibility identifier through it's' view model ``CloseButtonViewModel``. The button size shouldn't be adjusted and should be used as is. + +## Illustration + +> This image is illustrative only. For precise examples of iOS implementation, please run the SampleApplication. + +@TabNavigator { + @Tab("Light") { + ![The CloseButton on iOS](CloseButton) + } + + @Tab("Dark") { + ![The CloseButton Dark on iOS](CloseButton-dark) + } +} + +## Topics + +### View Model + +- ``CloseButtonViewModel`` diff --git a/BrowserKit/Sources/ComponentLibrary/Documentation.docc/Resources/CloseButton-dark.png b/BrowserKit/Sources/ComponentLibrary/Documentation.docc/Resources/CloseButton-dark.png new file mode 100644 index 000000000000..66aa59e9467a Binary files /dev/null and b/BrowserKit/Sources/ComponentLibrary/Documentation.docc/Resources/CloseButton-dark.png differ diff --git a/BrowserKit/Sources/ComponentLibrary/Documentation.docc/Resources/CloseButton.png b/BrowserKit/Sources/ComponentLibrary/Documentation.docc/Resources/CloseButton.png new file mode 100644 index 000000000000..b435f82f8418 Binary files /dev/null and b/BrowserKit/Sources/ComponentLibrary/Documentation.docc/Resources/CloseButton.png differ diff --git a/SampleComponentLibraryApp/SampleComponentLibraryApp/BottomSheet/BottomSheetComponentViewModel.swift b/SampleComponentLibraryApp/SampleComponentLibraryApp/BottomSheet/BottomSheetComponentViewModel.swift index 3dbf05abfa1d..f13eb00c5b91 100644 --- a/SampleComponentLibraryApp/SampleComponentLibraryApp/BottomSheet/BottomSheetComponentViewModel.swift +++ b/SampleComponentLibraryApp/SampleComponentLibraryApp/BottomSheet/BottomSheetComponentViewModel.swift @@ -12,7 +12,7 @@ struct BottomSheetComponentViewModel: ComponentViewModel { private var viewModel: BottomSheetViewModel init() { - viewModel = BottomSheetViewModel(closeButtonA11yLabel: "Close button") + viewModel = BottomSheetViewModel(closeButtonA11yLabel: "Close button", closeButtonA11yIdentifier: "a11yCloseButton") viewModel.shouldDismissForTapOutside = true viewController = BottomSheetViewController(