Skip to content

Commit

Permalink
LATCH-905 Add new brand for Telefonica style
Browse files Browse the repository at this point in the history
  • Loading branch information
jaranaz committed Oct 10, 2023
1 parent 6a9f441 commit 2414392
Show file tree
Hide file tree
Showing 264 changed files with 320 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ Blau:= blau
O2:= o2
Vivo:= vivo
VivoNew:= vivo-new
BRAND_FILES:= $(Movistar) $(Blau) $(O2) $(Vivo) $(VivoNew) # List of all the brand names that will be procesed.
Telefonica:= telefonica
BRAND_FILES:= $(Movistar) $(Blau) $(O2) $(Vivo) $(VivoNew) $(Telefonica) # List of all the brand names that will be procesed.

# Xcode
ifneq ($(origin GITHUB_ACTION),undefined)
Expand Down
2 changes: 2 additions & 0 deletions MisticaCatalog/Source/ColorsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ struct ColorsView: View {
return VivoColorPalette()
case .vivoNew:
return VivoNewColorPalette()
case .telefonica:
return TelefonicaColorPalette()
case .custom(let colors, _, _, _, _):
return colors
}
Expand Down
18 changes: 18 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,24 @@
"version" : "3.1.8"
}
},
{
"identity" : "sdwebimage",
"kind" : "remoteSourceControl",
"location" : "https://github.com/SDWebImage/SDWebImage.git",
"state" : {
"revision" : "633996a807442ec28df9d33b0f88ce57a0e2fdbf",
"version" : "5.17.0"
}
},
{
"identity" : "sdwebimagesvgcoder",
"kind" : "remoteSourceControl",
"location" : "https://github.com/SDWebImage/SDWebImageSVGCoder.git",
"state" : {
"revision" : "950167445ab703740569869c8b7510efc9d09a26",
"version" : "1.7.0"
}
},
{
"identity" : "swift-snapshot-testing",
"kind" : "remoteSourceControl",
Expand Down
2 changes: 1 addition & 1 deletion Sources/Mistica/Components/Title/TitleView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ private extension TitleView.Style {
switch MisticaConfig.brandStyle {
case .movistar:
return .title2
case .blau, .o2, .vivo, .custom, .vivoNew:
case .blau, .o2, .vivo, .custom, .vivoNew, .telefonica:
return .title1
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/MisticaCommon/Colors/ColorToolkit+UIColor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ public extension UIColor {
public extension BrandStyle {
var preferredStatusBarStyle: UIStatusBarStyle {
switch self {
case .movistar, .vivo, .o2, .blau, .custom, .vivoNew:
case .movistar, .vivo, .o2, .blau, .custom, .vivoNew, .telefonica:
return .lightContent
}
}
Expand Down
158 changes: 158 additions & 0 deletions Sources/MisticaCommon/Colors/TelefonicaColorPalette.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
//
// TelefonicaColorPalette.swift
//
// Made with ❤️ by Novum
//
// Copyright © Telefonica. All rights reserved.
//

import UIKit

struct TelefonicaColors: MisticaColors {
static let palette = TelefonicaColorPalette()

let appBarBackground = TelefonicaColors.palette.white | TelefonicaColors.palette.darkModeGrey
let background = TelefonicaColors.palette.white | TelefonicaColors.palette.darkModeBlack
let backgroundContainer = TelefonicaColors.palette.white | TelefonicaColors.palette.darkModeGrey
let backgroundContainerHover = TelefonicaColors.palette.telefonicaBlue.withAlphaComponent(0.03) | TelefonicaColors.palette.white.withAlphaComponent(0.03)
let backgroundContainerPressed = TelefonicaColors.palette.telefonicaBlue.withAlphaComponent(0.05) | TelefonicaColors.palette.white.withAlphaComponent(0.05)
let backgroundContainerBrand = TelefonicaColors.palette.telefonicaBlue | TelefonicaColors.palette.darkModeGrey
let backgroundContainerBrandHover = TelefonicaColors.palette.darkModeBlack.withAlphaComponent(0.2) | TelefonicaColors.palette.white.withAlphaComponent(0.03)
let backgroundContainerBrandPressed = TelefonicaColors.palette.darkModeBlack.withAlphaComponent(0.4) | TelefonicaColors.palette.white.withAlphaComponent(0.05)
let backgroundContainerBrandOverInverse = TelefonicaColors.palette.telefonicaBlue70 | TelefonicaColors.palette.darkModeGrey
let backgroundContainerAlternative = TelefonicaColors.palette.grey1 | TelefonicaColors.palette.darkModeGrey
let backgroundBrand = TelefonicaColors.palette.telefonicaBlue | TelefonicaColors.palette.darkModeBlack
let backgroundBrandSecondary = TelefonicaColors.palette.telefonicaBlue | TelefonicaColors.palette.darkModeBlack
let backgroundOverlay = TelefonicaColors.palette.grey6.withAlphaComponent(0.8) | TelefonicaColors.palette.darkModeGrey.withAlphaComponent(0.8)
let backgroundSkeleton = TelefonicaColors.palette.grey2 | TelefonicaColors.palette.grey6
let backgroundSkeletonInverse = TelefonicaColors.palette.telefonicaBlue70 | TelefonicaColors.palette.grey6
let navigationBarBackground = TelefonicaColors.palette.telefonicaBlue | TelefonicaColors.palette.darkModeBlack
let backgroundAlternative = TelefonicaColors.palette.grey1 | TelefonicaColors.palette.darkModeBlack
let backgroundFeedbackBottom = TelefonicaColors.palette.telefonicaBlue | TelefonicaColors.palette.darkModeBlack
let skeletonWave = TelefonicaColors.palette.grey2 | TelefonicaColors.palette.grey5
let borderLow = TelefonicaColors.palette.grey1 | TelefonicaColors.palette.darkModeBlack
let border = TelefonicaColors.palette.grey2 | TelefonicaColors.palette.darkModeGrey
let borderHigh = TelefonicaColors.palette.grey5
let borderSelected = TelefonicaColors.palette.telefonicaBlue
let coverBackgroundHover = TelefonicaColors.palette.darkModeBlack.withAlphaComponent(0.25)
let coverBackgroundPressed = TelefonicaColors.palette.darkModeBlack.withAlphaComponent(0.35)
let buttonDangerBackground = TelefonicaColors.palette.coral
let buttonDangerBackgroundSelected = TelefonicaColors.palette.coral80
let buttonDangerBackgroundHover = TelefonicaColors.palette.coral80
let buttonLinkBackgroundSelected = TelefonicaColors.palette.grey1 | TelefonicaColors.palette.white.withAlphaComponent(0.08)
let buttonLinkBackgroundInverseSelected = TelefonicaColors.palette.white.withAlphaComponent(0.08)
let buttonPrimaryBackground = TelefonicaColors.palette.telefonicaBlue
let buttonPrimaryBackgroundInverse = TelefonicaColors.palette.white | TelefonicaColors.palette.telefonicaBlue
let buttonPrimaryBackgroundSelected = TelefonicaColors.palette.telefonicaBlue70
let buttonPrimaryBackgroundHover = TelefonicaColors.palette.telefonicaBlue70
let buttonPrimaryBackgroundInverseSelected = TelefonicaColors.palette.telefonicaBlue30 | TelefonicaColors.palette.telefonicaBlue70
let buttonSecondaryBorder = TelefonicaColors.palette.telefonicaBlue | TelefonicaColors.palette.white
let buttonSecondaryBorderSelected = TelefonicaColors.palette.telefonicaBlue70 | TelefonicaColors.palette.white
let buttonSecondaryBackgroundHover = TelefonicaColors.palette.telefonicaBlue10 | TelefonicaColors.palette.white.withAlphaComponent(0.15)
let buttonSecondaryBackgroundSelected = TelefonicaColors.palette.telefonicaBlue10 | TelefonicaColors.palette.white.withAlphaComponent(0.15)
let buttonSecondaryBorderInverse = TelefonicaColors.palette.white
let buttonSecondaryBorderInverseSelected = TelefonicaColors.palette.white
let buttonSecondaryBackgroundInverseHover = TelefonicaColors.palette.white.withAlphaComponent(0.1) | TelefonicaColors.palette.white.withAlphaComponent(0.15)
let buttonSecondaryBackgroundInverseSelected = TelefonicaColors.palette.white.withAlphaComponent(0.1) | TelefonicaColors.palette.white.withAlphaComponent(0.15)
let textButtonPrimary = TelefonicaColors.palette.white | TelefonicaColors.palette.grey2
let textButtonPrimaryInverse = TelefonicaColors.palette.telefonicaBlue | TelefonicaColors.palette.grey2
let textButtonPrimaryInverseSelected = TelefonicaColors.palette.telefonicaBlue | TelefonicaColors.palette.grey2
let textButtonSecondary = TelefonicaColors.palette.telefonicaBlue | TelefonicaColors.palette.grey2
let textButtonSecondarySelected = TelefonicaColors.palette.telefonicaBlue70 | TelefonicaColors.palette.grey2
let textButtonSecondaryInverse = TelefonicaColors.palette.white | TelefonicaColors.palette.grey2
let textButtonSecondaryInverseSelected = TelefonicaColors.palette.white | TelefonicaColors.palette.grey2
let textLink = TelefonicaColors.palette.telefonicaBlue
let textLinkInverse = TelefonicaColors.palette.white | TelefonicaColors.palette.telefonicaBlue
let textLinkDanger = TelefonicaColors.palette.coral
let textLinkSnackbar = TelefonicaColors.palette.telefonicaBlue30
let control = TelefonicaColors.palette.grey3 | TelefonicaColors.palette.darkModeGrey6
let controlActivated = TelefonicaColors.palette.telefonicaBlue
let controlError = TelefonicaColors.palette.coral
let loadingBar = TelefonicaColors.palette.telefonicaBlue30 | TelefonicaColors.palette.telefonicaBlue
let loadingBarBackground = TelefonicaColors.palette.telefonicaBlue70 | TelefonicaColors.palette.grey6
let toggleAndroidInactive = TelefonicaColors.palette.grey2 | TelefonicaColors.palette.grey4
let toggleAndroidBackgroundActive = TelefonicaColors.palette.grey2 | TelefonicaColors.palette.telefonicaBlue20
let iosControlKnob = TelefonicaColors.palette.white | TelefonicaColors.palette.grey2
let divider = TelefonicaColors.palette.grey2 | TelefonicaColors.palette.white.withAlphaComponent(0.05)
let dividerInverse = TelefonicaColors.palette.white.withAlphaComponent(0.2) | TelefonicaColors.palette.white.withAlphaComponent(0.05)
let navigationBarDivider = TelefonicaColors.palette.telefonicaBlue | TelefonicaColors.palette.darkModeBlack
let badge = TelefonicaColors.palette.coral70
let feedbackErrorBackground = TelefonicaColors.palette.coral
let feedbackInfoBackground = TelefonicaColors.palette.grey9 | TelefonicaColors.palette.grey8
let brand = TelefonicaColors.palette.telefonicaBlue
let brandHigh = TelefonicaColors.palette.telefonicaBlue70 | TelefonicaColors.palette.white.withAlphaComponent(0.05)
let inverse = TelefonicaColors.palette.white | TelefonicaColors.palette.grey2
let neutralHigh = TelefonicaColors.palette.grey9 | TelefonicaColors.palette.grey2
let neutralMedium = TelefonicaColors.palette.grey5
let neutralMediumInverse = TelefonicaColors.palette.grey5
let neutralLow = TelefonicaColors.palette.grey1 | TelefonicaColors.palette.darkModeGrey6
let neutralLowAlternative = TelefonicaColors.palette.grey2 | TelefonicaColors.palette.darkModeGrey6
let textPrimary = TelefonicaColors.palette.grey9 | TelefonicaColors.palette.grey2
let textPrimaryInverse = TelefonicaColors.palette.white | TelefonicaColors.palette.grey2
let textSecondary = TelefonicaColors.palette.grey5 | TelefonicaColors.palette.grey4
let textSecondaryInverse = TelefonicaColors.palette.telefonicaBlue10 | TelefonicaColors.palette.grey4
let error = TelefonicaColors.palette.coral
let success = TelefonicaColors.palette.turquoise
let warning = TelefonicaColors.palette.ambar
let promo = TelefonicaColors.palette.orchid
let highlight = TelefonicaColors.palette.coral40
let successLow = TelefonicaColors.palette.turquoise10 | TelefonicaColors.palette.darkModeGrey6
let warningLow = TelefonicaColors.palette.ambar10 | TelefonicaColors.palette.darkModeGrey6
let errorLow = TelefonicaColors.palette.coral10 | TelefonicaColors.palette.darkModeGrey6
let promoLow = TelefonicaColors.palette.orchid10 | TelefonicaColors.palette.darkModeGrey6
let brandLow = TelefonicaColors.palette.telefonicaBlue10 | TelefonicaColors.palette.darkModeGrey6
let successHigh = TelefonicaColors.palette.turquoise70 | TelefonicaColors.palette.turquoise40
let warningHigh = TelefonicaColors.palette.ambar70 | TelefonicaColors.palette.ambar40
let errorHigh = TelefonicaColors.palette.coral70 | TelefonicaColors.palette.coral40
let promoHigh = TelefonicaColors.palette.orchid70 | TelefonicaColors.palette.orchid40
let successHighInverse = TelefonicaColors.palette.turquoise70
let warningHighInverse = TelefonicaColors.palette.ambar70
let errorHighInverse = TelefonicaColors.palette.coral70
let promoHighInverse = TelefonicaColors.palette.orchid70
let textNavigationBarPrimary = TelefonicaColors.palette.white | TelefonicaColors.palette.grey2
let textNavigationBarSecondary = TelefonicaColors.palette.grey1 | TelefonicaColors.palette.grey4
let textNavigationSearchBarHint = TelefonicaColors.palette.grey1 | TelefonicaColors.palette.grey4
let textNavigationSearchBarText = TelefonicaColors.palette.white | TelefonicaColors.palette.grey2
let textAppBar = TelefonicaColors.palette.grey4 | TelefonicaColors.palette.grey5
let textAppBarSelected = TelefonicaColors.palette.telefonicaBlue | TelefonicaColors.palette.grey2
let customTabsBackground = TelefonicaColors.palette.telefonicaBlue | TelefonicaColors.palette.darkModeBlack
}

public struct TelefonicaColorPalette {
public init() {}
public let telefonicaBlue = UIColor(hex: "#0066FF")!
public let telefonicaBlue10 = UIColor(hex: "#E5F0FF")!
public let telefonicaBlue20 = UIColor(hex: "#B2D1FF")!
public let telefonicaBlue30 = UIColor(hex: "#80B3FF")!
public let telefonicaBlue70 = UIColor(hex: "#0356C9")!
public let ambar = UIColor(hex: "#EAC344")!
public let ambar10 = UIColor(hex: "#FDF9EC")!
public let ambar40 = UIColor(hex: "#F0D57C")!
public let ambar70 = UIColor(hex: "#69581F")!
public let coral = UIColor(hex: "#E66C64")!
public let coral10 = UIColor(hex: "#FDF0EF")!
public let coral40 = UIColor(hex: "#E3A19A")!
public let coral70 = UIColor(hex: "#D50000")!
public let coral80 = UIColor(hex: "#912C31")!
public let orchid = UIColor(hex: "#C466EF")!
public let orchid10 = UIColor(hex: "#F9F0FD")!
public let orchid40 = UIColor(hex: "#D694F4")!
public let orchid70 = UIColor(hex: "#8A1A93")!
public let turquoise = UIColor(hex: "#59C2C9")!
public let turquoise10 = UIColor(hex: "#EEF9FA")!
public let turquoise40 = UIColor(hex: "#8BD4D9")!
public let turquoise70 = UIColor(hex: "#3E888D")!
public let grey1 = UIColor(hex: "#F2F4FF")!
public let grey2 = UIColor(hex: "#D1D5E4")!
public let grey3 = UIColor(hex: "#B0B6CA")!
public let grey4 = UIColor(hex: "#8F97AF")!
public let grey5 = UIColor(hex: "#6E7894")!
public let grey6 = UIColor(hex: "#58617A")!
public let grey7 = UIColor(hex: "#414B61")!
public let grey8 = UIColor(hex: "#2B3447")!
public let grey9 = UIColor(hex: "#031A34")!
public let white = UIColor(hex: "#FFFFFF")!
public let darkModeBlack = UIColor(hex: "#191919")!
public let darkModeGrey = UIColor(hex: "#242424")!
public let darkModeGrey6 = UIColor(hex: "#313235")!
}
2 changes: 1 addition & 1 deletion Sources/MisticaCommon/Colors/VivoNewColorPalette.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct VivoNewColors: MisticaColors {
let background = VivoNewColors.palette.white | VivoNewColors.palette.darkModeBlack
let backgroundAlternative = VivoNewColors.palette.grey1 | VivoNewColors.palette.darkModeGrey
let backgroundBrand = VivoNewColors.palette.vivoPurple | VivoNewColors.palette.darkModeBlack
let backgroundBrandSecondary = VivoNewColors.palette.vivoPurple | VivoNewColors.palette.darkModeBlack
let backgroundBrandSecondary = VivoNewColors.palette.vivoPurpleLight90 | VivoNewColors.palette.darkModeBlack
let backgroundContainer = VivoNewColors.palette.white | VivoNewColors.palette.darkModeGrey
let backgroundContainerHover = VivoNewColors.palette.darkModeBlack.withAlphaComponent(0.03) | VivoNewColors.palette.white.withAlphaComponent(0.03)
let backgroundContainerPressed = VivoNewColors.palette.darkModeBlack.withAlphaComponent(0.05) | VivoNewColors.palette.white.withAlphaComponent(0.05)
Expand Down
14 changes: 14 additions & 0 deletions Sources/MisticaCommon/Fonts/Brands/TelefonicaFontSizes.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// TelefonicaFontSizes.swift
//
// Made with ❤️ by Novum
//
// Copyright © Telefonica. All rights reserved.
//

import Foundation

struct TelefonicaFontSizes: MisticaFontSizes {
public var tabsLabel: CGFloat = 16
public var title2: CGFloat = 20
}
26 changes: 26 additions & 0 deletions Sources/MisticaCommon/Fonts/Brands/TelefonicaFontWeights.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// TelefonicaFontWeights.swift
//
// Made with ❤️ by Novum
//
// Copyright © Telefonica. All rights reserved.
//

import Foundation

struct TelefonicaFontWeights: MisticaFontWeights {
public var cardTitle: MisticaFontWeightType = .regular
public var button: MisticaFontWeightType = .medium
public var tabsLabel: MisticaFontWeightType = .medium
public var link: MisticaFontWeightType = .medium
public var title1: MisticaFontWeightType = .medium
public var title2: MisticaFontWeightType = .regular
public var indicator: MisticaFontWeightType = .medium
public var navigationBar: MisticaFontWeightType = .medium
public var text5: MisticaFontWeightType = .regular
public var text6: MisticaFontWeightType = .regular
public var text7: MisticaFontWeightType = .regular
public var text8: MisticaFontWeightType = .regular
public var text9: MisticaFontWeightType = .regular
public var text10: MisticaFontWeightType = .regular
}
6 changes: 6 additions & 0 deletions Sources/MisticaCommon/MisticaConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ private extension MisticaConfig {
currentFontWeights = VivoNewFontWeights()
currentCornerRadius = VivoNewCornerRadius()
currentFontSizes = VivoNewFontSizes()
case .telefonica:
currentColors = TelefonicaColors()
currentBrandAssets = DefaultMisticaBrandAssets()
currentFontWeights = TelefonicaFontWeights()
currentCornerRadius = TelefonicaCornerRadius()
currentFontSizes = TelefonicaFontSizes()
case .custom(let colors, let assets, let fontWeights, let cornerRadius, let fontSizes):
currentColors = colors
currentBrandAssets = assets
Expand Down
22 changes: 22 additions & 0 deletions Sources/MisticaCommon/Radius/Brands/TelefonicaCornerRadius.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// TelefonicaCornerRadius.swift
//
// Made with ❤️ by Novum
//
// Copyright © Telefonica. All rights reserved.
//

import Foundation

struct TelefonicaCornerRadius: MisticaCornerRadius {
var avatar: CGFloat = MisticaRadiusConstants.roundedRadius
var bar: CGFloat = 0
var button: CGFloat = MisticaRadiusConstants.roundedRadius
var checkbox: CGFloat = 0
var container: CGFloat = 0
var indicator: CGFloat = MisticaRadiusConstants.roundedRadius
var input: CGFloat = 0
var legacyDisplay: CGFloat = 0
var popup: CGFloat = 0
var sheet: CGFloat = 0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"provides-namespace" : true
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"data" : [
{
"filename" : "FeedbackError.json",
"idiom" : "universal",
"universal-type-identifier" : "public.json"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading

0 comments on commit 2414392

Please sign in to comment.