From 6b15ee3e25362f72b27fb1453aefcd2e541119a1 Mon Sep 17 00:00:00 2001 From: Aariana Singh Date: Tue, 17 Oct 2023 16:48:13 -0400 Subject: [PATCH 1/2] Added note to input asset and adding spacing beneath info asset --- ios/packages/demo/Sources/MockFlows.swift | 7 +++++++ .../reference-assets/Sources/SwiftUI/InfoAsset.swift | 4 ++-- .../reference-assets/Sources/SwiftUI/InputAsset.swift | 5 ++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ios/packages/demo/Sources/MockFlows.swift b/ios/packages/demo/Sources/MockFlows.swift index c92f6dfaf..14cd1e135 100644 --- a/ios/packages/demo/Sources/MockFlows.swift +++ b/ios/packages/demo/Sources/MockFlows.swift @@ -774,6 +774,13 @@ static let inputBasic: String = """ "type": "text", "value": "This is an input" } + }, + "note": { + "asset": { + "id": "input-1-note", + "type": "text", + "value": "This is a note" + } } } ], diff --git a/ios/packages/reference-assets/Sources/SwiftUI/InfoAsset.swift b/ios/packages/reference-assets/Sources/SwiftUI/InfoAsset.swift index a90a7e5a3..2993b6efa 100644 --- a/ios/packages/reference-assets/Sources/SwiftUI/InfoAsset.swift +++ b/ios/packages/reference-assets/Sources/SwiftUI/InfoAsset.swift @@ -36,8 +36,8 @@ struct InfoAssetView: View { @ViewBuilder var body: some View { VStack { - model.data.title?.asset?.view.font(.title) - model.data.subTitle?.asset?.view.font(.subheadline) + model.data.title?.asset?.view.font(.title).padding(.bottom, 40) + model.data.subTitle?.asset?.view.font(.subheadline).padding(.bottom, 40) model.data.primaryInfo?.asset?.view if let actions = model.data.actions?.compactMap { $0.asset } { ForEach(actions) { action in diff --git a/ios/packages/reference-assets/Sources/SwiftUI/InputAsset.swift b/ios/packages/reference-assets/Sources/SwiftUI/InputAsset.swift index 0206f83bf..a709735d2 100644 --- a/ios/packages/reference-assets/Sources/SwiftUI/InputAsset.swift +++ b/ios/packages/reference-assets/Sources/SwiftUI/InputAsset.swift @@ -32,6 +32,8 @@ public struct InputData: AssetData, Equatable { var dataType: DataType? /// A validation if present on the input var validation: ValidationData? + /// An asset to use as a note for this asset + var note: WrappedAsset? } /** @@ -87,7 +89,7 @@ struct InputAssetView: View { @ViewBuilder var body: some View { VStack(alignment: .leading) { - model.data.label?.asset?.view.foregroundColor(Color(red: 0.729, green: 0.745, blue: 0.773)).padding(.bottom, 0) + model.data.label?.asset?.view.foregroundColor(Color(red: 0.102, green: 0.125, blue: 0.173)).padding(.bottom, 8).font(.headline) TextField( model.data.placeholder ?? "", text: $model.text, @@ -109,6 +111,7 @@ struct InputAssetView: View { ValidationView(message: data.message, severity: data.severity, dismiss: dismissFunction) .accessibility(identifier: "\(model.data.id)-validation") } + model.data.note?.asset?.view.foregroundColor(Color(red: 0.729, green: 0.745, blue: 0.773)).padding(.top, 8).font(.subheadline) } } } From 3dc8a7326e867005b1248ccb9726f695d58429a6 Mon Sep 17 00:00:00 2001 From: Aariana Singh Date: Wed, 18 Oct 2023 14:37:01 -0400 Subject: [PATCH 2/2] Modified correct mock flows JSON file --- ios/packages/demo/Sources/MockFlows.swift | 2 +- plugins/reference-assets/mocks/input/input-basic.json | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ios/packages/demo/Sources/MockFlows.swift b/ios/packages/demo/Sources/MockFlows.swift index 14cd1e135..4a4a9dacb 100644 --- a/ios/packages/demo/Sources/MockFlows.swift +++ b/ios/packages/demo/Sources/MockFlows.swift @@ -777,7 +777,7 @@ static let inputBasic: String = """ }, "note": { "asset": { - "id": "input-1-note", + "id": "input-note", "type": "text", "value": "This is a note" } diff --git a/plugins/reference-assets/mocks/input/input-basic.json b/plugins/reference-assets/mocks/input/input-basic.json index 640c451a5..4cdc83615 100644 --- a/plugins/reference-assets/mocks/input/input-basic.json +++ b/plugins/reference-assets/mocks/input/input-basic.json @@ -8,5 +8,12 @@ "type": "text", "value": "This is an input" } + }, + "note": { + "asset": { + "id": "input-note", + "type": "text", + "value": "This is a note" + } } }