Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ class UICatalogButtonsViewController: UITableViewController {
Style(buttonStyle: .linkDanger, title: "Link Danger", isInverse: false, isSmall: false),
Style(buttonStyle: .primaryInverse, title: "Primary Inverse", isInverse: true, isSmall: false),
Style(buttonStyle: .secondaryInverse, title: "Secondary Inverse", isInverse: true, isSmall: false),
Style(buttonStyle: .primaryBrand, title: "Primary Brand", isInverse: true, isSmall: false),
Style(buttonStyle: .secondaryBrand, title: "Secondary Brand", isInverse: true, isSmall: false),
Style(buttonStyle: .linkInverse, title: "Link Inverse", isInverse: true, isSmall: false),
Style(buttonStyle: .linkDangerInverse, title: "Link Danger Inverse", isInverse: true, isSmall: false),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ struct ButtonsCatalogView: View {
Style(buttonStyle: .misticaPrimaryInverse(), title: "Primary Inverse", inverse: true),
Style(buttonStyle: .misticaSecondaryInverse(), title: "Secondary Inverse", inverse: true),
Style(buttonStyle: .misticaLinkInverse(), title: "Link Inverse", inverse: true),
Style(buttonStyle: .misticaPrimaryBrand(), title: "Primary Brand", inverse: true),
Style(buttonStyle: .misticaSecondaryBrand(), title: "Secondary Brand", inverse: true),

Style(buttonStyle: .misticaPrimary(small: true), title: "Primary Small", inverse: false),
Style(buttonStyle: .misticaSecondary(small: true), title: "Secondary Small", inverse: false),
Expand Down
24 changes: 21 additions & 3 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 56 additions & 0 deletions Sources/Mistica/Components/Button/ButtonStyle+Toolkit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,62 @@ public extension Button.Style {
return style
}

static var primaryBrand: Button.Style {
Button.Style(
allowsBleedingAlignment: false,
stateStyleByState: [
.normal: Button.StateStyle(
textColor: .textButtonPrimaryBrand,
backgroundColor: .buttonPrimaryBackgroundBrand,
borderColor: .clear
),
.selected: Button.StateStyle(
textColor: .textButtonPrimaryBrandPressed,
backgroundColor: .buttonPrimaryBackgroundBrandPressed,
borderColor: .clear
),
.disabled: Button.StateStyle(
textColor: .textButtonPrimaryBrand,
backgroundColor: .buttonPrimaryBackgroundBrand,
borderColor: .clear
),
.loading: Button.StateStyle(
textColor: .textButtonPrimaryBrand,
backgroundColor: .buttonPrimaryBackgroundBrand,
borderColor: .clear
)
]
)
}

static var secondaryBrand: Button.Style {
Button.Style(
allowsBleedingAlignment: false,
stateStyleByState: [
.normal: Button.StateStyle(
textColor: .textButtonSecondaryBrand,
backgroundColor: .buttonSecondaryBackgroundBrand,
borderColor: .buttonSecondaryBorderBrand
),
.selected: Button.StateStyle(
textColor: .textButtonSecondaryBrandPressed,
backgroundColor: .buttonSecondaryBackgroundBrandPressed,
borderColor: .buttonSecondaryBorderBrandPressed
),
.disabled: Button.StateStyle(
textColor: .textButtonSecondaryBrand,
backgroundColor: .buttonSecondaryBackgroundBrand,
borderColor: .buttonSecondaryBorderBrand
),
.loading: Button.StateStyle(
textColor: .textButtonSecondaryBrand,
backgroundColor: .buttonSecondaryBackgroundBrand,
borderColor: .buttonSecondaryBorderBrand
)
]
)
}

func insets(isSmall: Bool) -> UIEdgeInsets {
if let overriddenSizes = overriddenSizes {
return overriddenSizes.insets
Expand Down
Loading