VitaminSwiftUI 0.13.0

VitaminSwiftUI 0.13.0

由以下人员维护:Daniel DumortierFlorent LOTTHÉJeffrey Macko



  • Decathlon

重要

当前版本的 Vitamin 将不会再进行更新,今后只会接受错误修复。更多详情请参阅 此处


Vitamin Decathlon Design System logo Vitamin Decathlon Design System logo

Vitamin iOS

Decathlon 设计系统用于 iOS 和 iPadOS 应用程序的库

网站

介绍

Decathlon 设计系统 是帮助我们的生态系统设计和开发一致性和高质量体验的框架。
对于其 数字章节,我们称之为 Vitamin。

安装

SPM

将维生素添加到包的依赖数组中

dependencies: [
  .package(url: "https://github.com/Decathlon/vitamin-ios.git", .exact("0.13.0")),
  // Any other dependencies...
],

然后,将维生素添加到依赖于维生素的任何目标的依赖数组中。
对于 SwiftUI

.target(name: "YourSwiftUITarget",
        dependencies: [
            .product(name: "VitaminSwiftUI", package: "vitamin-ios"),
            // Any other dependencies...
        ]),

对于 UIKit

.target(name: "YourUIKitTarget",
        dependencies: [
            .product(name: "Vitamin", package: "vitamin-ios"),
            // Any other dependencies...
        ]),

一个完整示例

let package = Package(
    name: "YourPackage",
    products: [
        // Your products
    ],
    dependencies: [
        .package(url: "https://github.com/Decathlon/vitamin-ios.git", .exact("0.13.0")),
        // Any other dependencies...
    ],
    targets: [
        // Your target
        .target(name: "YourUIKitTarget",
                dependencies: [
                    .product(name: "Vitamin", package: "vitamin-ios"),
                    // Any other dependencies...
                ]), 
        .target(name: "YourSwiftUITarget",
                dependencies: [
                    .product(name: "VitaminSwiftUI", package: "vitamin-ios"),
                    // Any other dependencies...
                ]),
    ]
)

Cocoapods

# for UIKitVersion
pod 'Vitamin', '= 0.13.0'

# for SwiftUI version
pod 'VitaminSwiftUI', = '0.13.0'

可用元素

此库提供两种元素类型:基础元素和组件。
基础元素是维生素设计系统的核心积木,组件是基于基础元素构建的高级元素。

基础元素

以下为可用的基础元素

元素 描述 文档
资源 可用于设计系统的一组图形资源。 UIKit SwiftUI
颜色 设计系统的语义和基础颜色。 UIKit SwiftUI
图标 可用于设计系统的一组图标。 UIKit SwiftUI
半径 适用于设计系统中任何视图的半径。 UIKit SwiftUI
阴影 适用于设计系统中任何视图的阴影。 UIKit SwiftUI
字体 在设计系统中可用的文本样式。 UIKit SwiftUI

组件

以下组件可用

组件 描述 文档
徽章 来自Vitamin设计系统的徽章。 UIKit SwiftUI
按钮 Vitamin设计系统中的不同按钮样式。 UIKit SwiftUI
进度条 Vitamin设计系统中的不同进度条样式。 UIKit
分段控制器 Vitamin设计系统的分段控制器。 UIKit
通知栏 Vitamin设计系统的通知栏。 UIKit
开关 Vitamin设计系统的开关。 UIKit
标签 Vitamin设计系统的标签。 UIKit
文本框 Vitamin设计系统中的不同文本框样式。 UIKit SwiftUI

特别感谢

感谢参与这些 vitamin-ios 库的贡献者(甚至在它们成为开源之前)💙

还要感谢Remix Icon,因为Vitamix图标是Decathlon的官方图标库,基于他们的开源图标库(Remix Design © 2020)。此原始库遵循Apache 2.0许可,并由Decathlon修改。了解更多

许可协议

Copyright 2021 Decathlon.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   https://apache.ac.cn/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.