forked from ZebraDevs/zeta_flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Tidy, reorganise and prepare repo
docs: update changelog and documentation feat(type): Add xSmall and conform to latest figma designs.
- Loading branch information
1 parent
f91e8ef
commit 17b2299
Showing
48 changed files
with
809 additions
and
720 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
example/ | ||
custom_docs/ |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
|
||
# Contributor Covenant Code of Conduct | ||
|
||
## Our Pledge | ||
|
||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. | ||
|
||
## Our Standards | ||
|
||
Examples of behavior that contributes to a positive environment include: | ||
|
||
* Using welcoming and inclusive language | ||
* Being respectful of differing viewpoints and experiences | ||
* Gracefully accepting constructive criticism | ||
* Focusing on what is best for the community | ||
* Showing empathy towards other community members | ||
|
||
Examples of unacceptable behavior by participants include: | ||
|
||
* The use of sexualized language or imagery, and sexual attention or | ||
advances of any kind | ||
* Trolling, insulting or derogatory comments, and personal or political attacks | ||
* Public or private harassment | ||
* Publishing others' private information, such as a physical or email | ||
address, without their explicit permission | ||
* Other conduct which could reasonably be considered inappropriate in a | ||
professional setting | ||
|
||
## Our Responsibilities | ||
|
||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. | ||
|
||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. | ||
|
||
## Scope | ||
|
||
This Code of Conduct applies within all community spaces, and also applies when | ||
an individual is officially representing the community in public spaces. | ||
Examples of representing our community include using an official e-mail address, | ||
posting via an official social media account, or acting as an appointed | ||
representative at an online or offline event. | ||
Representation of a project may be further defined and clarified by project maintainers. | ||
|
||
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
reported to the community leaders responsible for enforcement at | ||
Devrel@zebra.com. | ||
All complaints will be reviewed and investigated promptly and fairly. | ||
The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. | ||
|
||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. | ||
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the Contributor Covenant, | ||
version 2.0, available at | ||
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Getting Involved | ||
|
||
Thank you for your interest in this project. We'd love to see your contributions. There are just few small guidelines you need to follow. | ||
Please note we have a code of conduct, please follow it in all your interactions with the project. | ||
|
||
## Opening an issue | ||
|
||
If you've noticed a bug or you have a suggestion for a new feature, please go ahead and open an issue in this project. Please do include as much information as possible. | ||
|
||
Please file issues before doing substantial work; this will ensure that others don't duplicate the work and that there's a chance to discuss any design issues. | ||
|
||
## Making a code change | ||
|
||
We're always open to pull requests, but these should be small and clearly described so that we can understand what you're trying to do. | ||
|
||
When you're ready to start coding, fork the needed repository to your own GitHub account and make your changes in a new branch. Once you're happy, open a pull request and explain what the change is and why you think we should include it in our project. | ||
|
||
## Code reviews | ||
|
||
All submissions, including submissions by project members, require review. We use GitHub pull requests (PRs) for this purpose. Consult [GitHub Help](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests) for more information on using pull requests. | ||
|
||
Before a PR can be reviewed, ensure you have done the following, and fixed any issues that may arise: | ||
|
||
- Ensure branch is up to date `git rebase main` | ||
- Check formatting: `flutter format .` | ||
- Run static analyses: `flutter analyze` | ||
- Run unit-tests: `flutter test` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,35 @@ | ||
<details> | ||
<summary>Zebra Repository Information</summary> | ||
<ul> | ||
<li> Zebra Business Unit : DMO - Innovation & Design</li> | ||
<li> Zebra Manager : ncvt73 </li> | ||
<li> Zebra Repo Admin: lwalton </li> | ||
<li> Zebra Jira Project ID: N/A </li> | ||
<li> Product: Zebra Design System (Zeta) - Flutter Component Library </li> | ||
<li> Topics: no_codeql </li> | ||
</ul> | ||
</details> | ||
|
||
# zeta-flutter | ||
|
||
Zebra Design System (Zeta) - Flutter Component Library | ||
# Zeta Flutter | ||
|
||
Zeta is the new, formal, standardized Zebra Design System based off the successes of ZDS (Zebra Design System). | ||
|
||
Note: This package is in pre-release, and so many aspects are incomplete. | ||
|
||
# Usage | ||
|
||
[Install zeta_flutter](https://pub.dev/packages/zeta_flutter/install) | ||
|
||
Zeta extends the use of Flutter's built in theming tools, and so to work correctly your app needs to be wrapped with the zeta theme as such: | ||
|
||
```dart | ||
@override | ||
Widget build(BuildContext context) { | ||
return Zeta( | ||
builder: (context, theme, colors) { | ||
return MaterialApp.router(theme: theme, routerConfig: router); | ||
}, | ||
); | ||
} | ||
``` | ||
|
||
This returns the Zeta theme and colors, which will be used across the app. Custom `ThemeData` and `ZetaColor` objects can be passed in to apply custom themes and colors. | ||
|
||
## Viewing the components | ||
|
||
To view examples of all the components in the library, you can run the example app in this repo or go to [Zeta](https://zeta-ds.web.app/) | ||
|
||
## Licensing | ||
|
||
This software is licensed with the MIT license (see [LICENSE](./LICENSE)). | ||
|
||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
## ZetaColors Usage | ||
|
||
To import ZetaColors into a Dart file: | ||
|
||
```dart | ||
import 'package:zeta_flutter/zeta_flutter.dart'; | ||
``` | ||
|
||
### Example | ||
|
||
ZetaColors should be an app-wide parameter, to ensure colors throughout an app stay consistent. As such, it should be created at the highest level of an app, from where it can be distributed. | ||
|
||
```dart | ||
import 'package:zeta_flutter/zeta_flutter.dart'; | ||
class MyApp extends StatelessWidget{ | ||
const MyApp({Key? key}) : super(key: key); | ||
@override | ||
Widget build(BuildContext context) { | ||
/// Build colors object with custom colors. | ||
final ZetaColors colors = ZetaColors( | ||
/// Add custom colors here. | ||
); | ||
/// Wrap whole app with [Zeta] to provide theming. | ||
return Zeta( | ||
colors: colors, | ||
builder: (BuildContext context, ThemeData theme, ZetaColors colors) => ZetaColorExample(), | ||
); | ||
} | ||
} | ||
class ZetaColorExample extends StatelessWidget{ | ||
const ZetaColorExample({Key? key}) : super(key: key); | ||
@override | ||
Widget build(BuildContext context) { | ||
final ZetaColors colors = ZetaColors.of(context); | ||
return Container( | ||
color: colors.red, | ||
); | ||
} | ||
} | ||
``` | ||
|
||
### ZetaColors | ||
|
||
ZetaColors provides a full range of colors to be used, with various modifiers to return colors based on function. | ||
|
||
The following colors are provided as `ZetaColorSwatch`: | ||
|
||
- primary | ||
- secondary | ||
- cool (grey) | ||
- warm (grey) | ||
- blue | ||
- red | ||
- green | ||
- orange | ||
- purple | ||
- yellow | ||
- teal | ||
- pink | ||
|
||
When creating a custom ZetaColors object, colors should be provided as a full `ZetaColorSwatch`, unless you want to use the default values, which are described in `ZetaColorBase`. | ||
|
||
ZetaColors has the following modifiers: | ||
|
||
- primary, onPrimary | ||
- secondary, onSecondary | ||
- positive, onPositive, negative, onNegative, warning, onWarning, info, onInfo | ||
- surface, onSurface, surfaceDisabled, surfaceHovered, surfaceSecondary, surfaceTertiary, surfaceSelectedHovered, surfaceSelected | ||
- background, onBackground | ||
- textDefault, textSubtle, textDisabled, textInverse, | ||
- borderDefault, borderSubtle, borderDisabled, borderSelected, | ||
- white, black | ||
- link, linkVisited, | ||
- textLightMode, textDarkMode | ||
|
||
Commonly, `ZetaColors.toColorScheme` should be used to create a color scheme for use with `MaterialApp`. | ||
|
||
### ZetaColorSwatch | ||
|
||
ZetaColorSwatch returns a swatch of colors with shades at 10, 20, 30, 40, 50, 60, 70, 80, 90 and 100 where the higher the value, the darker the color. | ||
|
||
ZetaColorSwatch has the following modifiers: | ||
|
||
- primary | ||
- icon | ||
- border, borderSubtle | ||
- surface | ||
- subtle | ||
- on | ||
- disabled | ||
|
||
ZetaColorSwatch can be generated from a single color, but this is not recommended as results may not look as expected, and will probably not conform to any accessability requirements. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.