From b6888671e75d7643613b0ed57efdd73fa5265b22 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Mon, 9 Jan 2023 15:33:55 -0600 Subject: [PATCH 1/8] added initial icon Signed-off-by: Matt Bruce --- VDS.xcodeproj/project.pbxproj | 24 ++ VDS/Components/Icon/Icon.swift | 154 +++++++ VDS/Components/Icon/IconCategory.swift | 66 +++ VDS/Components/Icon/IconColor.swift | 90 +++++ VDS/Components/Icon/IconName.swift | 531 +++++++++++++++++++++++++ 5 files changed, 865 insertions(+) create mode 100644 VDS/Components/Icon/Icon.swift create mode 100644 VDS/Components/Icon/IconCategory.swift create mode 100644 VDS/Components/Icon/IconColor.swift create mode 100644 VDS/Components/Icon/IconName.swift diff --git a/VDS.xcodeproj/project.pbxproj b/VDS.xcodeproj/project.pbxproj index 1648be01..2d6eb953 100644 --- a/VDS.xcodeproj/project.pbxproj +++ b/VDS.xcodeproj/project.pbxproj @@ -58,6 +58,10 @@ EA985BEE2968A92400F2FF2E /* TitleLockupSubTitleModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA985BED2968A92400F2FF2E /* TitleLockupSubTitleModel.swift */; }; EA985BF02968A93600F2FF2E /* TitleLockupEyebrowModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA985BEF2968A93600F2FF2E /* TitleLockupEyebrowModel.swift */; }; EA985BF22968B5BB00F2FF2E /* TitleLockupTypography.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA985BF12968B5BB00F2FF2E /* TitleLockupTypography.swift */; }; + EA985BF5296C60C000F2FF2E /* Icon.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA985BF4296C60C000F2FF2E /* Icon.swift */; }; + EA985BF7296C665E00F2FF2E /* IconName.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA985BF6296C665E00F2FF2E /* IconName.swift */; }; + EA985BF9296C710100F2FF2E /* IconColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA985BF8296C710100F2FF2E /* IconColor.swift */; }; + EA985BFB296C78D500F2FF2E /* IconCategory.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA985BFA296C78D500F2FF2E /* IconCategory.swift */; }; EAA5EEB528ECBFB4003B3210 /* ImageLabelAttribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAA5EEB428ECBFB4003B3210 /* ImageLabelAttribute.swift */; }; EAA5EEB728ECC03A003B3210 /* ToolTipLabelAttribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAA5EEB628ECC03A003B3210 /* ToolTipLabelAttribute.swift */; }; EAA5EEB928ECD24B003B3210 /* Icons.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EAA5EEB828ECD24B003B3210 /* Icons.xcassets */; }; @@ -165,6 +169,10 @@ EA985BED2968A92400F2FF2E /* TitleLockupSubTitleModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TitleLockupSubTitleModel.swift; sourceTree = ""; }; EA985BEF2968A93600F2FF2E /* TitleLockupEyebrowModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TitleLockupEyebrowModel.swift; sourceTree = ""; }; EA985BF12968B5BB00F2FF2E /* TitleLockupTypography.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TitleLockupTypography.swift; sourceTree = ""; }; + EA985BF4296C60C000F2FF2E /* Icon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Icon.swift; sourceTree = ""; }; + EA985BF6296C665E00F2FF2E /* IconName.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IconName.swift; sourceTree = ""; }; + EA985BF8296C710100F2FF2E /* IconColor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IconColor.swift; sourceTree = ""; }; + EA985BFA296C78D500F2FF2E /* IconCategory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IconCategory.swift; sourceTree = ""; }; EAA5EEB428ECBFB4003B3210 /* ImageLabelAttribute.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageLabelAttribute.swift; sourceTree = ""; }; EAA5EEB628ECC03A003B3210 /* ToolTipLabelAttribute.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToolTipLabelAttribute.swift; sourceTree = ""; }; EAA5EEB828ECD24B003B3210 /* Icons.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Icons.xcassets; sourceTree = ""; }; @@ -332,6 +340,7 @@ EA4DB2FE28DCBC1900103EE3 /* Badge */, EA0FC2BE2912D18200DF80B4 /* Buttons */, EAF7F092289985E200B287F5 /* Checkbox */, + EA985BF3296C609E00F2FF2E /* Icon */, EA3362412892EF700071C351 /* Label */, EA89200B28B530F0006B9984 /* RadioBox */, EAF7F11428A1470D00B287F5 /* RadioButton */, @@ -499,6 +508,17 @@ path = RadioBox; sourceTree = ""; }; + EA985BF3296C609E00F2FF2E /* Icon */ = { + isa = PBXGroup; + children = ( + EA985BF4296C60C000F2FF2E /* Icon.swift */, + EA985BFA296C78D500F2FF2E /* IconCategory.swift */, + EA985BF8296C710100F2FF2E /* IconColor.swift */, + EA985BF6296C665E00F2FF2E /* IconName.swift */, + ); + path = Icon; + sourceTree = ""; + }; EAB1D2D028ABEF3100DAE764 /* Typography */ = { isa = PBXGroup; children = ( @@ -725,6 +745,7 @@ EA4DB2FD28D3D0CA00103EE3 /* AnyEquatable.swift in Sources */, EAA5EEB728ECC03A003B3210 /* ToolTipLabelAttribute.swift in Sources */, EA5E305A29510F8B0082B959 /* EnumSubset.swift in Sources */, + EA985BF7296C665E00F2FF2E /* IconName.swift in Sources */, EAF7F0AF289B144C00B287F5 /* UnderlineLabelAttribute.swift in Sources */, EAC925842911C63100091998 /* Colorable.swift in Sources */, EA3361C5289030FC0071C351 /* Accessable.swift in Sources */, @@ -774,10 +795,12 @@ EAA5EEB528ECBFB4003B3210 /* ImageLabelAttribute.swift in Sources */, EAB5FF0129424ACB00998C17 /* UIControl.swift in Sources */, EAB1D2E628AE842000DAE764 /* Publisher+Bind.swift in Sources */, + EA985BF5296C60C000F2FF2E /* Icon.swift in Sources */, EA3361AA288B25E40071C351 /* Disabling.swift in Sources */, EA3361B6288B2A410071C351 /* Control.swift in Sources */, 5F21D7BF28DCEB3D003E7CD6 /* Useable.swift in Sources */, EAF7F0B7289C12A600B287F5 /* UITapGestureRecognizer.swift in Sources */, + EA985BF9296C710100F2FF2E /* IconColor.swift in Sources */, EAB5FED429267EB300998C17 /* UIView.swift in Sources */, EA3361AD288B26190071C351 /* DataTrackable.swift in Sources */, EA33623E2892EE950071C351 /* UIDevice.swift in Sources */, @@ -785,6 +808,7 @@ EAF7F0AD289B142900B287F5 /* StrikeThroughLabelAttribute.swift in Sources */, EAB5FEF12927F4AA00998C17 /* SelfSizingCollectionView.swift in Sources */, EA3361B8288B2AAA0071C351 /* ViewProtocol.swift in Sources */, + EA985BFB296C78D500F2FF2E /* IconCategory.swift in Sources */, EA3361BF288B2EA60071C351 /* Handlerable.swift in Sources */, EA3361A8288B23300071C351 /* UIColor.swift in Sources */, EAC9257D29119B5400091998 /* TextLink.swift in Sources */, diff --git a/VDS/Components/Icon/Icon.swift b/VDS/Components/Icon/Icon.swift new file mode 100644 index 00000000..618282f0 --- /dev/null +++ b/VDS/Components/Icon/Icon.swift @@ -0,0 +1,154 @@ +// +// Icon.swift +// VDS +// +// Created by Matt Bruce on 1/9/23. +// + +import Foundation +import UIKit +import VDSColorTokens +import Combine + +public enum IconSize: String, CaseIterable { + case xsmall + case small + case medium + case large + case XLarge + + public var dimensions: CGSize { + switch self { + + case .xsmall: + return .init(width: 12, height: 12) + + case .small: + return .init(width: 16, height: 16) + + case .medium: + return .init(width: 20, height: 20) + + case .large: + return .init(width: 24, height: 24) + + case .XLarge: + return .init(width: 28, height: 28) + + } + } +} + +@objc(VDSIcon) +public class Icon: View { + + //-------------------------------------------------- + // MARK: - Private Properties + //-------------------------------------------------- + private var widthConstraint: NSLayoutConstraint? + private var heightConstraint: NSLayoutConstraint? + + private var imageView = UIImageView().with { + $0.translatesAutoresizingMaskIntoConstraints = false + $0.contentMode = .scaleAspectFill + $0.clipsToBounds = true + } + + //-------------------------------------------------- + // MARK: - Public Properties + //-------------------------------------------------- + open var color: IconColor = .black { didSet { didChange() }} + open var size: IconSize = .medium { didSet { didChange() }} + open var name: IconName? { didSet { didChange() }} + + //reserverd for internal components only + internal var restrictedName: RestrictedIconName? { didSet { didChange() }} + internal var isBold: Bool = false { didSet { didChange() }} + + //functions + //-------------------------------------------------- + // MARK: - Lifecycle + //-------------------------------------------------- + + open override func setup() { + super.setup() + + addSubview(imageView) + imageView.pinToSuperView() + + heightConstraint = imageView.heightAnchor.constraint(equalToConstant: size.dimensions.height) + heightConstraint?.isActive = true + widthConstraint = imageView.widthAnchor.constraint(equalToConstant: size.dimensions.width) + widthConstraint?.isActive = true + + backgroundColor = .clear + } + + public override func reset() { + super.reset() + color = .black + imageView.image = nil + } + + //-------------------------------------------------- + // MARK: - State + //-------------------------------------------------- + open override func updateView() { + super.updateView() + + //get the color for the image + var imageColor = color.value + + //ensure the correct color for white/black colors + if surface == .dark && color == IconColor.black { + imageColor = VDSColor.elementsPrimaryOndark + } else if surface == .light && color == IconColor.black { + imageColor = VDSColor.elementsPrimaryOnlight + } + + //set the icon dimensions + let dimensions = size.dimensions + heightConstraint?.constant = dimensions.height + widthConstraint?.constant = dimensions.width + + //get the image name + //set the image + if let restrictedName, let image = getImage(for: restrictedName.rawValue) { + setImage(image: image, imageColor: imageColor) + + } else if let name, let image = getImage(for: name.rawValue) { + setImage(image: image, imageColor: imageColor) + } else { + imageView.image = nil + } + } + + private func getImage(for imageName: String) -> UIImage? { + if !imageName.hasPrefix("pagination"), isBold { + let boldIconName = "\(imageName)-bold" + if let image = UIImage(named: boldIconName, in: Bundle(for: Self.self), with: nil) { + return image + + } else if let image = UIImage(named: boldIconName) { + return image + + } else if let image = UIImage(named: imageName) { + return image + } + } else { + if let image = UIImage(named: imageName, in: Bundle(for: Self.self), with: nil) { + return image + + } else if let image = UIImage(named: imageName) { + return image + } + } + + return nil + } + + private func setImage(image: UIImage, imageColor: UIColor) { + imageView.image = image.withTintColor(imageColor) + } +} + diff --git a/VDS/Components/Icon/IconCategory.swift b/VDS/Components/Icon/IconCategory.swift new file mode 100644 index 00000000..037f8253 --- /dev/null +++ b/VDS/Components/Icon/IconCategory.swift @@ -0,0 +1,66 @@ +// +// IconCategory.swift +// VDS +// +// Created by Matt Bruce on 1/9/23. +// + +import Foundation + +public enum IconCategory: String, CaseIterable { + case accessibility + case b2b + case directional + case international + case navigational + case notification_feedback + case objects_industry + case orders_pricing + case other + case plans_devices + case social + case utilities +} + +extension IconCategory { + public var icons: [IconName] { + switch self { + + case .accessibility: + return [.accessibility, .americanSignLanguage, .assistedListeningSystems, .audioDescription, .blind, .braille, .brightness, .closedCaptioning, .closedCaptioningFill, .cognitiveDisability, .deaf, .internationalSymbolOfAccess, .openCaptioning, .phoneVolume, .teletype, .textToSpeech] + + case .b2b: + return [.assetTracking, .businessContinuity, .conditionBasedMaintenance, .conditionBasedWrench, .constructionHammer, .constructionTruck, .digitalSignageCar, .digitalSignage, .droneCamera, .educationCurriculum, .education, .electricPower, .electricUtility, .energyScience, .energyUtilities, .enterprise, .federalDefense, .financial, .fleetTracking, .fleet, .gas, .government, .group, .growth, .hackers, .healthcareCorporate, .healthcareGeneral, .healthcareWorker, .ideasSolutions, .inclusivity, .industry, .insurance, .intelligentTracking, .internetOfThings, .joinCall, .k12Education, .laptopAntivirus, .laptopControls, .laptopGpsTracking, .laptopSettings, .laptopTrends, .laptopWireless, .law, .lmr, .loyaltyRetention, .manufacturing, .mediaEntertainment, .mediumBusiness, .mobileCommandCenter, .mobileKioskInfo, .mobileKioskWireless, .mobileRetail, .mobileSearch, .mobileWorkforceManagement, .network, .networkAttachedStorage, .officePhoneSystem, .oilIndustry, .operationalTransformation, .pharmaceutical, .pharmacy, .planner, .powerUtility, .professionalServices, .qualityAssurance, .realEstate, .regulatoryCompliance, .research, .retail, .security, .securitySolution, .smarthouse, .socialMedia, .software, .solarPower, .solutions, .supplyChain, .systemIntegration, .telecommunications, .telemedicine, .telemetry, .thermodynamics, .trends, .utilityWorker, .vehicleTracking, .warehouseManagement, .waterIndustry, .wellness] + + case .directional: + return [.upCaret, .closeAlt, .close, .downArrow, .downCaret, .evenMoreFlexibility, .flexibilityRectangles, .flexibility, .gateway, .leftArrow, .leftCaret, .minus, .moreFlexibility, .noOff, .no, .plus, .rightArrow, .rightCaret, .swipeLeft, .swipeRight, .swipe, .switch, .upArrow] + + case .international: + return [.internationalLongDistance, .international, .travelPass, .tripPlanner] + + case .navigational: + return [.advancedSettings, .agentChat, .bookmark, .chat, .filterOff, .filter, .list, .lockClosed, .lockOpen, .logout, .menu, .moreHorizontal, .myAccount, .realTimeTracking, .search, .settings, .supportDrawer, .support, .userRegistration] + + case .notification_feedback: + return [.alertNotification, .checkmarkAlt, .checkmark, .clock, .error, .feedback, .loader, .notification, .notificationsOff, .notifyMe, .pushNotification, .remindMe, .reminder, .securityAlert, .securityCheck, .securityKeyhole, .securityWireless, .snooze, .speedMonitoring, .starOff, .star, .sync, .timer, .warning] + + case .objects_industry: + return [.ctr, .passenger, .tvContent, .urlTransparency, .adaptiveSpeaker, .adTechStack, .agricultureLeaves, .agricultureTractor, .agricultureVineyard, .airport, .airConditioner, .audienceTargetedSearch, .award, .babyMonitor, .bestPractices, .bid, .bot, .cellTower, .cloudDocument, .coffee, .coin, .complianceDocument, .conversion, .countDown, .crossDeviceTargeting, .crossDevice, .customAudience, .digitalContent, .dining, .display, .domainTargeting, .doorbell, .driver, .euro, .expense, .faceCovering, .fineArt, .flag, .flurry, .fridge, .gaming, .geofence, .home, .identityGraph, .impressionVideo, .inferredIdentity, .irobot, .ironingBoard, .kidsStroller, .levers, .mobilePlusTv, .mobileRetargeting, .motionDetector, .multipleDocuments, .music, .nativeVideo, .native, .onGoCar, .packBackpack, .packLuggage, .packPurse, .petsCollar, .realTime, .research, .retailStore, .retargeting, .schoolNotebook, .singleDocument, .smartFamilyChildAddressBook, .smartScooter, .smokeDetector, .solarPanel, .sportsBike, .sportsSkis, .sportsSoccer, .sportsTennis, .stadiumAlt, .stadiumFlag, .thermostatTech, .ticket, .tradingDeck, .traffic, .travelKeys, .trumpet, .unification, .unification, .visibility, .weights, .yield] + + case .orders_pricing: + return [.addToFavorite, .addedToFavorite, .billDown, .billUp, .camera, .creditCard, .gift, .inStorePickup, .noFee, .oneYear, .orders, .outOfStock, .reoccuringPayment, .reservations, .returns, .rewards, .shipping, .shoppingBag, .shopping, .tag, .taxes] + case .other: + return [.growthOpportunities, .noSmoking, .socialDistancing] + + case .plans_devices: + return [.battery, .bonusData, .bringYourOwnDevice, .callerId, .carryoverData, .compass, .connect, .dataBoost, .deviceProtection, .devicesAddons, .embeddedSound, .findMyRemote, .giftedData, .homeInternet, .internetDevices, .largePlan, .mediumPlan, .mobileApps, .mobileHotspot, .multipleDeviceProtection, .multipleDevices, .nationWide, .phoneAlt, .purchaseData, .router, .simCard, .smallPlan, .smartAssistant, .sound, .tablet, .techLaptop, .techPhone , .totalMobileProtection, .unlimitedPlan, .uplink, .videoOnTablet, .waterResistant, .wearable] + + case .social: + return [.at, .facebook, .instagram, .twitter, .youtube] + + case .utilities: + return [.ThreeDAd , .ar , .addFolder , .addUser , .analytics , .announcement , .archive , .artboard , .attach , .awareness , .barcode , .bluetooth , .boxOpen , .calendar , .calibrate , .callDisconnected , .cleanSurface , .cloudAlt , .cloud , .comparison , .compose , .connectParts , .consultativeTransfer , .convergence , .crop , .cta , .customize , .data , .decrease , .deviceActivity , .directCarrierBilling , .directory , .displayUtilities , .distribution , .download , .dragAndDrop , .dropShipment , .duplicate , .edit , .email , .emergencyContact , .emoji , .externalLink , .fallDetected , .favorite , .fax , .fingerprintSensor , .fire , .fitToZone , .flipCamera , .forwardedCall , .fullscreen , .getHelp , .gridView , .history , .humidity , .incomingCall , .increase , .info , .inventory , .invitationAccepted , .invitationExpired , .invitationRejected , .landscape , .light , .link , .location , .locationPin , .mapView , .masonryView , .maximize , .mergeCalls , .microphoneAlt , .microphone , .missedCall , .moveTo , .multicast , .mute , .networkConnection , .news , .next , .nfcTag , .night , .noVideo , .onDemand , .outgoingCall , .paperFreeBilling , .pauseInternet , .pause , .peelSticker , .photo , .platform , .playAlt , .playWith , .play , .portrait , .pressure , .previous , .print , .question , .recycle , .removeItem , .replaceAPhoto , .reply , .ringing , .ringtone , .riskMonitor , .rss , .satelliteOff , .satellite , .save , .scaleAlt , .scale , .sendMessage , .setFallbackImage , .setGalleryImage , .share , .shock , .signalBroadcast , .speakerMute , .speakerPhone , .speed , .stakeholder , .steps , .stop , .stopAlt , .survey , .talking , .teamLeader , .temperature , .template , .theme , .thumbsDown , .thumbsUp , .tiles , .tilt , .tools , .trash , .turnonOff , .tv , .upload , .userSettings , .vibration , .video , .volume , .volunteer , .virtualReality , .voiceHd , .voiceMail , .weather , .whiteBlackList , .wifi , .zoomIn , .zoomOut] + + } + } +} diff --git a/VDS/Components/Icon/IconColor.swift b/VDS/Components/Icon/IconColor.swift new file mode 100644 index 00000000..49f8d85d --- /dev/null +++ b/VDS/Components/Icon/IconColor.swift @@ -0,0 +1,90 @@ +// +// IconColor.swift +// VDS +// +// Created by Matt Bruce on 1/9/23. +// + +import Foundation +import VDSColorTokens +import UIKit + +public enum IconColor: String, CaseIterable { + case black + case white + case red + case gray95 + case gray85 + case gray65 + case gray44 + case gray20 + case gray11 + case orange91 + case orange46 + case orange39 + case orange15 + case yellow94 + case yellow62 + case yellow20 + case blue91 + case blue45 + case blue35 + case blue13 + case green89 + case green34 + case green26 + case green11 + + public var value: UIColor { + switch self { + case .black: + return VDSColor.paletteBlack + case .white: + return VDSColor.paletteWhite + case .red: + return VDSColor.paletteRed + case .gray95: + return VDSColor.paletteGray95 + case .gray85: + return VDSColor.paletteGray85 + case .gray65: + return VDSColor.paletteGray65 + case .gray44: + return VDSColor.paletteGray44 + case .gray20: + return VDSColor.paletteGray20 + case .gray11: + return VDSColor.paletteGray11 + case .orange91: + return VDSColor.paletteOrange91 + case .orange46: + return VDSColor.paletteOrange46 + case .orange39: + return VDSColor.paletteOrange39 + case .orange15: + return VDSColor.paletteOrange15 + case .yellow94: + return VDSColor.paletteYellow94 + case .yellow62: + return VDSColor.paletteYellow62 + case .yellow20: + return VDSColor.paletteYellow20 + case .blue91: + return VDSColor.paletteBlue91 + case .blue45: + return VDSColor.paletteBlue45 + case .blue35: + return VDSColor.paletteBlue35 + case .blue13: + return VDSColor.paletteBlue13 + case .green89: + return VDSColor.paletteGreen89 + case .green34: + return VDSColor.paletteGreen34 + case .green26: + return VDSColor.paletteGreen26 + case .green11: + return VDSColor.paletteGreen11 + } + } +} diff --git a/VDS/Components/Icon/IconName.swift b/VDS/Components/Icon/IconName.swift new file mode 100644 index 00000000..92397f6b --- /dev/null +++ b/VDS/Components/Icon/IconName.swift @@ -0,0 +1,531 @@ +// +// IconName.swift +// VDS +// +// Created by Matt Bruce on 1/9/23. +// + +import Foundation +import UIKit +import VDSColorTokens + +public enum IconName: String, CaseIterable { + //accessibility + case accessibility = "accessibility" + case americanSignLanguage = "american-sign-language" + case assistedListeningSystems = "assisted-listening-systems" + case audioDescription = "audio-description" + case blind = "blind" + case braille = "braille" + case brightness = "brightness" + case closedCaptioning = "closed-captioning" + case closedCaptioningFill = "closed-captioning-fill" + case cognitiveDisability = "cognitive-disability" + case deaf = "deaf" + case internationalSymbolOfAccess = "international-symbol-of-access" + case openCaptioning = "open-captioning" + case phoneVolume = "phone-volume" + case teletype = "teletype" + case textToSpeech = "text-to-speech" + + //b2b + case assetTracking = "asset-tracking" + case businessContinuity = "business-continuity" + case conditionBasedMaintenance = "condition-based-maintenance" + case conditionBasedWrench = "condition-based-wrench" + case constructionHammer = "construction-hammer" + case constructionTruck = "construction-truck" + case digitalSignageCar = "digital-signage-car" + case digitalSignage = "digital-signage" + case droneCamera = "drone-camera" + case educationCurriculum = "education-curriculum" + case education = "education" + case electricPower = "electric-power" + case electricUtility = "electric-utility" + case energyScience = "energy-science" + case energyUtilities = "energy-utilities" + case enterprise = "enterprise" + case federalDefense = "federal-defense" + case financial = "financial" + case fleetTracking = "fleet-tracking" + case fleet = "fleet" + case gas = "gas" + case government = "government" + case group = "group" + case growth = "growth" + case hackers = "hackers" + case healthcareCorporate = "healthcare-corporate" + case healthcareGeneral = "healthcare-general" + case healthcareWorker = "healthcare-worker" + case ideasSolutions = "ideas-solutions" + case inclusivity = "inclusivity" + case industry = "industry" + case insurance = "insurance" + case intelligentTracking = "intelligent-tracking" + case internetOfThings = "internet-of-things" + case joinCall = "join-call" + case k12Education = "k12-education" + case laptopAntivirus = "laptop-antivirus" + case laptopControls = "laptop-controls" + case laptopGpsTracking = "laptop-gps-tracking" + case laptopSettings = "laptop-settings" + case laptopTrends = "laptop-trends" + case laptopWireless = "laptop-wireless" + case law = "law" + case lmr = "lmr" + case loyaltyRetention = "loyalty-retention" + case manufacturing = "manufacturing" + case mediaEntertainment = "media-entertainment" + case mediumBusiness = "medium-business" + case mobileCommandCenter = "mobile-command-center" + case mobileKioskInfo = "mobile-kiosk-info" + case mobileKioskWireless = "mobile-kiosk-wireless" + case mobileRetail = "mobile-retail" + case mobileSearch = "mobile-search" + case mobileWorkforceManagement = "mobile-workforce-management" + case network = "network" + case networkAttachedStorage = "network-attached-storage" + case officePhoneSystem = "office-phone-system" + case oilIndustry = "oil-industry" + case operationalTransformation = "operational-transformation" + case pharmaceutical = "pharmaceutical" + case pharmacy = "pharmacy" + case planner = "planner" + case powerUtility = "power-utility" + case professionalServices = "professional-services" + case qualityAssurance = "quality-assurance" + case realEstate = "real-estate" + case regulatoryCompliance = "regulatory-compliance" + case retail = "retail" + case security = "security" + case securitySolution = "security-solution" + case smarthouse = "smarthouse" + case socialMedia = "social-media" + case software = "software" + case solarPower = "solar-power" + case solutions = "solutions" + case supplyChain = "supply-chain" + case systemIntegration = "system-integration" + case telecommunications = "telecommunications" + case telemedicine = "telemedicine" + case telemetry = "telemetry" + case thermodynamics = "thermodynamics" + case trends = "trends" + case utilityWorker = "utility-worker" + case vehicleTracking = "vehicle-tracking" + case warehouseManagement = "warehouse-management" + case waterIndustry = "water-industry" + case wellness = "wellness" + + //directional + case upCaret = "up-caret" + case closeAlt = "close-alt" + case close = "close" + case downArrow = "down-arrow" + case downCaret = "down-caret" + case evenMoreFlexibility = "even-more-flexibility" + case flexibilityRectangles = "flexibility-rectangles" + case flexibility = "flexibility" + case gateway = "gateway" + case leftArrow = "left-arrow" + case leftCaret = "left-caret" + case minus = "minus" + case moreFlexibility = "more-flexibility" + case noOff = "no-off" + case no = "no" + case plus = "plus" + case rightArrow = "right-arrow" + case rightCaret = "right-caret" + case swipeLeft = "swipe-left" + case swipeRight = "swipe-right" + case swipe = "swipe" + case `switch` = "switch" + case upArrow = "up-arrow" + + //international + case internationalLongDistance = "international-long-distance" + case international = "international" + case travelPass = "travel-pass" + case tripPlanner = "trip-planner" + + //navigational + case advancedSettings = "advanced-settings" + case agentChat = "agent-chat" + case bookmark = "bookmark" + case chat = "chat" + case filterOff = "filter-off" + case filter = "filter" + case list = "list" + case lockClosed = "lock-closed" + case lockOpen = "lock-open" + case logout = "logout" + case menu = "menu" + case moreHorizontal = "more-horizontal" + case myAccount = "my-account" + case realTimeTracking = "real-time-tracking" + case search = "search" + case settings = "settings" + case supportDrawer = "support-drawer" + case support = "support" + case userRegistration = "user-registration" + + //nofication_feedback + case alertNotification = "alert-notification" + case checkmarkAlt = "checkmark-alt" + case checkmark = "checkmark" + case clock = "clock" + case error = "error" + case feedback = "feedback" + case loader = "loader" + case notification = "notification" + case notificationsOff = "notifications-off" + case notifyMe = "notify-me" + case pushNotification = "push-notification" + case remindMe = "remind-me" + case reminder = "reminder" + case securityAlert = "security-alert" + case securityCheck = "security-check" + case securityKeyhole = "security-keyhole" + case securityWireless = "security-wireless" + case snooze = "snooze" + case speedMonitoring = "speed-monitoring" + case starOff = "star-off" + case star = "star" + case sync = "sync" + case timer = "timer" + case warning = "warning" + + //objects_industry + case ctr = "ctr" + case passenger = "passenger" + case tvContent = "tv-content" + case urlTransparency = "url-transparency" + case adaptiveSpeaker = "adaptive-speaker" + case adTechStack = "ad-tech-stack" + case agricultureLeaves = "agriculture-leaves" + case agricultureTractor = "agriculture-tractor" + case agricultureVineyard = "agriculture-vineyard" + case airport = "airport" + case airConditioner = "air-conditioner" + case audienceTargetedSearch = "audience-targeted-search" + case award = "award" + case babyMonitor = "baby-monitor" + case bestPractices = "best-practices" + case bid = "bid" + case bot = "bot" + case cellTower = "cell-tower" + case cloudDocument = "cloud-document" + case coffee = "coffee" + case coin = "coin" + case complianceDocument = "compliance-document" + case conversion = "conversion" + case countDown = "count-down" + case crossDeviceTargeting = "cross-device-targeting" + case crossDevice = "cross-device" + case customAudience = "custom-audience" + case digitalContent = "digital-content" + case dining = "dining" + case display = "display" + case domainTargeting = "domain-targeting" + case doorbell = "doorbell" + case driver = "driver" + case euro = "euro" + case expense = "expense" + case faceCovering = "face-covering" + case fineArt = "fine-art" + case flag = "flag" + case flurry = "flurry" + case fridge = "fridge" + case gaming = "gaming" + case geofence = "geofence" + case home = "home" + case identityGraph = "identity-graph" + case impressionVideo = "impression-video" + case inferredIdentity = "inferred-identity" + case irobot = "irobot" + case ironingBoard = "ironing-board" + case kidsStroller = "kids-stroller" + case levers = "levers" + case mobilePlusTv = "mobile-plus-tv" + case mobileRetargeting = "mobile-retargeting" + case motionDetector = "motion-detector" + case multipleDocuments = "multiple-documents" + case music = "music" + case nativeVideo = "native-video" + case native = "native" + case onGoCar = "on-go-car" + case packBackpack = "pack-backpack" + case packLuggage = "pack-luggage" + case packPurse = "pack-purse" + case petsCollar = "pets-collar" + case realTime = "real-time" + case research = "research" + case retailStore = "retail-store" + case retargeting = "retargeting" + case schoolNotebook = "school-notebook" + case singleDocument = "single-document" + case smartFamilyChildAddressBook = "smart-family-child-address-book" + case smartScooter = "smart-scooter" + case smokeDetector = "smoke-detector" + case solarPanel = "solar-panel" + case sportsBike = "sports-bike" + case sportsSkis = "sports-skis" + case sportsSoccer = "sports-soccer" + case sportsTennis = "sports-tennis" + case stadiumAlt = "stadium-alt" + case stadiumFlag = "stadium-flag" + case thermostatTech = "thermostat-tech" + case ticket = "ticket" + case tradingDeck = "trading-deck" + case traffic = "traffic" + case travelKeys = "travel-keys" + case trumpet = "trumpet" + case unification = "unification" + case visibility = "visibility" + case weights = "weights" + case yield = "yield" + + //orders_pricing + case addToFavorite = "add-to-favorite" + case addedToFavorite = "added-to-favorite" + case billDown = "bill-down" + case billUp = "bill-up" + case camera = "camera" + case creditCard = "credit-card" + case gift = "gift" + case inStorePickup = "in-store-pickup" + case noFee = "no-fee" + case oneYear = "one-year" + case orders = "orders" + case outOfStock = "out-of-stock" + case reoccuringPayment = "reoccuring-payment" + case reservations = "reservations" + case returns = "returns" + case rewards = "rewards" + case shipping = "shipping" + case shoppingBag = "shopping-bag" + case shopping = "shopping" + case tag = "tag" + case taxes = "taxes" + + //other + case growthOpportunities = "growth-opportunities" + case noSmoking = "no-smoking" + case socialDistancing = "social-distancing" + + //plans_other + case battery = "battery" + case bonusData = "bonus-data" + case bringYourOwnDevice = "bring-your-own-device" + case callerId = "caller-id" + case carryoverData = "carryover-data" + case compass = "compass" + case connect = "connect" + case dataBoost = "data-boost" + case deviceProtection = "device-protection" + case devicesAddons = "devices-addons" + case embeddedSound = "embedded-sound" + case findMyRemote = "find-my-remote" + case giftedData = "gifted-data" + case homeInternet = "home-internet" + case internetDevices = "internet-devices" + case largePlan = "large-plan" + case mediumPlan = "medium-plan" + case mobileApps = "mobile-apps" + case mobileHotspot = "mobile-hotspot" + case multipleDeviceProtection = "multiple-device-protection" + case multipleDevices = "multiple-devices" + case nationWide = "nation-wide" + case phoneAlt = "phone-alt" + case purchaseData = "purchase-data" + case router = "router" + case simCard = "sim-card" + case smallPlan = "small-plan" + case smartAssistant = "smart-assistant" + case sound = "sound" + case tablet = "tablet" + case techLaptop = "tech-laptop" + case techPhone = "tech-phone" + case totalMobileProtection = "total-mobile-protection" + case unlimitedPlan = "unlimited-plan" + case uplink = "uplink" + case videoOnTablet = "video-on-tablet" + case waterResistant = "water-resistant" + case wearable = "wearable" + + //social + case at = "at" + case facebook = "facebook" + case instagram = "instagram" + case twitter = "twitter" + case youtube = "youtube" + + //utilities + case ThreeDAd = "3d-ad" + case ar = "ar" + case addFolder = "add-folder" + case addUser = "add-user" + case analytics = "analytics" + case announcement = "announcement" + case archive = "archive" + case artboard = "artboard" + case attach = "attach" + case awareness = "awareness" + case barcode = "barcode" + case bluetooth = "bluetooth" + case boxOpen = "box-open" + case calendar = "calendar" + case calibrate = "calibrate" + case callDisconnected = "call-disconnected" + case cleanSurface = "clean-surface" + case cloudAlt = "cloud-alt" + case cloud = "cloud" + case comparison = "comparison" + case compose = "compose" + case connectParts = "connect-parts" + case consultativeTransfer = "consultative-transfer" + case convergence = "convergence" + case crop = "crop" + case cta = "cta" + case customize = "customize" + case data = "data" + case decrease = "decrease" + case deviceActivity = "device-activity" + case directCarrierBilling = "direct-carrier-billing" + case directory = "directory" + case displayUtilities = "display-utilities" + case distribution = "distribution" + case download = "download" + case dragAndDrop = "drag-and-drop" + case dropShipment = "drop-shipment" + case duplicate = "duplicate" + case edit = "edit" + case email = "email" + case emergencyContact = "emergency-contact" + case emoji = "emoji" + case externalLink = "external-link" + case fallDetected = "fall-detected" + case favorite = "favorite" + case fax = "fax" + case fingerprintSensor = "fingerprint-sensor" + case fire = "fire" + case fitToZone = "fit-to-zone" + case flipCamera = "flip-camera" + case forwardedCall = "forwarded-call" + case fullscreen = "fullscreen" + case getHelp = "get-help" + case gridView = "grid-view" + case history = "history" + case humidity = "humidity" + case incomingCall = "incoming-call" + case increase = "increase" + case info = "info" + case inventory = "inventory" + case invitationAccepted = "invitation-accepted" + case invitationExpired = "invitation-expired" + case invitationRejected = "invitation-rejected" + case landscape = "landscape" + case light = "light" + case link = "link" + case location = "location" + case locationPin = "location-pin" + case mapView = "map-view" + case masonryView = "masonry-view" + case maximize = "maximize" + case mergeCalls = "merge-calls" + case microphoneAlt = "microphone-alt" + case microphone = "microphone" + case missedCall = "missed-call" + case moveTo = "move-to" + case multicast = "multicast" + case mute = "mute" + case networkConnection = "network-connection" + case news = "news" + case next = "next" + case nfcTag = "nfc-tag" + case night = "night" + case noVideo = "no-video" + case onDemand = "on-demand" + case outgoingCall = "outgoing-call" + case paperFreeBilling = "paper-free-billing" + case pauseInternet = "pause-internet" + case pause = "pause" + case peelSticker = "peel-sticker" + case photo = "photo" + case platform = "platform" + case playAlt = "play-alt" + case playWith = "play-with" + case play = "play" + case portrait = "portrait" + case pressure = "pressure" + case previous = "previous" + case print = "print" + case question = "question" + case recycle = "recycle" + case removeItem = "remove-item" + case replaceAPhoto = "replace-a-photo" + case reply = "reply" + case ringing = "ringing" + case ringtone = "ringtone" + case riskMonitor = "risk-monitor" + case rss = "rss" + case satelliteOff = "satellite-off" + case satellite = "satellite" + case save = "save" + case scaleAlt = "scale-alt" + case scale = "scale" + case sendMessage = "send-message" + case setFallbackImage = "set-fallback-image" + case setGalleryImage = "set-gallery-image" + case share = "share" + case shock = "shock" + case signalBroadcast = "signal-broadcast" + case speakerMute = "speaker-mute" + case speakerPhone = "speaker-phone" + case speed = "speed" + case stakeholder = "stakeholder" + case steps = "steps" + case stop = "stop" + case stopAlt = "stop-alt" + case survey = "survey" + case talking = "talking" + case teamLeader = "team-leader" + case temperature = "temperature" + case template = "template" + case theme = "theme" + case thumbsDown = "thumbs-down" + case thumbsUp = "thumbs-up" + case tiles = "tiles" + case tilt = "tilt" + case tools = "tools" + case trash = "trash" + case turnonOff = "turnon-off" + case tv = "tv" + case upload = "upload" + case userSettings = "user-settings" + case vibration = "vibration" + case video = "video" + case volume = "volume" + case volunteer = "volunteer" + case virtualReality = "virtual-reality" + case voiceHd = "voice-hd" + case voiceMail = "voice-mail" + case weather = "weather" + case whiteBlackList = "white-black-list" + case wifi = "wifi" + case zoomIn = "zoom-in" + case zoomOut = "zoom-out" +} + +internal enum RestrictedIconName: String, CaseIterable { + case paginationLeftArrow = "pagination-left-arrow" + case paginationRightArrow = "pagination-right-arrow" + case checkmark = "checkmark" + case checkmarkAlt = "checkmark-alt" + case close = "close" + case error = "error" + case info = "info" + case leftCaret = "left-caret" + case rightCaret = "right-caret" + case warning = "warning" +} From 8b523c971a568af193e9f53b709fd58b5a802672 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Mon, 9 Jan 2023 15:39:49 -0600 Subject: [PATCH 2/8] added spacing Signed-off-by: Matt Bruce --- VDS/Components/Icon/IconCategory.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/VDS/Components/Icon/IconCategory.swift b/VDS/Components/Icon/IconCategory.swift index 037f8253..819ab48c 100644 --- a/VDS/Components/Icon/IconCategory.swift +++ b/VDS/Components/Icon/IconCategory.swift @@ -33,7 +33,7 @@ extension IconCategory { return [.assetTracking, .businessContinuity, .conditionBasedMaintenance, .conditionBasedWrench, .constructionHammer, .constructionTruck, .digitalSignageCar, .digitalSignage, .droneCamera, .educationCurriculum, .education, .electricPower, .electricUtility, .energyScience, .energyUtilities, .enterprise, .federalDefense, .financial, .fleetTracking, .fleet, .gas, .government, .group, .growth, .hackers, .healthcareCorporate, .healthcareGeneral, .healthcareWorker, .ideasSolutions, .inclusivity, .industry, .insurance, .intelligentTracking, .internetOfThings, .joinCall, .k12Education, .laptopAntivirus, .laptopControls, .laptopGpsTracking, .laptopSettings, .laptopTrends, .laptopWireless, .law, .lmr, .loyaltyRetention, .manufacturing, .mediaEntertainment, .mediumBusiness, .mobileCommandCenter, .mobileKioskInfo, .mobileKioskWireless, .mobileRetail, .mobileSearch, .mobileWorkforceManagement, .network, .networkAttachedStorage, .officePhoneSystem, .oilIndustry, .operationalTransformation, .pharmaceutical, .pharmacy, .planner, .powerUtility, .professionalServices, .qualityAssurance, .realEstate, .regulatoryCompliance, .research, .retail, .security, .securitySolution, .smarthouse, .socialMedia, .software, .solarPower, .solutions, .supplyChain, .systemIntegration, .telecommunications, .telemedicine, .telemetry, .thermodynamics, .trends, .utilityWorker, .vehicleTracking, .warehouseManagement, .waterIndustry, .wellness] case .directional: - return [.upCaret, .closeAlt, .close, .downArrow, .downCaret, .evenMoreFlexibility, .flexibilityRectangles, .flexibility, .gateway, .leftArrow, .leftCaret, .minus, .moreFlexibility, .noOff, .no, .plus, .rightArrow, .rightCaret, .swipeLeft, .swipeRight, .swipe, .switch, .upArrow] + return [.closeAlt, .close, .downArrow, .downCaret, .evenMoreFlexibility, .flexibilityRectangles, .flexibility, .gateway, .leftArrow, .leftCaret, .minus, .moreFlexibility, .noOff, .no, .plus, .rightArrow, .rightCaret, .swipeLeft, .swipeRight, .swipe, .switch, .upArrow, .upCaret] case .international: return [.internationalLongDistance, .international, .travelPass, .tripPlanner] @@ -49,6 +49,7 @@ extension IconCategory { case .orders_pricing: return [.addToFavorite, .addedToFavorite, .billDown, .billUp, .camera, .creditCard, .gift, .inStorePickup, .noFee, .oneYear, .orders, .outOfStock, .reoccuringPayment, .reservations, .returns, .rewards, .shipping, .shoppingBag, .shopping, .tag, .taxes] + case .other: return [.growthOpportunities, .noSmoking, .socialDistancing] From 34300a7f9cc91cc39a799675bd8511dcba8d35e8 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 10 Jan 2023 12:36:32 -0600 Subject: [PATCH 3/8] updated to call helper method Signed-off-by: Matt Bruce --- VDS/Components/Icon/Icon.swift | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/VDS/Components/Icon/Icon.swift b/VDS/Components/Icon/Icon.swift index 618282f0..774a4df8 100644 --- a/VDS/Components/Icon/Icon.swift +++ b/VDS/Components/Icon/Icon.swift @@ -124,27 +124,13 @@ public class Icon: View { } private func getImage(for imageName: String) -> UIImage? { - if !imageName.hasPrefix("pagination"), isBold { - let boldIconName = "\(imageName)-bold" - if let image = UIImage(named: boldIconName, in: Bundle(for: Self.self), with: nil) { - return image - - } else if let image = UIImage(named: boldIconName) { - return image - - } else if let image = UIImage(named: imageName) { - return image - } - } else { - if let image = UIImage(named: imageName, in: Bundle(for: Self.self), with: nil) { - return image - - } else if let image = UIImage(named: imageName) { - return image - } - } - return nil + //if the icon isBold (restricted internal) attach bold but + //some might not be found so then try the normal un-bold name + if isBold { + return BundleManager.shared.image(for: "\(imageName)-bold") + } + return BundleManager.shared.image(for: imageName) } private func setImage(image: UIImage, imageColor: UIColor) { From 850181965863fd7fb44cd93911dc1cedaaecc513 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 10 Jan 2023 13:11:33 -0600 Subject: [PATCH 4/8] added icon / images / etc... first cut Signed-off-by: Matt Bruce --- VDS.xcodeproj/project.pbxproj | 10 +- VDS/Classes/BundleManager.swift | 61 ++ VDS/Components/Icon/Icon.swift | 15 +- VDS/Components/Icon/IconCategory.swift | 67 --- VDS/Components/Icon/IconName.swift | 543 +----------------- .../Icons.xcassets/Restricted/Contents.json | 6 + .../checkmark-alt-bold.imageset/Contents.json | 12 + .../checkmark-alt-bold.svg | 8 + .../checkmark-alt.imageset/Contents.json | 0 .../checkmark-alt.imageset/checkmark-alt.svg | 0 .../checkmark-bold.imageset/Contents.json | 12 + .../checkmark-bold.svg | 6 + .../checkmark.imageset/Contents.json | 12 + .../checkmark.imageset/checkmark.svg | 1 + .../close-bold.imageset/Contents.json | 12 + .../close-bold.imageset/close-bold.svg | 6 + .../Restricted/close.imageset/Contents.json | 12 + .../Restricted/close.imageset/close.svg | 1 + .../down-caret-bold.imageset/Contents.json | 12 + .../down-caret-bold.svg | 5 + .../down-caret.imageset/Contents.json | 12 + .../down-caret.imageset/down-caret.svg | 3 + .../error-bold.imageset/Contents.json | 12 + .../error-bold.imageset/error-bold.svg | 12 + .../error.imageset/Contents.json | 0 .../{ => Restricted}/error.imageset/error.svg | 0 .../info-bold.imageset/Contents.json | 12 + .../info-bold.imageset/info-bold.svg | 10 + .../info.imageset/Contents.json | 0 .../{ => Restricted}/info.imageset/info.svg | 0 .../left-caret-bold.imageset/Contents.json | 12 + .../left-caret-bold.svg | 6 + .../left-caret.imageset/Contents.json | 12 + .../left-caret.imageset/left-caret.svg | 3 + .../Contents.json | 12 + .../pagination-left-arrow.svg | 6 + .../Contents.json | 12 + .../pagination-left-caret.svg | 4 + .../Contents.json | 12 + .../pagination-right-arrow.svg | 3 + .../Contents.json | 12 + .../pagination-right-caret.svg | 4 + .../right-caret-bold.imageset/Contents.json | 12 + .../right-caret-bold.svg | 6 + .../warning-bold.imageset/Contents.json | 12 + .../warning-bold.imageset/warning-bold.svg | 3 + .../Restricted/warning.imageset/Contents.json | 12 + .../Restricted/warning.imageset/warning.svg | 3 + 48 files changed, 406 insertions(+), 602 deletions(-) create mode 100644 VDS/Classes/BundleManager.swift delete mode 100644 VDS/Components/Icon/IconCategory.swift create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/Contents.json create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/checkmark-alt-bold.imageset/Contents.json create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/checkmark-alt-bold.imageset/checkmark-alt-bold.svg rename VDS/SupportingFiles/Icons.xcassets/{ => Restricted}/checkmark-alt.imageset/Contents.json (100%) rename VDS/SupportingFiles/Icons.xcassets/{ => Restricted}/checkmark-alt.imageset/checkmark-alt.svg (100%) create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/checkmark-bold.imageset/Contents.json create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/checkmark-bold.imageset/checkmark-bold.svg create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/checkmark.imageset/Contents.json create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/checkmark.imageset/checkmark.svg create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/close-bold.imageset/Contents.json create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/close-bold.imageset/close-bold.svg create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/close.imageset/Contents.json create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/close.imageset/close.svg create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/down-caret-bold.imageset/Contents.json create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/down-caret-bold.imageset/down-caret-bold.svg create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/down-caret.imageset/Contents.json create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/down-caret.imageset/down-caret.svg create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/error-bold.imageset/Contents.json create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/error-bold.imageset/error-bold.svg rename VDS/SupportingFiles/Icons.xcassets/{ => Restricted}/error.imageset/Contents.json (100%) rename VDS/SupportingFiles/Icons.xcassets/{ => Restricted}/error.imageset/error.svg (100%) create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/info-bold.imageset/Contents.json create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/info-bold.imageset/info-bold.svg rename VDS/SupportingFiles/Icons.xcassets/{ => Restricted}/info.imageset/Contents.json (100%) rename VDS/SupportingFiles/Icons.xcassets/{ => Restricted}/info.imageset/info.svg (100%) create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/left-caret-bold.imageset/Contents.json create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/left-caret-bold.imageset/left-caret-bold.svg create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/left-caret.imageset/Contents.json create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/left-caret.imageset/left-caret.svg create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-left-arrow.imageset/Contents.json create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-left-arrow.imageset/pagination-left-arrow.svg create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-left-caret.imageset/Contents.json create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-left-caret.imageset/pagination-left-caret.svg create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-right-arrow.imageset/Contents.json create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-right-arrow.imageset/pagination-right-arrow.svg create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-right-caret.imageset/Contents.json create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-right-caret.imageset/pagination-right-caret.svg create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/right-caret-bold.imageset/Contents.json create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/right-caret-bold.imageset/right-caret-bold.svg create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/warning-bold.imageset/Contents.json create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/warning-bold.imageset/warning-bold.svg create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/warning.imageset/Contents.json create mode 100644 VDS/SupportingFiles/Icons.xcassets/Restricted/warning.imageset/warning.svg diff --git a/VDS.xcodeproj/project.pbxproj b/VDS.xcodeproj/project.pbxproj index 2d6eb953..d37a05ac 100644 --- a/VDS.xcodeproj/project.pbxproj +++ b/VDS.xcodeproj/project.pbxproj @@ -61,7 +61,7 @@ EA985BF5296C60C000F2FF2E /* Icon.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA985BF4296C60C000F2FF2E /* Icon.swift */; }; EA985BF7296C665E00F2FF2E /* IconName.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA985BF6296C665E00F2FF2E /* IconName.swift */; }; EA985BF9296C710100F2FF2E /* IconColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA985BF8296C710100F2FF2E /* IconColor.swift */; }; - EA985BFB296C78D500F2FF2E /* IconCategory.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA985BFA296C78D500F2FF2E /* IconCategory.swift */; }; + EA985C1D296CD13600F2FF2E /* BundleManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA985C1C296CD13600F2FF2E /* BundleManager.swift */; }; EAA5EEB528ECBFB4003B3210 /* ImageLabelAttribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAA5EEB428ECBFB4003B3210 /* ImageLabelAttribute.swift */; }; EAA5EEB728ECC03A003B3210 /* ToolTipLabelAttribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAA5EEB628ECC03A003B3210 /* ToolTipLabelAttribute.swift */; }; EAA5EEB928ECD24B003B3210 /* Icons.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EAA5EEB828ECD24B003B3210 /* Icons.xcassets */; }; @@ -172,7 +172,7 @@ EA985BF4296C60C000F2FF2E /* Icon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Icon.swift; sourceTree = ""; }; EA985BF6296C665E00F2FF2E /* IconName.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IconName.swift; sourceTree = ""; }; EA985BF8296C710100F2FF2E /* IconColor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IconColor.swift; sourceTree = ""; }; - EA985BFA296C78D500F2FF2E /* IconCategory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IconCategory.swift; sourceTree = ""; }; + EA985C1C296CD13600F2FF2E /* BundleManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BundleManager.swift; sourceTree = ""; }; EAA5EEB428ECBFB4003B3210 /* ImageLabelAttribute.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageLabelAttribute.swift; sourceTree = ""; }; EAA5EEB628ECC03A003B3210 /* ToolTipLabelAttribute.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToolTipLabelAttribute.swift; sourceTree = ""; }; EAA5EEB828ECD24B003B3210 /* Icons.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Icons.xcassets; sourceTree = ""; }; @@ -341,10 +341,10 @@ EA0FC2BE2912D18200DF80B4 /* Buttons */, EAF7F092289985E200B287F5 /* Checkbox */, EA985BF3296C609E00F2FF2E /* Icon */, + EA1F265F28B945070033E859 /* RadioSwatch */, EA3362412892EF700071C351 /* Label */, EA89200B28B530F0006B9984 /* RadioBox */, EAF7F11428A1470D00B287F5 /* RadioButton */, - EA1F265F28B945070033E859 /* RadioSwatch */, EAC925852911C9DE00091998 /* TextFields */, EA5E304A294CBDBB0082B959 /* TileContainer */, EA5E3056295105930082B959 /* Tilet */, @@ -403,6 +403,7 @@ EA3361B4288B2A360071C351 /* Classes */ = { isa = PBXGroup; children = ( + EA985C1C296CD13600F2FF2E /* BundleManager.swift */, EAF7F0B8289C139800B287F5 /* ColorConfiguration.swift */, EAF7F09D289AAEC000B287F5 /* Constants.swift */, EA3361B5288B2A410071C351 /* Control.swift */, @@ -512,7 +513,6 @@ isa = PBXGroup; children = ( EA985BF4296C60C000F2FF2E /* Icon.swift */, - EA985BFA296C78D500F2FF2E /* IconCategory.swift */, EA985BF8296C710100F2FF2E /* IconColor.swift */, EA985BF6296C665E00F2FF2E /* IconName.swift */, ); @@ -783,6 +783,7 @@ EA5E304E294CC7F00082B959 /* VDSColor.swift in Sources */, EA89201528B56CF4006B9984 /* RadioBoxGroup.swift in Sources */, EAF7F09E289AAEC000B287F5 /* Constants.swift in Sources */, + EA985C1D296CD13600F2FF2E /* BundleManager.swift in Sources */, EA1F266528B945070033E859 /* RadioSwatch.swift in Sources */, EA4DB18528CA967F00103EE3 /* SelectorGroupHandlerBase.swift in Sources */, EA89200228AECF2A006B9984 /* UIButton+Publisher.swift in Sources */, @@ -808,7 +809,6 @@ EAF7F0AD289B142900B287F5 /* StrikeThroughLabelAttribute.swift in Sources */, EAB5FEF12927F4AA00998C17 /* SelfSizingCollectionView.swift in Sources */, EA3361B8288B2AAA0071C351 /* ViewProtocol.swift in Sources */, - EA985BFB296C78D500F2FF2E /* IconCategory.swift in Sources */, EA3361BF288B2EA60071C351 /* Handlerable.swift in Sources */, EA3361A8288B23300071C351 /* UIColor.swift in Sources */, EAC9257D29119B5400091998 /* TextLink.swift in Sources */, diff --git a/VDS/Classes/BundleManager.swift b/VDS/Classes/BundleManager.swift new file mode 100644 index 00000000..e7365b08 --- /dev/null +++ b/VDS/Classes/BundleManager.swift @@ -0,0 +1,61 @@ +// +// BundleManager.swift +// VDS +// +// Created by Matt Bruce on 1/9/23. +// + +import Foundation +import UIKit + +public class BundleManager { + public static var shared = BundleManager() + + public var bundles: [Bundle] = [] + private var paths: [String] = [] + + private init(){ + bundles.append(Bundle(for: Self.self)) + } + + private func updateBundles() { + bundles.removeAll() + bundles.append(Bundle(for: Self.self)) + paths.forEach({ path in + if let bundle = Bundle(path: path) { + bundles.append(bundle) + } + }) + } + + public static func register(_ path: String) { + if !shared.paths.contains(where: {$0 == path}) { + if let bundle = Bundle(path: path) { + shared.paths.append(path) + shared.bundles.append(bundle) + } + } + } +} + +extension BundleManager { + + public func image(for name: String) -> UIImage? { + var foundImage: UIImage? + + if let image = UIImage(named: name) { + foundImage = image + + } else { + + for bundle in bundles { + if let image = UIImage(named: name, in: bundle, with: nil) { + foundImage = image + break + } + } + } + + return foundImage + } +} diff --git a/VDS/Components/Icon/Icon.swift b/VDS/Components/Icon/Icon.swift index 774a4df8..eb0f28bd 100644 --- a/VDS/Components/Icon/Icon.swift +++ b/VDS/Components/Icon/Icon.swift @@ -61,10 +61,6 @@ public class Icon: View { open var size: IconSize = .medium { didSet { didChange() }} open var name: IconName? { didSet { didChange() }} - //reserverd for internal components only - internal var restrictedName: RestrictedIconName? { didSet { didChange() }} - internal var isBold: Bool = false { didSet { didChange() }} - //functions //-------------------------------------------------- // MARK: - Lifecycle @@ -95,7 +91,6 @@ public class Icon: View { //-------------------------------------------------- open override func updateView() { super.updateView() - //get the color for the image var imageColor = color.value @@ -113,10 +108,7 @@ public class Icon: View { //get the image name //set the image - if let restrictedName, let image = getImage(for: restrictedName.rawValue) { - setImage(image: image, imageColor: imageColor) - - } else if let name, let image = getImage(for: name.rawValue) { + if let name, let image = getImage(for: name.rawValue) { setImage(image: image, imageColor: imageColor) } else { imageView.image = nil @@ -125,11 +117,6 @@ public class Icon: View { private func getImage(for imageName: String) -> UIImage? { - //if the icon isBold (restricted internal) attach bold but - //some might not be found so then try the normal un-bold name - if isBold { - return BundleManager.shared.image(for: "\(imageName)-bold") - } return BundleManager.shared.image(for: imageName) } diff --git a/VDS/Components/Icon/IconCategory.swift b/VDS/Components/Icon/IconCategory.swift deleted file mode 100644 index 819ab48c..00000000 --- a/VDS/Components/Icon/IconCategory.swift +++ /dev/null @@ -1,67 +0,0 @@ -// -// IconCategory.swift -// VDS -// -// Created by Matt Bruce on 1/9/23. -// - -import Foundation - -public enum IconCategory: String, CaseIterable { - case accessibility - case b2b - case directional - case international - case navigational - case notification_feedback - case objects_industry - case orders_pricing - case other - case plans_devices - case social - case utilities -} - -extension IconCategory { - public var icons: [IconName] { - switch self { - - case .accessibility: - return [.accessibility, .americanSignLanguage, .assistedListeningSystems, .audioDescription, .blind, .braille, .brightness, .closedCaptioning, .closedCaptioningFill, .cognitiveDisability, .deaf, .internationalSymbolOfAccess, .openCaptioning, .phoneVolume, .teletype, .textToSpeech] - - case .b2b: - return [.assetTracking, .businessContinuity, .conditionBasedMaintenance, .conditionBasedWrench, .constructionHammer, .constructionTruck, .digitalSignageCar, .digitalSignage, .droneCamera, .educationCurriculum, .education, .electricPower, .electricUtility, .energyScience, .energyUtilities, .enterprise, .federalDefense, .financial, .fleetTracking, .fleet, .gas, .government, .group, .growth, .hackers, .healthcareCorporate, .healthcareGeneral, .healthcareWorker, .ideasSolutions, .inclusivity, .industry, .insurance, .intelligentTracking, .internetOfThings, .joinCall, .k12Education, .laptopAntivirus, .laptopControls, .laptopGpsTracking, .laptopSettings, .laptopTrends, .laptopWireless, .law, .lmr, .loyaltyRetention, .manufacturing, .mediaEntertainment, .mediumBusiness, .mobileCommandCenter, .mobileKioskInfo, .mobileKioskWireless, .mobileRetail, .mobileSearch, .mobileWorkforceManagement, .network, .networkAttachedStorage, .officePhoneSystem, .oilIndustry, .operationalTransformation, .pharmaceutical, .pharmacy, .planner, .powerUtility, .professionalServices, .qualityAssurance, .realEstate, .regulatoryCompliance, .research, .retail, .security, .securitySolution, .smarthouse, .socialMedia, .software, .solarPower, .solutions, .supplyChain, .systemIntegration, .telecommunications, .telemedicine, .telemetry, .thermodynamics, .trends, .utilityWorker, .vehicleTracking, .warehouseManagement, .waterIndustry, .wellness] - - case .directional: - return [.closeAlt, .close, .downArrow, .downCaret, .evenMoreFlexibility, .flexibilityRectangles, .flexibility, .gateway, .leftArrow, .leftCaret, .minus, .moreFlexibility, .noOff, .no, .plus, .rightArrow, .rightCaret, .swipeLeft, .swipeRight, .swipe, .switch, .upArrow, .upCaret] - - case .international: - return [.internationalLongDistance, .international, .travelPass, .tripPlanner] - - case .navigational: - return [.advancedSettings, .agentChat, .bookmark, .chat, .filterOff, .filter, .list, .lockClosed, .lockOpen, .logout, .menu, .moreHorizontal, .myAccount, .realTimeTracking, .search, .settings, .supportDrawer, .support, .userRegistration] - - case .notification_feedback: - return [.alertNotification, .checkmarkAlt, .checkmark, .clock, .error, .feedback, .loader, .notification, .notificationsOff, .notifyMe, .pushNotification, .remindMe, .reminder, .securityAlert, .securityCheck, .securityKeyhole, .securityWireless, .snooze, .speedMonitoring, .starOff, .star, .sync, .timer, .warning] - - case .objects_industry: - return [.ctr, .passenger, .tvContent, .urlTransparency, .adaptiveSpeaker, .adTechStack, .agricultureLeaves, .agricultureTractor, .agricultureVineyard, .airport, .airConditioner, .audienceTargetedSearch, .award, .babyMonitor, .bestPractices, .bid, .bot, .cellTower, .cloudDocument, .coffee, .coin, .complianceDocument, .conversion, .countDown, .crossDeviceTargeting, .crossDevice, .customAudience, .digitalContent, .dining, .display, .domainTargeting, .doorbell, .driver, .euro, .expense, .faceCovering, .fineArt, .flag, .flurry, .fridge, .gaming, .geofence, .home, .identityGraph, .impressionVideo, .inferredIdentity, .irobot, .ironingBoard, .kidsStroller, .levers, .mobilePlusTv, .mobileRetargeting, .motionDetector, .multipleDocuments, .music, .nativeVideo, .native, .onGoCar, .packBackpack, .packLuggage, .packPurse, .petsCollar, .realTime, .research, .retailStore, .retargeting, .schoolNotebook, .singleDocument, .smartFamilyChildAddressBook, .smartScooter, .smokeDetector, .solarPanel, .sportsBike, .sportsSkis, .sportsSoccer, .sportsTennis, .stadiumAlt, .stadiumFlag, .thermostatTech, .ticket, .tradingDeck, .traffic, .travelKeys, .trumpet, .unification, .unification, .visibility, .weights, .yield] - - case .orders_pricing: - return [.addToFavorite, .addedToFavorite, .billDown, .billUp, .camera, .creditCard, .gift, .inStorePickup, .noFee, .oneYear, .orders, .outOfStock, .reoccuringPayment, .reservations, .returns, .rewards, .shipping, .shoppingBag, .shopping, .tag, .taxes] - - case .other: - return [.growthOpportunities, .noSmoking, .socialDistancing] - - case .plans_devices: - return [.battery, .bonusData, .bringYourOwnDevice, .callerId, .carryoverData, .compass, .connect, .dataBoost, .deviceProtection, .devicesAddons, .embeddedSound, .findMyRemote, .giftedData, .homeInternet, .internetDevices, .largePlan, .mediumPlan, .mobileApps, .mobileHotspot, .multipleDeviceProtection, .multipleDevices, .nationWide, .phoneAlt, .purchaseData, .router, .simCard, .smallPlan, .smartAssistant, .sound, .tablet, .techLaptop, .techPhone , .totalMobileProtection, .unlimitedPlan, .uplink, .videoOnTablet, .waterResistant, .wearable] - - case .social: - return [.at, .facebook, .instagram, .twitter, .youtube] - - case .utilities: - return [.ThreeDAd , .ar , .addFolder , .addUser , .analytics , .announcement , .archive , .artboard , .attach , .awareness , .barcode , .bluetooth , .boxOpen , .calendar , .calibrate , .callDisconnected , .cleanSurface , .cloudAlt , .cloud , .comparison , .compose , .connectParts , .consultativeTransfer , .convergence , .crop , .cta , .customize , .data , .decrease , .deviceActivity , .directCarrierBilling , .directory , .displayUtilities , .distribution , .download , .dragAndDrop , .dropShipment , .duplicate , .edit , .email , .emergencyContact , .emoji , .externalLink , .fallDetected , .favorite , .fax , .fingerprintSensor , .fire , .fitToZone , .flipCamera , .forwardedCall , .fullscreen , .getHelp , .gridView , .history , .humidity , .incomingCall , .increase , .info , .inventory , .invitationAccepted , .invitationExpired , .invitationRejected , .landscape , .light , .link , .location , .locationPin , .mapView , .masonryView , .maximize , .mergeCalls , .microphoneAlt , .microphone , .missedCall , .moveTo , .multicast , .mute , .networkConnection , .news , .next , .nfcTag , .night , .noVideo , .onDemand , .outgoingCall , .paperFreeBilling , .pauseInternet , .pause , .peelSticker , .photo , .platform , .playAlt , .playWith , .play , .portrait , .pressure , .previous , .print , .question , .recycle , .removeItem , .replaceAPhoto , .reply , .ringing , .ringtone , .riskMonitor , .rss , .satelliteOff , .satellite , .save , .scaleAlt , .scale , .sendMessage , .setFallbackImage , .setGalleryImage , .share , .shock , .signalBroadcast , .speakerMute , .speakerPhone , .speed , .stakeholder , .steps , .stop , .stopAlt , .survey , .talking , .teamLeader , .temperature , .template , .theme , .thumbsDown , .thumbsUp , .tiles , .tilt , .tools , .trash , .turnonOff , .tv , .upload , .userSettings , .vibration , .video , .volume , .volunteer , .virtualReality , .voiceHd , .voiceMail , .weather , .whiteBlackList , .wifi , .zoomIn , .zoomOut] - - } - } -} diff --git a/VDS/Components/Icon/IconName.swift b/VDS/Components/Icon/IconName.swift index 92397f6b..9db8e362 100644 --- a/VDS/Components/Icon/IconName.swift +++ b/VDS/Components/Icon/IconName.swift @@ -9,523 +9,34 @@ import Foundation import UIKit import VDSColorTokens -public enum IconName: String, CaseIterable { - //accessibility - case accessibility = "accessibility" - case americanSignLanguage = "american-sign-language" - case assistedListeningSystems = "assisted-listening-systems" - case audioDescription = "audio-description" - case blind = "blind" - case braille = "braille" - case brightness = "brightness" - case closedCaptioning = "closed-captioning" - case closedCaptioningFill = "closed-captioning-fill" - case cognitiveDisability = "cognitive-disability" - case deaf = "deaf" - case internationalSymbolOfAccess = "international-symbol-of-access" - case openCaptioning = "open-captioning" - case phoneVolume = "phone-volume" - case teletype = "teletype" - case textToSpeech = "text-to-speech" +public struct IconName: RawRepresentable { + public typealias RawValue = String + public var rawValue: String - //b2b - case assetTracking = "asset-tracking" - case businessContinuity = "business-continuity" - case conditionBasedMaintenance = "condition-based-maintenance" - case conditionBasedWrench = "condition-based-wrench" - case constructionHammer = "construction-hammer" - case constructionTruck = "construction-truck" - case digitalSignageCar = "digital-signage-car" - case digitalSignage = "digital-signage" - case droneCamera = "drone-camera" - case educationCurriculum = "education-curriculum" - case education = "education" - case electricPower = "electric-power" - case electricUtility = "electric-utility" - case energyScience = "energy-science" - case energyUtilities = "energy-utilities" - case enterprise = "enterprise" - case federalDefense = "federal-defense" - case financial = "financial" - case fleetTracking = "fleet-tracking" - case fleet = "fleet" - case gas = "gas" - case government = "government" - case group = "group" - case growth = "growth" - case hackers = "hackers" - case healthcareCorporate = "healthcare-corporate" - case healthcareGeneral = "healthcare-general" - case healthcareWorker = "healthcare-worker" - case ideasSolutions = "ideas-solutions" - case inclusivity = "inclusivity" - case industry = "industry" - case insurance = "insurance" - case intelligentTracking = "intelligent-tracking" - case internetOfThings = "internet-of-things" - case joinCall = "join-call" - case k12Education = "k12-education" - case laptopAntivirus = "laptop-antivirus" - case laptopControls = "laptop-controls" - case laptopGpsTracking = "laptop-gps-tracking" - case laptopSettings = "laptop-settings" - case laptopTrends = "laptop-trends" - case laptopWireless = "laptop-wireless" - case law = "law" - case lmr = "lmr" - case loyaltyRetention = "loyalty-retention" - case manufacturing = "manufacturing" - case mediaEntertainment = "media-entertainment" - case mediumBusiness = "medium-business" - case mobileCommandCenter = "mobile-command-center" - case mobileKioskInfo = "mobile-kiosk-info" - case mobileKioskWireless = "mobile-kiosk-wireless" - case mobileRetail = "mobile-retail" - case mobileSearch = "mobile-search" - case mobileWorkforceManagement = "mobile-workforce-management" - case network = "network" - case networkAttachedStorage = "network-attached-storage" - case officePhoneSystem = "office-phone-system" - case oilIndustry = "oil-industry" - case operationalTransformation = "operational-transformation" - case pharmaceutical = "pharmaceutical" - case pharmacy = "pharmacy" - case planner = "planner" - case powerUtility = "power-utility" - case professionalServices = "professional-services" - case qualityAssurance = "quality-assurance" - case realEstate = "real-estate" - case regulatoryCompliance = "regulatory-compliance" - case retail = "retail" - case security = "security" - case securitySolution = "security-solution" - case smarthouse = "smarthouse" - case socialMedia = "social-media" - case software = "software" - case solarPower = "solar-power" - case solutions = "solutions" - case supplyChain = "supply-chain" - case systemIntegration = "system-integration" - case telecommunications = "telecommunications" - case telemedicine = "telemedicine" - case telemetry = "telemetry" - case thermodynamics = "thermodynamics" - case trends = "trends" - case utilityWorker = "utility-worker" - case vehicleTracking = "vehicle-tracking" - case warehouseManagement = "warehouse-management" - case waterIndustry = "water-industry" - case wellness = "wellness" + public init?(rawValue: String) { + self.rawValue = rawValue + } - //directional - case upCaret = "up-caret" - case closeAlt = "close-alt" - case close = "close" - case downArrow = "down-arrow" - case downCaret = "down-caret" - case evenMoreFlexibility = "even-more-flexibility" - case flexibilityRectangles = "flexibility-rectangles" - case flexibility = "flexibility" - case gateway = "gateway" - case leftArrow = "left-arrow" - case leftCaret = "left-caret" - case minus = "minus" - case moreFlexibility = "more-flexibility" - case noOff = "no-off" - case no = "no" - case plus = "plus" - case rightArrow = "right-arrow" - case rightCaret = "right-caret" - case swipeLeft = "swipe-left" - case swipeRight = "swipe-right" - case swipe = "swipe" - case `switch` = "switch" - case upArrow = "up-arrow" + public init(name: String){ + self.rawValue = name + } - //international - case internationalLongDistance = "international-long-distance" - case international = "international" - case travelPass = "travel-pass" - case tripPlanner = "trip-planner" - - //navigational - case advancedSettings = "advanced-settings" - case agentChat = "agent-chat" - case bookmark = "bookmark" - case chat = "chat" - case filterOff = "filter-off" - case filter = "filter" - case list = "list" - case lockClosed = "lock-closed" - case lockOpen = "lock-open" - case logout = "logout" - case menu = "menu" - case moreHorizontal = "more-horizontal" - case myAccount = "my-account" - case realTimeTracking = "real-time-tracking" - case search = "search" - case settings = "settings" - case supportDrawer = "support-drawer" - case support = "support" - case userRegistration = "user-registration" - - //nofication_feedback - case alertNotification = "alert-notification" - case checkmarkAlt = "checkmark-alt" - case checkmark = "checkmark" - case clock = "clock" - case error = "error" - case feedback = "feedback" - case loader = "loader" - case notification = "notification" - case notificationsOff = "notifications-off" - case notifyMe = "notify-me" - case pushNotification = "push-notification" - case remindMe = "remind-me" - case reminder = "reminder" - case securityAlert = "security-alert" - case securityCheck = "security-check" - case securityKeyhole = "security-keyhole" - case securityWireless = "security-wireless" - case snooze = "snooze" - case speedMonitoring = "speed-monitoring" - case starOff = "star-off" - case star = "star" - case sync = "sync" - case timer = "timer" - case warning = "warning" - - //objects_industry - case ctr = "ctr" - case passenger = "passenger" - case tvContent = "tv-content" - case urlTransparency = "url-transparency" - case adaptiveSpeaker = "adaptive-speaker" - case adTechStack = "ad-tech-stack" - case agricultureLeaves = "agriculture-leaves" - case agricultureTractor = "agriculture-tractor" - case agricultureVineyard = "agriculture-vineyard" - case airport = "airport" - case airConditioner = "air-conditioner" - case audienceTargetedSearch = "audience-targeted-search" - case award = "award" - case babyMonitor = "baby-monitor" - case bestPractices = "best-practices" - case bid = "bid" - case bot = "bot" - case cellTower = "cell-tower" - case cloudDocument = "cloud-document" - case coffee = "coffee" - case coin = "coin" - case complianceDocument = "compliance-document" - case conversion = "conversion" - case countDown = "count-down" - case crossDeviceTargeting = "cross-device-targeting" - case crossDevice = "cross-device" - case customAudience = "custom-audience" - case digitalContent = "digital-content" - case dining = "dining" - case display = "display" - case domainTargeting = "domain-targeting" - case doorbell = "doorbell" - case driver = "driver" - case euro = "euro" - case expense = "expense" - case faceCovering = "face-covering" - case fineArt = "fine-art" - case flag = "flag" - case flurry = "flurry" - case fridge = "fridge" - case gaming = "gaming" - case geofence = "geofence" - case home = "home" - case identityGraph = "identity-graph" - case impressionVideo = "impression-video" - case inferredIdentity = "inferred-identity" - case irobot = "irobot" - case ironingBoard = "ironing-board" - case kidsStroller = "kids-stroller" - case levers = "levers" - case mobilePlusTv = "mobile-plus-tv" - case mobileRetargeting = "mobile-retargeting" - case motionDetector = "motion-detector" - case multipleDocuments = "multiple-documents" - case music = "music" - case nativeVideo = "native-video" - case native = "native" - case onGoCar = "on-go-car" - case packBackpack = "pack-backpack" - case packLuggage = "pack-luggage" - case packPurse = "pack-purse" - case petsCollar = "pets-collar" - case realTime = "real-time" - case research = "research" - case retailStore = "retail-store" - case retargeting = "retargeting" - case schoolNotebook = "school-notebook" - case singleDocument = "single-document" - case smartFamilyChildAddressBook = "smart-family-child-address-book" - case smartScooter = "smart-scooter" - case smokeDetector = "smoke-detector" - case solarPanel = "solar-panel" - case sportsBike = "sports-bike" - case sportsSkis = "sports-skis" - case sportsSoccer = "sports-soccer" - case sportsTennis = "sports-tennis" - case stadiumAlt = "stadium-alt" - case stadiumFlag = "stadium-flag" - case thermostatTech = "thermostat-tech" - case ticket = "ticket" - case tradingDeck = "trading-deck" - case traffic = "traffic" - case travelKeys = "travel-keys" - case trumpet = "trumpet" - case unification = "unification" - case visibility = "visibility" - case weights = "weights" - case yield = "yield" - - //orders_pricing - case addToFavorite = "add-to-favorite" - case addedToFavorite = "added-to-favorite" - case billDown = "bill-down" - case billUp = "bill-up" - case camera = "camera" - case creditCard = "credit-card" - case gift = "gift" - case inStorePickup = "in-store-pickup" - case noFee = "no-fee" - case oneYear = "one-year" - case orders = "orders" - case outOfStock = "out-of-stock" - case reoccuringPayment = "reoccuring-payment" - case reservations = "reservations" - case returns = "returns" - case rewards = "rewards" - case shipping = "shipping" - case shoppingBag = "shopping-bag" - case shopping = "shopping" - case tag = "tag" - case taxes = "taxes" - - //other - case growthOpportunities = "growth-opportunities" - case noSmoking = "no-smoking" - case socialDistancing = "social-distancing" - - //plans_other - case battery = "battery" - case bonusData = "bonus-data" - case bringYourOwnDevice = "bring-your-own-device" - case callerId = "caller-id" - case carryoverData = "carryover-data" - case compass = "compass" - case connect = "connect" - case dataBoost = "data-boost" - case deviceProtection = "device-protection" - case devicesAddons = "devices-addons" - case embeddedSound = "embedded-sound" - case findMyRemote = "find-my-remote" - case giftedData = "gifted-data" - case homeInternet = "home-internet" - case internetDevices = "internet-devices" - case largePlan = "large-plan" - case mediumPlan = "medium-plan" - case mobileApps = "mobile-apps" - case mobileHotspot = "mobile-hotspot" - case multipleDeviceProtection = "multiple-device-protection" - case multipleDevices = "multiple-devices" - case nationWide = "nation-wide" - case phoneAlt = "phone-alt" - case purchaseData = "purchase-data" - case router = "router" - case simCard = "sim-card" - case smallPlan = "small-plan" - case smartAssistant = "smart-assistant" - case sound = "sound" - case tablet = "tablet" - case techLaptop = "tech-laptop" - case techPhone = "tech-phone" - case totalMobileProtection = "total-mobile-protection" - case unlimitedPlan = "unlimited-plan" - case uplink = "uplink" - case videoOnTablet = "video-on-tablet" - case waterResistant = "water-resistant" - case wearable = "wearable" - - //social - case at = "at" - case facebook = "facebook" - case instagram = "instagram" - case twitter = "twitter" - case youtube = "youtube" - - //utilities - case ThreeDAd = "3d-ad" - case ar = "ar" - case addFolder = "add-folder" - case addUser = "add-user" - case analytics = "analytics" - case announcement = "announcement" - case archive = "archive" - case artboard = "artboard" - case attach = "attach" - case awareness = "awareness" - case barcode = "barcode" - case bluetooth = "bluetooth" - case boxOpen = "box-open" - case calendar = "calendar" - case calibrate = "calibrate" - case callDisconnected = "call-disconnected" - case cleanSurface = "clean-surface" - case cloudAlt = "cloud-alt" - case cloud = "cloud" - case comparison = "comparison" - case compose = "compose" - case connectParts = "connect-parts" - case consultativeTransfer = "consultative-transfer" - case convergence = "convergence" - case crop = "crop" - case cta = "cta" - case customize = "customize" - case data = "data" - case decrease = "decrease" - case deviceActivity = "device-activity" - case directCarrierBilling = "direct-carrier-billing" - case directory = "directory" - case displayUtilities = "display-utilities" - case distribution = "distribution" - case download = "download" - case dragAndDrop = "drag-and-drop" - case dropShipment = "drop-shipment" - case duplicate = "duplicate" - case edit = "edit" - case email = "email" - case emergencyContact = "emergency-contact" - case emoji = "emoji" - case externalLink = "external-link" - case fallDetected = "fall-detected" - case favorite = "favorite" - case fax = "fax" - case fingerprintSensor = "fingerprint-sensor" - case fire = "fire" - case fitToZone = "fit-to-zone" - case flipCamera = "flip-camera" - case forwardedCall = "forwarded-call" - case fullscreen = "fullscreen" - case getHelp = "get-help" - case gridView = "grid-view" - case history = "history" - case humidity = "humidity" - case incomingCall = "incoming-call" - case increase = "increase" - case info = "info" - case inventory = "inventory" - case invitationAccepted = "invitation-accepted" - case invitationExpired = "invitation-expired" - case invitationRejected = "invitation-rejected" - case landscape = "landscape" - case light = "light" - case link = "link" - case location = "location" - case locationPin = "location-pin" - case mapView = "map-view" - case masonryView = "masonry-view" - case maximize = "maximize" - case mergeCalls = "merge-calls" - case microphoneAlt = "microphone-alt" - case microphone = "microphone" - case missedCall = "missed-call" - case moveTo = "move-to" - case multicast = "multicast" - case mute = "mute" - case networkConnection = "network-connection" - case news = "news" - case next = "next" - case nfcTag = "nfc-tag" - case night = "night" - case noVideo = "no-video" - case onDemand = "on-demand" - case outgoingCall = "outgoing-call" - case paperFreeBilling = "paper-free-billing" - case pauseInternet = "pause-internet" - case pause = "pause" - case peelSticker = "peel-sticker" - case photo = "photo" - case platform = "platform" - case playAlt = "play-alt" - case playWith = "play-with" - case play = "play" - case portrait = "portrait" - case pressure = "pressure" - case previous = "previous" - case print = "print" - case question = "question" - case recycle = "recycle" - case removeItem = "remove-item" - case replaceAPhoto = "replace-a-photo" - case reply = "reply" - case ringing = "ringing" - case ringtone = "ringtone" - case riskMonitor = "risk-monitor" - case rss = "rss" - case satelliteOff = "satellite-off" - case satellite = "satellite" - case save = "save" - case scaleAlt = "scale-alt" - case scale = "scale" - case sendMessage = "send-message" - case setFallbackImage = "set-fallback-image" - case setGalleryImage = "set-gallery-image" - case share = "share" - case shock = "shock" - case signalBroadcast = "signal-broadcast" - case speakerMute = "speaker-mute" - case speakerPhone = "speaker-phone" - case speed = "speed" - case stakeholder = "stakeholder" - case steps = "steps" - case stop = "stop" - case stopAlt = "stop-alt" - case survey = "survey" - case talking = "talking" - case teamLeader = "team-leader" - case temperature = "temperature" - case template = "template" - case theme = "theme" - case thumbsDown = "thumbs-down" - case thumbsUp = "thumbs-up" - case tiles = "tiles" - case tilt = "tilt" - case tools = "tools" - case trash = "trash" - case turnonOff = "turnon-off" - case tv = "tv" - case upload = "upload" - case userSettings = "user-settings" - case vibration = "vibration" - case video = "video" - case volume = "volume" - case volunteer = "volunteer" - case virtualReality = "virtual-reality" - case voiceHd = "voice-hd" - case voiceMail = "voice-mail" - case weather = "weather" - case whiteBlackList = "white-black-list" - case wifi = "wifi" - case zoomIn = "zoom-in" - case zoomOut = "zoom-out" -} - -internal enum RestrictedIconName: String, CaseIterable { - case paginationLeftArrow = "pagination-left-arrow" - case paginationRightArrow = "pagination-right-arrow" - case checkmark = "checkmark" - case checkmarkAlt = "checkmark-alt" - case close = "close" - case error = "error" - case info = "info" - case leftCaret = "left-caret" - case rightCaret = "right-caret" - case warning = "warning" + internal static let paginationLeftArrow = IconName(name: "pagination-left-arrow") + internal static let paginationRightArrow = IconName(name: "pagination-right-arrow") + public static let checkmark = IconName(name: "checkmark") + internal static let checkmarkBold = IconName(name: "checkmark-bold") + public static let checkmarkAlt = IconName(name: "checkmark-alt") + internal static let checkmarkAltBold = IconName(name: "checkmark-alt-bold") + public static let close = IconName(name: "close") + internal static let closeBold = IconName(name: "close-bold") + public static let error = IconName(name: "error") + internal static let errorBold = IconName(name: "error-bold") + public static let info = IconName(name: "info") + internal static let infoBold = IconName(name: "info-bold") + public static let leftCaret = IconName(name: "left-caret") + internal static let leftCaretBold = IconName(name: "left-caret-bold") + public static let rightCaret = IconName(name: "right-caret") + internal static let rightCaretBold = IconName(name: "right-caret-bold") + public static let warning = IconName(name: "warning") + internal static let warningBold = IconName(name: "warning-bold") } diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/Contents.json b/VDS/SupportingFiles/Icons.xcassets/Restricted/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/checkmark-alt-bold.imageset/Contents.json b/VDS/SupportingFiles/Icons.xcassets/Restricted/checkmark-alt-bold.imageset/Contents.json new file mode 100644 index 00000000..efc51701 --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/checkmark-alt-bold.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "checkmark-alt-bold.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/checkmark-alt-bold.imageset/checkmark-alt-bold.svg b/VDS/SupportingFiles/Icons.xcassets/Restricted/checkmark-alt-bold.imageset/checkmark-alt-bold.svg new file mode 100644 index 00000000..4e3a7dbd --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/checkmark-alt-bold.imageset/checkmark-alt-bold.svg @@ -0,0 +1,8 @@ + + + + + diff --git a/VDS/SupportingFiles/Icons.xcassets/checkmark-alt.imageset/Contents.json b/VDS/SupportingFiles/Icons.xcassets/Restricted/checkmark-alt.imageset/Contents.json similarity index 100% rename from VDS/SupportingFiles/Icons.xcassets/checkmark-alt.imageset/Contents.json rename to VDS/SupportingFiles/Icons.xcassets/Restricted/checkmark-alt.imageset/Contents.json diff --git a/VDS/SupportingFiles/Icons.xcassets/checkmark-alt.imageset/checkmark-alt.svg b/VDS/SupportingFiles/Icons.xcassets/Restricted/checkmark-alt.imageset/checkmark-alt.svg similarity index 100% rename from VDS/SupportingFiles/Icons.xcassets/checkmark-alt.imageset/checkmark-alt.svg rename to VDS/SupportingFiles/Icons.xcassets/Restricted/checkmark-alt.imageset/checkmark-alt.svg diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/checkmark-bold.imageset/Contents.json b/VDS/SupportingFiles/Icons.xcassets/Restricted/checkmark-bold.imageset/Contents.json new file mode 100644 index 00000000..14a052ea --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/checkmark-bold.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "checkmark-bold.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/checkmark-bold.imageset/checkmark-bold.svg b/VDS/SupportingFiles/Icons.xcassets/Restricted/checkmark-bold.imageset/checkmark-bold.svg new file mode 100644 index 00000000..7cedbd22 --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/checkmark-bold.imageset/checkmark-bold.svg @@ -0,0 +1,6 @@ + + + + + diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/checkmark.imageset/Contents.json b/VDS/SupportingFiles/Icons.xcassets/Restricted/checkmark.imageset/Contents.json new file mode 100644 index 00000000..6b69c1c8 --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/checkmark.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "checkmark.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/checkmark.imageset/checkmark.svg b/VDS/SupportingFiles/Icons.xcassets/Restricted/checkmark.imageset/checkmark.svg new file mode 100644 index 00000000..afebbcbe --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/checkmark.imageset/checkmark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/close-bold.imageset/Contents.json b/VDS/SupportingFiles/Icons.xcassets/Restricted/close-bold.imageset/Contents.json new file mode 100644 index 00000000..f7e08c7b --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/close-bold.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "close-bold.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/close-bold.imageset/close-bold.svg b/VDS/SupportingFiles/Icons.xcassets/Restricted/close-bold.imageset/close-bold.svg new file mode 100644 index 00000000..74f491da --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/close-bold.imageset/close-bold.svg @@ -0,0 +1,6 @@ + + + + + diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/close.imageset/Contents.json b/VDS/SupportingFiles/Icons.xcassets/Restricted/close.imageset/Contents.json new file mode 100644 index 00000000..308f9c8f --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/close.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "close.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/close.imageset/close.svg b/VDS/SupportingFiles/Icons.xcassets/Restricted/close.imageset/close.svg new file mode 100644 index 00000000..fa18112e --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/close.imageset/close.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/down-caret-bold.imageset/Contents.json b/VDS/SupportingFiles/Icons.xcassets/Restricted/down-caret-bold.imageset/Contents.json new file mode 100644 index 00000000..97881155 --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/down-caret-bold.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "down-caret-bold.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/down-caret-bold.imageset/down-caret-bold.svg b/VDS/SupportingFiles/Icons.xcassets/Restricted/down-caret-bold.imageset/down-caret-bold.svg new file mode 100644 index 00000000..56350437 --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/down-caret-bold.imageset/down-caret-bold.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/down-caret.imageset/Contents.json b/VDS/SupportingFiles/Icons.xcassets/Restricted/down-caret.imageset/Contents.json new file mode 100644 index 00000000..fca125b2 --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/down-caret.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "down-caret.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/down-caret.imageset/down-caret.svg b/VDS/SupportingFiles/Icons.xcassets/Restricted/down-caret.imageset/down-caret.svg new file mode 100644 index 00000000..f379dc74 --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/down-caret.imageset/down-caret.svg @@ -0,0 +1,3 @@ + + + diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/error-bold.imageset/Contents.json b/VDS/SupportingFiles/Icons.xcassets/Restricted/error-bold.imageset/Contents.json new file mode 100644 index 00000000..90962db0 --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/error-bold.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "error-bold.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/error-bold.imageset/error-bold.svg b/VDS/SupportingFiles/Icons.xcassets/Restricted/error-bold.imageset/error-bold.svg new file mode 100644 index 00000000..cbb4edb8 --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/error-bold.imageset/error-bold.svg @@ -0,0 +1,12 @@ + + + + + + diff --git a/VDS/SupportingFiles/Icons.xcassets/error.imageset/Contents.json b/VDS/SupportingFiles/Icons.xcassets/Restricted/error.imageset/Contents.json similarity index 100% rename from VDS/SupportingFiles/Icons.xcassets/error.imageset/Contents.json rename to VDS/SupportingFiles/Icons.xcassets/Restricted/error.imageset/Contents.json diff --git a/VDS/SupportingFiles/Icons.xcassets/error.imageset/error.svg b/VDS/SupportingFiles/Icons.xcassets/Restricted/error.imageset/error.svg similarity index 100% rename from VDS/SupportingFiles/Icons.xcassets/error.imageset/error.svg rename to VDS/SupportingFiles/Icons.xcassets/Restricted/error.imageset/error.svg diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/info-bold.imageset/Contents.json b/VDS/SupportingFiles/Icons.xcassets/Restricted/info-bold.imageset/Contents.json new file mode 100644 index 00000000..ffefe268 --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/info-bold.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "info-bold.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/info-bold.imageset/info-bold.svg b/VDS/SupportingFiles/Icons.xcassets/Restricted/info-bold.imageset/info-bold.svg new file mode 100644 index 00000000..54749e1b --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/info-bold.imageset/info-bold.svg @@ -0,0 +1,10 @@ + + + + + + diff --git a/VDS/SupportingFiles/Icons.xcassets/info.imageset/Contents.json b/VDS/SupportingFiles/Icons.xcassets/Restricted/info.imageset/Contents.json similarity index 100% rename from VDS/SupportingFiles/Icons.xcassets/info.imageset/Contents.json rename to VDS/SupportingFiles/Icons.xcassets/Restricted/info.imageset/Contents.json diff --git a/VDS/SupportingFiles/Icons.xcassets/info.imageset/info.svg b/VDS/SupportingFiles/Icons.xcassets/Restricted/info.imageset/info.svg similarity index 100% rename from VDS/SupportingFiles/Icons.xcassets/info.imageset/info.svg rename to VDS/SupportingFiles/Icons.xcassets/Restricted/info.imageset/info.svg diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/left-caret-bold.imageset/Contents.json b/VDS/SupportingFiles/Icons.xcassets/Restricted/left-caret-bold.imageset/Contents.json new file mode 100644 index 00000000..1e4c1c7e --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/left-caret-bold.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "left-caret-bold.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/left-caret-bold.imageset/left-caret-bold.svg b/VDS/SupportingFiles/Icons.xcassets/Restricted/left-caret-bold.imageset/left-caret-bold.svg new file mode 100644 index 00000000..6ab7bc2a --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/left-caret-bold.imageset/left-caret-bold.svg @@ -0,0 +1,6 @@ + + + + + diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/left-caret.imageset/Contents.json b/VDS/SupportingFiles/Icons.xcassets/Restricted/left-caret.imageset/Contents.json new file mode 100644 index 00000000..7dcf67e0 --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/left-caret.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "left-caret.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/left-caret.imageset/left-caret.svg b/VDS/SupportingFiles/Icons.xcassets/Restricted/left-caret.imageset/left-caret.svg new file mode 100644 index 00000000..1ccebca5 --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/left-caret.imageset/left-caret.svg @@ -0,0 +1,3 @@ + + + diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-left-arrow.imageset/Contents.json b/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-left-arrow.imageset/Contents.json new file mode 100644 index 00000000..84274b84 --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-left-arrow.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "pagination-left-arrow.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-left-arrow.imageset/pagination-left-arrow.svg b/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-left-arrow.imageset/pagination-left-arrow.svg new file mode 100644 index 00000000..48081348 --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-left-arrow.imageset/pagination-left-arrow.svg @@ -0,0 +1,6 @@ + + + + + diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-left-caret.imageset/Contents.json b/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-left-caret.imageset/Contents.json new file mode 100644 index 00000000..b7e824be --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-left-caret.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "pagination-left-caret.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-left-caret.imageset/pagination-left-caret.svg b/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-left-caret.imageset/pagination-left-caret.svg new file mode 100644 index 00000000..be5d0283 --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-left-caret.imageset/pagination-left-caret.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-right-arrow.imageset/Contents.json b/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-right-arrow.imageset/Contents.json new file mode 100644 index 00000000..67994793 --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-right-arrow.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "pagination-right-arrow.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-right-arrow.imageset/pagination-right-arrow.svg b/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-right-arrow.imageset/pagination-right-arrow.svg new file mode 100644 index 00000000..b86c3569 --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-right-arrow.imageset/pagination-right-arrow.svg @@ -0,0 +1,3 @@ + + + diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-right-caret.imageset/Contents.json b/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-right-caret.imageset/Contents.json new file mode 100644 index 00000000..ac5bf0f8 --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-right-caret.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "pagination-right-caret.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-right-caret.imageset/pagination-right-caret.svg b/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-right-caret.imageset/pagination-right-caret.svg new file mode 100644 index 00000000..3cd4317c --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-right-caret.imageset/pagination-right-caret.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/right-caret-bold.imageset/Contents.json b/VDS/SupportingFiles/Icons.xcassets/Restricted/right-caret-bold.imageset/Contents.json new file mode 100644 index 00000000..9c8e052c --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/right-caret-bold.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "right-caret-bold.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/right-caret-bold.imageset/right-caret-bold.svg b/VDS/SupportingFiles/Icons.xcassets/Restricted/right-caret-bold.imageset/right-caret-bold.svg new file mode 100644 index 00000000..076915e0 --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/right-caret-bold.imageset/right-caret-bold.svg @@ -0,0 +1,6 @@ + + + + + diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/warning-bold.imageset/Contents.json b/VDS/SupportingFiles/Icons.xcassets/Restricted/warning-bold.imageset/Contents.json new file mode 100644 index 00000000..079e7cc3 --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/warning-bold.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "warning-bold.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/warning-bold.imageset/warning-bold.svg b/VDS/SupportingFiles/Icons.xcassets/Restricted/warning-bold.imageset/warning-bold.svg new file mode 100644 index 00000000..fbb6b503 --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/warning-bold.imageset/warning-bold.svg @@ -0,0 +1,3 @@ + + + diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/warning.imageset/Contents.json b/VDS/SupportingFiles/Icons.xcassets/Restricted/warning.imageset/Contents.json new file mode 100644 index 00000000..b9aa7c20 --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/warning.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "warning.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/warning.imageset/warning.svg b/VDS/SupportingFiles/Icons.xcassets/Restricted/warning.imageset/warning.svg new file mode 100644 index 00000000..8bd5e27f --- /dev/null +++ b/VDS/SupportingFiles/Icons.xcassets/Restricted/warning.imageset/warning.svg @@ -0,0 +1,3 @@ + + + From b3e24693938cebf47a8c4a88a72127e9d4418b26 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 10 Jan 2023 13:25:07 -0600 Subject: [PATCH 5/8] refactored TextField Signed-off-by: Matt Bruce --- VDS.xcodeproj/project.pbxproj | 14 +++++++------- .../InputField.swift} | 12 +++++------- 2 files changed, 12 insertions(+), 14 deletions(-) rename VDS/Components/TextFields/{TextEntryField/TextEntryField.swift => InputField/InputField.swift} (95%) diff --git a/VDS.xcodeproj/project.pbxproj b/VDS.xcodeproj/project.pbxproj index d37a05ac..1d13c142 100644 --- a/VDS.xcodeproj/project.pbxproj +++ b/VDS.xcodeproj/project.pbxproj @@ -84,7 +84,7 @@ EAC9257D29119B5400091998 /* TextLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAC9257C29119B5400091998 /* TextLink.swift */; }; EAC925832911B35400091998 /* TextLinkCaret.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAC925822911B35300091998 /* TextLinkCaret.swift */; }; EAC925842911C63100091998 /* Colorable.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAA5EEDF28F49DB3003B3210 /* Colorable.swift */; }; - EAC9258C2911C9DE00091998 /* TextEntryField.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAC925872911C9DE00091998 /* TextEntryField.swift */; }; + EAC9258C2911C9DE00091998 /* InputField.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAC925872911C9DE00091998 /* InputField.swift */; }; EAC9258F2911C9DE00091998 /* EntryField.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAC9258B2911C9DE00091998 /* EntryField.swift */; }; EAD8D2C128BFDE8B006EB6A6 /* UIGestureRecognizer+Publisher.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAD8D2C028BFDE8B006EB6A6 /* UIGestureRecognizer+Publisher.swift */; }; EAF7F0952899861000B287F5 /* Checkbox.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF7F0932899861000B287F5 /* Checkbox.swift */; }; @@ -195,7 +195,7 @@ EAC846F2294B95CE00F685BA /* ButtonGroupCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ButtonGroupCollectionViewCell.swift; sourceTree = ""; }; EAC9257C29119B5400091998 /* TextLink.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextLink.swift; sourceTree = ""; }; EAC925822911B35300091998 /* TextLinkCaret.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextLinkCaret.swift; sourceTree = ""; }; - EAC925872911C9DE00091998 /* TextEntryField.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextEntryField.swift; sourceTree = ""; }; + EAC925872911C9DE00091998 /* InputField.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InputField.swift; sourceTree = ""; }; EAC9258B2911C9DE00091998 /* EntryField.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EntryField.swift; sourceTree = ""; }; EAD8D2C028BFDE8B006EB6A6 /* UIGestureRecognizer+Publisher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIGestureRecognizer+Publisher.swift"; sourceTree = ""; }; EAF7F0932899861000B287F5 /* Checkbox.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Checkbox.swift; sourceTree = ""; }; @@ -558,18 +558,18 @@ EAC925852911C9DE00091998 /* TextFields */ = { isa = PBXGroup; children = ( - EAC925862911C9DE00091998 /* TextEntryField */, + EAC925862911C9DE00091998 /* InputField */, EAC925892911C9DE00091998 /* EntryField */, ); path = TextFields; sourceTree = ""; }; - EAC925862911C9DE00091998 /* TextEntryField */ = { + EAC925862911C9DE00091998 /* InputField */ = { isa = PBXGroup; children = ( - EAC925872911C9DE00091998 /* TextEntryField.swift */, + EAC925872911C9DE00091998 /* InputField.swift */, ); - path = TextEntryField; + path = InputField; sourceTree = ""; }; EAC925892911C9DE00091998 /* EntryField */ = { @@ -737,7 +737,7 @@ EA3361C328902D960071C351 /* Toggle.swift in Sources */, EAF7F0A0289AB7EC00B287F5 /* View.swift in Sources */, EA89201328B568D8006B9984 /* RadioBox.swift in Sources */, - EAC9258C2911C9DE00091998 /* TextEntryField.swift in Sources */, + EAC9258C2911C9DE00091998 /* InputField.swift in Sources */, EA3362402892EF6C0071C351 /* Label.swift in Sources */, EAF7F0B3289B1ADC00B287F5 /* ActionLabelAttribute.swift in Sources */, EAC925832911B35400091998 /* TextLinkCaret.swift in Sources */, diff --git a/VDS/Components/TextFields/TextEntryField/TextEntryField.swift b/VDS/Components/TextFields/InputField/InputField.swift similarity index 95% rename from VDS/Components/TextFields/TextEntryField/TextEntryField.swift rename to VDS/Components/TextFields/InputField/InputField.swift index 280a66e0..0b82f53b 100644 --- a/VDS/Components/TextFields/TextEntryField/TextEntryField.swift +++ b/VDS/Components/TextFields/InputField/InputField.swift @@ -11,14 +11,12 @@ import VDSColorTokens import VDSFormControlsTokens import Combine -public enum TextEntryFieldType: String, CaseIterable { +public enum InputFieldType: String, CaseIterable { case text, number, calendar, inlineAction, password, creditCard, tel, date, securityCode } -@objc(VDSTextEntryField) -public class TextEntryField: TextEntryFieldBase{} - -open class TextEntryFieldBase: EntryField { +@objc(VDSInputField) +public class InputField: EntryField { //-------------------------------------------------- // MARK: - Initializers //-------------------------------------------------- @@ -50,7 +48,7 @@ open class TextEntryFieldBase: EntryField { // MARK: - Public Properties //-------------------------------------------------- - open var type: TextEntryFieldType = .text { didSet { didChange() }} + open var type: InputFieldType = .text { didSet { didChange() }} var _showError: Bool = false open override var showError: Bool { @@ -187,7 +185,7 @@ open class TextEntryFieldBase: EntryField { } } -extension TextEntryFieldType { +extension InputFieldType { var width: CGFloat { switch self { case .inlineAction: From aafb7770b2606775b6ae514473a67961e54c9a75 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 10 Jan 2023 14:32:40 -0600 Subject: [PATCH 6/8] added added error/success icons Signed-off-by: Matt Bruce --- .../TextFields/EntryField/EntryField.swift | 43 +++++++++++++++++-- .../TextFields/InputField/InputField.swift | 43 ++++++++++++++----- 2 files changed, 72 insertions(+), 14 deletions(-) diff --git a/VDS/Components/TextFields/EntryField/EntryField.swift b/VDS/Components/TextFields/EntryField/EntryField.swift index ab9c0a98..3cc7fc4a 100644 --- a/VDS/Components/TextFields/EntryField/EntryField.swift +++ b/VDS/Components/TextFields/EntryField/EntryField.swift @@ -42,7 +42,7 @@ open class EntryField: Control, Accessable { $0.distribution = .fill } }() - + internal var titleLabel = Label().with { $0.setContentCompressionResistancePriority(.required, for: .vertical) $0.attributes = [] @@ -68,13 +68,32 @@ open class EntryField: Control, Accessable { } }() + internal var containerStackView: UIStackView = { + return UIStackView().with { + $0.translatesAutoresizingMaskIntoConstraints = false + $0.axis = .horizontal + $0.distribution = .fillProportionally + $0.alignment = .top + } + }() + + internal var controlContainerView: UIView = { + return UIView().with { + $0.translatesAutoresizingMaskIntoConstraints = false + } + }() + + internal var tooltipView: UIView? + internal var icon: Icon = Icon().with { + $0.size = .small + } //-------------------------------------------------- // MARK: - Configuration Properties //-------------------------------------------------- // Sizes are from InVision design specs. - internal let containerSize = CGSize(width: 45, height: 45) + internal let containerSize = CGSize(width: 45, height: 44) internal let primaryColorConfig = ViewColorConfiguration().with { $0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forDisabled: true) @@ -173,8 +192,21 @@ open class EntryField: Control, Accessable { heightConstraint?.isActive = true widthConstraint = containerView.widthAnchor.constraint(equalToConstant: 0) - + + //get the container this is what is color + //border, internal, etc... let container = getContainer() + + //add ContainerStackView + //this is the horizontal stack that contains + //the left, InputContainer, Icons, Buttons + container.addSubview(containerStackView) + containerStackView.pinToSuperView(.init(top: 12, left: 12, bottom: 12, right: 12)) + + //add the view to add input fields + containerStackView.addArrangedSubview(controlContainerView) + containerStackView.addArrangedSubview(icon) + stackView.addArrangedSubview(titleLabel) stackView.addArrangedSubview(container) stackView.addArrangedSubview(errorLabel) @@ -345,7 +377,12 @@ open class EntryField: Control, Accessable { errorLabel.surface = surface errorLabel.disabled = disabled errorLabel.isHidden = false + icon.name = .error + icon.color = .black + icon.surface = surface + icon.isHidden = disabled } else { + icon.isHidden = true errorLabel.isHidden = true } } diff --git a/VDS/Components/TextFields/InputField/InputField.swift b/VDS/Components/TextFields/InputField/InputField.swift index 0b82f53b..d3cb99e0 100644 --- a/VDS/Components/TextFields/InputField/InputField.swift +++ b/VDS/Components/TextFields/InputField/InputField.swift @@ -35,7 +35,7 @@ public class InputField: EntryField { //-------------------------------------------------- // MARK: - Private Properties //-------------------------------------------------- - internal var containerStackView: UIStackView = { + internal var inputFieldStackView: UIStackView = { return UIStackView().with { $0.translatesAutoresizingMaskIntoConstraints = false $0.axis = .horizontal @@ -92,6 +92,17 @@ public class InputField: EntryField { $0.typograpicalStyle = .BodySmall } + private var textField = UITextField().with { + $0.translatesAutoresizingMaskIntoConstraints = false + $0.font = TypographicalStyle.BodyLarge.font + } + + public var textFieldTextColorConfiguration: AnyColorable = ViewColorConfiguration().with { + $0.setSurfaceColors(VDSColor.elementsSecondaryOnlight, VDSColor.elementsSecondaryOndark, forDisabled: true) + $0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forDisabled: false) + }.eraseToAnyColorable() + + internal var minWidthConstraint: NSLayoutConstraint? //-------------------------------------------------- @@ -102,7 +113,11 @@ public class InputField: EntryField { minWidthConstraint = containerView.widthAnchor.constraint(greaterThanOrEqualToConstant: 0) minWidthConstraint?.isActive = true - + + controlContainerView.addSubview(textField) + textField.pinToSuperView() + textField.heightAnchor.constraint(equalToConstant: 20).isActive = true + stackView.addArrangedSubview(successLabel) stackView.setCustomSpacing(8, after: successLabel) @@ -126,8 +141,8 @@ public class InputField: EntryField { } open override func getContainer() -> UIView { - containerStackView.addArrangedSubview(containerView) - return containerStackView + inputFieldStackView.addArrangedSubview(containerView) + return inputFieldStackView } //-------------------------------------------------- @@ -136,6 +151,9 @@ public class InputField: EntryField { open override func updateView() { super.updateView() + textField.isEnabled = isEnabled + textField.textColor = textFieldTextColorConfiguration.getColor(self) + //show error or success if showError, let _ = errorText { successLabel.isHidden = true @@ -146,10 +164,13 @@ public class InputField: EntryField { successLabel.disabled = disabled successLabel.isHidden = false errorLabel.isHidden = true - + icon.name = .checkmarkAlt + icon.color = .black + icon.surface = surface + icon.isHidden = disabled } else { + icon.isHidden = true successLabel.isHidden = true - } //set the width constraints @@ -173,12 +194,12 @@ public class InputField: EntryField { //set the helper label position if helperText != nil { if helperTextPlacement == .right { - containerStackView.spacing = 12 - containerStackView.distribution = .fillEqually - containerStackView.addArrangedSubview(helperLabel) + inputFieldStackView.spacing = 12 + inputFieldStackView.distribution = .fillEqually + inputFieldStackView.addArrangedSubview(helperLabel) } else { - containerStackView.spacing = 0 - containerStackView.distribution = .fill + inputFieldStackView.spacing = 0 + inputFieldStackView.distribution = .fill stackView.addArrangedSubview(helperLabel) } } From 62837354288e9a19a3add2a47a56a8746343047a Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 10 Jan 2023 16:49:29 -0600 Subject: [PATCH 7/8] added textArea Signed-off-by: Matt Bruce --- VDS.xcodeproj/project.pbxproj | 12 ++ .../TextFields/TextArea/TextArea.swift | 142 ++++++++++++++++++ 2 files changed, 154 insertions(+) create mode 100644 VDS/Components/TextFields/TextArea/TextArea.swift diff --git a/VDS.xcodeproj/project.pbxproj b/VDS.xcodeproj/project.pbxproj index 1d13c142..ee4cc638 100644 --- a/VDS.xcodeproj/project.pbxproj +++ b/VDS.xcodeproj/project.pbxproj @@ -62,6 +62,7 @@ EA985BF7296C665E00F2FF2E /* IconName.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA985BF6296C665E00F2FF2E /* IconName.swift */; }; EA985BF9296C710100F2FF2E /* IconColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA985BF8296C710100F2FF2E /* IconColor.swift */; }; EA985C1D296CD13600F2FF2E /* BundleManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA985C1C296CD13600F2FF2E /* BundleManager.swift */; }; + EA985C23296E033A00F2FF2E /* TextArea.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA985C22296E033A00F2FF2E /* TextArea.swift */; }; EAA5EEB528ECBFB4003B3210 /* ImageLabelAttribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAA5EEB428ECBFB4003B3210 /* ImageLabelAttribute.swift */; }; EAA5EEB728ECC03A003B3210 /* ToolTipLabelAttribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAA5EEB628ECC03A003B3210 /* ToolTipLabelAttribute.swift */; }; EAA5EEB928ECD24B003B3210 /* Icons.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EAA5EEB828ECD24B003B3210 /* Icons.xcassets */; }; @@ -173,6 +174,7 @@ EA985BF6296C665E00F2FF2E /* IconName.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IconName.swift; sourceTree = ""; }; EA985BF8296C710100F2FF2E /* IconColor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IconColor.swift; sourceTree = ""; }; EA985C1C296CD13600F2FF2E /* BundleManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BundleManager.swift; sourceTree = ""; }; + EA985C22296E033A00F2FF2E /* TextArea.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextArea.swift; sourceTree = ""; }; EAA5EEB428ECBFB4003B3210 /* ImageLabelAttribute.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageLabelAttribute.swift; sourceTree = ""; }; EAA5EEB628ECC03A003B3210 /* ToolTipLabelAttribute.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToolTipLabelAttribute.swift; sourceTree = ""; }; EAA5EEB828ECD24B003B3210 /* Icons.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Icons.xcassets; sourceTree = ""; }; @@ -519,6 +521,14 @@ path = Icon; sourceTree = ""; }; + EA985C21296E032000F2FF2E /* TextArea */ = { + isa = PBXGroup; + children = ( + EA985C22296E033A00F2FF2E /* TextArea.swift */, + ); + path = TextArea; + sourceTree = ""; + }; EAB1D2D028ABEF3100DAE764 /* Typography */ = { isa = PBXGroup; children = ( @@ -559,6 +569,7 @@ isa = PBXGroup; children = ( EAC925862911C9DE00091998 /* InputField */, + EA985C21296E032000F2FF2E /* TextArea */, EAC925892911C9DE00091998 /* EntryField */, ); path = TextFields; @@ -739,6 +750,7 @@ EA89201328B568D8006B9984 /* RadioBox.swift in Sources */, EAC9258C2911C9DE00091998 /* InputField.swift in Sources */, EA3362402892EF6C0071C351 /* Label.swift in Sources */, + EA985C23296E033A00F2FF2E /* TextArea.swift in Sources */, EAF7F0B3289B1ADC00B287F5 /* ActionLabelAttribute.swift in Sources */, EAC925832911B35400091998 /* TextLinkCaret.swift in Sources */, EA33622E2891EA3C0071C351 /* DispatchQueue+Once.swift in Sources */, diff --git a/VDS/Components/TextFields/TextArea/TextArea.swift b/VDS/Components/TextFields/TextArea/TextArea.swift new file mode 100644 index 00000000..349fc33f --- /dev/null +++ b/VDS/Components/TextFields/TextArea/TextArea.swift @@ -0,0 +1,142 @@ +// +// TextArea.swift +// VDS +// +// Created by Matt Bruce on 1/10/23. +// + +import Foundation +import Foundation +import UIKit +import VDSColorTokens +import VDSFormControlsTokens +import Combine + +@objc(VDSTextArea) +public class TextArea: EntryField { + //-------------------------------------------------- + // MARK: - Initializers + //-------------------------------------------------- + required public init() { + super.init(frame: .zero) + } + + public override init(frame: CGRect) { + super.init(frame: .zero) + } + + public required init?(coder: NSCoder) { + super.init(coder: coder) + } + + //-------------------------------------------------- + // MARK: - Private Properties + //-------------------------------------------------- + internal var inputFieldStackView: UIStackView = { + return UIStackView().with { + $0.translatesAutoresizingMaskIntoConstraints = false + $0.axis = .horizontal + $0.distribution = .fill + $0.spacing = 12 + } + }() + + //-------------------------------------------------- + // MARK: - Public Properties + //-------------------------------------------------- + override var containerSize: CGSize { CGSize(width: 45, height: 88) } + + private var textView = UITextView().with { + $0.translatesAutoresizingMaskIntoConstraints = false + $0.font = TypographicalStyle.BodyLarge.font + $0.sizeToFit() + $0.isScrollEnabled = false + } + + public var textViewTextColorConfiguration: AnyColorable = ViewColorConfiguration().with { + $0.setSurfaceColors(VDSColor.elementsSecondaryOnlight, VDSColor.elementsSecondaryOndark, forDisabled: true) + $0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forDisabled: false) + }.eraseToAnyColorable() + + internal var minWidthConstraint: NSLayoutConstraint? + internal var textViewHeightConstraint: NSLayoutConstraint? + //-------------------------------------------------- + // MARK: - Lifecycle + //-------------------------------------------------- + open override func setup() { + super.setup() + + minWidthConstraint = containerView.widthAnchor.constraint(greaterThanOrEqualToConstant: 0) + minWidthConstraint?.isActive = true + + controlContainerView.addSubview(textView) + textView.pinToSuperView() + textViewHeightConstraint = textView.heightAnchor.constraint(greaterThanOrEqualToConstant: 64) + textViewHeightConstraint?.isActive = true + backgroundColorConfiguration.setSurfaceColors(VDSColor.feedbackSuccessBackgroundOnlight, VDSColor.feedbackSuccessBackgroundOndark, forState: .success) + borderColorConfiguration.setSurfaceColors(VDSColor.feedbackSuccessOnlight, VDSColor.feedbackSuccessOndark, forState: .success) + + textView.delegate = self + } + + public override func reset() { + super.reset() + textView.text = "" + } + + open override func getContainer() -> UIView { + inputFieldStackView.addArrangedSubview(containerView) + return inputFieldStackView + } + + //-------------------------------------------------- + // MARK: - State + //-------------------------------------------------- + open override func updateView() { + super.updateView() + + textView.isEditable = isEnabled + textView.textColor = textViewTextColorConfiguration.getColor(self) + + //set the width constraints + if let width { + widthConstraint?.constant = width + widthConstraint?.isActive = true + minWidthConstraint?.isActive = false + } else { + minWidthConstraint?.constant = containerSize.width + widthConstraint?.isActive = false + minWidthConstraint?.isActive = true + } + } +} + +extension TextArea: UITextViewDelegate { + //-------------------------------------------------- + // MARK: - UITextViewDelegate + //-------------------------------------------------- + public func textViewDidChange(_ textView: UITextView) { + + //dynamic textView Height sizing based on Figma + //if you want it to work "as-is" delete this code + //since it will autogrow with the current settings + if let textViewHeightConstraint, textView.isEditable { + let height = textView.frame.size.height + let constraintHeight = textViewHeightConstraint.constant + if height > constraintHeight { + if height > 64 && height < 152 { + textViewHeightConstraint.constant = 152 + } else if height > 152 { + textViewHeightConstraint.constant = 328 + } else { + textViewHeightConstraint.constant = 64 + } + } + } + + //setting the value and firing control event + value = textView.text + sendActions(for: .valueChanged) + + } +} From c6ffa5736d00d97276a9dc3216916b47e0a0e809 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 10 Jan 2023 16:49:39 -0600 Subject: [PATCH 8/8] updated entry field Signed-off-by: Matt Bruce --- .../TextFields/EntryField/EntryField.swift | 2 +- .../TextFields/InputField/InputField.swift | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/VDS/Components/TextFields/EntryField/EntryField.swift b/VDS/Components/TextFields/EntryField/EntryField.swift index 3cc7fc4a..b5f6193e 100644 --- a/VDS/Components/TextFields/EntryField/EntryField.swift +++ b/VDS/Components/TextFields/EntryField/EntryField.swift @@ -93,7 +93,7 @@ open class EntryField: Control, Accessable { // MARK: - Configuration Properties //-------------------------------------------------- // Sizes are from InVision design specs. - internal let containerSize = CGSize(width: 45, height: 44) + internal var containerSize: CGSize { CGSize(width: 45, height: 44) } internal let primaryColorConfig = ViewColorConfiguration().with { $0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forDisabled: true) diff --git a/VDS/Components/TextFields/InputField/InputField.swift b/VDS/Components/TextFields/InputField/InputField.swift index d3cb99e0..e4e84be1 100644 --- a/VDS/Components/TextFields/InputField/InputField.swift +++ b/VDS/Components/TextFields/InputField/InputField.swift @@ -16,7 +16,7 @@ public enum InputFieldType: String, CaseIterable { } @objc(VDSInputField) -public class InputField: EntryField { +public class InputField: EntryField, UITextFieldDelegate { //-------------------------------------------------- // MARK: - Initializers //-------------------------------------------------- @@ -102,7 +102,6 @@ public class InputField: EntryField { $0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forDisabled: false) }.eraseToAnyColorable() - internal var minWidthConstraint: NSLayoutConstraint? //-------------------------------------------------- @@ -117,6 +116,13 @@ public class InputField: EntryField { controlContainerView.addSubview(textField) textField.pinToSuperView() textField.heightAnchor.constraint(equalToConstant: 20).isActive = true + textField + .textPublisher + .sink { [weak self] text in + self?.value = text + self?.sendActions(for: .valueChanged) + + }.store(in: &subscribers) stackView.addArrangedSubview(successLabel) stackView.setCustomSpacing(8, after: successLabel) @@ -130,6 +136,9 @@ public class InputField: EntryField { public override func reset() { super.reset() + textField.text = "" + textField.delegate = self + successLabel.reset() successLabel.textPosition = .left successLabel.typograpicalStyle = .BodySmall @@ -204,6 +213,7 @@ public class InputField: EntryField { } } } + } extension InputFieldType {