@getyoti/yoti-doc-scan-react-native 4.0.0 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,22 +7,81 @@
7
7
  objects = {
8
8
 
9
9
  /* Begin PBXBuildFile section */
10
+ 20354F3E2D413CF0007F025B /* Theme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20354F3D2D413CF0007F025B /* Theme.swift */; };
11
+ 20354F3F2D413CF0007F025B /* ShapeTheme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20354F3C2D413CF0007F025B /* ShapeTheme.swift */; };
12
+ 20354F432D415545007F025B /* SpacingMode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20354F422D415545007F025B /* SpacingMode.swift */; };
13
+ 20354F452D418A10007F025B /* UIColor+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20354F442D418A10007F025B /* UIColor+Extension.swift */; };
14
+ 20354F4A2D41A5BC007F025B /* ColorTheme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20354F492D41A5BC007F025B /* ColorTheme.swift */; };
15
+ 20354F522D42678C007F025B /* FileConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20354F512D42678C007F025B /* FileConfiguration.swift */; };
16
+ 20354F542D42BA77007F025B /* IllustrationTheme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20354F532D42BA77007F025B /* IllustrationTheme.swift */; };
17
+ 20354F562D42BAFF007F025B /* Illustration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20354F552D42BAFF007F025B /* Illustration.swift */; };
18
+ 20354F5E2D4390D3007F025B /* IconTheme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20354F5D2D4390D3007F025B /* IconTheme.swift */; };
19
+ 20354F602D4390D8007F025B /* Icon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20354F5F2D4390D8007F025B /* Icon.swift */; };
20
+ 20354F622D4395F0007F025B /* SymbolWeight.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20354F612D4395F0007F025B /* SymbolWeight.swift */; };
21
+ 20354F6A2D43E83C007F025B /* TypographyTheme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20354F692D43E83C007F025B /* TypographyTheme.swift */; };
22
+ 20354F6C2D43ED91007F025B /* TypographyStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20354F6B2D43ED91007F025B /* TypographyStyle.swift */; };
23
+ 20354F6E2D43FC21007F025B /* FontWeight.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20354F6D2D43FC21007F025B /* FontWeight.swift */; };
24
+ 20354F702D43FC41007F025B /* FontDesign.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20354F6F2D43FC41007F025B /* FontDesign.swift */; };
25
+ 205F0BA12D3BFEFB0063BF19 /* RNYotiDocScan.swift in Sources */ = {isa = PBXBuildFile; fileRef = 205F0BA02D3BFEFB0063BF19 /* RNYotiDocScan.swift */; };
10
26
  20C21B632A1E794C0065E753 /* RNYotiDocScan.m in Sources */ = {isa = PBXBuildFile; fileRef = 20C21B612A1E794C0065E753 /* RNYotiDocScan.m */; };
27
+ 20C2FCC52DC4D581001A7C3E /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20C2FCC42DC4D581001A7C3E /* Configuration.swift */; };
11
28
  /* End PBXBuildFile section */
12
29
 
13
30
  /* Begin PBXFileReference section */
31
+ 20354F3C2D413CF0007F025B /* ShapeTheme.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShapeTheme.swift; sourceTree = "<group>"; };
32
+ 20354F3D2D413CF0007F025B /* Theme.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Theme.swift; sourceTree = "<group>"; };
33
+ 20354F422D415545007F025B /* SpacingMode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpacingMode.swift; sourceTree = "<group>"; };
34
+ 20354F442D418A10007F025B /* UIColor+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+Extension.swift"; sourceTree = "<group>"; };
35
+ 20354F492D41A5BC007F025B /* ColorTheme.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorTheme.swift; sourceTree = "<group>"; };
36
+ 20354F512D42678C007F025B /* FileConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileConfiguration.swift; sourceTree = "<group>"; };
37
+ 20354F532D42BA77007F025B /* IllustrationTheme.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IllustrationTheme.swift; sourceTree = "<group>"; };
38
+ 20354F552D42BAFF007F025B /* Illustration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Illustration.swift; sourceTree = "<group>"; };
39
+ 20354F5D2D4390D3007F025B /* IconTheme.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IconTheme.swift; sourceTree = "<group>"; };
40
+ 20354F5F2D4390D8007F025B /* Icon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Icon.swift; sourceTree = "<group>"; };
41
+ 20354F612D4395F0007F025B /* SymbolWeight.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SymbolWeight.swift; sourceTree = "<group>"; };
42
+ 20354F692D43E83C007F025B /* TypographyTheme.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypographyTheme.swift; sourceTree = "<group>"; };
43
+ 20354F6B2D43ED91007F025B /* TypographyStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypographyStyle.swift; sourceTree = "<group>"; };
44
+ 20354F6D2D43FC21007F025B /* FontWeight.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FontWeight.swift; sourceTree = "<group>"; };
45
+ 20354F6F2D43FC41007F025B /* FontDesign.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FontDesign.swift; sourceTree = "<group>"; };
46
+ 205F0B9F2D3BFEFB0063BF19 /* RNYotiDocScan-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RNYotiDocScan-Bridging-Header.h"; sourceTree = "<group>"; };
47
+ 205F0BA02D3BFEFB0063BF19 /* RNYotiDocScan.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RNYotiDocScan.swift; sourceTree = "<group>"; };
14
48
  20C21B612A1E794C0065E753 /* RNYotiDocScan.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNYotiDocScan.m; sourceTree = "<group>"; };
15
- 20C21B622A1E794C0065E753 /* RNYotiDocScan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNYotiDocScan.h; sourceTree = "<group>"; };
49
+ 20C2FCC42DC4D581001A7C3E /* Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = "<group>"; };
16
50
  2224907023E3E53500258582 /* libRNYotiDocScan.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNYotiDocScan.a; sourceTree = BUILT_PRODUCTS_DIR; };
17
51
  /* End PBXFileReference section */
18
52
 
19
53
  /* Begin PBXGroup section */
54
+ 20354F4D2D41A949007F025B /* Theme */ = {
55
+ isa = PBXGroup;
56
+ children = (
57
+ 20354F492D41A5BC007F025B /* ColorTheme.swift */,
58
+ 20354F6F2D43FC41007F025B /* FontDesign.swift */,
59
+ 20354F6D2D43FC21007F025B /* FontWeight.swift */,
60
+ 20354F5F2D4390D8007F025B /* Icon.swift */,
61
+ 20354F5D2D4390D3007F025B /* IconTheme.swift */,
62
+ 20354F552D42BAFF007F025B /* Illustration.swift */,
63
+ 20354F532D42BA77007F025B /* IllustrationTheme.swift */,
64
+ 20354F3C2D413CF0007F025B /* ShapeTheme.swift */,
65
+ 20354F422D415545007F025B /* SpacingMode.swift */,
66
+ 20354F612D4395F0007F025B /* SymbolWeight.swift */,
67
+ 20354F3D2D413CF0007F025B /* Theme.swift */,
68
+ 20354F6B2D43ED91007F025B /* TypographyStyle.swift */,
69
+ 20354F692D43E83C007F025B /* TypographyTheme.swift */,
70
+ 20354F442D418A10007F025B /* UIColor+Extension.swift */,
71
+ );
72
+ path = Theme;
73
+ sourceTree = "<group>";
74
+ };
20
75
  2224906723E3E53500258582 = {
21
76
  isa = PBXGroup;
22
77
  children = (
23
- 20C21B622A1E794C0065E753 /* RNYotiDocScan.h */,
78
+ 205F0B9F2D3BFEFB0063BF19 /* RNYotiDocScan-Bridging-Header.h */,
24
79
  20C21B612A1E794C0065E753 /* RNYotiDocScan.m */,
80
+ 205F0BA02D3BFEFB0063BF19 /* RNYotiDocScan.swift */,
81
+ 20C2FCC42DC4D581001A7C3E /* Configuration.swift */,
82
+ 20354F512D42678C007F025B /* FileConfiguration.swift */,
25
83
  2224907123E3E53500258582 /* Products */,
84
+ 20354F4D2D41A949007F025B /* Theme */,
26
85
  );
27
86
  sourceTree = "<group>";
28
87
  };
@@ -59,11 +118,12 @@
59
118
  isa = PBXProject;
60
119
  attributes = {
61
120
  BuildIndependentTargetsInParallel = YES;
62
- LastUpgradeCheck = 1430;
121
+ LastUpgradeCheck = 1620;
63
122
  ORGANIZATIONNAME = "Yoti Ltd";
64
123
  TargetAttributes = {
65
124
  2224906F23E3E53500258582 = {
66
125
  CreatedOnToolsVersion = 11.2;
126
+ LastSwiftMigration = 1620;
67
127
  };
68
128
  };
69
129
  };
@@ -90,6 +150,23 @@
90
150
  isa = PBXSourcesBuildPhase;
91
151
  buildActionMask = 2147483647;
92
152
  files = (
153
+ 20354F6C2D43ED91007F025B /* TypographyStyle.swift in Sources */,
154
+ 20354F432D415545007F025B /* SpacingMode.swift in Sources */,
155
+ 20354F4A2D41A5BC007F025B /* ColorTheme.swift in Sources */,
156
+ 20354F542D42BA77007F025B /* IllustrationTheme.swift in Sources */,
157
+ 20354F562D42BAFF007F025B /* Illustration.swift in Sources */,
158
+ 20354F6A2D43E83C007F025B /* TypographyTheme.swift in Sources */,
159
+ 20354F702D43FC41007F025B /* FontDesign.swift in Sources */,
160
+ 205F0BA12D3BFEFB0063BF19 /* RNYotiDocScan.swift in Sources */,
161
+ 20354F3E2D413CF0007F025B /* Theme.swift in Sources */,
162
+ 20354F602D4390D8007F025B /* Icon.swift in Sources */,
163
+ 20354F5E2D4390D3007F025B /* IconTheme.swift in Sources */,
164
+ 20354F6E2D43FC21007F025B /* FontWeight.swift in Sources */,
165
+ 20C2FCC52DC4D581001A7C3E /* Configuration.swift in Sources */,
166
+ 20354F452D418A10007F025B /* UIColor+Extension.swift in Sources */,
167
+ 20354F3F2D413CF0007F025B /* ShapeTheme.swift in Sources */,
168
+ 20354F522D42678C007F025B /* FileConfiguration.swift in Sources */,
169
+ 20354F622D4395F0007F025B /* SymbolWeight.swift in Sources */,
93
170
  20C21B632A1E794C0065E753 /* RNYotiDocScan.m in Sources */,
94
171
  );
95
172
  runOnlyForDeploymentPostprocessing = 0;
@@ -205,6 +282,7 @@
205
282
  MTL_ENABLE_DEBUG_INFO = NO;
206
283
  MTL_FAST_MATH = YES;
207
284
  SDKROOT = iphoneos;
285
+ SWIFT_COMPILATION_MODE = wholemodule;
208
286
  VALIDATE_PRODUCT = YES;
209
287
  };
210
288
  name = Release;
@@ -216,6 +294,8 @@
216
294
  OTHER_LDFLAGS = "-ObjC";
217
295
  PRODUCT_NAME = "$(TARGET_NAME)";
218
296
  SKIP_INSTALL = YES;
297
+ SWIFT_OBJC_BRIDGING_HEADER = "RNYotiDocScan-Bridging-Header.h";
298
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
219
299
  TARGETED_DEVICE_FAMILY = "1,2";
220
300
  };
221
301
  name = Debug;
@@ -227,6 +307,7 @@
227
307
  OTHER_LDFLAGS = "-ObjC";
228
308
  PRODUCT_NAME = "$(TARGET_NAME)";
229
309
  SKIP_INSTALL = YES;
310
+ SWIFT_OBJC_BRIDGING_HEADER = "RNYotiDocScan-Bridging-Header.h";
230
311
  TARGETED_DEVICE_FAMILY = "1,2";
231
312
  };
232
313
  name = Release;
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <Scheme
3
- LastUpgradeVersion = "1430"
3
+ LastUpgradeVersion = "1620"
4
4
  version = "1.3">
5
5
  <BuildAction
6
6
  parallelizeBuildables = "YES"
@@ -0,0 +1,128 @@
1
+ //
2
+ // Copyright © 2025 Yoti Ltd. All rights reserved.
3
+ //
4
+
5
+ import UIKit
6
+ import YotiSDKDesign
7
+
8
+ struct ColorTheme: YotiSDKColorTheme, Decodable {
9
+ let actionEmphasisPrimaryPressed: UIColor
10
+ let actionPrimary: UIColor
11
+ let actionPrimaryDisabled: UIColor
12
+ let actionPrimaryPressed: UIColor
13
+ let actionSuccessEnabled: UIColor
14
+ let backgroundEmphasisSolid: UIColor
15
+ let backgroundInfo: UIColor
16
+ let backgroundSolid: UIColor
17
+ let backgroundSolid2: UIColor
18
+ let backgroundWarning: UIColor
19
+ let border: UIColor
20
+ let border2: UIColor
21
+ let border3: UIColor
22
+ let borderCritical: UIColor
23
+ let borderEmphasis2: UIColor
24
+ let icon: UIColor
25
+ let icon3: UIColor
26
+ let iconEmphasis: UIColor
27
+ let iconWarning: UIColor
28
+ let shimmerBackground: UIColor
29
+ let shimmerForeground: UIColor
30
+ let text: UIColor
31
+ let text2: UIColor
32
+ let textCritical: UIColor
33
+ let textEmphasis: UIColor
34
+ let textLinkEnabled: UIColor
35
+ let textLinkPressed: UIColor
36
+ let textWarning: UIColor
37
+
38
+ init(from decoder: Decoder) throws {
39
+ let container = try decoder.container(keyedBy: CodingKeys.self)
40
+ let actionEmphasisPrimaryPressed = try container.decode(String.self, forKey: .actionEmphasisPrimaryPressed)
41
+ let actionPrimary = try container.decode(String.self, forKey: .actionPrimary)
42
+ let actionPrimaryDisabled = try container.decode(String.self, forKey: .actionPrimaryDisabled)
43
+ let actionPrimaryPressed = try container.decode(String.self, forKey: .actionPrimaryPressed)
44
+ let actionSuccessEnabled = try container.decode(String.self, forKey: .actionSuccessEnabled)
45
+ let backgroundEmphasisSolid = try container.decode(String.self, forKey: .backgroundEmphasisSolid)
46
+ let backgroundInfo = try container.decode(String.self, forKey: .backgroundInfo)
47
+ let backgroundSolid = try container.decode(String.self, forKey: .backgroundSolid)
48
+ let backgroundSolid2 = try container.decode(String.self, forKey: .backgroundSolid2)
49
+ let backgroundWarning = try container.decode(String.self, forKey: .backgroundWarning)
50
+ let border = try container.decode(String.self, forKey: .border)
51
+ let border2 = try container.decode(String.self, forKey: .border2)
52
+ let border3 = try container.decode(String.self, forKey: .border3)
53
+ let borderCritical = try container.decode(String.self, forKey: .borderCritical)
54
+ let borderEmphasis2 = try container.decode(String.self, forKey: .borderEmphasis2)
55
+ let icon = try container.decode(String.self, forKey: .icon)
56
+ let icon3 = try container.decode(String.self, forKey: .icon3)
57
+ let iconEmphasis = try container.decode(String.self, forKey: .iconEmphasis)
58
+ let iconWarning = try container.decode(String.self, forKey: .iconWarning)
59
+ let shimmerBackground = try container.decode(String.self, forKey: .shimmerBackground)
60
+ let shimmerForeground = try container.decode(String.self, forKey: .shimmerForeground)
61
+ let text = try container.decode(String.self, forKey: .text)
62
+ let text2 = try container.decode(String.self, forKey: .text2)
63
+ let textCritical = try container.decode(String.self, forKey: .textCritical)
64
+ let textEmphasis = try container.decode(String.self, forKey: .textEmphasis)
65
+ let textLinkEnabled = try container.decode(String.self, forKey: .textLinkEnabled)
66
+ let textLinkPressed = try container.decode(String.self, forKey: .textLinkPressed)
67
+ let textWarning = try container.decode(String.self, forKey: .textWarning)
68
+ self.actionEmphasisPrimaryPressed = UIColor(hexString: actionEmphasisPrimaryPressed)
69
+ self.actionPrimary = UIColor(hexString: actionPrimary)
70
+ self.actionPrimaryDisabled = UIColor(hexString: actionPrimaryDisabled)
71
+ self.actionPrimaryPressed = UIColor(hexString: actionPrimaryPressed)
72
+ self.actionSuccessEnabled = UIColor(hexString: actionSuccessEnabled)
73
+ self.backgroundEmphasisSolid = UIColor(hexString: backgroundEmphasisSolid)
74
+ self.backgroundInfo = UIColor(hexString: backgroundInfo)
75
+ self.backgroundSolid = UIColor(hexString: backgroundSolid)
76
+ self.backgroundSolid2 = UIColor(hexString: backgroundSolid2)
77
+ self.backgroundWarning = UIColor(hexString: backgroundWarning)
78
+ self.border = UIColor(hexString: border)
79
+ self.border2 = UIColor(hexString: border2)
80
+ self.border3 = UIColor(hexString: border3)
81
+ self.borderCritical = UIColor(hexString: borderCritical)
82
+ self.borderEmphasis2 = UIColor(hexString: borderEmphasis2)
83
+ self.icon = UIColor(hexString: icon)
84
+ self.icon3 = UIColor(hexString: icon3)
85
+ self.iconEmphasis = UIColor(hexString: iconEmphasis)
86
+ self.iconWarning = UIColor(hexString: iconWarning)
87
+ self.shimmerBackground = UIColor(hexString: shimmerBackground)
88
+ self.shimmerForeground = UIColor(hexString: shimmerForeground)
89
+ self.text = UIColor(hexString: text)
90
+ self.text2 = UIColor(hexString: text2)
91
+ self.textCritical = UIColor(hexString: textCritical)
92
+ self.textEmphasis = UIColor(hexString: textEmphasis)
93
+ self.textLinkEnabled = UIColor(hexString: textLinkEnabled)
94
+ self.textLinkPressed = UIColor(hexString: textLinkPressed)
95
+ self.textWarning = UIColor(hexString: textWarning)
96
+ }
97
+
98
+ private enum CodingKeys: String, CodingKey {
99
+ case actionEmphasisPrimaryPressed = "action_emphasis_primary_pressed"
100
+ case actionPrimary = "action_primary"
101
+ case actionPrimaryDisabled = "action_primary_disabled"
102
+ case actionPrimaryPressed = "action_primary_pressed"
103
+ case actionSuccessEnabled = "action_success_enabled"
104
+ case backgroundEmphasisSolid = "background_emphasis_solid"
105
+ case backgroundInfo = "background_info"
106
+ case backgroundSolid = "background_solid"
107
+ case backgroundSolid2 = "background_solid2"
108
+ case backgroundWarning = "background_warning"
109
+ case border
110
+ case border2
111
+ case border3
112
+ case borderCritical = "border_critical"
113
+ case borderEmphasis2 = "border_emphasis2"
114
+ case icon
115
+ case icon3
116
+ case iconEmphasis = "icon_emphasis"
117
+ case iconWarning = "icon_warning"
118
+ case shimmerBackground = "shimmer_background"
119
+ case shimmerForeground = "shimmer_foreground"
120
+ case text
121
+ case text2
122
+ case textCritical = "text_critical"
123
+ case textEmphasis = "text_emphasis"
124
+ case textLinkEnabled = "text_link_enabled"
125
+ case textLinkPressed = "text_link_pressed"
126
+ case textWarning = "text_warning"
127
+ }
128
+ }
@@ -0,0 +1,28 @@
1
+ //
2
+ // Copyright © 2025 Yoti Ltd. All rights reserved.
3
+ //
4
+
5
+ import UIKit
6
+
7
+ enum FontDesign: String, Decodable {
8
+ case `default`
9
+ case rounded
10
+ case serif
11
+ case monospaced
12
+ }
13
+
14
+ @available(iOS 13, *)
15
+ extension UIFontDescriptor.SystemDesign {
16
+ init(_ design: FontDesign) {
17
+ switch design {
18
+ case .`default`:
19
+ self = .`default`
20
+ case .rounded:
21
+ self = .rounded
22
+ case .serif:
23
+ self = .serif
24
+ case .monospaced:
25
+ self = .monospaced
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,42 @@
1
+ //
2
+ // Copyright © 2025 Yoti Ltd. All rights reserved.
3
+ //
4
+
5
+ import UIKit
6
+
7
+ enum FontWeight: String, Decodable {
8
+ case ultraLight = "ultra_light"
9
+ case thin
10
+ case light
11
+ case regular
12
+ case medium
13
+ case semibold
14
+ case bold
15
+ case heavy
16
+ case black
17
+ }
18
+
19
+ extension UIFont.Weight {
20
+ init(_ weight: FontWeight) {
21
+ switch weight {
22
+ case .ultraLight:
23
+ self = .ultraLight
24
+ case .thin:
25
+ self = .thin
26
+ case .light:
27
+ self = .light
28
+ case .regular:
29
+ self = .regular
30
+ case .medium:
31
+ self = .medium
32
+ case .semibold:
33
+ self = .semibold
34
+ case .bold:
35
+ self = .bold
36
+ case .heavy:
37
+ self = .heavy
38
+ case .black:
39
+ self = . black
40
+ }
41
+ }
42
+ }
@@ -0,0 +1,62 @@
1
+ //
2
+ // Copyright © 2025 Yoti Ltd. All rights reserved.
3
+ //
4
+
5
+ import UIKit
6
+ import YotiSDKDesign
7
+
8
+ @available(iOS 13, *)
9
+ struct Icon: Decodable {
10
+ var bundleIdentifier: String?
11
+ var customName: String?
12
+ var systemName: String?
13
+ var weight: UIImage.SymbolWeight?
14
+ var locale: Locale?
15
+
16
+ init(from decoder: Decoder) throws {
17
+ let container = try decoder.container(keyedBy: CodingKeys.self)
18
+ if let bundleIdentifier = try container.decodeIfPresent(String.self, forKey: .bundleIdentifier), !bundleIdentifier.isEmpty {
19
+ self.bundleIdentifier = bundleIdentifier
20
+ } else if let bundleIdentifier = Bundle.main.bundleIdentifier, !bundleIdentifier.isEmpty {
21
+ self.bundleIdentifier = bundleIdentifier
22
+ }
23
+ if let customName = try container.decodeIfPresent(String.self, forKey: .customName), !customName.isEmpty {
24
+ self.customName = customName
25
+ }
26
+ if let systemName = try container.decodeIfPresent(String.self, forKey: .systemName), !systemName.isEmpty {
27
+ self.systemName = systemName
28
+ }
29
+ if let rawValue = try container.decodeIfPresent(String.self, forKey: .weight), !rawValue.isEmpty {
30
+ let weight = SymbolWeight(rawValue: rawValue)!
31
+ self.weight = UIImage.SymbolWeight(weight)
32
+ }
33
+ if let localeIdentifier = try container.decodeIfPresent(String.self, forKey: .localeIdentifier), !localeIdentifier.isEmpty {
34
+ if localeIdentifier == "current" {
35
+ locale = .current
36
+ } else {
37
+ locale = Locale(identifier: localeIdentifier)
38
+ }
39
+ }
40
+ }
41
+
42
+ private enum CodingKeys: String, CodingKey {
43
+ case bundleIdentifier = "bundle_identifier"
44
+ case customName = "custom_name"
45
+ case systemName = "system_name"
46
+ case weight
47
+ case localeIdentifier = "locale_identifier"
48
+ }
49
+ }
50
+
51
+ @available(iOS 13, *)
52
+ extension YotiSDKIcon {
53
+ init?(_ icon: Icon) {
54
+ if let bundleIdentifier = icon.bundleIdentifier, let customName = icon.customName {
55
+ self.init(bundleIdentifier: bundleIdentifier, name: customName, weight: icon.weight, locale: icon.locale)
56
+ } else if let systemName = icon.systemName {
57
+ self.init(systemName: systemName, weight: icon.weight, locale: icon.locale)
58
+ } else {
59
+ return nil
60
+ }
61
+ }
62
+ }
@@ -0,0 +1,121 @@
1
+ //
2
+ // Copyright © 2025 Yoti Ltd. All rights reserved.
3
+ //
4
+
5
+ import YotiSDKDesign
6
+
7
+ @available(iOS 13, *)
8
+ struct IconTheme: YotiSDKIconTheme, Decodable {
9
+ var arrowUpToLine: YotiSDKIcon?
10
+ var bin: YotiSDKIcon?
11
+ var boxedCheckmark: YotiSDKIcon?
12
+ var camera: YotiSDKIcon?
13
+ var checkmark: YotiSDKIcon?
14
+ var digitalIDConnect: YotiSDKIcon?
15
+ var document: YotiSDKIcon?
16
+ var eye: YotiSDKIcon?
17
+ var exclamationmark: YotiSDKIcon?
18
+ var face: YotiSDKIcon?
19
+ var identityDocumentCapture: YotiSDKIcon?
20
+ var info: YotiSDKIcon?
21
+ var largeLeftChevron: YotiSDKIcon?
22
+ var passport: YotiSDKIcon?
23
+ var passportChip: YotiSDKIcon?
24
+ var profile: YotiSDKIcon?
25
+ var rotatingArrows: YotiSDKIcon?
26
+ var smallDownChevron: YotiSDKIcon?
27
+ var smallRightChevron: YotiSDKIcon?
28
+ var sun: YotiSDKIcon?
29
+ var xmark: YotiSDKIcon?
30
+
31
+ init(from decoder: Decoder) throws {
32
+ let container = try decoder.container(keyedBy: CodingKeys.self)
33
+ if let icon = try container.decodeIfPresent(Icon.self, forKey: .arrowUpToLine) {
34
+ arrowUpToLine = YotiSDKIcon(icon)
35
+ }
36
+ if let icon = try container.decodeIfPresent(Icon.self, forKey: .bin) {
37
+ bin = YotiSDKIcon(icon)
38
+ }
39
+ if let icon = try container.decodeIfPresent(Icon.self, forKey: .boxedCheckmark) {
40
+ boxedCheckmark = YotiSDKIcon(icon)
41
+ }
42
+ if let icon = try container.decodeIfPresent(Icon.self, forKey: .camera) {
43
+ camera = YotiSDKIcon(icon)
44
+ }
45
+ if let icon = try container.decodeIfPresent(Icon.self, forKey: .checkmark) {
46
+ checkmark = YotiSDKIcon(icon)
47
+ }
48
+ if let icon = try container.decodeIfPresent(Icon.self, forKey: .digitalIDConnect) {
49
+ digitalIDConnect = YotiSDKIcon(icon)
50
+ }
51
+ if let icon = try container.decodeIfPresent(Icon.self, forKey: .document) {
52
+ document = YotiSDKIcon(icon)
53
+ }
54
+ if let icon = try container.decodeIfPresent(Icon.self, forKey: .eye) {
55
+ eye = YotiSDKIcon(icon)
56
+ }
57
+ if let icon = try container.decodeIfPresent(Icon.self, forKey: .exclamationmark) {
58
+ exclamationmark = YotiSDKIcon(icon)
59
+ }
60
+ if let icon = try container.decodeIfPresent(Icon.self, forKey: .face) {
61
+ face = YotiSDKIcon(icon)
62
+ }
63
+ if let icon = try container.decodeIfPresent(Icon.self, forKey: .identityDocumentCapture) {
64
+ identityDocumentCapture = YotiSDKIcon(icon)
65
+ }
66
+ if let icon = try container.decodeIfPresent(Icon.self, forKey: .info) {
67
+ info = YotiSDKIcon(icon)
68
+ }
69
+ if let icon = try container.decodeIfPresent(Icon.self, forKey: .largeLeftChevron) {
70
+ largeLeftChevron = YotiSDKIcon(icon)
71
+ }
72
+ if let icon = try container.decodeIfPresent(Icon.self, forKey: .passport) {
73
+ passport = YotiSDKIcon(icon)
74
+ }
75
+ if let icon = try container.decodeIfPresent(Icon.self, forKey: .passportChip) {
76
+ passportChip = YotiSDKIcon(icon)
77
+ }
78
+ if let icon = try container.decodeIfPresent(Icon.self, forKey: .profile) {
79
+ profile = YotiSDKIcon(icon)
80
+ }
81
+ if let icon = try container.decodeIfPresent(Icon.self, forKey: .rotatingArrows) {
82
+ rotatingArrows = YotiSDKIcon(icon)
83
+ }
84
+ if let icon = try container.decodeIfPresent(Icon.self, forKey: .smallDownChevron) {
85
+ smallDownChevron = YotiSDKIcon(icon)
86
+ }
87
+ if let icon = try container.decodeIfPresent(Icon.self, forKey: .smallRightChevron) {
88
+ smallRightChevron = YotiSDKIcon(icon)
89
+ }
90
+ if let icon = try container.decodeIfPresent(Icon.self, forKey: .sun) {
91
+ sun = YotiSDKIcon(icon)
92
+ }
93
+ if let icon = try container.decodeIfPresent(Icon.self, forKey: .xmark) {
94
+ xmark = YotiSDKIcon(icon)
95
+ }
96
+ }
97
+
98
+ private enum CodingKeys: String, CodingKey {
99
+ case arrowUpToLine = "arrow_up_to_line"
100
+ case bin
101
+ case boxedCheckmark = "boxed_checkmark"
102
+ case camera
103
+ case checkmark
104
+ case digitalIDConnect = "digital_id_connect"
105
+ case document
106
+ case eye
107
+ case exclamationmark
108
+ case face
109
+ case identityDocumentCapture = "identity_document_capture"
110
+ case info
111
+ case largeLeftChevron = "large_left_chevron"
112
+ case passport
113
+ case passportChip = "passport_chip"
114
+ case profile
115
+ case rotatingArrows = "rotating_arrows"
116
+ case smallDownChevron = "small_down_chevron"
117
+ case smallRightChevron = "small_right_chevron"
118
+ case sun
119
+ case xmark
120
+ }
121
+ }
@@ -0,0 +1,36 @@
1
+ //
2
+ // Copyright © 2025 Yoti Ltd. All rights reserved.
3
+ //
4
+
5
+ import YotiSDKDesign
6
+
7
+ struct Illustration: Decodable {
8
+ var bundleIdentifier: String?
9
+ var name: String?
10
+
11
+ init(from decoder: Decoder) throws {
12
+ let container = try decoder.container(keyedBy: CodingKeys.self)
13
+ if let bundleIdentifier = try container.decodeIfPresent(String.self, forKey: .bundleIdentifier), !bundleIdentifier.isEmpty {
14
+ self.bundleIdentifier = bundleIdentifier
15
+ } else if let bundleIdentifier = Bundle.main.bundleIdentifier, !bundleIdentifier.isEmpty {
16
+ self.bundleIdentifier = bundleIdentifier
17
+ }
18
+ if let name = try container.decodeIfPresent(String.self, forKey: .name), !name.isEmpty {
19
+ self.name = name
20
+ }
21
+ }
22
+
23
+ private enum CodingKeys: String, CodingKey {
24
+ case bundleIdentifier = "bundle_identifier"
25
+ case name
26
+ }
27
+ }
28
+
29
+ extension YotiSDKIllustration {
30
+ init?(_ illustration: Illustration) {
31
+ guard let bundleIdentifier = illustration.bundleIdentifier, let name = illustration.name else {
32
+ return nil
33
+ }
34
+ self.init(bundleIdentifier: bundleIdentifier, name: name)
35
+ }
36
+ }