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.
Files changed (93) hide show
  1. package/.browserslistrc +17 -0
  2. package/karma.conf.js +44 -0
  3. package/ng-package.json +10 -0
  4. package/package.json +3 -10
  5. package/src/assets/bloomandwild/variables.css +21 -13
  6. package/src/assets/bloomon/variables.css +21 -13
  7. package/src/assets/global/scss-breakpoints.scss +1 -1
  8. package/src/assets/global/typography.scss +4 -6
  9. package/src/assets/global/variables.css +5 -2
  10. package/src/lib/components/button/button.component.html +16 -0
  11. package/src/lib/components/button/button.component.scss +188 -0
  12. package/src/lib/components/button/button.component.spec.ts +25 -0
  13. package/src/lib/components/button/button.component.ts +95 -0
  14. package/src/lib/components/button/button.modifiers.scss +101 -0
  15. package/src/lib/components/button/button.ts +48 -0
  16. package/src/lib/components/icon/icon.component.html +5 -0
  17. package/src/lib/components/icon/icon.component.scss +5 -0
  18. package/src/lib/components/icon/icon.component.spec.ts +25 -0
  19. package/src/lib/components/icon/icon.component.ts +50 -0
  20. package/src/lib/components/icon/icon.ts +25 -0
  21. package/src/lib/components/layout/Layout.ts +64 -0
  22. package/src/lib/components/layout/_layout.scss +105 -0
  23. package/src/lib/components/layout/box/box.component.scss +124 -0
  24. package/src/lib/components/layout/box/box.component.ts +103 -0
  25. package/src/lib/components/layout/container/container.component.scss +66 -0
  26. package/src/lib/components/layout/container/container.component.ts +70 -0
  27. package/src/lib/components/layout/grid/grid.component.scss +162 -0
  28. package/src/lib/components/layout/grid/grid.component.ts +103 -0
  29. package/src/lib/components/layout/stack/stack.component.scss +60 -0
  30. package/src/lib/components/layout/stack/stack.component.ts +58 -0
  31. package/src/lib/components/text/text.component.html +1 -0
  32. package/src/lib/components/text/text.component.scss +33 -0
  33. package/src/lib/components/text/text.component.spec.ts +25 -0
  34. package/src/lib/components/text/text.component.ts +29 -0
  35. package/src/lib/components/text/text.ts +1 -0
  36. package/src/lib/oasys-lib.module.ts +42 -0
  37. package/src/lib/oasys-lib.service.spec.ts +16 -0
  38. package/src/lib/oasys-lib.service.ts +9 -0
  39. package/src/lib/services/token.service.ts +37 -0
  40. package/src/lib/services/window.service.ts +16 -0
  41. package/{public-api.d.ts → src/public-api.ts} +7 -1
  42. package/src/test.ts +27 -0
  43. package/tsconfig.lib.json +17 -0
  44. package/tsconfig.lib.prod.json +7 -0
  45. package/tsconfig.spec.json +17 -0
  46. package/bundles/oasys-lib.umd.js +0 -629
  47. package/bundles/oasys-lib.umd.js.map +0 -1
  48. package/esm2015/lib/components/button/button.component.js +0 -97
  49. package/esm2015/lib/components/button/button.js +0 -2
  50. package/esm2015/lib/components/icon/icon.component.js +0 -58
  51. package/esm2015/lib/components/icon/icon.js +0 -2
  52. package/esm2015/lib/components/layout/Layout.js +0 -2
  53. package/esm2015/lib/components/layout/box/box.component.js +0 -99
  54. package/esm2015/lib/components/layout/container/container.component.js +0 -81
  55. package/esm2015/lib/components/layout/grid/grid.component.js +0 -104
  56. package/esm2015/lib/components/layout/stack/stack.component.js +0 -65
  57. package/esm2015/lib/components/text/text.js +0 -2
  58. package/esm2015/lib/oasys-lib.module.js +0 -66
  59. package/esm2015/lib/services/token.service.js +0 -41
  60. package/esm2015/lib/services/window.service.js +0 -19
  61. package/esm2015/oasys-lib.js +0 -5
  62. package/esm2015/public-api.js +0 -11
  63. package/fesm2015/oasys-lib.js +0 -601
  64. package/fesm2015/oasys-lib.js.map +0 -1
  65. package/lib/components/button/button.component.d.ts +0 -32
  66. package/lib/components/button/button.component.d.ts.map +0 -1
  67. package/lib/components/button/button.d.ts +0 -18
  68. package/lib/components/button/button.d.ts.map +0 -1
  69. package/lib/components/icon/icon.component.d.ts +0 -26
  70. package/lib/components/icon/icon.component.d.ts.map +0 -1
  71. package/lib/components/icon/icon.d.ts +0 -3
  72. package/lib/components/icon/icon.d.ts.map +0 -1
  73. package/lib/components/layout/Layout.d.ts +0 -27
  74. package/lib/components/layout/Layout.d.ts.map +0 -1
  75. package/lib/components/layout/box/box.component.d.ts +0 -28
  76. package/lib/components/layout/box/box.component.d.ts.map +0 -1
  77. package/lib/components/layout/container/container.component.d.ts +0 -21
  78. package/lib/components/layout/container/container.component.d.ts.map +0 -1
  79. package/lib/components/layout/grid/grid.component.d.ts +0 -31
  80. package/lib/components/layout/grid/grid.component.d.ts.map +0 -1
  81. package/lib/components/layout/stack/stack.component.d.ts +0 -21
  82. package/lib/components/layout/stack/stack.component.d.ts.map +0 -1
  83. package/lib/components/text/text.d.ts +0 -2
  84. package/lib/components/text/text.d.ts.map +0 -1
  85. package/lib/oasys-lib.module.d.ts +0 -15
  86. package/lib/oasys-lib.module.d.ts.map +0 -1
  87. package/lib/services/token.service.d.ts +0 -12
  88. package/lib/services/token.service.d.ts.map +0 -1
  89. package/lib/services/window.service.d.ts +0 -7
  90. package/lib/services/window.service.d.ts.map +0 -1
  91. package/oasys-lib.d.ts +0 -6
  92. package/oasys-lib.d.ts.map +0 -1
  93. 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
+ }
@@ -0,0 +1,16 @@
1
+ import { Injectable } from '@angular/core';
2
+
3
+ function _window(): any {
4
+ return window;
5
+ }
6
+
7
+ @Injectable({
8
+ providedIn: 'root'
9
+ })
10
+ export class WindowService {
11
+
12
+ get nativeWindow(): any {
13
+ return _window();
14
+ }
15
+
16
+ }
@@ -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
- //# sourceMappingURL=public-api.d.ts.map
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,7 @@
1
+ /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
+ {
3
+ "extends": "./tsconfig.lib.json",
4
+ "compilerOptions": {
5
+ "declarationMap": false
6
+ }
7
+ }
@@ -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
+ }