Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the components #143

Merged
merged 35 commits into from Feb 25, 2024
Merged

Update the components #143

merged 35 commits into from Feb 25, 2024

Conversation

mattesmohr
Copy link
Member

@mattesmohr mattesmohr commented Dec 3, 2023

This PR includes new symbols, some API changes and a new, but familiar approach for configuring styles.

New symbols

Symbol(system: .bell)
Symbol(system: .chevron(.up))
Symbol(system: .chevron(.down))
Symbol(system: .chevron(.left))
Symbol(system: .chevron(.right))
Symbol(system: .ellipsis(.horizontal))
Symbol(system: .ellipsis(.vertical))
Symbol(system: .eye)
Symbol(system: .filter)
Symbol(system: .flask)
Symbol(system: .key)
Symbol(system: .lightbulb)
Symbol(system: .pencil)
Symbol(system: .refresh)
Symbol(system: .trash)

API changes

Symbol(system: .folder)

// Previously
Symbol(system: "folder")
VStack(spacing: .small) {}

// Previously
VStack {}.contentSpace(.small);
Grid(spacing: .small) {}

// You can also now differentiate between horizontal and vertical spacing
Grid(horizontalSpacing: .small, verticalSpacing: .small) {}

Grid {}.contentSpace(.small)
Text(alignment: .center) {}
Text {}.foregroundColor(.accent)

// Previously
Text {}.foregroundColor(.primary)
// Sets the frame height to max-content
VStack {}.frame(height: .maximum)

// Sets the frame height to auto
VStack {}.frame(height: .minimum)

Group appearance

Grouping buttons or images alters the appearance of its content, e. g. individual images become an avatar group.

Grouping {
  Button(role: .button) {
     "Left"
  }
  Button(role: .button) {
     "Right"
  }
}

Style configuration

You can now define a style once and apply it to multiple components.

struct CustomStyle: TextConfiguration {

    var fontFamily: Tokens.FontFamily? = nil
    var fontSize: Tokens.FontSize? = .small
    var fontWeight: Tokens.FontWeight? = .bold
    var foregroundColor: Tokens.ForegroundColor? = .accent
    var textCase: Tokens.TextCase? = .uppercase
}

Text {
  "Hello World!"
}
.textStyle(CustomStyle())

Text {
  "Are you there?"
}
.textStyle(CustomStyle())

Remove the internal initialiser since they have never been used
The dropdown doesnt act as a button anymore, therefore it should lose the modifier
Remove the secondary color and rename the primary to accent, also fix others
@mattesmohr mattesmohr changed the title Upgrade the package Update the components Feb 4, 2024
@mattesmohr mattesmohr merged commit 34979f2 into main Feb 25, 2024
1 check passed
@mattesmohr mattesmohr deleted the upgrade/htmlkit-3.0-9 branch February 25, 2024 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant