Skip to content

Commit

Permalink
feat: core tokens mapping for clr-ui
Browse files Browse the repository at this point in the history
Signed-off-by: stsogoo <stsogoo@vmware.com>
  • Loading branch information
Shijir committed Jan 7, 2022
1 parent 0695d3b commit ef164e7
Show file tree
Hide file tree
Showing 45 changed files with 11,617 additions and 0 deletions.
17 changes: 17 additions & 0 deletions apps/shim-clr-ui/.browserslistrc
@@ -0,0 +1,17 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support

# You can see what browsers were selected by your queries by running:
# npx browserslist

last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
16 changes: 16 additions & 0 deletions apps/shim-clr-ui/.editorconfig
@@ -0,0 +1,16 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.ts]
quote_type = single

[*.md]
max_line_length = off
trim_trailing_whitespace = false
45 changes: 45 additions & 0 deletions apps/shim-clr-ui/.gitignore
@@ -0,0 +1,45 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/out-tsc
# Only exists if Bazel was run
/bazel-out

# dependencies
/node_modules

# profiling files
chrome-profiler-events*.json

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings

# System Files
.DS_Store
Thumbs.db
27 changes: 27 additions & 0 deletions apps/shim-clr-ui/README.md
@@ -0,0 +1,27 @@
# ClrAngularApp

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 12.1.2.

## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
125 changes: 125 additions & 0 deletions apps/shim-clr-ui/angular.json
@@ -0,0 +1,125 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"cli": {
"analytics": false
},
"version": 1,
"newProjectRoot": "projects",
"projects": {
"core-angular-cli": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
},
"@schematics/angular:application": {
"strict": true
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/core-angular-cli",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": ["src/favicon.ico", "src/assets"],
"styles": [
"node_modules/@cds/core/global.min.css",
"node_modules/@cds/core/styles/module.shims.min.css",
"node_modules/@cds/city/css/bundles/default.min.css",
"node_modules/@clr/ui/clr-ui.min.css",

"node_modules/@cds/core/styles/module.tokens.min.css",
"node_modules/@cds/core/styles/shim.clr-ui.min.css",
"node_modules/@cds/core/styles/theme.dark.min.css",
"src/styles.scss"
],
"scripts": []
},
"configurations": {
"production": {
"sourceMap": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"outputHashing": "all",
"optimization": {
"scripts": true,
"fonts": {
"inline": true
},
"styles": {
"minify": true,
"inlineCritical": false
}
}
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "core-angular-cli:build:production"
},
"development": {
"browserTarget": "core-angular-cli:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "core-angular-cli:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"inlineStyleLanguage": "scss",
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.scss"],
"scripts": []
}
}
}
}
},
"defaultProject": "core-angular-cli"
}
41 changes: 41 additions & 0 deletions apps/shim-clr-ui/karma.conf.js
@@ -0,0 +1,41 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma'),
],
client: {
jasmine: {
// you can add configuration options for Jasmine here
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
// for example, you can disable the random execution with `random: false`
// or set a specific seed with `seed: 4321`
},
clearContext: false, // leave Jasmine Spec Runner output visible in browser
},
jasmineHtmlReporter: {
suppressAll: true, // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage/core-angular-cli'),
subdir: '.',
reporters: [{ type: 'html' }, { type: 'text-summary' }],
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true,
});
};
45 changes: 45 additions & 0 deletions apps/shim-clr-ui/package.json
@@ -0,0 +1,45 @@
{
"name": "shim-clr-ui",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"@angular/animations": "~12.1.2",
"@angular/common": "~12.1.2",
"@angular/compiler": "~12.1.2",
"@angular/core": "~12.1.2",
"@angular/forms": "~12.1.2",
"@angular/platform-browser": "~12.1.2",
"@angular/platform-browser-dynamic": "~12.1.2",
"@angular/router": "~12.1.2",
"@cds/angular": "../../dist/angular",
"@cds/city": "^1.1.0",
"@cds/core": "../../dist/core",
"@clr/angular": "^12.0.8",
"@clr/ui": "^12.0.8",
"modern-normalize": "^1.1.0",
"rxjs": "~6.6.0",
"tslib": "^2.2.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~12.1.2",
"@angular/cli": "~12.1.2",
"@angular/compiler-cli": "~12.1.2",
"@types/jasmine": "~3.8.0",
"@types/node": "^12.11.1",
"jasmine-core": "~3.8.0",
"karma": "~6.3.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "~1.7.0",
"typescript": "~4.3.2"
}
}
@@ -0,0 +1,32 @@
<h3 cds-layout="m-t:none m-b:md">Accordion</h3>

<div cds-layout="m-y:md">
<clr-accordion clrAccordionMultiPanel="true">
<clr-accordion-panel [(clrAccordionPanelOpen)]="stepOpen">
<clr-accordion-title>Step 1</clr-accordion-title>
<clr-accordion-description
>The full license information can be found in LICENSE in the root directory.</clr-accordion-description
>
<clr-accordion-content *clrIfExpanded>Content 1</clr-accordion-content>
</clr-accordion-panel>

<clr-accordion-panel [clrAccordionPanelOpen]="true">
<clr-accordion-title>Step 2</clr-accordion-title>
<clr-accordion-description
>The full license information can be found in LICENSE in the root directory.</clr-accordion-description
>
<clr-accordion-content *clrIfExpanded>Content 2</clr-accordion-content>
</clr-accordion-panel>

<clr-accordion-panel [clrAccordionPanelDisabled]="disableThirdPanel">
<clr-accordion-title>Step 3</clr-accordion-title>
<clr-accordion-description
><span *ngIf="disableThirdPanel">The panel is currently disabled.</span
><span *ngIf="!disableThirdPanel"
>The full license information can be found in LICENSE in the root directory.</span
>
</clr-accordion-description>
<clr-accordion-content *clrIfExpanded>Content 3</clr-accordion-content>
</clr-accordion-panel>
</clr-accordion>
</div>
@@ -0,0 +1,14 @@
import { Component } from '@angular/core';

@Component({
selector: 'app-accordion-demo',
templateUrl: './accordion-demo.component.html',
})
export class AccordionDemoComponent {
stepOpen = true;
disableThirdPanel = true;

change(event: any) {
console.log('Accordion Changed', event);
}
}
26 changes: 26 additions & 0 deletions apps/shim-clr-ui/src/app/app-routing.module.ts
@@ -0,0 +1,26 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { AccordionDemoComponent } from './accordion-demo/accordion-demo.component';
import { ComboboxDemoComponent } from './combobox-demo/combobox-demo.component';
import { DatagridDemoComponent } from './datagrid-demo/datagrid-demo.component';
import { ModalDemoComponent } from './modal-demo/modal-demo.component';
import { OverviewComponent } from './overview/overview.component';
import { StepperDemoComponent } from './stepper-demo/stepper-demo.component';
import { WizardDemoComponent } from './wizard-demo/wizard-demo.component';

const routes: Routes = [
{ path: 'overview', component: OverviewComponent },
{ path: 'accordion', component: AccordionDemoComponent },
{ path: 'combobox', component: ComboboxDemoComponent },
{ path: 'datagrid', component: DatagridDemoComponent },
{ path: 'modal', component: ModalDemoComponent },
{ path: 'stepper', component: StepperDemoComponent },
{ path: 'wizard', component: WizardDemoComponent },
{ path: '', redirectTo: '/overview', pathMatch: 'full' },
];

@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule],
})
export class AppRoutingModule {}

0 comments on commit ef164e7

Please sign in to comment.