Skip to content

Commit

Permalink
Merge pull request #54 from PB-Digital/develop
Browse files Browse the repository at this point in the history
`RELEASE`: v1.5.0
  • Loading branch information
faridpashabank authored Jan 18, 2024
2 parents a0f7afa + 5b37cd4 commit 792af3c
Show file tree
Hide file tree
Showing 24 changed files with 515 additions and 135 deletions.
4 changes: 2 additions & 2 deletions Config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "1.4.2",
"release_notes": "`subtitleTextColor` for `PBRowView`"
"version": "1.5.0",
"release_notes": "Fixed Pasha Business issues"
}
2 changes: 1 addition & 1 deletion Sources/PashaKit/Common Enums/Validity.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import Foundation

/// Sets the validity for for text fields.
///
public enum PBTextFieldValidity {
public enum PBTextFieldValidity: Equatable {
case valid
case invalid(String)
}
57 changes: 57 additions & 0 deletions Sources/PashaKit/Extensions/UIColor+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -178,5 +178,62 @@ extension UIColor {
UIColor(red: 0.596, green: 0.596, blue: 0.624, alpha: 1)
}
}

static var SMETextFieldLabelDisabled: UIColor {
return UIColor { (traits) -> UIColor in
return traits.userInterfaceStyle == .dark ?
UIColor(red: 0.922, green: 0.922, blue: 0.961, alpha: 0.6) :
UIColor(red: 0.235, green: 0.235, blue: 0.263, alpha: 0.3)
}
}

static var SMETextFieldText: UIColor {
return UIColor { (traits) -> UIColor in
return traits.userInterfaceStyle == .dark ?
UIColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 1):
UIColor(red: 0.0, green: 0.0, blue: 0.0, alpha: 1)
}
}

static var SMEActionBackground: UIColor {
return UIColor { (traits) -> UIColor in
return traits.userInterfaceStyle == .dark ?
UIColor(red: 0.173, green: 0.173, blue: 0.180, alpha: 1) :
UIColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 1)
}
}

static var SMEActionTitle: UIColor {
return UIColor { (traits) -> UIColor in
return traits.userInterfaceStyle == .dark ?
UIColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 1):
UIColor(red: 0.0, green: 0.0, blue: 0.0, alpha: 1)
}
}

static var SMEActionSubTitle: UIColor {
return UIColor { (traits) -> UIColor in
return traits.userInterfaceStyle == .dark ?
UIColor(red: 0.922, green: 0.922, blue: 0.961, alpha: 0.6):
UIColor(red: 0.235, green: 0.235, blue: 0.263, alpha: 0.6)
}
}

static var SMEActionDisabledTitle: UIColor {
return UIColor { (traits) -> UIColor in
return traits.userInterfaceStyle == .dark ?
UIColor(red: 0.922, green: 0.922, blue: 0.961, alpha: 0.6):
UIColor(red: 0.235, green: 0.235, blue: 0.263, alpha: 0.6)
}
}

static var SMEActionDisabledSubTitle: UIColor {
return UIColor { (traits) -> UIColor in
return traits.userInterfaceStyle == .dark ?
UIColor(red: 0.922, green: 0.922, blue: 0.961, alpha: 0.3):
UIColor(red: 0.235, green: 0.235, blue: 0.263, alpha: 0.3)
}
}

}
}
4 changes: 4 additions & 0 deletions Sources/PashaKit/Extensions/UIImage+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,9 @@ extension UIImage {
static let icSMEInfoYellow = UIImage(named: "ic_sme_info_yellow", in: Bundle.module, compatibleWith: nil)
static let icEyeOpen = UIImage(named: "ic_eye_open", in: Bundle.module, compatibleWith: nil)
static let icEyeClosed = UIImage(named: "ic_eye_closed", in: Bundle.module, compatibleWith: nil)
static let icSMEChevronBottom = UIImage(named: "ic_sme_chevron_bottom", in: Bundle.module, compatibleWith: nil)
static let icSMELoading = UIImage(named: "ic_sme_loading", in: Bundle.module, compatibleWith: nil)
static let icSMERadio = UIImage(named: "ic_sme_radio", in: Bundle.module, compatibleWith: nil)
static let icSMERadioDisabled = UIImage(named: "ic_sme_radio_disabled", in: Bundle.module, compatibleWith: nil)
}
}
2 changes: 1 addition & 1 deletion Sources/PashaKit/Extensions/UITextField+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ extension UITextField {

let flexSpace = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil)
let done: UIBarButtonItem = UIBarButtonItem(title: title, style: .done, target: self, action: #selector(self.onDoneButton))

done.tintColor = UIColor.Colors.SMEGreen
let items = [flexSpace, done]
doneToolbar.items = items
doneToolbar.sizeToFit()
Expand Down
38 changes: 38 additions & 0 deletions Sources/PashaKit/Media.xcassets/Color.colorset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "0.600",
"blue" : "0.263",
"green" : "0.235",
"red" : "0.235"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xFF",
"green" : "0xFF",
"red" : "0xFE"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"filename" : "Chevron Down 1 - 24px.svg",
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "Icons.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "beams sun new fresh load loading.svg",
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"filename" : "Font Icon.svg",
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "Font Icon 1.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"filename" : "Font Icon.svg",
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "Font Icon 1.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 20 additions & 11 deletions Sources/PashaKit/PBRowView/PBRowView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -178,16 +178,6 @@ open class PBRowView: UIView, PBSkeletonable {
}
}

/// Sets the color for text of `subtitleLabel`.
///
/// By default text color of `subtitleLabel` is `black (0.6 alpha)`
///
public var subtitleTextColor: UIColor = .black.withAlphaComponent(0.6) {
didSet {
self.subtitleLabel.textColor = self.subtitleTextColor
}
}

/// The background color for `leftIconWrapperView`.
///
/// By default the background color of `leftIconWrapperView` is `PBGrayTransparent`.
Expand Down Expand Up @@ -283,7 +273,7 @@ open class PBRowView: UIView, PBSkeletonable {
}
}

/// A boolean value for deciding wheter chevron icon should be visible.
/// A boolean value for deciding whether chevron icon should be visible.
///
/// By default the value of this property is `true`. Since in our mobile app we have
/// a lot row views with visible chevron icon, we kept this property value at `true`
Expand Down Expand Up @@ -312,6 +302,24 @@ open class PBRowView: UIView, PBSkeletonable {
self.divider.isHidden = !showsDivider
}
}

/// A boolean value for deciding whether right icon should be visible.
///
/// By default the value of this property is `true`. Since in our mobile app we have
/// a lot row views with visible chevron icon, we kept this property value at `true`
/// for ease of access.
///
/// Changing its value to `false` removes it from row view.
///
public var isRightIconVisible: Bool = true {
didSet {
if self.isRightIconVisible {
self.rightIconWrapperView.isHidden = false
} else {
self.rightIconWrapperView.isHidden = true
}
}
}

private var leftPaddingForDivider: CGFloat {
return self.layoutMargins.left + self.leftViewSize.width + 12.0
Expand Down Expand Up @@ -414,6 +422,7 @@ open class PBRowView: UIView, PBSkeletonable {
label.translatesAutoresizingMaskIntoConstraints = false

label.font = UIFont.systemFont(ofSize: 15, weight: .regular)
label.textColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.6)
label.numberOfLines = 1
label.isSkeletonable = true

Expand Down
7 changes: 7 additions & 0 deletions Sources/PashaKit/PBUITextField/PBBaseUITextField.swift
Original file line number Diff line number Diff line change
Expand Up @@ -225,5 +225,12 @@ class PBBaseUITextField: UITextField {
override func editingRect(forBounds bounds: CGRect) -> CGRect {
return bounds.inset(by: self.contentInsets)
}

override func deleteBackward() {
self.onDeleteBackward?()
super.deleteBackward()
}

public var onDeleteBackward: (() -> Void)?
}

Loading

0 comments on commit 792af3c

Please sign in to comment.