Skip to content

Commit

Permalink
chore: Tidy, reorganise and prepare repo
Browse files Browse the repository at this point in the history
docs: update changelog and documentation

feat(type): Add xSmall and conform to latest figma designs.
  • Loading branch information
thelukewalton committed Sep 11, 2023
1 parent f91e8ef commit 17b2299
Show file tree
Hide file tree
Showing 48 changed files with 809 additions and 720 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/onMerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
with:
files: |
**/*.dart
docs/*
custom-docs/*
**/*.yaml
**/*.yml
files_ignore: example/*
Expand All @@ -41,7 +41,7 @@ jobs:
- name: Run step if any *.js file(s) or any file in the static folder change
if: steps.changed-files-excluded.outputs.any_changed == 'true'
run: |
echo "One or more *.js file(s) or any file in the static folder but not in the doc folder has changed."
echo "One or more *.js file(s) or any file in the static folder but not in the custom-docs folder has changed."
echo "List all the files that have changed: ${{ steps.changed-files-excluded.outputs.all_changed_files }}"
- name: Change flutter version tag
uses: BentEngbers/flutter-change-version@v1.0.3
Expand Down Expand Up @@ -116,13 +116,13 @@ jobs:
env:
API_TOKEN_GITHUB: ${{ secrets.PAT }}
with:
source_file: "docs/"
source_file: "custom-docs/"
destination_repo: "zebratechnologies/zeta"
destination_folder: "./"
destination_branch: "flutter/${{ steps.read-version.outputs.version-number }}"
user_email: "github-actions@github.com"
user_name: "github-actions"
commit_message: "flutter docs"
commit_message: "flutter doc"
- name: Open Zeta PR
uses: thecanadianroot/open-pull-request-action@v1.0.3
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "PR" # TODO: Publish this as a reusable action
name: "PR"
on:
pull_request:

Expand All @@ -14,15 +14,15 @@ jobs:
fetch-depth: 0
ref: main
persist-credentials: false
- name: Get all changed *.dart, files in docs or pubspec.yaml
- name: Get all changed *.dart, files in custom-docs or pubspec.yaml
id: changed-files
uses: tj-actions/changed-files@v35
with:
base_sha: ${{ github.event.pull_request.base.sha }}
sha: ${{ github.event.pull_request.head.sha }}
files: |
**/*.dart
docs
custom-docs
pubspec.yaml
analyze:
runs-on: ubuntu-latest
Expand All @@ -49,7 +49,7 @@ jobs:
uses: tj-actions/branch-names@v5.1
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.10.x"
flutter-version: "3.13.x"
channel: "stable"
- name: Setup flutter
run: flutter pub get
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ migrate_working_dir/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
.vscode/settings.json

# Flutter/Dart/Pub related
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
Expand All @@ -31,4 +31,5 @@ build/

.vscode/settings.json
.flutter-plugins
.flutter-plugins-dependencies
.flutter-plugins-dependencies
**/.fvm/
2 changes: 2 additions & 0 deletions .pubignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
example/
custom_docs/
144 changes: 54 additions & 90 deletions CHANGELOG.md

Large diffs are not rendered by default.

58 changes: 58 additions & 0 deletions CODE_OF_CONDUCT
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.
27 changes: 27 additions & 0 deletions CONTRIBUTING
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`
50 changes: 35 additions & 15 deletions README.md
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)).

---
1 change: 0 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ linter:
avoid_types_on_closure_parameters: false
cascade_invocations: false
close_sinks: false
diagnostic_describe_all_properties: false
lines_longer_than_80_chars: false
omit_local_variable_types: false
prefer_constructors_over_static_methods: false
Expand Down
102 changes: 102 additions & 0 deletions custom_docs/components/Color/flutter.md
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.
44 changes: 0 additions & 44 deletions example/.gitignore

This file was deleted.

16 changes: 0 additions & 16 deletions example/README.md

This file was deleted.

Loading

0 comments on commit 17b2299

Please sign in to comment.