diff --git a/VDSSample/ViewControllers/BreadcrumbsViewController.swift b/VDSSample/ViewControllers/BreadcrumbsViewController.swift index 1cee787..cecc9a4 100644 --- a/VDSSample/ViewControllers/BreadcrumbsViewController.swift +++ b/VDSSample/ViewControllers/BreadcrumbsViewController.swift @@ -90,3 +90,19 @@ class BreadcrumbsViewController: BaseViewController { } } + +extension BreadcrumbsViewController: ComponentSampleable { + static func makeSample() -> ComponentSample { + let component = Self.makeComponent() + component.breadcrumbModels = [ + .init(text: "Home"), + .init(text: "Support", enabeled: false), + .init(text: "Service & Apps"), + .init(text: "My Verizon"), + .init(text: "Bill"), + .init(text: "Mobile Billing & Payments"), + .init(text: "Billing statement FAQs", selected: true) + ] + return ComponentSample(component: component) + } +} diff --git a/VDSSample/ViewControllers/ButtonIconViewController.swift b/VDSSample/ViewControllers/ButtonIconViewController.swift index 8d3b24a..d7f17ed 100644 --- a/VDSSample/ViewControllers/ButtonIconViewController.swift +++ b/VDSSample/ViewControllers/ButtonIconViewController.swift @@ -181,6 +181,7 @@ class ButtonIconViewController: BaseViewController { let name = Icon.Name.addToFavorite component.iconName = name + component.onChange = { c in print("changed: \(c.isSelected)") } //setup UI surfacePickerSelectorView.text = component.surface.rawValue surfaceTypePickerSelectorView.text = component.surfaceType.rawValue @@ -261,6 +262,9 @@ extension ButtonIconViewController: ComponentSampleable { static func makeSample() -> ComponentSample { let component = Self.makeComponent() component.iconName = .addToFavorite + component.selectedIconName = .addedToFavorite + component.selectable = true + component.onChange = { c in print("changed: \(c.isSelected)") } component.size = .large return ComponentSample(component: component, trailingPinningType: .lessThanOrEqual) } diff --git a/VDSSample/ViewControllers/CarouselScrollbarViewConttroller.swift b/VDSSample/ViewControllers/CarouselScrollbarViewConttroller.swift index 99ca1ce..63b0da4 100644 --- a/VDSSample/ViewControllers/CarouselScrollbarViewConttroller.swift +++ b/VDSSample/ViewControllers/CarouselScrollbarViewConttroller.swift @@ -119,3 +119,12 @@ class CarouselScrollbarViewConttroller: BaseViewController { } } } + + +extension CarouselScrollbarViewConttroller: ComponentSampleable { + static func makeSample() -> ComponentSample { + let component = Self.makeComponent() + component.numberOfSlides = 4 + return ComponentSample(component: component) + } +} diff --git a/VDSSample/ViewControllers/DropShawdowViewController.swift b/VDSSample/ViewControllers/DropShawdowViewController.swift index c0be652..17d3733 100644 --- a/VDSSample/ViewControllers/DropShawdowViewController.swift +++ b/VDSSample/ViewControllers/DropShawdowViewController.swift @@ -431,3 +431,29 @@ public class ShadowView: View { } } + +extension ViewProtocol where Self: UIView { + private func createShadowLayer() -> CALayer { + let shadowLayer = CALayer() + shadowLayer.backgroundColor = UIColor.clear.cgColor + shadowLayer.frame = bounds + return shadowLayer + } + + func addCustomShadow(config: DropShadowConfiguration) { + let shadowLayer = createShadowLayer() +// shadowLayer.shadowColor = config.shadowColorConfiguration.getColor(self).cgColor +// shadowLayer.shadowOpacity = config.shadowOpacityConfiguration.value(for: self) +// shadowLayer.shadowOffset = offset +// shadowLayer.shadowRadius = radius + layer.insertSublayer(shadowLayer, at: 0) + } + + func removeAllCustomShadows() { + layer.sublayers?.forEach { sublayer in + if sublayer.shadowOpacity > 0 && sublayer.backgroundColor == UIColor.clear.cgColor { + sublayer.removeFromSuperlayer() + } + } + } +} diff --git a/VDSSample/ViewControllers/DropdownSelectViewController.swift b/VDSSample/ViewControllers/DropdownSelectViewController.swift index 177aa4c..52552c3 100644 --- a/VDSSample/ViewControllers/DropdownSelectViewController.swift +++ b/VDSSample/ViewControllers/DropdownSelectViewController.swift @@ -186,3 +186,22 @@ class DropdownSelectViewController: BaseViewController { content: content) : nil } } + +extension DropdownSelectViewController: ComponentSampleable { + static func makeSample() -> ComponentSample { + let component = Self.makeComponent() + component.labelText = "Street Address" + component.helperText = "For example: 123 Verizon St" + component.errorText = "Enter a valid address." + component.tooltipModel = .init(title: "Check the formatting of your address", content:"House/Building number then street name") + component.options = [ + .init(text: "Alabama"), + .init(text: "Alaska"), + .init(text: "Arizona"), + .init(text: "Arkansas") + ] + return ComponentSample(component: component) + } +} + + diff --git a/VDSSample/ViewControllers/PaginationViewController.swift b/VDSSample/ViewControllers/PaginationViewController.swift index 47a5807..920c4a9 100644 --- a/VDSSample/ViewControllers/PaginationViewController.swift +++ b/VDSSample/ViewControllers/PaginationViewController.swift @@ -46,3 +46,11 @@ final class PaginationViewController: BaseViewController { }.store(in: &subscribers) } } + +extension PaginationViewController: ComponentSampleable { + static func makeSample() -> ComponentSample { + let component = Self.makeComponent() + component.total = 10 + return ComponentSample(component: component) + } +} diff --git a/VDSSample/ViewControllers/TileContainerViewController.swift b/VDSSample/ViewControllers/TileContainerViewController.swift index 2af2295..d4e0007 100644 --- a/VDSSample/ViewControllers/TileContainerViewController.swift +++ b/VDSSample/ViewControllers/TileContainerViewController.swift @@ -99,6 +99,8 @@ class TileContainerViewController: BaseViewController { addContentTopView(view: .makeWrapper(for: component)) component.width = 150 component.color = .secondary + component.accessibilityLabel = "Tile Container" + component.addContentView(Label().with { $0.text = "Testing Label" }) setupPicker() setupModel() } @@ -165,7 +167,7 @@ class TileContainerViewController: BaseViewController { } showDropShadowSwitch.onChange = { [weak self] sender in - self?.component.showDropShadows = sender.isOn + self?.component.showDropShadow = sender.isOn } heightTextField diff --git a/VDSSample/ViewControllers/TileletViewController.swift b/VDSSample/ViewControllers/TileletViewController.swift index 772a189..038487b 100644 --- a/VDSSample/ViewControllers/TileletViewController.swift +++ b/VDSSample/ViewControllers/TileletViewController.swift @@ -291,7 +291,7 @@ class TileletViewController: BaseViewController { } showDropShadowSwitch.onChange = { [weak self] sender in - self?.component.showDropShadows = sender.isOn + self?.component.showDropShadow = sender.isOn } imageFallbackColorPickerSelectorView.onPickerDidSelect = { [weak self] item in