Skip to content

Commit c9cb4f2

Browse files
[PM-26064] Move Appearance to BitwardenKit (#2008)
1 parent 277efe6 commit c9cb4f2

File tree

62 files changed

+133
-380
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+133
-380
lines changed

AuthenticatorShared/UI/Platform/Application/Appearance/Modifiers/ImageStyle.swift

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,6 @@ extension ImageStyle {
3030
///
3131
static let accessoryIcon = accessoryIcon()
3232

33-
/// An `ImageStyle` for applying common properties for icons within a row.
34-
///
35-
/// - Size: 22x22pt
36-
/// - Color: `Asset.Colors.textSecondary`
37-
///
38-
static let rowIcon = rowIcon()
39-
40-
/// An `ImageStyle` for applying common properties for icons within a toolbar.
41-
///
42-
/// - Size: 19x19pt
43-
/// - Color: `Asset.Colors.primaryBitwarden`
44-
///
45-
static let toolbarIcon = ImageStyle(
46-
color: Asset.Colors.primaryBitwarden.swiftUIColor,
47-
scaleWithFont: false,
48-
width: 19,
49-
height: 19
50-
)
51-
5233
/// An `ImageStyle` for applying common properties to a circular accessory icon.
5334
///
5435
/// - Size: 16x16pt
@@ -64,22 +45,6 @@ extension ImageStyle {
6445
) -> ImageStyle {
6546
ImageStyle(color: color, scaleWithFont: scaleWithFont, width: 16, height: 16)
6647
}
67-
68-
/// An `ImageStyle` for applying common properties for icons within a row.
69-
///
70-
/// - Size: 22x22pt
71-
/// - Color: Defaults to `Asset.Colors.textSecondary`
72-
///
73-
/// - Parameters:
74-
/// - color: The foreground color of the image. Defaults to `Asset.Colors.textSecondary`.
75-
/// - scaleWithFont: Whether the image should scale with font size changes.
76-
///
77-
static func rowIcon(
78-
color: Color = Asset.Colors.textSecondary.swiftUIColor,
79-
scaleWithFont: Bool = true
80-
) -> ImageStyle {
81-
ImageStyle(color: color, scaleWithFont: scaleWithFont, width: 22, height: 22)
82-
}
8348
}
8449

8550
// MARK: - Image

AuthenticatorShared/UI/Platform/Application/Appearance/Modifiers/ScaledFrame.swift

Lines changed: 0 additions & 124 deletions
This file was deleted.

AuthenticatorShared/UI/Platform/Application/Appearance/Modifiers/TextFieldConfiguration.swift

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,6 @@ extension TextFieldConfiguration {
3030
textInputAutocapitalization: .never
3131
)
3232

33-
/// A `TextFieldConfiguration` for applying common properties to password text fields.
34-
static let password = TextFieldConfiguration(
35-
isAutocorrectionDisabled: true,
36-
keyboardType: .default,
37-
textContentType: .password,
38-
textInputAutocapitalization: .never
39-
)
40-
4133
/// A `TextFieldConfiguration` for applying common properties to URL text fields.
4234
static let url = TextFieldConfiguration(
4335
isAutocorrectionDisabled: true,
@@ -46,14 +38,6 @@ extension TextFieldConfiguration {
4638
textInputAutocapitalization: .never
4739
)
4840

49-
/// A `TextFieldConfiguration` for applying common properties to username text fields.
50-
static let username = TextFieldConfiguration(
51-
isAutocorrectionDisabled: true,
52-
keyboardType: .default,
53-
textContentType: .username,
54-
textInputAutocapitalization: .never
55-
)
56-
5741
/// A `TextFieldConfiguration` for applying common properties to numeric text fields.
5842
static func numeric(_ textContentType: UITextContentType) -> TextFieldConfiguration {
5943
TextFieldConfiguration(

AuthenticatorShared/UI/Platform/Application/Appearance/Styles/AccessoryButtonStyle.swift

Lines changed: 0 additions & 47 deletions
This file was deleted.

AuthenticatorShared/UI/Platform/Application/Appearance/Styles/BitwardenBorderlessButtonStyle.swift

Lines changed: 0 additions & 47 deletions
This file was deleted.

AuthenticatorShared/UI/Platform/Application/Appearance/Styles/BitwardenToggleStyle.swift

Lines changed: 0 additions & 21 deletions
This file was deleted.

Bitwarden/Application/SceneDelegate.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import AuthenticationServices
2+
import BitwardenKit
23
import BitwardenShared
34
import SwiftUI
45
import UIKit
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import SwiftUI
55

66
/// A modifier for the footer on BitwardenMenu
77
///
8-
struct BitwardenMenuFooterTextModifier: ViewModifier {
8+
public struct BitwardenMenuFooterTextModifier: ViewModifier {
99
/// The bottom padding of the modifier.
1010
var topPadding: CGFloat
1111

@@ -14,7 +14,7 @@ struct BitwardenMenuFooterTextModifier: ViewModifier {
1414

1515
// MARK: View
1616

17-
func body(content: Content) -> some View {
17+
public func body(content: Content) -> some View {
1818
content
1919
.styleGuide(.footnote, includeLinePadding: false, includeLineSpacing: false)
2020
.foregroundColor(SharedAsset.Colors.textSecondary.swiftUIColor)
@@ -24,7 +24,7 @@ struct BitwardenMenuFooterTextModifier: ViewModifier {
2424
}
2525
}
2626

27-
extension View {
27+
public extension View {
2828
func bitwardenMenuFooterText(topPadding: CGFloat = 0, bottomPadding: CGFloat = 12) -> some View {
2929
modifier(BitwardenMenuFooterTextModifier(topPadding: topPadding, bottomPadding: bottomPadding))
3030
}

BitwardenShared/UI/Platform/Application/Appearance/Modifiers/ImageStyle.swift renamed to BitwardenKit/UI/Platform/Application/Appearance/Modifiers/ImageStyle.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import SwiftUI
77
/// A struct containing configuration properties for applying common properties to images across
88
/// the app.
99
///
10-
struct ImageStyle {
10+
public struct ImageStyle {
1111
// MARK: Properties
1212

1313
/// The foreground color of the image.
@@ -23,7 +23,7 @@ struct ImageStyle {
2323
let height: CGFloat
2424
}
2525

26-
extension ImageStyle {
26+
public extension ImageStyle {
2727
/// An `ImageStyle` for applying common properties to a circular accessory icon.
2828
///
2929
/// - Size: 16x16pt
@@ -134,7 +134,7 @@ extension ImageStyle {
134134

135135
// MARK: - Image
136136

137-
extension Image {
137+
public extension Image {
138138
/// A view extension that applies common image properties based on a style.
139139
///
140140
/// - Parameter style: The configuration used to set common image properties.
@@ -149,7 +149,7 @@ extension Image {
149149

150150
// MARK: - View
151151

152-
extension View {
152+
public extension View {
153153
/// A view extension that applies common image properties based on a style.
154154
///
155155
/// Note: Since this is an extension on `View`, this can't mark the image as resizable, so that

0 commit comments

Comments
 (0)