Skip to content

Commit 4019066

Browse files
tuentisreBocanegra
andauthored
feat(skin): update design tokens from mistica-design (#485)
* feat(skin): update design tokens * Run swiftformat * Record screenshots automatically launched from GH action * feat: Add secondaryBrand style to buttons * feat: Add tests * Change SwiftUI, add tests * Run swiftformat * Fix text color * Add primary Brand style to buttons * Rerun new screenshots * Fix: new movistar feedback success lottie animation * Record screenshots automatically launched from GH action --------- Co-authored-by: tuentisre <tuentisre@users.noreply.github.com> Co-authored-by: Luis Ángel García <luisangel.garciamunoz@telefonica.com>
1 parent 45e8280 commit 4019066

File tree

95 files changed

+2517
-40
lines changed

Some content is hidden

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

95 files changed

+2517
-40
lines changed

MisticaCatalog/Source/Catalog/Mistica/Components/UICatalogButtonsViewController.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ class UICatalogButtonsViewController: UITableViewController {
2222
Style(buttonStyle: .linkDanger, title: "Link Danger", isInverse: false, isSmall: false),
2323
Style(buttonStyle: .primaryInverse, title: "Primary Inverse", isInverse: true, isSmall: false),
2424
Style(buttonStyle: .secondaryInverse, title: "Secondary Inverse", isInverse: true, isSmall: false),
25+
Style(buttonStyle: .primaryBrand, title: "Primary Brand", isInverse: true, isSmall: false),
26+
Style(buttonStyle: .secondaryBrand, title: "Secondary Brand", isInverse: true, isSmall: false),
2527
Style(buttonStyle: .linkInverse, title: "Link Inverse", isInverse: true, isSmall: false),
2628
Style(buttonStyle: .linkDangerInverse, title: "Link Danger Inverse", isInverse: true, isSmall: false),
2729

MisticaCatalog/Source/Catalog/MisticaSwiftUI/Components/ButtonCatalogView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ struct ButtonsCatalogView: View {
2222
Style(buttonStyle: .misticaPrimaryInverse(), title: "Primary Inverse", inverse: true),
2323
Style(buttonStyle: .misticaSecondaryInverse(), title: "Secondary Inverse", inverse: true),
2424
Style(buttonStyle: .misticaLinkInverse(), title: "Link Inverse", inverse: true),
25+
Style(buttonStyle: .misticaPrimaryBrand(), title: "Primary Brand", inverse: true),
26+
Style(buttonStyle: .misticaSecondaryBrand(), title: "Secondary Brand", inverse: true),
2527

2628
Style(buttonStyle: .misticaPrimary(small: true), title: "Primary Small", inverse: false),
2729
Style(buttonStyle: .misticaSecondary(small: true), title: "Secondary Small", inverse: false),

Package.resolved

Lines changed: 21 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sources/Mistica/Components/Button/ButtonStyle+Toolkit.swift

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,62 @@ public extension Button.Style {
157157
return style
158158
}
159159

160+
static var primaryBrand: Button.Style {
161+
Button.Style(
162+
allowsBleedingAlignment: false,
163+
stateStyleByState: [
164+
.normal: Button.StateStyle(
165+
textColor: .textButtonPrimaryBrand,
166+
backgroundColor: .buttonPrimaryBackgroundBrand,
167+
borderColor: .clear
168+
),
169+
.selected: Button.StateStyle(
170+
textColor: .textButtonPrimaryBrandPressed,
171+
backgroundColor: .buttonPrimaryBackgroundBrandPressed,
172+
borderColor: .clear
173+
),
174+
.disabled: Button.StateStyle(
175+
textColor: .textButtonPrimaryBrand,
176+
backgroundColor: .buttonPrimaryBackgroundBrand,
177+
borderColor: .clear
178+
),
179+
.loading: Button.StateStyle(
180+
textColor: .textButtonPrimaryBrand,
181+
backgroundColor: .buttonPrimaryBackgroundBrand,
182+
borderColor: .clear
183+
)
184+
]
185+
)
186+
}
187+
188+
static var secondaryBrand: Button.Style {
189+
Button.Style(
190+
allowsBleedingAlignment: false,
191+
stateStyleByState: [
192+
.normal: Button.StateStyle(
193+
textColor: .textButtonSecondaryBrand,
194+
backgroundColor: .buttonSecondaryBackgroundBrand,
195+
borderColor: .buttonSecondaryBorderBrand
196+
),
197+
.selected: Button.StateStyle(
198+
textColor: .textButtonSecondaryBrandPressed,
199+
backgroundColor: .buttonSecondaryBackgroundBrandPressed,
200+
borderColor: .buttonSecondaryBorderBrandPressed
201+
),
202+
.disabled: Button.StateStyle(
203+
textColor: .textButtonSecondaryBrand,
204+
backgroundColor: .buttonSecondaryBackgroundBrand,
205+
borderColor: .buttonSecondaryBorderBrand
206+
),
207+
.loading: Button.StateStyle(
208+
textColor: .textButtonSecondaryBrand,
209+
backgroundColor: .buttonSecondaryBackgroundBrand,
210+
borderColor: .buttonSecondaryBorderBrand
211+
)
212+
]
213+
)
214+
}
215+
160216
func insets(isSmall: Bool) -> UIEdgeInsets {
161217
if let overriddenSizes = overriddenSizes {
162218
return overriddenSizes.insets

0 commit comments

Comments
 (0)