ProductPromotion
Logo

Angular.JS

made by https://0x3d.site

GitHub - kirbydesign/designsystem: Kirby Design System
Kirby Design System. Contribute to kirbydesign/designsystem development by creating an account on GitHub.
Visit Site

GitHub - kirbydesign/designsystem: Kirby Design System

GitHub - kirbydesign/designsystem: Kirby Design System

Kirby Design System

npm npm npm

GitHub forks GitHub stars

About

Kirby Design System is a UX Component library implementing the Kirby Design Philosophy.

Kirby Components are built on top of Angular and can be used in Angular projects.

The Kirby Cookbook, containing samples, status of components etc. can be accessed from https://cookbook.kirby.design.

Table of Contents

Installation

Install through npm:

npm i @kirbydesign/designsystem

Include KirbyModule

NgModule based application

Import the KirbyModule in your AppModule :

import { KirbyModule } from '@kirbydesign/designsystem';

...

@NgModule({
    imports: [
        ...,
        KirbyModule
    ],
    ...
})
export class AppModule {}

Standalone application

Import providers from KirbyModule when bootstrapping your application:

import { importProvidersFrom } from '@angular/core';
import { KirbyModule } from '@kirbydesign/designsystem';

...

await bootstrapApplication(RootComponent, {
  providers: [
    ...,
    importProvidersFrom(KirbyModule)
  ]
});

Sass

Include the Kirby global styles in your app, e.g., in src/styles.scss:

@use '@kirbydesign/designsystem/scss/global-styles';

In each .scss file where you need to access the Sass utility functions from Kirby (e.g. colors or fonts) you must import the scss utilities:

@use '@kirbydesign/designsystem/scss/utils';

Generic Print Styles (Optional)

Kirby also provides a generic print stylesheet. It includes the basics. You most likely have to add local print styles specific to your app as well.

Import it into your app, e.g., in src/styles.scss or in your local print stylesheet if you have one:

@use '@kirbydesign/designsystem/scss/print';

Testing

To unit-test applications using Kirby's Components, we recommend importing one of the following modules:

  • When using jasmine: import { KirbyTestingModule } from '@kirbydesign/designsystem/testing-jasmine';
  • When using jest: import { KirbyTestingModule } from '@kirbydesign/designsystem/testing-jest';

Example:

import { KirbyTestingModule } from '@kirbydesign/designsystem/testing-jasmine';

describe('AppComponent', () => {
  beforeEach(async(() => {
    TestBed.configureTestingModule({
      imports: [KirbyTestingModule],
      declarations: [AppComponent]
    }).compileComponents();
  }));

  ...

});

For unit test performance reasons it's highly recommended to utilize these modules, since they provide a template-less implementation of the Kirby Components, but still translude content through <ng-content></ng-content> and provide @Input -decorated properties and @Output -decorated EventEmitter s, without having to reflow the DOM, execute component logic etc.

Icons

Kirby comes bundled with a default set of icons. Make sure the .svg files used by Kirby are copied to your output folder by adding the following to build > options > assets in angular.json :

{
  ...
  "build": {
    "options": {
      "assets": [
        ...,
        {
          "glob": "**/*.svg",
          "input": "node_modules/@kirbydesign/designsystem/icons/svg",
          "output": "./assets/kirby/icons/svg"
        },
        {
          "glob": "close.svg",
          "input": "node_modules/@kirbydesign/designsystem/icons/svg",
          "output": "./svg"
        },
        ...
      ],
    }
  }
}

It is possible to configure the path that the built-in icons are loaded from by providing the BUILT_IN_ICONS_URL injection token:

// In app providers:
{
  provide: BUILT_IN_ICONS_URL,
  useValue: 'https://example.org/1.0.1/kirby/icons/svg/'
}

Migration Guides

For details on migrating from earlier versions of Kirby see our Migration Guides.

Folder Structure

The folder structure of the repository is based on Nrwl's NX mono-repository project.

A basic walkthrough is outlined in the structure below:

@kirbydesign/designsystem
├── apps                    # Contains source code for applications
|  └── cookbook             # - Cookbook application (showcase and examples)
├── dist                    # Contains output files when building artifacts (for distribution)
|  ├── apps
|  └── libs
├── libs                    # Contains source code for libraries
|  └── designsystem         # - Actual implementation of library (designsystem)
├── scripts                 # Scripts for building artifacts
└── tools                   # Contains various tools
   ├── generate-mocks       # - CLI utility for generating mocks for `@kirbydesign/designsystem/testing-jasmine`
   |                        #   and `@kirbydesign/designsystem/testing-jest` entry points.
   ├── sass-to-ts           # - CLI and Webpack plugin for extract global variables from SASS to TS
   ├── schematics           # - Angular schematics

Scripts

Below is an overview of most widely used scripts, available for this project.
Use them in your terminal like: npm run <script> :

Command Description
start Starts the development server, providing a means of running the cookbook while developing
start:ios Builds the flows app and deploys it to an iOS device (real or simulated) using Capacitor
start:android Builds the flows app and deploys it to an Android device (real or simulated) using Capacitor
publish When run locally it produces a set of npm packages in dist/ that can be installed locally with npm install
storybook Opens up Storybook where component states are set up for snapshot testing with Chromatic

We use nx to run common tasks like building, linting and testing projects. This is done with npx nx <target name> <project name>, e.g. npx nx lint designsystem preferrably from the root of the workspace to ensure config paths are resolved correctly.

Contributing

If you wish to contribute new features, bug fixes or something third to the project have a look at the contribution guidelines.

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory