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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
29 changes: 29 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
# https://docs.coderabbit.ai/guides/configure-coderabbit

language: en-US

reviews:
auto_review:
enabled: true
# CodeRabbit only reviews PRs targeting the default branch unless told otherwise.
# Icon imports are large enough to be split into a stacked pair, so the code half
# targets a feature branch and would otherwise never be reviewed.
base_branches:
- "feat/.*"

path_filters:
# Asset catalogs are generated: imageset Contents.json is written by Xcode or by the
# Figma export tooling, never edited by hand, so there is nothing to review in them.
# Their volume alone also pushes icon-import PRs past CodeRabbit's file limit, which
# skips the review of the Swift changes that actually matter.
- "!**/*.xcassets/**"

path_instructions:
# Generated from the asset catalog on disk — the raw values cannot be meaningfully
# checked line by line, but the shape of the API can.
- path: "Sources/DashUIKit/Foundation/Icon_DashUI.swift"
instructions: >-
This file is generated from the asset catalog. Review the API shape — protocol
conformances, availability annotations, naming scheme — but do not comment on
individual enum cases or their raw values.
4 changes: 2 additions & 2 deletions Sources/DashUIKit/Button/DashButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ private struct DashButtonStylePreview: View {
VStack(alignment: .leading, spacing: 12) {
VStack(alignment: .leading, spacing: 8) {
Text("Enabled")
.font(.subheadline)
.dashFont(.subhead)
.foregroundColor(.secondary)

HStack(alignment: .top, spacing: 12) {
Expand All @@ -291,7 +291,7 @@ private struct DashButtonStylePreview: View {

VStack(alignment: .leading, spacing: 8) {
Text("Disabled")
.font(.subheadline)
.dashFont(.subhead)
.foregroundColor(.secondary)

HStack(alignment: .top, spacing: 12) {
Expand Down
10 changes: 5 additions & 5 deletions Sources/DashUIKit/Components/AddressFieldView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ public struct AddressFieldView: View {
"",
text: $text,
prompt: Text(placeholder)
.font(Font.dash.subhead)
.dashFont(.subhead)
.foregroundStyle(Color.dash.black1000Alpha30),
axis: .vertical
)
.lineLimit(1...2)
.font(Font.dash.subhead)
.dashFont(.subhead)
.textInputAutocapitalization(.never)
.disableAutocorrection(true)
.foregroundStyle(Color.dash.primaryText)
Expand All @@ -136,7 +136,7 @@ public struct AddressFieldView: View {
.disabled(isDisabled)
} else {
TextField(placeholder, text: $text)
.font(Font.dash.subhead)
.dashFont(.subhead)
.textInputAutocapitalization(.never)
.disableAutocorrection(true)
.foregroundStyle(Color.dash.primaryText)
Expand All @@ -150,15 +150,15 @@ public struct AddressFieldView: View {
Group {
if text.isEmpty {
Button(action: { onScanQR?() }) {
Image(dash: .custom("text-field-qr", bundle: .dashUIKit))
DashIcon.Other.textFieldQR.image
.resizable()
.scaledToFit()
.frame(width: Layout.iconSize, height: Layout.iconSize)
}
.accessibilityLabel(NSLocalizedString("Scan QR code", bundle: .module, comment: "DashUIKit"))
} else {
Button(action: { text = "" }) {
Image(dash: .custom("text-field-clear", bundle: .dashUIKit))
DashIcon.Other.textFieldClear.image
.renderingMode(.template)
.resizable()
.scaledToFit()
Expand Down
2 changes: 1 addition & 1 deletion Sources/DashUIKit/Components/DashAmount.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public struct DashAmount: View {
Text(DashAmountFormat.string(forDuffs: abs(amount)))
.font(.system(size: fontSize, weight: weight))
.lineLimit(1)
Image(dash: .custom("icon_dash_currency", bundle: .dashUIKit))
DashIcon.Common.iconDashCurrency.image
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: fontSize * dashSymbolFactor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public struct DashBalanceView: View {
VStack(alignment: .trailing, spacing: 0) {
HStack(spacing: 6) {
Text(balance)
.font(Font.dash.subhead)
.dashFont(.subhead)
.lineLimit(1)

dashSymbol
Expand All @@ -47,14 +47,14 @@ public struct DashBalanceView: View {

if let fiat {
Text(fiat)
.font(Font.dash.caption1)
.dashFont(.caption1)
.foregroundColor(Color.dash.primaryText)
}
}
}

private var dashSymbol: some View {
Image(dash: .custom("icon_dash_currency", bundle: .dashUIKit))
DashIcon.Common.iconDashCurrency.image
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 12, height: 10)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public struct DashPickerView<Option: Hashable>: View {

private func pickerOption(_ option: Option) -> some View {
Text(title(option))
.font(Font.dash.caption2)
.dashFont(.caption2)
.foregroundColor(selected == option ? Color.dash.primaryText : Color.dash.tertiaryText)
.padding(.horizontal, Layout.hPadding)
.padding(.vertical, Layout.vPadding)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ internal struct DualInputTypeSwitcher: View {
onSelect(code)
} label: {
Text(code)
.font(Font.dash.caption2)
.dashFont(.caption2)
.foregroundColor(
code == selected
? Color.dash.primaryText
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ public struct EnterAmountView: View {
.frame(width: 40, height: 40)

Text(NSLocalizedString("Max", bundle: .module, comment: ""))
.font(Font.dash.caption2)
.dashFont(.caption2)
.foregroundColor(Color.dash.blue)
}
}
Expand Down Expand Up @@ -339,7 +339,7 @@ private struct DualSwapPreviewContainer: View {
var body: some View {
VStack(spacing: 20) {
Text(showMax ? "With Max button" : "No Max button — amount stays centered")
.font(Font.dash.caption1)
.dashFont(.caption1)
.foregroundColor(Color.dash.tertiaryText)

EnterAmountView(
Expand All @@ -358,7 +358,7 @@ private struct DualSwapPreviewContainer: View {
.padding(.horizontal, 20)

Button("Tap to swap") { isPrimarySelected.toggle() }
.font(Font.dash.footnote)
.dashFont(.footnote)
.foregroundColor(Color.dash.blue)
}
.padding(.vertical, 20)
Expand Down
20 changes: 10 additions & 10 deletions Sources/DashUIKit/Components/EnterAmount/SwapAmountView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public struct SwapAmountView: View {
VStack(spacing: 2) {
if let top = topText {
Text(top)
.font(Font.dash.caption1)
.dashFont(.caption1)
.foregroundColor(Color.dash.tertiaryText)
}

Expand All @@ -108,7 +108,7 @@ public struct SwapAmountView: View {

if let bottom = bottomText {
Text(bottom)
.font(Font.dash.caption1)
.dashFont(.caption1)
.foregroundColor(Color.dash.tertiaryText)
}
}
Expand All @@ -123,7 +123,7 @@ public struct SwapAmountView: View {

if let secondary = secondaryText {
Text(secondary)
.font(Font.dash.subhead)
.dashFont(.subhead)
.foregroundColor(Color.dash.tertiaryText)
}
}
Expand Down Expand Up @@ -166,7 +166,7 @@ public struct SwapAmountView: View {
Button {
onCurrencyTap?()
} label: {
Image(dash: .custom("chevron-down-currency-select", bundle: .dashUIKit))
DashIcon.Common.chevronDownCurrencySelect.image
.frame(width: 10, height: 5)
}
.buttonStyle(.plain)
Expand All @@ -191,7 +191,7 @@ public struct SwapAmountView: View {
.font(font)

if showDashLogo {
Image(dash: .custom("enter-amount-dash", bundle: .dashUIKit))
DashIcon.Common.enterAmountDash.image
.resizable()
.scaledToFit()
.frame(width: dashSize?.width, height: dashSize?.height)
Expand All @@ -210,7 +210,7 @@ public struct SwapAmountView: View {
.font(font)

if showSecondaryDashLogo {
Image(dash: .custom("enter-amount-dash", bundle: .dashUIKit))
DashIcon.Common.enterAmountDash.image
.resizable()
.scaledToFit()
.frame(width: dashSize?.width, height: dashSize?.height)
Expand Down Expand Up @@ -365,7 +365,7 @@ private struct AnimatedSwapLayout: View {

if showSecondaryCurrencyButton {
Button { onSecondaryCurrencyTap?() } label: {
Image(dash: .custom("chevron-down-currency-select", bundle: .dashUIKit))
DashIcon.Common.chevronDownCurrencySelect.image
.resizable()
.scaledToFit()
.frame(width: chevronSize.width, height: chevronSize.height)
Expand Down Expand Up @@ -436,7 +436,7 @@ private struct AnimatedSwapLayout: View {
}
Text(displayText).font(font)
if showLogo {
Image(dash: .custom("enter-amount-dash", bundle: .dashUIKit))
DashIcon.Common.enterAmountDash.image
.resizable()
.scaledToFit()
.frame(width: dashSize.width, height: dashSize.height)
Expand Down Expand Up @@ -622,7 +622,7 @@ private struct SwapAmountAnimatedPreview: View {
var body: some View {
VStack(spacing: 16) {
Text(isPrimarySelected ? "Dash is primary (large)" : "Fiat is primary (large)")
.font(Font.dash.caption1)
.dashFont(.caption1)
.foregroundColor(Color.dash.tertiaryText)

SwapAmountView(
Expand All @@ -640,7 +640,7 @@ private struct SwapAmountAnimatedPreview: View {
.onTapGesture { isPrimarySelected.toggle() }

Button("Tap to swap") { isPrimarySelected.toggle() }
.font(Font.dash.footnote)
.dashFont(.footnote)
.foregroundColor(Color.dash.blue)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public struct ErrorIllustration: View {
ZStack {
Color.dash.red

Image(dash: .custom("illustration-xmark", bundle: .dashUIKit))
DashIcon.Common.illustrationXmark.image
.resizable()
.scaledToFit()
.frame(maxHeight: 29)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public struct SuccessIllustration: View {
ZStack {
Color.dash.green

Image(dash: .custom("checkmark", bundle: .dashUIKit))
DashIcon.Common.checkmark.image
.resizable()
.scaledToFit()
.frame(maxHeight: 29)
Expand Down
6 changes: 3 additions & 3 deletions Sources/DashUIKit/Components/MenuItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -249,17 +249,17 @@ public struct MenuItem: View {
#Preview("Enabled vs disabled") {
VStack(spacing: 0) {
MenuItem(
leadingIcon: .custom("menu-receive", bundle: .dashUIKit),
leadingIcon: DashIcon.Menu.receive.source,
title: "Buy Dash",
helpText: "From any crypto to your Dash Wallet"
)

Divider().padding(.leading, 16)

MenuItem(
leadingIcon: .custom("menu-receive", bundle: .dashUIKit),
leadingIcon: DashIcon.Menu.receive.source,
isEnabled: false,
disabledLeadingIcon: .custom("menu-receive.disabled", bundle: .dashUIKit),
disabledLeadingIcon: DashIcon.Menu.receiveDisabled.source,
title: "Buy Dash",
helpText: "From any crypto to your Dash Wallet"
)
Expand Down
2 changes: 1 addition & 1 deletion Sources/DashUIKit/Components/NumericKeyboardView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public struct NumericKeyboardView: View {
private func helperTextRow(_ text: String?) -> some View {
if let text, !text.isEmpty {
Text(text)
.font(Font.dash.footnote)
.dashFont(.footnote)
.foregroundColor(Color.dash.secondaryText)
.multilineTextAlignment(.center)
.frame(maxWidth: .infinity)
Expand Down
10 changes: 5 additions & 5 deletions Sources/DashUIKit/Components/SearchBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private struct SearchBarFocused: View {
}

private var magnifyingGlass: some View {
Image(dash: .custom("searchbar-magnifyingglass-icon", bundle: .dashUIKit))
DashIcon.SearchBar.magnifyingglassIcon.image
.resizable()
.scaledToFit()
.frame(maxHeight: 15)
Expand All @@ -105,7 +105,7 @@ private struct SearchBarFocused: View {
Button(
action: { text = "" },
label: {
Image(dash: .custom("searchbar-xmark-icon", bundle: .dashUIKit))
DashIcon.SearchBar.xmarkIcon.image
.resizable()
.scaledToFit()
.frame(maxHeight: 15)
Expand Down Expand Up @@ -142,7 +142,7 @@ private struct SearchBarFocused: View {
TextField(
text: $text,
prompt: Text(placeholder)
.font(Font.dash.subhead)
.dashFont(.subhead)
.foregroundStyle(Color.dash.black1000Alpha30)
) {
EmptyView()
Expand Down Expand Up @@ -188,7 +188,7 @@ private struct SearchBarLegacy: View {
}

private var magnifyingGlass: some View {
Image(dash: .custom("searchbar-magnifyingglass-icon", bundle: .dashUIKit))
DashIcon.SearchBar.magnifyingglassIcon.image
.resizable()
.scaledToFit()
.frame(maxHeight: 15)
Expand All @@ -200,7 +200,7 @@ private struct SearchBarLegacy: View {
Button(
action: { text = "" },
label: {
Image(dash: .custom("searchbar-xmark-icon", bundle: .dashUIKit))
DashIcon.SearchBar.xmarkIcon.image
.resizable()
.scaledToFit()
.frame(maxHeight: 15)
Expand Down
37 changes: 37 additions & 0 deletions Sources/DashUIKit/Components/Switch/Components/ThumbView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// ThumbView.swift
// DashUIKit
//
// Created by Roman Chornyi on 29.07.2026.
//

import SwiftUI

@available(iOS 14, macOS 11, *)
struct ThumbView: View {

private struct Constants {
static let switchThumbFill: Color = Color.dash.white
static let switchThumbRadius: CGFloat = 1000
}

var body: some View {
Rectangle()
.foregroundColor(.clear)
.frame(width: 39, height: 24)
.background(Constants.switchThumbFill)
.cornerRadius(Constants.switchThumbRadius)
.shadow(color: Color(red: 0.1, green: 0.13, blue: 0.15).opacity(0.06), radius: 1, x: 0, y: 1)
.shadow(color: Color(red: 0.1, green: 0.13, blue: 0.15).opacity(0.1), radius: 1.5, x: 0, y: 1)
}
}

#if DEBUG

@available(iOS 17, macOS 14, *)
#Preview {
ThumbView()
.padding()
}

#endif
Loading
Loading