Skip to content

Commit

Permalink
Fix the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
PavelHolec committed Jan 23, 2024
1 parent 6bad7ea commit f947b1e
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 19 deletions.
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
[![swift-package-manager](https://img.shields.io/badge/Swift_Package_Manager-compatible-green)](https://github.com/apple/swift-package-manager)
[![Build](https://github.com/kiwicom/orbit-swiftui/actions/workflows/ci.yml/badge.svg)](https://github.com/kiwicom/orbit-swiftui/actions/workflows/ci.yml)

<strong>Orbit is a SwiftUI component library which provides developers the easiest possible way of building Kiwi.com’s products.</strong>
<strong>Orbit SwiftUI is a component library that provides developers an easy way of building Kiwi.com’s products.</strong>

</div>

## Orbit Mission

[Orbit](https://orbit.kiwi) aims to bring order and consistency to all of our products and processes. We elevate user experience and increase the speed and efficiency of how we design and build products.
[Orbit](https://orbit.kiwi) aims to bring consistency to our products and processes.

Orbit is an open-source design system created for specific needs of Kiwi.com and together with that – for needs of travel projects.
Orbit is an open-source design system created for specific needs of Kiwi.com.

This library allows you to integrate the Orbit design system into your iOS SwiftUI project.
This library allows you to integrate it into your iOS SwiftUI project.

## Requirements

Expand All @@ -35,7 +35,7 @@ This library allows you to integrate the Orbit design system into your iOS Swift
Add Orbit package to your project by adding the package dependency:

```swift
.package(name: "Orbit", url: "https://github.com/kiwicom/orbit-swiftui.git", .upToNextMajor(from: "0.8.0")),
.package(name: "Orbit", url: "https://github.com/kiwicom/orbit-swiftui.git", .upToNextMajor(from: "0.10.0")),
```

## Documentation
Expand All @@ -44,21 +44,22 @@ Add Orbit package to your project by adding the package dependency:
<br>
[DocC documentation](https://kiwicom.github.io/orbit-swiftui/documentation/orbit/)

The online documentation contains instructions on how to get started with the library once you integrate it into your project, as well as examples and pages for individual components.
The online documentation contains instructions on how to get started with the library as well as examples and pages for individual components.

You can also build this documentation locally in Xcode (Product -> Build Documentation).
You can also build the documentation locally in Xcode (Product -> Build Documentation).

## App Store

The app can also be downloaded from the App Store.
The Orbit Storybook that contains a showcase of Orbit foundation and components can be built in Xcode or downloaded as a standalone app in the App Store.

<a href="https://apps.apple.com/us/app/orbit-storybook/id1622225639?itsct=apps_box_badge&amp;itscg=30200" style="display: inline-block; overflow: hidden; border-radius: 13px; width: 150px; height: 50px;"><img src="https://tools.applemediaservices.com/api/badges/download-on-the-app-store/black/en-us?size=150x50&amp;releaseDate=1651708800&h=19b81a69aa959af2af398c51dc84737a" alt="Download on the App Store" style="border-radius: 13px; width: 150px; height: 50px;"></a>

## Contributing

Feel free to create bug reports and feature requests via the Issues tab.

If you want to directly contribute by fixing a bug or implementing a feature or enhancement, you are welcome to do so. Pull request review has following priorities to check:
If you want to directly contribute by fixing a bug or implementing a feature or enhancement, you are welcome to do so.
Pull request review has following priorities to check:

1) API consistency with other components (similar components should have similar API)
2) Component variants matching design variants (components should have same properties as design)
Expand All @@ -68,4 +69,5 @@ If you want to directly contribute by fixing a bug or implementing a feature or

## Feedback

We want to provide high quality and easy to use components. We can’t do that without your feedback. If you have any suggestions about what we can do to improve, please report it directly as an issue or write to us at #orbit-components on Slack.
We want to provide high quality and easy to use components. We can’t do that without your feedback.
If you have any suggestions about what we can do to improve, please report it as an issue.
1 change: 1 addition & 0 deletions Sources/Orbit/Orbit.docc/Components/Components.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ Our components are a collection of interface elements that can be reused across

- ``Heading``
- ``Text``
- ``Textarea``
- ``TextRepresentable``

### Utility components
Expand Down
13 changes: 10 additions & 3 deletions Sources/Orbit/Orbit.docc/FileStructureAndNaming.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,25 @@ To use Orbit components in SwiftUI, import the `Orbit` library and use the compo

```swift
import Orbit
import OrbitIllustrations

...

VStack(spacing: .medium) {
Heading("Messages", style: .title2)
Illustration(.mailbox)
Text("...<strong>...</strong>...<a href="...">here</a>.")
Button("Continue", style: .secondary)
.textSize(.large)
.textColor(.inkNormal)
Button("Continue", style: .secondary) {
// Action
}
}
```

As some Orbit components already exist in standard SwiftUI library (`Text` and `List` for example), you can create a typealias for Orbit components to shadow these. In order to access standard components where needed, a `SwifUI.` prefix can be used to specify the native component.
As some components with Orbit component names already exist in standard SwiftUI library (`Text` and `List` for example),
you can create a typealias for Orbit components to shadow these.
In order to access standard components where needed, a `SwifUI.` prefix can be used to specify the native component.

```swift
// Add these lines to prefer Orbit components over SwiftUI ones
Expand Down Expand Up @@ -66,4 +73,4 @@ Use ``BorderRadius`` and ``BorderWidth`` enums.

Use `Font` extensions.

All Orbit components use the Orbit font (see <doc:GettingStarted>) automatically.
All Orbit components use the (optional) Orbit font (see <doc:GettingStarted>) automatically.
20 changes: 15 additions & 5 deletions Sources/Orbit/Orbit.docc/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,18 @@

Set up Orbit to work with your project.

### Register fonts
### Register Icon font

If you omit this optional step, Orbit components will use default iOS system fonts.
In order to display Orbit Icons that use Orbit icon symbols,
register Orbit icon font once during the app start (or by using the ``OrbitPreviewWrapper`` for previews).

```swift
Font.registerOrbitIconFont()
```

### Register Orbit or custom fonts (Optional)

If you omit this optional step, Orbit components will use the default iOS system fonts for all textual components.

Define `Circular Pro` or any custom font to be used for each font weight variant. [Circular Pro must be licensed](https://orbit.kiwi/foundation/typography/circular-pro/#circular-pro-in-non-kiwicom-projects).

Expand All @@ -18,21 +27,22 @@ Font.orbitFonts = [
]
```

Register those fonts once at app start (or use ``OrbitPreviewWrapper`` for previews).
Register these fonts once during the app start (or by using the ``OrbitPreviewWrapper`` for previews).

```swift
Font.registerOrbitFonts()
```

### Import the Orbit package

Include Orbit package in your package or project and include `import Orbit` in SwiftUI file to access Orbit foundations and components.
Include Orbit package in your package or project and add `import Orbit` to a SwiftUI file to access Orbit foundations and components.

![Usage in code](usage.png)

### Storybook catalogue screen

The `OrbitStorybook` target contains views that can be checked (using previews or an empty app) to browse a catalogue of all components. The storybook is also available for download on the [AppStore](https://apps.apple.com/us/app/orbit-storybook/id1622225639).
The `OrbitStorybook` target contains views that can be checked (using previews or an empty app) to browse a catalogue of all components.
The storybook is also available as an app on the [AppStore](https://apps.apple.com/us/app/orbit-storybook/id1622225639).

```swift
import OrbitStorybook
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ struct ContentView: View {
.bold: Bundle.main.url(forResource: "Circular20-Bold.otf", withExtension: nil),
.black: Bundle.main.url(forResource: "Circular20-Black.otf", withExtension: nil),
]

// Register above custom fonts for use in Orbit textual components
Font.registerOrbitFonts()

// Register custom font for use in Orbit `Icon` component
Font.registerOrbitIconFont()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

@Section(title: "(Optional) Configure Fonts to be Used by Orbit Components") {
@ContentAndMedia {
Orbit uses a set of fonts for all its components.
Orbit uses a set of fonts for all its textual components.

If you own a licence for Orbit's default Circular20 font family, you can set it up. Or you can use any custom fonts for each font weight.
}
Expand Down

0 comments on commit f947b1e

Please sign in to comment.