oasys-lib 1.1.4 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.browserslistrc +17 -0
- package/karma.conf.js +44 -0
- package/ng-package.json +10 -0
- package/package.json +3 -10
- package/src/assets/bloomandwild/variables.css +21 -13
- package/src/assets/bloomon/variables.css +21 -13
- package/src/assets/global/scss-breakpoints.scss +1 -1
- package/src/assets/global/typography.scss +4 -6
- package/src/assets/global/variables.css +5 -2
- package/src/lib/components/button/button.component.html +16 -0
- package/src/lib/components/button/button.component.scss +188 -0
- package/src/lib/components/button/button.component.spec.ts +25 -0
- package/src/lib/components/button/button.component.ts +95 -0
- package/src/lib/components/button/button.modifiers.scss +101 -0
- package/src/lib/components/button/button.ts +48 -0
- package/src/lib/components/icon/icon.component.html +5 -0
- package/src/lib/components/icon/icon.component.scss +5 -0
- package/src/lib/components/icon/icon.component.spec.ts +25 -0
- package/src/lib/components/icon/icon.component.ts +50 -0
- package/src/lib/components/icon/icon.ts +25 -0
- package/src/lib/components/layout/Layout.ts +64 -0
- package/src/lib/components/layout/_layout.scss +105 -0
- package/src/lib/components/layout/box/box.component.scss +124 -0
- package/src/lib/components/layout/box/box.component.ts +103 -0
- package/src/lib/components/layout/container/container.component.scss +66 -0
- package/src/lib/components/layout/container/container.component.ts +70 -0
- package/src/lib/components/layout/grid/grid.component.scss +162 -0
- package/src/lib/components/layout/grid/grid.component.ts +103 -0
- package/src/lib/components/layout/stack/stack.component.scss +60 -0
- package/src/lib/components/layout/stack/stack.component.ts +58 -0
- package/src/lib/components/text/text.component.html +1 -0
- package/src/lib/components/text/text.component.scss +33 -0
- package/src/lib/components/text/text.component.spec.ts +25 -0
- package/src/lib/components/text/text.component.ts +29 -0
- package/src/lib/components/text/text.ts +1 -0
- package/src/lib/oasys-lib.module.ts +42 -0
- package/src/lib/oasys-lib.service.spec.ts +16 -0
- package/src/lib/oasys-lib.service.ts +9 -0
- package/src/lib/services/token.service.ts +37 -0
- package/src/lib/services/window.service.ts +16 -0
- package/{public-api.d.ts → src/public-api.ts} +7 -1
- package/src/test.ts +27 -0
- package/tsconfig.lib.json +17 -0
- package/tsconfig.lib.prod.json +7 -0
- package/tsconfig.spec.json +17 -0
- package/bundles/oasys-lib.umd.js +0 -629
- package/bundles/oasys-lib.umd.js.map +0 -1
- package/esm2015/lib/components/button/button.component.js +0 -97
- package/esm2015/lib/components/button/button.js +0 -2
- package/esm2015/lib/components/icon/icon.component.js +0 -58
- package/esm2015/lib/components/icon/icon.js +0 -2
- package/esm2015/lib/components/layout/Layout.js +0 -2
- package/esm2015/lib/components/layout/box/box.component.js +0 -99
- package/esm2015/lib/components/layout/container/container.component.js +0 -81
- package/esm2015/lib/components/layout/grid/grid.component.js +0 -104
- package/esm2015/lib/components/layout/stack/stack.component.js +0 -65
- package/esm2015/lib/components/text/text.js +0 -2
- package/esm2015/lib/oasys-lib.module.js +0 -66
- package/esm2015/lib/services/token.service.js +0 -41
- package/esm2015/lib/services/window.service.js +0 -19
- package/esm2015/oasys-lib.js +0 -5
- package/esm2015/public-api.js +0 -11
- package/fesm2015/oasys-lib.js +0 -601
- package/fesm2015/oasys-lib.js.map +0 -1
- package/lib/components/button/button.component.d.ts +0 -32
- package/lib/components/button/button.component.d.ts.map +0 -1
- package/lib/components/button/button.d.ts +0 -18
- package/lib/components/button/button.d.ts.map +0 -1
- package/lib/components/icon/icon.component.d.ts +0 -26
- package/lib/components/icon/icon.component.d.ts.map +0 -1
- package/lib/components/icon/icon.d.ts +0 -3
- package/lib/components/icon/icon.d.ts.map +0 -1
- package/lib/components/layout/Layout.d.ts +0 -27
- package/lib/components/layout/Layout.d.ts.map +0 -1
- package/lib/components/layout/box/box.component.d.ts +0 -28
- package/lib/components/layout/box/box.component.d.ts.map +0 -1
- package/lib/components/layout/container/container.component.d.ts +0 -21
- package/lib/components/layout/container/container.component.d.ts.map +0 -1
- package/lib/components/layout/grid/grid.component.d.ts +0 -31
- package/lib/components/layout/grid/grid.component.d.ts.map +0 -1
- package/lib/components/layout/stack/stack.component.d.ts +0 -21
- package/lib/components/layout/stack/stack.component.d.ts.map +0 -1
- package/lib/components/text/text.d.ts +0 -2
- package/lib/components/text/text.d.ts.map +0 -1
- package/lib/oasys-lib.module.d.ts +0 -15
- package/lib/oasys-lib.module.d.ts.map +0 -1
- package/lib/services/token.service.d.ts +0 -12
- package/lib/services/token.service.d.ts.map +0 -1
- package/lib/services/window.service.d.ts +0 -7
- package/lib/services/window.service.d.ts.map +0 -1
- package/oasys-lib.d.ts +0 -6
- package/oasys-lib.d.ts.map +0 -1
- package/public-api.d.ts.map +0 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { WindowService } from './window.service';
|
|
3
|
+
|
|
4
|
+
@Injectable({
|
|
5
|
+
providedIn: 'root'
|
|
6
|
+
})
|
|
7
|
+
export class TokenService {
|
|
8
|
+
|
|
9
|
+
brandCustomPropertyName: string = '--utility-brand-name';
|
|
10
|
+
|
|
11
|
+
constructor(private windowRef: WindowService){}
|
|
12
|
+
|
|
13
|
+
/*
|
|
14
|
+
Get the brand name for the currently enable custom property set (ie. /bloomon/variables.css)
|
|
15
|
+
Because variables are scoped via a selector (ie: ':root .bloomon {}')
|
|
16
|
+
we cannot get brand-specific custom properties programatically
|
|
17
|
+
|
|
18
|
+
Important: Ensure that the component requiring the brand name has locally scoped the custom property:
|
|
19
|
+
| ui-icon {
|
|
20
|
+
| --icon-component-brand: var(--utility-brand-name);
|
|
21
|
+
| }
|
|
22
|
+
*/
|
|
23
|
+
getBrandName(): string {
|
|
24
|
+
return this.getTokenValue(this.brandCustomPropertyName);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
getTokenValue(tokenName: string, element?: Element): string {
|
|
28
|
+
const rootElement = element || this.windowRef.nativeWindow.document.querySelector('[class*="brand-tokens"]');
|
|
29
|
+
if(!rootElement) {
|
|
30
|
+
return '';
|
|
31
|
+
}
|
|
32
|
+
return this.windowRef.nativeWindow.getComputedStyle(rootElement)
|
|
33
|
+
.getPropertyValue(tokenName)
|
|
34
|
+
.trim() || '';
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Public API Surface of oasys-lib
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
|
|
1
6
|
export * from './lib/oasys-lib.module';
|
|
7
|
+
|
|
2
8
|
export * from './lib/components/button/button.component';
|
|
3
9
|
export * from './lib/components/icon/icon.component';
|
|
4
10
|
export * from './lib/components/layout/box/box.component';
|
|
5
11
|
export * from './lib/components/layout/stack/stack.component';
|
|
6
12
|
export * from './lib/components/layout/grid/grid.component';
|
|
7
13
|
export * from './lib/components/layout/container/container.component';
|
|
8
|
-
|
|
14
|
+
|
package/src/test.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
|
2
|
+
|
|
3
|
+
import 'zone.js';
|
|
4
|
+
import 'zone.js/testing';
|
|
5
|
+
import { getTestBed } from '@angular/core/testing';
|
|
6
|
+
import {
|
|
7
|
+
BrowserDynamicTestingModule,
|
|
8
|
+
platformBrowserDynamicTesting
|
|
9
|
+
} from '@angular/platform-browser-dynamic/testing';
|
|
10
|
+
|
|
11
|
+
declare const require: {
|
|
12
|
+
context(path: string, deep?: boolean, filter?: RegExp): {
|
|
13
|
+
<T>(id: string): T;
|
|
14
|
+
keys(): string[];
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// First, initialize the Angular testing environment.
|
|
19
|
+
// getTestBed().initTestEnvironment(
|
|
20
|
+
// BrowserDynamicTestingModule,
|
|
21
|
+
// platformBrowserDynamicTesting(),
|
|
22
|
+
// );
|
|
23
|
+
|
|
24
|
+
// Then we find all the tests.
|
|
25
|
+
const context = require.context('./', true, /\.spec\.ts$/);
|
|
26
|
+
// And load the modules.
|
|
27
|
+
context.keys().map(context);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
{
|
|
3
|
+
"extends": "../../tsconfig.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"outDir": "../../out-tsc/lib",
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"declarationMap": true,
|
|
8
|
+
"inlineSources": true,
|
|
9
|
+
"types": [],
|
|
10
|
+
"strictPropertyInitialization": false,
|
|
11
|
+
"preserveSymlinks": true
|
|
12
|
+
},
|
|
13
|
+
"exclude": [
|
|
14
|
+
"src/test.ts",
|
|
15
|
+
"**/*.spec.ts"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
+
{
|
|
3
|
+
"extends": "../../tsconfig.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"outDir": "../../out-tsc/spec",
|
|
6
|
+
"types": [
|
|
7
|
+
"jasmine"
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"src/test.ts"
|
|
12
|
+
],
|
|
13
|
+
"include": [
|
|
14
|
+
"**/*.spec.ts",
|
|
15
|
+
"**/*.d.ts"
|
|
16
|
+
]
|
|
17
|
+
}
|