added samples

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-04-25 16:30:55 -05:00
parent 327975d99d
commit ff6182db75
6 changed files with 81 additions and 0 deletions

View File

@ -90,3 +90,19 @@ class BreadcrumbsViewController: BaseViewController<Breadcrumbs> {
}
}
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)
}
}

View File

@ -262,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)
}

View File

@ -119,3 +119,12 @@ class CarouselScrollbarViewConttroller: BaseViewController<CarouselScrollbar> {
}
}
}
extension CarouselScrollbarViewConttroller: ComponentSampleable {
static func makeSample() -> ComponentSample {
let component = Self.makeComponent()
component.numberOfSlides = 4
return ComponentSample(component: component)
}
}

View File

@ -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()
}
}
}
}

View File

@ -186,3 +186,22 @@ class DropdownSelectViewController: BaseViewController<DropdownSelect> {
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)
}
}

View File

@ -46,3 +46,11 @@ final class PaginationViewController: BaseViewController<Pagination> {
}.store(in: &subscribers)
}
}
extension PaginationViewController: ComponentSampleable {
static func makeSample() -> ComponentSample {
let component = Self.makeComponent()
component.total = 10
return ComponentSample(component: component)
}
}