@cuby-ui/core 0.0.16 → 0.0.17

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 (37) hide show
  1. package/components/alert/alert.module.d.ts +1 -1
  2. package/components/banner/banner.component.d.ts +17 -0
  3. package/components/banner/banner.module.d.ts +10 -0
  4. package/components/banner/banner.options.d.ts +13 -0
  5. package/components/banner/index.d.ts +3 -0
  6. package/components/index.d.ts +2 -0
  7. package/components/root/index.d.ts +2 -0
  8. package/components/root/root.component.d.ts +5 -0
  9. package/components/root/root.module.d.ts +10 -0
  10. package/esm2020/components/alert/alert.component.mjs +5 -4
  11. package/esm2020/components/alert/alert.module.mjs +3 -1
  12. package/esm2020/components/alert/alerts.component.mjs +2 -2
  13. package/esm2020/components/banner/banner.component.mjs +61 -0
  14. package/esm2020/components/banner/banner.module.mjs +28 -0
  15. package/esm2020/components/banner/banner.options.mjs +6 -0
  16. package/esm2020/components/banner/index.mjs +4 -0
  17. package/esm2020/components/editor/editor.component.mjs +2 -1
  18. package/esm2020/components/index.mjs +3 -1
  19. package/esm2020/components/notification/notification.component.mjs +2 -2
  20. package/esm2020/components/root/index.mjs +3 -0
  21. package/esm2020/components/root/root.component.mjs +13 -0
  22. package/esm2020/components/root/root.module.mjs +28 -0
  23. package/esm2020/index.mjs +2 -1
  24. package/esm2020/services/index.mjs +2 -0
  25. package/esm2020/services/theme.options.mjs +6 -0
  26. package/esm2020/services/theme.service.mjs +30 -0
  27. package/fesm2015/cuby-ui-core.mjs +154 -8
  28. package/fesm2015/cuby-ui-core.mjs.map +1 -1
  29. package/fesm2020/cuby-ui-core.mjs +154 -8
  30. package/fesm2020/cuby-ui-core.mjs.map +1 -1
  31. package/index.d.ts +1 -0
  32. package/package.json +3 -3
  33. package/services/index.d.ts +1 -0
  34. package/services/theme.options.d.ts +5 -0
  35. package/services/theme.service.d.ts +12 -0
  36. package/styles/theme.scss +12 -1
  37. package/styles/variables/colors.scss +9 -1
@@ -5,7 +5,7 @@ import { CommonModule, DOCUMENT } from '@angular/common';
5
5
  import { DomSanitizer } from '@angular/platform-browser';
6
6
  import { cuiIsIcon, CUI_ICONS } from '@cuby-ui/icons';
7
7
  import * as i2 from '@cuby-ui/cdk';
8
- import { cuiCreateToken, cuiCreateTokenFromFactory, CuiDestroyService, CuiFilterPipe, CuiPopoverService, cuiProvide, CuiAutoResizingDirective } from '@cuby-ui/cdk';
8
+ import { cuiCreateToken, cuiCreateTokenFromFactory, CuiDestroyService, CuiFilterPipe, CuiPopoverService, cuiProvide, CuiAutoResizingDirective, CUI_LOCAL_STORAGE } from '@cuby-ui/cdk';
9
9
  import { BehaviorSubject, takeUntil } from 'rxjs';
10
10
  import * as i2$1 from '@angular/forms';
11
11
  import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
@@ -311,10 +311,10 @@ class CuiNotificationComponent {
311
311
  }
312
312
  }
313
313
  CuiNotificationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiNotificationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
314
- CuiNotificationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CuiNotificationComponent, selector: "cui-notification", inputs: { status: "status", isCloseable: "isCloseable" }, outputs: { closed: "closed" }, host: { properties: { "attr.data-status": "this.status" } }, ngImport: i0, template: "<cui-svg\n *ngIf=\"ICON_OPTIONS[status] as iconOption\"\n [icon]=\"iconOption.icon\"\n [color]=\"iconOption.color\"\n></cui-svg>\n<div class=\"c-content\">\n <ng-content></ng-content>\n</div>\n<button\n *ngIf=\"isCloseable\"\n cuiButton\n appearance=\"ghost\"\n size=\"xxs\"\n icon=\"cuiIconX\"\n (click)=\"onClose()\"\n></button>\n", styles: [":host{padding:16px;font-weight:400;font-size:14px;line-height:20px;display:flex;align-items:flex-start;border-radius:12px;background:var(--dark-gray-30);color:var(--cui-gray-0);font-family:var(--cui-main-font)}:host-context([cuiTheme=dark])[data-status=info]{background:var(--cui-blue-900)}:host-context([cuiTheme=dark])[data-status=success]{background:var(--cui-green-900)}:host-context([cuiTheme=dark])[data-status=alert]{background:var(--cui-yellow-900)}:host-context([cuiTheme=dark])[data-status=error]{background:var(--cui-red-900)}.c-content{flex:1;margin-left:12px;margin-right:16px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CuiSvgComponent, selector: "cui-svg[icon]", inputs: ["width", "height", "strokeWidth", "color", "icon"] }, { kind: "component", type: CuiButtonComponent, selector: "button[cuiButton], a[cuiButton]", inputs: ["shape", "disabled", "isLoaderShown", "icon", "iconRight", "appearance", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
314
+ CuiNotificationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CuiNotificationComponent, selector: "cui-notification", inputs: { status: "status", isCloseable: "isCloseable" }, outputs: { closed: "closed" }, host: { properties: { "attr.data-status": "this.status" } }, ngImport: i0, template: "<cui-svg\n *ngIf=\"ICON_OPTIONS[status] as iconOption\"\n [icon]=\"iconOption.icon\"\n [color]=\"iconOption.color\"\n></cui-svg>\n<div class=\"c-content\">\n <ng-content></ng-content>\n</div>\n<button\n *ngIf=\"isCloseable\"\n cuiButton\n appearance=\"ghost\"\n size=\"xxs\"\n icon=\"cuiIconX\"\n (click)=\"onClose()\"\n></button>\n", styles: [":host{padding:16px;font-weight:400;font-size:14px;line-height:20px;display:flex;align-items:flex-start;border-radius:12px;background:var(--cui-dark-gray-30);color:var(--cui-gray-0);font-family:var(--cui-main-font)}:host-context([cuiTheme=dark])[data-status=info]{background:var(--cui-blue-900)}:host-context([cuiTheme=dark])[data-status=success]{background:var(--cui-green-900)}:host-context([cuiTheme=dark])[data-status=alert]{background:var(--cui-yellow-900)}:host-context([cuiTheme=dark])[data-status=error]{background:var(--cui-red-900)}.c-content{flex:1;margin-left:12px;margin-right:16px;overflow-wrap:anywhere}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CuiSvgComponent, selector: "cui-svg[icon]", inputs: ["width", "height", "strokeWidth", "color", "icon"] }, { kind: "component", type: CuiButtonComponent, selector: "button[cuiButton], a[cuiButton]", inputs: ["shape", "disabled", "isLoaderShown", "icon", "iconRight", "appearance", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
315
315
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiNotificationComponent, decorators: [{
316
316
  type: Component,
317
- args: [{ selector: 'cui-notification', changeDetection: ChangeDetectionStrategy.OnPush, template: "<cui-svg\n *ngIf=\"ICON_OPTIONS[status] as iconOption\"\n [icon]=\"iconOption.icon\"\n [color]=\"iconOption.color\"\n></cui-svg>\n<div class=\"c-content\">\n <ng-content></ng-content>\n</div>\n<button\n *ngIf=\"isCloseable\"\n cuiButton\n appearance=\"ghost\"\n size=\"xxs\"\n icon=\"cuiIconX\"\n (click)=\"onClose()\"\n></button>\n", styles: [":host{padding:16px;font-weight:400;font-size:14px;line-height:20px;display:flex;align-items:flex-start;border-radius:12px;background:var(--dark-gray-30);color:var(--cui-gray-0);font-family:var(--cui-main-font)}:host-context([cuiTheme=dark])[data-status=info]{background:var(--cui-blue-900)}:host-context([cuiTheme=dark])[data-status=success]{background:var(--cui-green-900)}:host-context([cuiTheme=dark])[data-status=alert]{background:var(--cui-yellow-900)}:host-context([cuiTheme=dark])[data-status=error]{background:var(--cui-red-900)}.c-content{flex:1;margin-left:12px;margin-right:16px}\n"] }]
317
+ args: [{ selector: 'cui-notification', changeDetection: ChangeDetectionStrategy.OnPush, template: "<cui-svg\n *ngIf=\"ICON_OPTIONS[status] as iconOption\"\n [icon]=\"iconOption.icon\"\n [color]=\"iconOption.color\"\n></cui-svg>\n<div class=\"c-content\">\n <ng-content></ng-content>\n</div>\n<button\n *ngIf=\"isCloseable\"\n cuiButton\n appearance=\"ghost\"\n size=\"xxs\"\n icon=\"cuiIconX\"\n (click)=\"onClose()\"\n></button>\n", styles: [":host{padding:16px;font-weight:400;font-size:14px;line-height:20px;display:flex;align-items:flex-start;border-radius:12px;background:var(--cui-dark-gray-30);color:var(--cui-gray-0);font-family:var(--cui-main-font)}:host-context([cuiTheme=dark])[data-status=info]{background:var(--cui-blue-900)}:host-context([cuiTheme=dark])[data-status=success]{background:var(--cui-green-900)}:host-context([cuiTheme=dark])[data-status=alert]{background:var(--cui-yellow-900)}:host-context([cuiTheme=dark])[data-status=error]{background:var(--cui-red-900)}.c-content{flex:1;margin-left:12px;margin-right:16px;overflow-wrap:anywhere}\n"] }]
318
318
  }], propDecorators: { status: [{
319
319
  type: Input
320
320
  }, {
@@ -348,10 +348,10 @@ class CuiAlertComponent {
348
348
  }
349
349
  }
350
350
  CuiAlertComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiAlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
351
- CuiAlertComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CuiAlertComponent, selector: "cui-alert", host: { properties: { "attr.data-resizing": "this.resizing" } }, ngImport: i0, template: "<cui-notification\n [status]=\"context.status\"\n [isCloseable]=\"context.isCloseable\"\n (closed)=\"onClosed()\"\n>\n <h2 class=\"c-heading\">Title</h2>\n {{ this.context.content }}\n</cui-notification>\n", styles: [":host{max-width:470px}:host[data-resizing=hug]{width:-moz-fit-content;width:fit-content}:host[data-resizing=fixed]{width:470px}.c-heading{font-weight:500;font-size:14px;line-height:20px;margin:0 0 8px}\n"], dependencies: [{ kind: "component", type: CuiNotificationComponent, selector: "cui-notification", inputs: ["status", "isCloseable"], outputs: ["closed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
351
+ CuiAlertComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CuiAlertComponent, selector: "cui-alert", host: { properties: { "attr.data-resizing": "this.resizing" } }, ngImport: i0, template: "<cui-notification\n [status]=\"context.status\"\n [isCloseable]=\"context.isCloseable\"\n (closed)=\"onClosed()\"\n>\n <h2\n *ngIf=\"context.label\"\n class=\"c-heading\"\n >\n {{ context.label }}\n </h2>\n {{ context.content }}\n</cui-notification>\n", styles: [":host{max-width:470px}:host[data-resizing=hug]{width:-moz-fit-content;width:fit-content}:host[data-resizing=fixed]{width:470px}.c-heading{font-weight:500;font-size:14px;line-height:20px;margin:0 0 8px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CuiNotificationComponent, selector: "cui-notification", inputs: ["status", "isCloseable"], outputs: ["closed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
352
352
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiAlertComponent, decorators: [{
353
353
  type: Component,
354
- args: [{ selector: 'cui-alert', changeDetection: ChangeDetectionStrategy.OnPush, template: "<cui-notification\n [status]=\"context.status\"\n [isCloseable]=\"context.isCloseable\"\n (closed)=\"onClosed()\"\n>\n <h2 class=\"c-heading\">Title</h2>\n {{ this.context.content }}\n</cui-notification>\n", styles: [":host{max-width:470px}:host[data-resizing=hug]{width:-moz-fit-content;width:fit-content}:host[data-resizing=fixed]{width:470px}.c-heading{font-weight:500;font-size:14px;line-height:20px;margin:0 0 8px}\n"] }]
354
+ args: [{ selector: 'cui-alert', changeDetection: ChangeDetectionStrategy.OnPush, template: "<cui-notification\n [status]=\"context.status\"\n [isCloseable]=\"context.isCloseable\"\n (closed)=\"onClosed()\"\n>\n <h2\n *ngIf=\"context.label\"\n class=\"c-heading\"\n >\n {{ context.label }}\n </h2>\n {{ context.content }}\n</cui-notification>\n", styles: [":host{max-width:470px}:host[data-resizing=hug]{width:-moz-fit-content;width:fit-content}:host[data-resizing=fixed]{width:470px}.c-heading{font-weight:500;font-size:14px;line-height:20px;margin:0 0 8px}\n"] }]
355
355
  }], propDecorators: { resizing: [{
356
356
  type: HostBinding,
357
357
  args: ['attr.data-resizing']
@@ -380,10 +380,10 @@ class CuiAlertsComponent {
380
380
  }
381
381
  }
382
382
  CuiAlertsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiAlertsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
383
- CuiAlertsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CuiAlertsComponent, selector: "cui-alerts", providers: [CuiDestroyService], ngImport: i0, template: "<ng-container *ngIf=\"alerts$ | async as alerts\">\n <div class=\"c-wrapper c-wrapper_position_center\">\n <ng-container *ngFor=\"let alert of alerts | cuiFilter: alertsMatcher: 'center'; let i = index; trackBy: trackByFn\">\n <ng-container *ngComponentOutlet=\"alert.component; injector: alertInjectors[i]\"></ng-container>\n </ng-container>\n </div>\n <div class=\"c-wrapper c-wrapper_position_right\">\n <ng-container *ngFor=\"let alert of alerts | cuiFilter: alertsMatcher: 'right'; let i = index; trackBy: trackByFn\">\n <ng-container *ngComponentOutlet=\"alert.component; injector: alertInjectors[i]\"></ng-container>\n </ng-container>\n </div>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column;position:fixed;right:20px;bottom:20px}.c-wrapper{position:fixed;bottom:20px;display:flex;flex-direction:column;gap:16px}.c-wrapper_position_center{left:50%;transform:translate(-50%)}.c-wrapper_position_right{right:20px}\n"], dependencies: [{ kind: "directive", type: i1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.CuiFilterPipe, name: "cuiFilter" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
383
+ CuiAlertsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CuiAlertsComponent, selector: "cui-alerts", providers: [CuiDestroyService], ngImport: i0, template: "<ng-container *ngIf=\"alerts$ | async as alerts\">\n <div class=\"c-wrapper c-wrapper_position_center\">\n <ng-container *ngFor=\"let alert of alerts | cuiFilter: alertsMatcher: 'center'; let i = index; trackBy: trackByFn\">\n <ng-container *ngComponentOutlet=\"alert.component; injector: alertInjectors[i]\"></ng-container>\n </ng-container>\n </div>\n <div class=\"c-wrapper c-wrapper_position_right\">\n <ng-container *ngFor=\"let alert of alerts | cuiFilter: alertsMatcher: 'right'; let i = index; trackBy: trackByFn\">\n <ng-container *ngComponentOutlet=\"alert.component; injector: alertInjectors[i]\"></ng-container>\n </ng-container>\n </div>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column;position:fixed;right:20px;bottom:20px}.c-wrapper{position:fixed;bottom:20px;display:flex;flex-direction:column;gap:16px}.c-wrapper_position_center{align-items:center;left:50%;transform:translate(-50%)}.c-wrapper_position_right{align-items:flex-end;right:20px}\n"], dependencies: [{ kind: "directive", type: i1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.CuiFilterPipe, name: "cuiFilter" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
384
384
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiAlertsComponent, decorators: [{
385
385
  type: Component,
386
- args: [{ selector: 'cui-alerts', changeDetection: ChangeDetectionStrategy.OnPush, providers: [CuiDestroyService], template: "<ng-container *ngIf=\"alerts$ | async as alerts\">\n <div class=\"c-wrapper c-wrapper_position_center\">\n <ng-container *ngFor=\"let alert of alerts | cuiFilter: alertsMatcher: 'center'; let i = index; trackBy: trackByFn\">\n <ng-container *ngComponentOutlet=\"alert.component; injector: alertInjectors[i]\"></ng-container>\n </ng-container>\n </div>\n <div class=\"c-wrapper c-wrapper_position_right\">\n <ng-container *ngFor=\"let alert of alerts | cuiFilter: alertsMatcher: 'right'; let i = index; trackBy: trackByFn\">\n <ng-container *ngComponentOutlet=\"alert.component; injector: alertInjectors[i]\"></ng-container>\n </ng-container>\n </div>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column;position:fixed;right:20px;bottom:20px}.c-wrapper{position:fixed;bottom:20px;display:flex;flex-direction:column;gap:16px}.c-wrapper_position_center{left:50%;transform:translate(-50%)}.c-wrapper_position_right{right:20px}\n"] }]
386
+ args: [{ selector: 'cui-alerts', changeDetection: ChangeDetectionStrategy.OnPush, providers: [CuiDestroyService], template: "<ng-container *ngIf=\"alerts$ | async as alerts\">\n <div class=\"c-wrapper c-wrapper_position_center\">\n <ng-container *ngFor=\"let alert of alerts | cuiFilter: alertsMatcher: 'center'; let i = index; trackBy: trackByFn\">\n <ng-container *ngComponentOutlet=\"alert.component; injector: alertInjectors[i]\"></ng-container>\n </ng-container>\n </div>\n <div class=\"c-wrapper c-wrapper_position_right\">\n <ng-container *ngFor=\"let alert of alerts | cuiFilter: alertsMatcher: 'right'; let i = index; trackBy: trackByFn\">\n <ng-container *ngComponentOutlet=\"alert.component; injector: alertInjectors[i]\"></ng-container>\n </ng-container>\n </div>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column;position:fixed;right:20px;bottom:20px}.c-wrapper{position:fixed;bottom:20px;display:flex;flex-direction:column;gap:16px}.c-wrapper_position_center{align-items:center;left:50%;transform:translate(-50%)}.c-wrapper_position_right{align-items:flex-end;right:20px}\n"] }]
387
387
  }] });
388
388
 
389
389
  class CuiNotificationModule {
@@ -415,6 +415,7 @@ CuiAlertModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version:
415
415
  CuiAlertsComponent], imports: [CommonModule,
416
416
  CuiFilterPipe,
417
417
  CuiNotificationModule], exports: [CuiAlertComponent,
418
+ CuiAlertComponent,
418
419
  CuiAlertsComponent] });
419
420
  CuiAlertModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiAlertModule, imports: [CommonModule,
420
421
  CuiNotificationModule] });
@@ -431,6 +432,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
431
432
  CuiAlertsComponent
432
433
  ],
433
434
  exports: [
435
+ CuiAlertComponent,
434
436
  CuiAlertComponent,
435
437
  CuiAlertsComponent
436
438
  ]
@@ -449,6 +451,88 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
449
451
  }]
450
452
  }] });
451
453
 
454
+ const CUI_BANNER_DEFAULT_OPTIONS = {
455
+ status: 'info'
456
+ };
457
+ const CUI_BANNER_OPTIONS = cuiCreateToken(CUI_BANNER_DEFAULT_OPTIONS);
458
+
459
+ class CuiBannerComponent {
460
+ constructor() {
461
+ this.cuiBannerOptions = inject(CUI_BANNER_OPTIONS);
462
+ this.ICON_OPTIONS = {
463
+ info: {
464
+ icon: 'cuiIconInfo',
465
+ color: 'var(--c-info-color)'
466
+ },
467
+ success: {
468
+ icon: 'cuiIconCheckCircle',
469
+ color: 'var(--cui-green-500)'
470
+ },
471
+ alert: {
472
+ icon: 'cuiIconAlertTriangle',
473
+ color: 'var(--c-alert-color)'
474
+ },
475
+ error: {
476
+ icon: 'cuiIconXCircle',
477
+ color: 'var(--cui-red-500)'
478
+ },
479
+ };
480
+ this.status = this.cuiBannerOptions.status;
481
+ this.isCloseable = true;
482
+ this.actionButtonClicked = new EventEmitter();
483
+ this.closed = new EventEmitter();
484
+ }
485
+ onAction() {
486
+ this.actionButtonClicked.emit();
487
+ }
488
+ onClose() {
489
+ this.closed.emit();
490
+ }
491
+ }
492
+ CuiBannerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiBannerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
493
+ CuiBannerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CuiBannerComponent, selector: "cui-banner", inputs: { status: "status", isCloseable: "isCloseable", label: "label", actionButtonText: "actionButtonText" }, outputs: { actionButtonClicked: "actionButtonClicked", closed: "closed" }, host: { properties: { "attr.data-status": "this.status" } }, ngImport: i0, template: "<cui-svg\n *ngIf=\"ICON_OPTIONS[status] as iconOption\"\n [icon]=\"iconOption.icon\"\n [color]=\"iconOption.color\"\n class=\"c-icon\"\n></cui-svg>\n<div class=\"c-wrapper\">\n <h2\n *ngIf=\"label\"\n class=\"c-heading\"\n >\n {{ label }}\n </h2>\n <ng-content></ng-content>\n <!-- TODO: \u0416\u0434\u0443 \u0442\u0451\u043C\u043D\u0443\u044E \u0442\u0435\u043C\u0443 \u043A\u043D\u043E\u043F\u043E\u043A -->\n <button\n cuiButton\n *ngIf=\"actionButtonText\"\n appearance=\"link\"\n (click)=\"onAction()\"\n >\n {{ actionButtonText }}\n </button>\n</div>\n<button\n *ngIf=\"isCloseable\"\n cuiButton\n appearance=\"ghost\"\n size=\"xxs\"\n icon=\"cuiIconX\"\n (click)=\"onClose()\"\n></button>\n", styles: [":host{--c-info-color: var(--cui-blue-600);--c-success-color: var(--cui-green-700);--c-alert-color: var(--cui-orange-800);padding:12px 16px;font-weight:400;font-size:14px;line-height:20px;display:flex;color:var(--cui-base-900);font-family:var(--cui-main-font)}:host[data-status=info]{background:var(--cui-light-blue-50)}:host[data-status=success]{background:var(--cui-green-50)}:host[data-status=alert]{color:var(--cui-orange-800);background:var(--cui-yellow-100)}:host[data-status=error]{background:var(--cui-red-50)}:host-context([cuiTheme=dark]){--c-info-color: var(--cui-blue-500);--c-success-color: var(--cui-green-500);--c-alert-color: #F9C15A;color:var(--cui-gray-0)}:host-context([cuiTheme=dark])[data-status=info]{background:var(--cui-blue-900)}:host-context([cuiTheme=dark])[data-status=success]{background:var(--cui-green-900)}:host-context([cuiTheme=dark])[data-status=alert]{background:var(--cui-yellow-900)}:host-context([cuiTheme=dark])[data-status=error]{background:var(--cui-red-900)}.c-icon{height:28px}.c-wrapper{flex:1;display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-left:12px;margin-right:16px;overflow-wrap:anywhere}.c-heading{font-weight:500;font-size:14px;line-height:20px;margin:0}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CuiSvgComponent, selector: "cui-svg[icon]", inputs: ["width", "height", "strokeWidth", "color", "icon"] }, { kind: "component", type: CuiButtonComponent, selector: "button[cuiButton], a[cuiButton]", inputs: ["shape", "disabled", "isLoaderShown", "icon", "iconRight", "appearance", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
494
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiBannerComponent, decorators: [{
495
+ type: Component,
496
+ args: [{ selector: 'cui-banner', changeDetection: ChangeDetectionStrategy.OnPush, template: "<cui-svg\n *ngIf=\"ICON_OPTIONS[status] as iconOption\"\n [icon]=\"iconOption.icon\"\n [color]=\"iconOption.color\"\n class=\"c-icon\"\n></cui-svg>\n<div class=\"c-wrapper\">\n <h2\n *ngIf=\"label\"\n class=\"c-heading\"\n >\n {{ label }}\n </h2>\n <ng-content></ng-content>\n <!-- TODO: \u0416\u0434\u0443 \u0442\u0451\u043C\u043D\u0443\u044E \u0442\u0435\u043C\u0443 \u043A\u043D\u043E\u043F\u043E\u043A -->\n <button\n cuiButton\n *ngIf=\"actionButtonText\"\n appearance=\"link\"\n (click)=\"onAction()\"\n >\n {{ actionButtonText }}\n </button>\n</div>\n<button\n *ngIf=\"isCloseable\"\n cuiButton\n appearance=\"ghost\"\n size=\"xxs\"\n icon=\"cuiIconX\"\n (click)=\"onClose()\"\n></button>\n", styles: [":host{--c-info-color: var(--cui-blue-600);--c-success-color: var(--cui-green-700);--c-alert-color: var(--cui-orange-800);padding:12px 16px;font-weight:400;font-size:14px;line-height:20px;display:flex;color:var(--cui-base-900);font-family:var(--cui-main-font)}:host[data-status=info]{background:var(--cui-light-blue-50)}:host[data-status=success]{background:var(--cui-green-50)}:host[data-status=alert]{color:var(--cui-orange-800);background:var(--cui-yellow-100)}:host[data-status=error]{background:var(--cui-red-50)}:host-context([cuiTheme=dark]){--c-info-color: var(--cui-blue-500);--c-success-color: var(--cui-green-500);--c-alert-color: #F9C15A;color:var(--cui-gray-0)}:host-context([cuiTheme=dark])[data-status=info]{background:var(--cui-blue-900)}:host-context([cuiTheme=dark])[data-status=success]{background:var(--cui-green-900)}:host-context([cuiTheme=dark])[data-status=alert]{background:var(--cui-yellow-900)}:host-context([cuiTheme=dark])[data-status=error]{background:var(--cui-red-900)}.c-icon{height:28px}.c-wrapper{flex:1;display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-left:12px;margin-right:16px;overflow-wrap:anywhere}.c-heading{font-weight:500;font-size:14px;line-height:20px;margin:0}\n"] }]
497
+ }], propDecorators: { status: [{
498
+ type: Input
499
+ }, {
500
+ type: HostBinding,
501
+ args: ['attr.data-status']
502
+ }], isCloseable: [{
503
+ type: Input
504
+ }], label: [{
505
+ type: Input
506
+ }], actionButtonText: [{
507
+ type: Input
508
+ }], actionButtonClicked: [{
509
+ type: Output
510
+ }], closed: [{
511
+ type: Output
512
+ }] } });
513
+
514
+ class CuiBannerModule {
515
+ }
516
+ CuiBannerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiBannerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
517
+ CuiBannerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: CuiBannerModule, declarations: [CuiBannerComponent], imports: [CommonModule,
518
+ CuiSvgModule,
519
+ CuiButtonModule], exports: [CuiBannerComponent] });
520
+ CuiBannerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiBannerModule, imports: [CommonModule,
521
+ CuiSvgModule,
522
+ CuiButtonModule] });
523
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiBannerModule, decorators: [{
524
+ type: NgModule,
525
+ args: [{
526
+ imports: [
527
+ CommonModule,
528
+ CuiSvgModule,
529
+ CuiButtonModule
530
+ ],
531
+ declarations: [CuiBannerComponent],
532
+ exports: [CuiBannerComponent]
533
+ }]
534
+ }] });
535
+
452
536
  class CuiButtonGroupComponent {
453
537
  }
454
538
  CuiButtonGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiButtonGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
@@ -846,6 +930,7 @@ const CUI_TEXT_FILED_CONTROLLER_PROVIDER = [
846
930
  }
847
931
  ];
848
932
 
933
+ // TODO: Будет переделан дизайн
849
934
  class CuiEditorComponent {
850
935
  constructor() {
851
936
  this.ICONS = {
@@ -1579,6 +1664,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
1579
1664
  }]
1580
1665
  }] });
1581
1666
 
1667
+ class CuiRootComponent {
1668
+ }
1669
+ CuiRootComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiRootComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1670
+ CuiRootComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CuiRootComponent, selector: "cui-root", ngImport: i0, template: "<ng-content />\n<cui-dialogs />\n<cui-alerts />\n", dependencies: [{ kind: "component", type: CuiDialogsComponent, selector: "cui-dialogs" }, { kind: "component", type: CuiAlertsComponent, selector: "cui-alerts" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1671
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiRootComponent, decorators: [{
1672
+ type: Component,
1673
+ args: [{ selector: 'cui-root', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content />\n<cui-dialogs />\n<cui-alerts />\n" }]
1674
+ }] });
1675
+
1676
+ class CuiRootModule {
1677
+ }
1678
+ CuiRootModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiRootModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1679
+ CuiRootModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: CuiRootModule, declarations: [CuiRootComponent], imports: [CommonModule,
1680
+ CuiDialogModule,
1681
+ CuiAlertModule], exports: [CuiRootComponent] });
1682
+ CuiRootModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiRootModule, imports: [CommonModule,
1683
+ CuiDialogModule,
1684
+ CuiAlertModule] });
1685
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiRootModule, decorators: [{
1686
+ type: NgModule,
1687
+ args: [{
1688
+ imports: [
1689
+ CommonModule,
1690
+ CuiDialogModule,
1691
+ CuiAlertModule
1692
+ ],
1693
+ declarations: [CuiRootComponent],
1694
+ exports: [CuiRootComponent]
1695
+ }]
1696
+ }] });
1697
+
1582
1698
  class CuiTextareaComponent {
1583
1699
  constructor() {
1584
1700
  this.cuiTextFieldController = inject(CUI_TEXT_FIELD_CONTROLLER);
@@ -1616,9 +1732,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
1616
1732
  }]
1617
1733
  }] });
1618
1734
 
1735
+ const CUI_THEME_STORAGE_DEFAULT_KEY = 'cuiTheme';
1736
+ const CUI_DEFAULT_THEME = 'light';
1737
+ const CUI_THEME_STORAGE_KEY = cuiCreateToken(CUI_THEME_STORAGE_DEFAULT_KEY);
1738
+ const CUI_THEME = cuiCreateToken(CUI_DEFAULT_THEME);
1739
+
1740
+ class CuiThemeService extends BehaviorSubject {
1741
+ constructor() {
1742
+ super(inject(CUI_LOCAL_STORAGE).getItem(inject(CUI_THEME_STORAGE_KEY))
1743
+ ?? inject(CUI_THEME));
1744
+ this.localStorage = inject(CUI_LOCAL_STORAGE);
1745
+ this.key = inject(CUI_THEME_STORAGE_KEY);
1746
+ }
1747
+ next(theme) {
1748
+ this.localStorage.setItem(this.key, theme);
1749
+ super.next(theme);
1750
+ }
1751
+ // При работе только двух тем
1752
+ switch() {
1753
+ this.next(this.value === 'light' ? 'dark' : 'light');
1754
+ }
1755
+ }
1756
+ CuiThemeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiThemeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1757
+ CuiThemeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiThemeService, providedIn: 'root' });
1758
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiThemeService, decorators: [{
1759
+ type: Injectable,
1760
+ args: [{
1761
+ providedIn: 'root'
1762
+ }]
1763
+ }], ctorParameters: function () { return []; } });
1764
+
1619
1765
  /**
1620
1766
  * Generated bundle index. Do not edit.
1621
1767
  */
1622
1768
 
1623
- export { CUI_ALERTS, CUI_ALERT_CONTEXT, CUI_ALERT_DEFAULT_OPTIONS, CUI_ALERT_OPTIONS, CUI_BUTTON_DEFAULT_OPTIONS, CUI_BUTTON_OPTIONS, CUI_NOTIFICATION_DEFAULT_OPTIONS, CUI_NOTIFICATION_OPTIONS, CUI_TEXT_FIELD_CONTROLLER, CUI_TEXT_FIELD_ICON_LEFT, CUI_TEXT_FIELD_ID, CUI_TEXT_FIELD_IS_ERROR, CUI_TEXT_FIELD_PLACEHOLDER, CUI_TEXT_FIELD_SIZE, CUI_TEXT_FILED_CONTROLLER_PROVIDER, CuiAccordionComponent, CuiAccordionItemComponent, CuiAccordionModule, CuiAlertComponent, CuiAlertModule, CuiAlertService, CuiAlertsComponent, CuiButtonComponent, CuiButtonGroupComponent, CuiButtonGroupModule, CuiButtonModule, CuiContextMenuComponent, CuiContextMenuModule, CuiDialogComponent, CuiDialogModule, CuiDialogService, CuiDialogsComponent, CuiEditorComponent, CuiEditorModule, CuiHintComponent, CuiHintModule, CuiIconButtonComponent, CuiIconButtonModule, CuiInputModule, CuiInputNumberComponent, CuiInputNumberModule, CuiInputPasswordComponent, CuiInputPasswordModule, CuiInputTextComponent, CuiLabelComponent, CuiLabelModule, CuiNotificationComponent, CuiNotificationModule, CuiSvgComponent, CuiSvgModule, CuiTextFieldController, CuiTextFieldControllerModule, CuiTextFieldIconLeftDirective, CuiTextFieldIdDirective, CuiTextFieldIsErrorDirective, CuiTextFieldPlaceholderDirective, CuiTextFieldSizeDirective, CuiTextareaComponent, CuiTextareaModule, cuiRemoveSpaces, cuiReplace };
1769
+ export { CUI_ALERTS, CUI_ALERT_CONTEXT, CUI_ALERT_DEFAULT_OPTIONS, CUI_ALERT_OPTIONS, CUI_BANNER_DEFAULT_OPTIONS, CUI_BANNER_OPTIONS, CUI_BUTTON_DEFAULT_OPTIONS, CUI_BUTTON_OPTIONS, CUI_NOTIFICATION_DEFAULT_OPTIONS, CUI_NOTIFICATION_OPTIONS, CUI_TEXT_FIELD_CONTROLLER, CUI_TEXT_FIELD_ICON_LEFT, CUI_TEXT_FIELD_ID, CUI_TEXT_FIELD_IS_ERROR, CUI_TEXT_FIELD_PLACEHOLDER, CUI_TEXT_FIELD_SIZE, CUI_TEXT_FILED_CONTROLLER_PROVIDER, CuiAccordionComponent, CuiAccordionItemComponent, CuiAccordionModule, CuiAlertComponent, CuiAlertModule, CuiAlertService, CuiAlertsComponent, CuiBannerComponent, CuiBannerModule, CuiButtonComponent, CuiButtonGroupComponent, CuiButtonGroupModule, CuiButtonModule, CuiContextMenuComponent, CuiContextMenuModule, CuiDialogComponent, CuiDialogModule, CuiDialogService, CuiDialogsComponent, CuiEditorComponent, CuiEditorModule, CuiHintComponent, CuiHintModule, CuiIconButtonComponent, CuiIconButtonModule, CuiInputModule, CuiInputNumberComponent, CuiInputNumberModule, CuiInputPasswordComponent, CuiInputPasswordModule, CuiInputTextComponent, CuiLabelComponent, CuiLabelModule, CuiNotificationComponent, CuiNotificationModule, CuiRootComponent, CuiRootModule, CuiSvgComponent, CuiSvgModule, CuiTextFieldController, CuiTextFieldControllerModule, CuiTextFieldIconLeftDirective, CuiTextFieldIdDirective, CuiTextFieldIsErrorDirective, CuiTextFieldPlaceholderDirective, CuiTextFieldSizeDirective, CuiTextareaComponent, CuiTextareaModule, CuiThemeService, cuiRemoveSpaces, cuiReplace };
1624
1770
  //# sourceMappingURL=cuby-ui-core.mjs.map