-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(sdds-counter, counterview): corrections to comments
- Loading branch information
1 parent
6785849
commit 4c90ff5
Showing
27 changed files
with
1,595 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
...ts/Components/SDDSCounter/CounterAppearance+Extensions/CounterAppearance+Extensions.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import Foundation | ||
import SDDSThemeCore | ||
|
||
public extension CounterAppearance { | ||
func size(_ size: CounterSizeConfiguration) -> CounterAppearance { | ||
return CounterAppearance( | ||
size: size, | ||
dataTypography: self.dataTypography, | ||
dataColor: self.dataColor, | ||
backgroundColor: self.backgroundColor, | ||
disabledAlpha: self.disabledAlpha, | ||
loadingAlpha: self.loadingAlpha | ||
) | ||
} | ||
|
||
func dataTypography(_ dataTypography: TypographyConfiguration) -> CounterAppearance { | ||
return CounterAppearance( | ||
size: self.size, | ||
dataTypography: dataTypography, | ||
dataColor: self.dataColor, | ||
backgroundColor: self.backgroundColor, | ||
disabledAlpha: self.disabledAlpha, | ||
loadingAlpha: self.loadingAlpha | ||
) | ||
} | ||
|
||
func dataColor(_ dataColor: CounterColor) -> CounterAppearance { | ||
return CounterAppearance( | ||
size: self.size, | ||
dataTypography: self.dataTypography, | ||
dataColor: dataColor, | ||
backgroundColor: self.backgroundColor, | ||
disabledAlpha: self.disabledAlpha, | ||
loadingAlpha: self.loadingAlpha | ||
) | ||
} | ||
|
||
func backgroundColor(_ backgroundColor: CounterColor) -> CounterAppearance { | ||
return CounterAppearance( | ||
size: self.size, | ||
dataTypography: self.dataTypography, | ||
dataColor: self.dataColor, | ||
backgroundColor: backgroundColor, | ||
disabledAlpha: self.disabledAlpha, | ||
loadingAlpha: self.loadingAlpha | ||
) | ||
} | ||
|
||
func disabledAlpha(_ disabledAlpha: CGFloat) -> CounterAppearance { | ||
return CounterAppearance( | ||
size: self.size, | ||
dataTypography: self.dataTypography, | ||
dataColor: dataColor, | ||
backgroundColor: self.backgroundColor, | ||
disabledAlpha: disabledAlpha, | ||
loadingAlpha: self.loadingAlpha | ||
) | ||
} | ||
|
||
func loadingAlpha(_ loadingAlpha: CGFloat) -> CounterAppearance { | ||
return CounterAppearance( | ||
size: self.size, | ||
dataTypography: self.dataTypography, | ||
dataColor: dataColor, | ||
backgroundColor: self.backgroundColor, | ||
disabledAlpha: self.disabledAlpha, | ||
loadingAlpha: loadingAlpha | ||
) | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...s/Sources/SDDSComponents/Components/SDDSCounter/CounterAppearance/CounterAppearance.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import Foundation | ||
@_exported import SDDSThemeCore | ||
|
||
public struct CounterAppearance { | ||
public let size: CounterSizeConfiguration | ||
public let dataTypography: TypographyConfiguration | ||
public let dataColor: CounterColor | ||
public let backgroundColor: CounterColor | ||
public let disabledAlpha: CGFloat | ||
public let loadingAlpha: CGFloat | ||
|
||
public init( | ||
size: CounterSizeConfiguration = DefaultCounterSize(), | ||
dataTypography: TypographyConfiguration = .default, | ||
dataColor: CounterColor = CounterColor(), | ||
backgroundColor: CounterColor = CounterColor(), | ||
disabledAlpha: CGFloat = 0, | ||
loadingAlpha: CGFloat = 0 | ||
) { | ||
self.size = size | ||
self.dataTypography = dataTypography | ||
self.dataColor = dataColor | ||
self.backgroundColor = backgroundColor | ||
self.disabledAlpha = disabledAlpha | ||
self.loadingAlpha = loadingAlpha | ||
} | ||
} | ||
|
18 changes: 18 additions & 0 deletions
18
...onents/Sources/SDDSComponents/Components/SDDSCounter/CounterAppearance/CounterColor.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import Foundation | ||
@_exported import SDDSThemeCore | ||
|
||
public struct CounterColor { | ||
public let defaultColor: ColorToken | ||
public let highlightedColor: ColorToken | ||
public let hoveredColor: ColorToken | ||
|
||
public init( | ||
defaultColor: ColorToken = .clearColor, | ||
highlightedColor: ColorToken = .clearColor, | ||
hoveredColor: ColorToken = .clearColor | ||
) { | ||
self.defaultColor = defaultColor | ||
self.highlightedColor = highlightedColor | ||
self.hoveredColor = hoveredColor | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...ponents/Sources/SDDSComponents/Components/SDDSCounter/CounterAppearance/CounterSize.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import Foundation | ||
import SwiftUI | ||
|
||
public struct DefaultCounterSize: CounterSizeConfiguration { | ||
public var height: CGFloat = 0 | ||
public var width: CGFloat = 0 | ||
public var paddings: EdgeInsets = .init() | ||
public var debugDescription: String { | ||
return "DefaultCounterSize" | ||
} | ||
|
||
public init() {} | ||
} | ||
|
||
public protocol CounterSizeConfiguration: SizeConfiguration, CustomDebugStringConvertible { | ||
var height: CGFloat { get } | ||
var width: CGFloat { get } | ||
var paddings: EdgeInsets { get } | ||
} |
9 changes: 9 additions & 0 deletions
9
SDDSComponents/Sources/SDDSComponents/Components/SDDSCounter/CounterData.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import Foundation | ||
|
||
public struct CounterData { | ||
public var value: String | ||
|
||
public init(value: String = "") { | ||
self.value = value | ||
} | ||
} |
Oops, something went wrong.