Skip to content

Orange-OpenSource/ouds-ios

Repository files navigation

OUDS iOS

OUDS iOS provides Orange iOS components to developers and a demo application.
Report bug · Request feature

Table of contents

Status

MIT license

Versions Still maintained

Code size Opened issues

iOS 15.0

Content

This repository contains the OUDS iOS library that provides Orange iOS components, but also a demo application showcasing these different components.

Integrate OUDS

Use Swift Package Manager

If you want to add the iOS library of Orange Unified Design System, you need to add our Swift Package into your project. To do that, add a new package dependency to your Xcode project by refering to it with https://github.com/Orange-OpenSource/ouds-ios. You are free to choose wether or not you want a branch or a specific tag, pick the solution you want.

Import the library you need

You should use one of the following imports for your needs:

import OUDSModules           // To use modules
import OUDSComponents        // To use components
import OUDSThemesOrange      // To use the default theme
import OUDSThemesCommons     // If you want to define your theme or use OUDSThemeableView
import OUDSTokensComponent   // If you need to override components tokens
import OUDSTokenSemantic     // If you need to override semantic tokens
import OUDSTokensRaw         // If you need to override raw tokens

Use themeable view

// Make imports
import OUDSThemesCommons
import OUDSThemesOrange

// Add themeable view to your root view
OUDSThemeableView(theme: OrangeTheme()) {
    YourRootView()
}

Define a custom theme if needed

class YourCustomTheme: OrangeTheme { }

extension YourCustomTheme {

    // Override components tokens if needed
    override var ftiBorderStyle: BorderStyleSemanticToken { borderStyleDrag }
    override var ftiBorderWidth: BorderWidthSemanticToken { borderWidthThickest }
    
    // Override colors semantic tokens if needed
    override var colorBackgroundDefaultPrimaryLight: ColorSemanticToken! { ColorRawTokens.colorFunctionalSun500 }
    override var colorBackgroundDefaultPrimaryDark: ColorSemanticToken! { ColorRawTokens.colorFunctionalSun800 }
    
    // Etc.
}

Bugs and feature requests

Have a bug or a feature request? Please first search for existing and closed issues. If your problem or idea is not addressed yet, please open a new issue.

Contributing

Please read through our contributing guidelines. Included are directions for opening issues, coding standards, and notes on development.

Copyright and license

Code released under the MIT License.