Skip to content

Commit

Permalink
Merge pull request #96 from tarkalabs/develop
Browse files Browse the repository at this point in the history
Merge develop into main
  • Loading branch information
arvindhsukumar authored Feb 19, 2024
2 parents 64c32f2 + f00b20f commit 373dc48
Show file tree
Hide file tree
Showing 32 changed files with 1,544 additions and 442 deletions.
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
# Tarka UI Kit iOS
Tarka UI Kit is a reusable component library for building iOS and iPadOS apps, based on a design system using Atomic Design principles

# Usage
[Component Documentation](https://github.com/tarkalabs/tarka-ui-kit-ios/wiki/Components)

# Installation
Tarka UI Kit can be installed using Swift Package Manager (SPM). You can add it to the `Package.swift` as follows, or in the package list in Xcode.

```
// package.swift
dependencies: [
.package(url: "git@github.com:tarkalabs/tarka-ui-kit-ios.git", from: "1.0.0"),
],
targets: [
.target(
name: "Your Target",
dependencies: [
.product(name: "TarkaUI", package: "tarka-ui-kit-ios"),
]
)
]
```

# List of components
- TUIAppTopBar
- TUIAttachmentUpload
Expand All @@ -25,8 +46,13 @@ Tarka UI Kit is a reusable component library for building iOS and iPadOS apps, b
- TUISelectionCard
- TUISnackBar
- TUIStatusIndicator
- TUITab
- TUITabBar
- TUITableCell
- TUIFloatingActionButton
- TUITag
- TUITextRow

- TUIToggleSwitch
- TUIRadioButton
- TUIRadioRow

Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public struct TUIButton: View {
}
.frame(minHeight: size.height)
.background(style.backgroundColor)
.roundedCornerWithBorder(width: style.borderWidth, color: .onSurface)
.border(Capsule(), width: style.borderWidth, color: .onSurface)
}

private func image(for icon: FluentIcon) -> some View {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public extension TUIChip {
/// - Returns: A closure that returns the TUIChip
func style(_ style: Style, size: Size = .size40) -> Self {
var newView = self
newView.style = style
newView.size = size
newView.inputItem.style = style
newView.inputItem.size = size
return newView
}

Expand All @@ -27,47 +27,78 @@ public extension TUIChip {
/// - badgeCount: This is used to display the badge view in top trailing only applicable for withButton type
///
/// - Returns: A closure that returns the TUIChip
func style(filter: Filter, isSelected: Bool = false, badgeCount: Int? = nil) -> Self {
func style(filter: Filter, isSelected: Bool = false, badgeCount: Int? = nil, badgeColor: Color = .error) -> Self {
var newView = self
newView.style = Style.filter(filter)
newView.isSelected = isSelected
newView.badgeCount = badgeCount
newView.inputItem.style = Style.filter(filter)
newView.inputItem.isSelected = isSelected
newView.inputItem.badgeCount = badgeCount
newView.inputItem.badgeColor = badgeColor
return newView
}

func action(_ action: @escaping () -> Void) -> Self {
var newView = self
newView.action = action
newView.inputItem.action = action
return newView
}

func isSelected(_ selected: Bool = false) -> Self {
var newView = self
newView.isSelected = selected
newView.inputItem.isSelected = selected
return newView
}

func textColor(_ color: Color = .onSurface) -> Self {
func textColor(_ color: Color) -> Self {
var newView = self
newView.textColor = color
newView.inputItem.textColor = color
return newView
}

func textSelectionColor(_ color: Color) -> Self {
var newView = self
newView.inputItem.textSelectionColor = color
return newView
}

func size(_ size: Size) -> Self {
var newView = self
newView.size = size
newView.inputItem.size = size
return newView
}

func backgroundColor(_ color: Color) -> Self {
var newView = self
newView.backgroundColor = color
newView.inputItem.color = color
return newView
}

func backgroundSelectionColor(_ color: Color) -> Self {
var newView = self
newView.inputItem.selectionColor = color
return newView
}

func foregroundColor(_ color: Color) -> Self {
var newView = self
newView.inputItem.foregroundColor = color
return newView
}

func foregroundSelectionColor(_ color: Color) -> Self {
var newView = self
newView.inputItem.foregroundSelectionColor = color
return newView
}

func borderColor(_ color: Color) -> Self {
var newView = self
newView.borderColor = color
newView.inputItem.borderColor = color
return newView
}

func borderSelectionColor(_ color: Color) -> Self {
var newView = self
newView.inputItem.borderSelectionColor = color
return newView
}
}
Loading

0 comments on commit 373dc48

Please sign in to comment.