重要
此版本的 Vitamin 将不再进行演进,今后只接受错误修复。更多信息请点击这里。
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 |
Snackbar | 来自Vitamin设计系统的Snackbar。 | 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.